remove versioning on boost xml serialization

Posted by cppanda on Stack Overflow See other posts from Stack Overflow or by cppanda
Published on 2011-01-11T20:16:33Z Indexed on 2011/01/12 0:54 UTC
Read the original article Hit count: 177

Filed under:
|
|

hi, i just can't find a way to remove the version tracking from the boost xmlarchives.

example

<Settings class_id="0" tracking_level="0" version="1">
 <px class_id="1" tracking_level="1" version="0" object_id="_0">
  <TestInt>3</TestInt>
  <Resolution class_id="2" tracking_level="0" version="0">
   <x>800</x>
   <y>600</y>
  </Resolution>
  <SomeStuff>0</SomeStuff>
 </px>
</Settings>

I want to get ride of the class_id="0" tracking_level="0" version="1" stuff, because for in this case i just don't need it and want a simple clean config like file

code

void serialize(Archive & ar, const unsigned int version)
{
  ar & make_nvp("TestInt", TestInt);

  ar & make_nvp("Resolution", resolution);
  ar & make_nvp("SomeStuff", SomeStuff);
}

i found boost::serialization::track_never, but nowhere to use it

© Stack Overflow or respective owner

Related posts about Xml

Related posts about serialization