[Boost-bugs] [Boost C++ Libraries] #8088: Limited Forward Compatibility

Subject: [Boost-bugs] [Boost C++ Libraries] #8088: Limited Forward Compatibility
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-17 15:32:10


#8088: Limited Forward Compatibility
-----------------------------------------------+----------------------------
 Reporter: Dmitry Shesterkin <dfb@…> | Owner: ramey
     Type: Patches | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: Forward Compatibility |
-----------------------------------------------+----------------------------
 We use xml serialization for saving and loading several types of metadata
 and we have to support possibility of reading new versions of files with
 old versions of soft. Boost::serialization is very good at backward
 compatibility but does not provide anything with opposite problem.

 So, This patch introduces new flag boost::archive::skip_unknown_tail_tags.
 When this flag is set and basic_xml_iarchive is faced with unknown tags at
 the end of element it will skip them (include nested).

 E.g., the first version of some file was:
 {{{
 <Test class_id="0" tracking_level="0" version="0">
     <a>31</a>
     <t2 class_id="1" tracking_level="0" version="0">
         <a>11</a>
         <b>12</b>
     </t2>
     <b>32</b>
 </Test>
 }}}

 After a while, the second version could be:
 {{{
 <Test class_id="0" tracking_level="0" version="0">
     <a>31</a>
     <t2 class_id="1" tracking_level="0" version="1">
         <a>11</a>
         <b>12</b>
         <c>13</c>
         <d>14</d>
         <t1 class_id="2" tracking_level="0" version="0">
             <a>1</a>
             <b>2</b>
         </t1>
     </t2>
     <b>32</b>
 </Test>
 }}}

 Therefore, if the first version software set skip_unknown_tail_tags it can
 read second version of file (if does not set then exception will be
 thrown).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8088>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC