7 #ifndef NUKLEI_SERIAL_H
8 #define NUKLEI_SERIAL_H
34 static void readObject(T &
object,
const std::string& filename,
35 const std::string &typeName);
38 static void readObject(T &
object,
const std::string& filename)
41 std::string errorsCat = std::string(
"Error at input for file `") +
42 filename +
"'\nErrors at each format attempt were:";
47 std::list<std::string> formats;
53 formats.push_back(
"bbinc");
54 formats.push_back(
"bxmlc");
56 formats.push_back(
"bxml");
58 for (std::list<std::string>::const_iterator i = formats.begin();
59 i != formats.end(); ++i)
62 readObject<T>(
object, filename, *i);
64 }
catch (std::exception &e) {
65 errorsCat +=
"\n" + std::string(e.what());
74 static void writeObject(
const T &
object,
const std::string& filename,
75 const std::string &typeName = SERIALIZATION_DEFAULT_BOOST_ARCHIVE,
76 const int precision = PRECISION);
78 typedef enum { BOOSTXML = 0, BOOSTXML_COMPRESSED,
79 BOOSTBIN, BOOSTBIN_COMPRESSED,
81 static const Type defaultType = BOOSTBIN_COMPRESSED;
82 static const std::string TypeNames[];