C ++: High Level XML Serialization Library

I'm looking for a high-level XML library with an interface like boost::serialization to automatically serialize C ++ objects to XML:

I dream about this scenario (this is part of deserialization):

  • You register C ++ types binding them to an XML tag (which is boost::serialization::make_nvp plus boost::<Archive>::register_type do)

  • For any type, you provide a function to tell which children the type needs / accepts and where to store them (similar to what boost::serialization::serialize does)

What is it. This should be enough to deserialize the XML files in a very simple / high-level way. Is there anything similar?


Boost: serialization would be ideal, but it might not fit the job due to several issues:

  • A tag associated with a type is defined inside that type of serialize . For my purpose, the tag must be defined before entering such a function (i.e.: in parent deserialization).

  • You must know a priori what type you expect (what type you are going to read). This is also related to the above problem.

The way boost::serialization serializes (i.e. generates) XML should already be compatible with what I'm looking for ...

+4
source share

Source: https://habr.com/ru/post/1333884/


All Articles