|
Boost : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-10-24 05:07:28
Robert Ramey wrote:
>>How can I store raw binary data with the serialization library? I have a
>>class which keeps an int* pointer and the size of the pointed data, and
>>I'd like to make it serializable. There's
>
>> void write_binary(const void *address, size_t count)
>
>>method in archieve implementation, but it's only mentined in docs as
>>member of some class and I could not find any description about what it
>>does.
>
> You've got the right idea. Its currently implemented only for binary
> archives. Its usage is ar.write_binary to stuff data into archives and
> ar.read_binary to suck data out.
Ok, great. I'll make use of them.
> For text and XML archives I want to render binary data as base64. XML
> requires
> a little extra work to wrap in XML syntax. Its almost done so I believe
> so I don't
> believe you'll have long to wait. If you need an immediate temporary
> resolution let me know and I'll offer some suggestions.
I'm not in a hyrry about text archive. I'm just going to evaluate the size
of stored date for some use case, and I'll use binary streams as more
compact.
> By the way. The library as reviewed last november implemente read/write
> binary
> as just inserting the binary data. It was you that pointed out that for
> text archives it would be more appropriatly rendered as a text like format
> such as base64. I was immediatly convinced. Just proves that no good
> deed goes unpunished.
:-)
- Volodya
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk