Boost serialization library

E

eyal.susser

Hi,

I'm using the Boost serialization library. Iwant to serialize
classes into simple buffers on RAM. There doesn't seem to be a
suitable archiver. Am I missing it? The ones I saw were for files
only. Although implementing one is easy, I would like to have one that
has already been tested...

Thanks,

Eyal.
 
J

Jeff Flinn

Hi,

I'm using the Boost serialization library. Iwant to serialize
classes into simple buffers on RAM. There doesn't seem to be a
suitable archiver. Am I missing it? The ones I saw were for files
only. Although implementing one is easy, I would like to have one that
has already been tested...

Your best bet is to join the boost mailing list(s) at www.boost.org. In the
meantime, archives are independent of the particular stream type. You pass a
reference to the desired stream type when you construct an instance of an
archive.

std::eek:stringstream lOut;

boost::archive::xml_oarchive oa( lOut );

or

boost::archive::text_oarchive oa( lOut );

or

boost::archive::binary_oarchive oa( lOut );

If these don't meet your needs, You can use Jonathan Turkanis' IOstream
library to easily wrap other storage/transmission methods. This is/soon to
be part of boost. For example, I've used it to wrap the MS Windows clipboard
to support copy/paste and drag/drop.


Jeff Flinn
 
E

eyal.susser

Well, fome the looks of it, std::stringstream does the trick. I'll run
some more checks to be sure...anyway, thanks! I'm a bit embarrased to
admit I didn't know there was such a thing a stringstream...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top