Boost logo

Boost :

From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2008-08-08 04:46:21


On Fri, Aug 8, 2008 at 1:28 PM, Alexander Dong Back Kim
<alexdbkim_at_[hidden]> wrote:
>
> What I want to ask here is how I can avoid to create a file and fill the
> data array instead by using boost serialization? Any comments will be
> appreciated.
>

Try using a stringbuf, then wrap it in an std::ostream, which you then
use to initialize the archive:

  std::stringbuf buffer;
  std::ostream stream(&buffer);
  text_oarchive archive(stream);

HTH

-- 
Dean Michael C. Berris
Software Engineer, Friendster, Inc.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk