Overview

Sweet Persist is a C++ serialization library. It requires Microsoft Visual Studio 2008 (MSVC 9.0).

Features:

Anti features:

Boost Serialization vs Sweet Persist

The Boost Serialization Library is written by Robert Ramey.  Documentation is available at http://www.boost.org/libs/serialization/doc/index.html.

The main difference between Boost Serialization and Sweet Persist is the way that they handle shared data.  Boost Serialization automatically tracks pointers to shared data and writes out objects by value the first time they are encountered and then by reference for any further occurences.  Sweet Persist allows the application to specify when an object is written out by reference and when it is written out by value.  This is a deliberate design decision to simplify the implementation and to allow control of where data shows up in an archive - in our opinion this makes them easier to transform using XSLT and easier to read.  The cost of doing it this way is that the application is then responsible for making sure that all referenced objects are written to an archive and that objects aren't written out by value more than once.

Sweet Persist supports weak_ptrs and intrusive_ptrs while Boost Serialization does not.  The support for shared_ptrs in Sweet Persist does not depend on their implementation as it does in Boost Serialization.  Sweet Persist supports conversion of enumerations and bit masks to useful text values for text based archives.  Sweet Persist also supports the conversion of paths - allowing absolute paths to be converted to relative paths when persisted in an archive and back to absolute paths when the archive is read back in.

Boost Serialization handles multiple inheritance, classes that contain reference member variables, can work without RTTI, is far more portable, supports boost::optional and boost::variant, and has been reviewed and tested extensively by the Boost community.

In summary Boost Serialization will be better if you don't need control over where your data appears when written to an XML archive, you don't need your enumerations and bit masks converted to text, you don't need relative paths in your archives, or you don't want the responsibility of determining which objects to write by value and which to write out by reference.

libs11n vs Sweet Persist

The libs11n Library is written by Stephan Beal.  Documentation is available at http://s11n.net/.

The libs11n Library has excellent documentation and supports a wide variety of data formats including persistence to MySQL and SQLite databases.  However it doesn't support wide characters, binary archives, or use as a static library.

In summary the libs11n implementation will probably be better for you if you want to support serialization to a wide variety of data formats or SQL databases.  On the other hand if you need to support wide characters, binary archives, or don't like dynamic libraries then you might prefer Boost Serialization or Sweet Persist.