belahcene wrote:
> Hi,
> I use fltk (C++ graphical interface) to create an electronics design package. 
> I created a list of objects and placed them on a window. My problem is how to 
> save the file, I think to create a list in memory for the objects placed on 
> the sheet and store them in a file.
> I think (not sure of course) that xfig for example uses this procedure ?
>

Nothing per se, as fltk does not support serialization and persistance.
 Overall, serialization in C/C++ is a pain in the neck, as the language
does not make it easy, so expect to write some special code for each
class you use.

The best mixed ascii/binary format for serialization is called YAML
(which is a simplified and better version of JSON).  JSON is now used
everywhere as part of AJAX and Web2.0 in things such as Google maps and
the like.  Albeit there's currently no C++ YAML library, you can use a
C++ JSON library like Jaula and get almost 90% there. The s11n library
also now allows serializing to a JSON grammar, among other 5 other formats.

A not so good but popular alternative is called XML, which is a full
featured language, with a lot of quirks but became popular since it was
one of the earliest formats to appear.  There are several C++ libraries
for XML: GNU's CPP framework, Eternity, etc.

Best library out there for C++ serialization (in features and
documentation) is probably boost::serialization.  It allows versioning
on a per class basis, which is very useful and not present on other
alternatives.  By default it uses its own custom binary format, but has
support for XML.


-- 
Gonzalo Garramuño
[EMAIL PROTECTED]

AMD4400 - ASUS48N-E
GeForce7300GT
Kubuntu Edgy

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to