Boost logo

Boost Users :

From: Nat Goodspeed (ngoodspeed_at_[hidden])
Date: 2006-10-12 11:40:28


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Baranowski, Daniel
> Sent: Wednesday, October 11, 2006 2:06 PM
> To: boost-users_at_[hidden]
> Subject: [Boost-users] [Serialization] Serializing to a void * and a
size?
>
> I guess my questions is, what's the best way to serialize to a void *
> and a size? I'm pretty illiterate on streams, so I've started to read
up
> on it, but I haven't figured it out yet, though I feel that's probably
> where the answer lies.
>
> std::ostringstream sTestBinary1;
> boost::archive::binary_oarchive oa(sTestBinary1);
> oa << *pA;
>
> // Get the size of the buffer and a pointer to it
> size_t iSize = 0;//sTestBinary1.size(); // ?? How do I get the size
> ??
> void * pVoid = sTestBinary1.rdbuf(); // ?? Is this the right
pointer
> ??

[Nat] Are you familiar with the std::ostringstream::str() method?


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