By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,289 Members | 1,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,289 IT Pros & Developers. It's quick & easy.

Boost serialization library

P: n/a
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.

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

<ey*********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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::ostringstream 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
Jul 23 '05 #2

P: n/a
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...

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.