I just can't find a way to remove version tracking from xmlarchives accelerators.
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 enjoy class_id = "0" tracking_level = "0" version = "1" because in this case I just donβt need it and I want a simple clean config as a file
the 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
try creating iarchive with the "no_header" option:
boost::archive::xml_iarchive ia(is, boost::archive::no_header);
itβs too late for the original poster, I would like to share what I found
BOOST_CLASS_IMPLEMENTATION(My_class, object_serializable)
does the trick.
xml,
class_id, tracking_level ,
BOOST_CLASS_IMPLEMENTATION( <type>, boost::serialization::object_serializable ) BOOST_CLASS_TRACKING( <type>, boost::serialization::track_never )
. .
BOOST_CLASS_VERSION
, .
( AFAIK), boost::archive::no_tracking, , , ( , XML):
boost::archive::no_tracking
boost::archive::xml_oarchive oa{std::cout, boost::archive::no_header | boost::archive::no_tracking};
(http://boost.2283326.n4.nabble.com/serialization-removing-excess-XML-tags-td2582827.html)
(- ).
<my_carbon class_id="0" tracking_level="0" version="0"> <number>6</number> <symbol>C</symbol> <AR_electronegativity class_id="1" tracking_level="0" version="0"> <has_value>1</has_value> <value>2.50000000000000000e+00</value> </AR_electronegativity> <covalent_radius class_id="2" tracking_level="0" version="0"> <has_value>1</has_value> <value class_id="3" tracking_level="0" version="0"> <value>7.60000000000000009e-01</value> </value> </covalent_radius> ...
"".
"" , . , - , , , . "_" , _id, . . , , , , . , object_id = "_0". , , object_id. . . . , , . - . , .
, , . - . IIRC .
, . . , . "no_header" . .
... , - , , .
Source: https://habr.com/ru/post/1784823/More articles:How can I use ajax to send a message through a url and still keep line breaks? - javascriptHow to redefine a style in a specific topic - stylesGoogle API Speed ββLimit - networkinghow to include a file that is inside another directory - phpRegular expression to get text between two lines - phpproblem of using ESAPI library to prevent XSS - securityHiding an element when I click it or somewhere else on the page - jqueryHide an element if it is displayed (a bit complicated case) - jqueryJavaME MIDlet will not clear variables? - javastatic variables store values ββfrom previous run - javaAll Articles