Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove versioning on boost xml serialization

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

like image 463
cppanda Avatar asked Jan 11 '11 20:01

cppanda


1 Answers

while too late for the original poster I'd like to share what I've found

BOOST_CLASS_IMPLEMENTATION(My_class, object_serializable)

does the trick.

like image 139
stefan Avatar answered Oct 05 '22 12:10

stefan