serialization library

Bill Baxter wbaxter at gmail.com
Fri Nov 10 21:42:30 PST 2006


Georg Wrede wrote:
> Bill Baxter wrote:
> 
>> That is one thing I do like about boost::serialization.  With 
>> basically one line of code I can switch between xml serialization and 
>> binary serialization.  Only thing I didn't like was I couldn't figure 
>> out how to keep some things binary.
> 
> 
> With a text file, you can tell what it is, even when the file has got 
> misplaced or renamed, but with a binary it's pretty hopeless.

Having all the structure in ASCII is great, and maybe everything in 
ASCII while you're debugging, but some things just don't work well as 
ascii -- images, videos, audio files, 3D meshes, etc.  It makes sense to 
have the structure annotated in ascii, but when it comes to storing raw 
image data there's not much to be gained from storing that as a giant 
ASCII string.  With the boost::serialization's XML I wanted to be able 
to store that image as something like

<image width=1024 height=768 format=RGBA type="float">
   [big hunk o raw binary image data]
</image>

But I couldn't find any way to do that.

> And of course you might look at a few languages ( ~ fileformats) 
> especially made for serializing.
> 
> YAML looks very clean, and is easily readable by humans (XML is not)

I took a look at that one before.  I agree that it would be nice if a 
more human-friendly alternative to XML caught on.

--bb



More information about the Digitalmars-d-announce mailing list