|
Boost Users : |
From: Joel de Guzman (joel_at_[hidden])
Date: 2006-07-10 01:52:55
Robert Ramey wrote:
>> (I'm particularly interested with XML archives. If I had control
>> over the xml parser, that would simply mean ignoring everything
>> from the current tag until the next matching tag is found).
>
> I believe you do have the control you desire. Here's a sketch:
>
> suppose object A includes memory variables x, y and z
>
> specialize template for xml input archives and type A
>
> void load (boost::archive::xml_iarchive & ia, A & a, const unsigned
> version){
> ia & BOOST_SERIALIZATION_NVP(x);
> if(version == 1){
> // the next data should look like <x ...>...</x>
> // skip over this data using your favorite xml parser - or use the
> one
> // that the serialization library uses - built with spirit - note
> that this
> // is not exposed by the library and is hidden from users as an
> // implementation detail
> }
> ia & BOOST_SERIALIZATION_NVP(z);
> }
You didn't answer my question. What I am asking is what
do I write in the commented out portion of the code
using only Boost.Serialization interface. I do not want
to do any undocumented back-door tricks. I want a way to
skip reading some data regardless of what the archive type
is.
Regards,
-- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net