Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2008-03-23 17:11:45


if you don't like tracking - you can turn it off for the types you want.

to add your own characters between archives try something like this:

{
    ofstream os("filename);

    {
        boost::archive::text_archive oa(os);
        oa << ....
     } // close archive - leaves stream open
    os << '\n'; // or whatever
    {
        boost::archive::text_archive oa(os); // another archive in the same
stream
    {
        boost::archive::text_archive oa(os);
        oa << ....
     } // close archive - leaves stream open
    os << '\n'; // or whatever
} // closes output stream

Robert Ramey

François Mauger wrote:
> Hi
>
> I have large amount of data to store/load from files.
> I use boost::serialization library to do it.
> It has very nice features.
>
> I use version 1.33:
>>>> libboost-serialization-dev 1.33.1-9ubuntu3.1
>
> Checking different strategies to play with my data and i/o archives,
> I met the following problem:
> if I save several text_oarchives within the same
> output file (a trick to break side-effects of memory tracking),
> then the deserialization failed for there is
> no separator between successive text archives.
>
> I have to explicitely add a 'std::endl' in the output stream
> to make it run.
>
> This pb does not appear
> with xml archives for the </tag> at the end is unambiguous
> to parse the end of each archive.
> I did not check for binary archives, but I guess there will be no pb.
>
> For me a mandatory 'white' character
> should be added as the last byte in a text output archive
> (when destructor is invoked?).
> This will make more coherent (symmetric!) in comparison
> with xml/binary ars.
> This is only a suggestion: I cannot imagine all the side-effects
> such a strategy could imply.
>
> A sample demo file is attached.
>
> Thanks for your attention.
>
> frc
>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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