Boost logo

Boost Users :

From: Bill Lear (rael_at_[hidden])
Date: 2006-06-21 14:50:21


On Tuesday, June 20, 2006 at 12:50:37 (+0200) Vidal Roca writes:
>It is possible to define more than one serialization format for a data
>structure with the serialization library?
>If not, has someone some good purposes to make it to?

How do you mean? There are several archive formats: binary, text,
xml. See:

#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>

Or do you mean define different serialization methods for a class?
Such as:

class Foo {
   template<class Archive>
   void serialize(Archive& ar, const unsigned int version);

   template<class Archive>
   void serialize_II(Archive& ar, const unsigned int version);
};

Where serialize_II presumably reads and writes the data structure
in a different order?

Or do you mean something else?

Bill


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net