Boost1.32.0 is released recently, and a little excited mood DOWN has a look, find more than a serialization library (in fact, there is more than this library), it is so good, remember that it is still a few weeks ago. C does not provide a viable serialization mechanism from a language level or a standard library level. As a few days, there is such a library in Boost, and I have achieved a sequential interface.
. Let's take a look at the design objectives claimed by this sequence library provided by Boost:
Code portability - depend only on ANSI C facilities Code economy -.. Exploit features of C such as RTTI, templates, and multiple inheritance, etc. where appropriate to make code shorter and simpler to use Independent versioning for each class definition That is,. when a class definition changed, older files can still be imported to the new version of the class. Deep pointer save and restore. That is, save and restore of pointers saves and restores the data pointed to. Proper restoration of pointers to shared data. serialization of STL containers and other commonly used templates Data Portability -... Streams of bytes created on one platform should be readable on any other Orthogonal specification of class serialization and archive format That is, any file format should be able to store serialization of any Arbitrary Set of C Data Structures without has class. Non-Intrusive. Permit Serialization To Be Applied To Unaltered Classes. That IS, DON ' t require that classes to be serialized be derived from a specific base class or implement specified member functions. This is necessary to easily permit serialization to be applied to classes from class libraries that we can not or do not want to have to alter. The archive interface must be simple enough to easily permit creation of a new type of archive. the archive interface must be rich enough to permit the creation of an archive that presents serialized data as XML in a useful manner. I am more interested in which is the 6th 7, 9 points, I don't know if this version has achieved the above design goals, and may wait for a while to analyze the Boost's C serialization implementation.