serialization library

Bill Baxter dnewsgroup at billbaxter.com
Thu Nov 9 15:55:37 PST 2006


Fredrik Olsson wrote:
> Bill Baxter skrev:
> <snip>

>>
> What you want is a lib for reading and writing EA IFF-85 compatible files?

I've never heard of EA IFF-85, but a brief skim of the description here:
http://www.newtek.com/lightwave/developer/LW80/8lwsdk/docs/filefmts/eaiff85.html
sounds good.

Is it something 3D-graphics specific though?  Electronic Arts created 
the standard, and the website I found above is for a 3D modeling 
package...  But it looks right.

But the truth is I don't know what I want exactly in terms of API.  I 
just want something that makes it easy to take my data structures -> 
extract the data into something generic and ESPECIALLY not intrinsically 
tied to the types in my program -> save it to disk -> load it back into 
whatever data structures I choose later.  It's ok if it's a little more 
painful than   MyData.serialize(archive); MyData.load(archive);  as long 
as it achieves the goal.

With Boost::serialization I've ended up having to write upgrader 
programs a few times over the course of development.  It's always a pain 
because boost::serialization wants to be smart so what I end up doing is 
taking an old version of my data structures header file, wrapping it in 
an "oldversion" namespace then load via the olversion::type, and save 
via the newversion::type.

> I actually have some code for D doing this around somewhere. Written to 
> be able to read IFF graphics files and Lightwave 3D objects.

Oh, right, lightwave.  So I guess it's not a coincidence google for EA 
IFF-85 turned up NewTek's page.

> I shall dig up the code, clean it up in a presentable shape, and make it 
> public.

Cool, can you explain how the API works a little?  I guess I can imagine 
that loading such a file is not so different from loading an XML file. 
So like XML parsing there are a few ways to do it.


--bb



More information about the Digitalmars-d-announce mailing list