[Serialization, XML] Suppress generation of class_id, tracking_level and version?
Hi, is it possible to suppress the in the xml-output generated attributes for object types (class_id, tracking_level and version)? Because it is better human writable/editable and in my case i have tested the reading of files w/o these attributes and it was all successful. Thanks in advance for your help!
Hello Gerrit, GB> is it possible to suppress the in the xml-output generated GB> attributes for object types (class_id, tracking_level and version)? Sure, it is possible. But at the expense of tracking and versioning of course. You should tell explicitly to the serialization library that your classes have to have no versioning and tracking information. It can be done by using special traits classes. To make long story short, just add two following macros for every your class that has to be serialized without additional info: BOOST_CLASS_IMPLEMENTATION(YourClassName, boost::serialization::object_serializable); BOOST_CLASS_TRACKING(YourClassName, boost::serialization::track_never) Regards. Slava. -- -- Vyacheslav E. Andrejev -- System Architect, Optech International, Inc. -- E-mail: mortituris@mail.ru
This could be done by making a custom archive by deriving from the xml_archive in the library. I can't imagine that such an archive would be generally readable however. Perhaps in some specific cases maybe. Robert Ramey Gerrit Brehmer wrote:
Hi,
is it possible to suppress the in the xml-output generated attributes for object types (class_id, tracking_level and version)? Because it is better human writable/editable and in my case i have tested the reading of files w/o these attributes and it was all successful.
Thanks in advance for your help!
participants (3)
-
Gerrit Brehmer
-
Robert Ramey
-
Vyacheslav E. Andrejev