MFC C++ 应用程序的最佳 XML 序列化库

Best XML serialization library for a MFC C++ app(MFC C++ 应用程序的最佳 XML 序列化库)

本文介绍了MFC C++ 应用程序的最佳 XML 序列化库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 MFC 和 Stingray 库用 C++ 编写的应用程序.该应用程序适用于各种大型数据类型,这些数据类型目前都基于 MFC 文档/视图序列化派生功能进行序列化.我还添加了基于 Stingray 库的 XML 序列化选项,该库通过 Microsoft XML SDK 实现 DOM.虽然易于实现,但性能却很糟糕,以至于除了非常小的文档之外,它无法用于任何其他东西.

I have an application, written in C++ using MFC and Stingray libraries. The application works with a wide variety of large data types, which are all currently serialized based on MFC Document/View serialize derived functionality. I have also added options for XML serialization based on the Stingray libraries, which implements DOM via the Microsoft XML SDK. While easy to implement the performance is terrible, to the extent that it is unusable on anything other than very small documents.

对于这种情况,你们会推荐哪些其他 XML 序列化工具.我不想要 DOM,因为它似乎是一个内存猪,而且我已经在处理大量内存数据.理想情况下,我想要一个快速且易于与 MFC 一起使用的流解析器.我目前的领先者是 expat ,它既快速又简单,但需要大量的逐类序列化代码要添加.人们会推荐任何其他有效且更易于实施的替代方案吗?

What other XML serialization tools would you folks recommend for this scenario. I don't want DOM, as it seems to be a memory hog, and I'm already dealing with large in memory data. Ideally, i'd like a streaming parser that is fast, and easy to use with MFC. My current front runner is expat which is fast and simple, but would require a lot of class by class serialization code to be added. Any other efficient and easier to implement alternatives out there that people would recommend?

推荐答案

Boost 序列化 库支持 XML.这个库主要包含在:

The Boost Serialization library supports XML. This library basically consists in:

  1. 从 MFC 序列化的原理出发,把它提供的所有好东西都拿走.
  2. 解决MFC序列化的每一个问题!

与 MFC 相比的改进之一是对 XML 的支持.请注意,您不一定要控制此序列化的 XML 模式.它使用自己的架构.

Among the improvements compared to MFC is support for XML. Note that you don't necessarily control the XML schema of this serialization. It uses its own schema.

这篇关于MFC C++ 应用程序的最佳 XML 序列化库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:MFC C++ 应用程序的最佳 XML 序列化库

基础教程推荐