Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] unwinding "stack" of object duringloading
From: Igor R (boost.lists_at_[hidden])
Date: 2011-11-13 12:21:55


> Note that the the serialization library does throw exceptions on failure.
> These exceptions are documented in the manual.  You should be able to catch these exceptions in your own save/load functions.  I can't say to what extent one might be able to recover.  Implementing this would likely require more elaborat save/load functions.

Yes, I know it throws exceptions that I can catch, but the question is
how the library would behave in the following case.
Consider the following xml small item:
                <item class_id="2" tracking_level="0" version="1">
                        <px class_id="3" tracking_level="1" version="0" object_id="_0">
                                <info_ class_id="8" tracking_level="0" version="0">
                                        <obj.token_>134959408</obj.token_>
                                        <obj.name_>somename</obj.name_>
                                </info_>
                                <connectionProps_ class_id="12" tracking_level="0" version="0">
                                        <obj.currPeer_>0</obj.currPeer_>
                                        <obj.encrypt_>0</obj.encrypt_>
                                        <obj.key_>12345</obj.key_>
                                </connectionProps_>
                        </px>
                </item>

If reading <info_> sub-item throws in the middle, will the stream
remain in a consistent state, i.e. will it skip until after </info>
(or some outer closing tag)? If not, can I take some measures to force
this?


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