27 #include <boost/serialization/optional.hpp> 28 #include <boost/serialization/shared_ptr.hpp> 29 #include <boost/serialization/vector.hpp> 30 #include <boost/serialization/map.hpp> 31 #include <boost/serialization/list.hpp> 32 #include <boost/serialization/deque.hpp> 33 #include <boost/serialization/weak_ptr.hpp> 35 #include <boost/archive/text_oarchive.hpp> 36 #include <boost/archive/text_iarchive.hpp> 37 #include <boost/archive/xml_iarchive.hpp> 38 #include <boost/archive/xml_oarchive.hpp> 39 #include <boost/archive/binary_iarchive.hpp> 40 #include <boost/archive/binary_oarchive.hpp> 41 #include <boost/serialization/export.hpp> 52 boost::archive::text_oarchive out_archive(out_archive_stream);
59 boost::archive::text_iarchive in_archive(in_archive_stream);
66 std::ostringstream out_archive_stream;
68 return out_archive_stream.str();
74 std::istringstream in_archive_stream(serialized);
81 std::ofstream out_archive_stream(filename.c_str());
82 if (!out_archive_stream.is_open())
return false;
84 out_archive_stream.close();
91 std::ifstream in_archive_stream(filename.c_str());
92 if (!in_archive_stream.is_open())
return false;
94 in_archive_stream.close();
118 const std::string&
name =
"data") {
119 boost::archive::xml_oarchive out_archive(out_archive_stream);
120 out_archive << boost::serialization::make_nvp(
name.c_str(), input);
126 const std::string&
name =
"data") {
127 boost::archive::xml_iarchive in_archive(in_archive_stream);
128 in_archive >> boost::serialization::make_nvp(
name.c_str(), output);
134 const std::string&
name =
"data") {
135 std::ostringstream out_archive_stream;
137 return out_archive_stream.str();
143 const std::string&
name =
"data") {
144 std::istringstream in_archive_stream(serialized);
151 const std::string&
name =
"data") {
152 std::ofstream out_archive_stream(filename.c_str());
153 if (!out_archive_stream.is_open())
return false;
155 out_archive_stream.close();
162 const std::string&
name =
"data") {
163 std::ifstream in_archive_stream(filename.c_str());
164 if (!in_archive_stream.is_open())
return false;
166 in_archive_stream.close();
173 const std::string&
name =
"data") {
180 const std::string&
name =
"data") {
192 const std::string&
name =
"data") {
193 boost::archive::binary_oarchive out_archive(out_archive_stream);
194 out_archive << boost::serialization::make_nvp(
name.c_str(), input);
200 const std::string&
name =
"data") {
201 boost::archive::binary_iarchive in_archive(in_archive_stream);
202 in_archive >> boost::serialization::make_nvp(
name.c_str(), output);
208 const std::string&
name =
"data") {
209 std::ostringstream out_archive_stream;
211 return out_archive_stream.str();
217 const std::string&
name =
"data") {
218 std::istringstream in_archive_stream(serialized);
225 const std::string&
name =
"data") {
226 std::ofstream out_archive_stream(filename.c_str());
227 if (!out_archive_stream.is_open())
return false;
229 out_archive_stream.close();
236 const std::string&
name =
"data") {
237 std::ifstream in_archive_stream(filename.c_str());
238 if (!in_archive_stream.is_open())
return false;
240 in_archive_stream.close();
247 const std::string&
name =
"data") {
254 const std::string&
name =
"data") {
bool deserializeFromFile(const std::string &filename, T &output)
deserializes from a file
void deserializeFromXMLStream(std::istream &in_archive_stream, T &output, const std::string &name="data")
deserializes from a stream in XML
std::string serializeToXMLString(const T &input, const std::string &name="data")
serializes to a string in XML
void serializeToStream(const T &input, std::ostream &out_archive_stream)
std::string serialize(const T &input)
serializes to a string
bool serializeToFile(const T &input, const std::string &filename)
serializes to a file
std::string serializeToBinaryString(const T &input, const std::string &name="data")
serializes to a string in binary
void deserializeFromStream(std::istream &in_archive_stream, T &output)
deserializes from a stream
void deserializeXML(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in XML
bool serializeToBinaryFile(const T &input, const std::string &filename, const std::string &name="data")
serializes to a binary file
void serializeToBinaryStream(const T &input, std::ostream &out_archive_stream, const std::string &name="data")
void deserializeFromString(const std::string &serialized, T &output)
deserializes from a string
void deserializeFromXMLString(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in XML
void deserializeBinary(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in binary
void deserializeFromBinaryString(const std::string &serialized, T &output, const std::string &name="data")
deserializes from a string in binary
bool deserializeFromXMLFile(const std::string &filename, T &output, const std::string &name="data")
deserializes from an XML file
A small structure to hold a non zero as a triplet (i,j,value).
void deserialize(const std::string &serialized, T &output)
deserializes from a string
std::string serializeXML(const T &input, const std::string &name="data")
serializes to a string in XML
bool serializeToXMLFile(const T &input, const std::string &filename, const std::string &name="data")
serializes to an XML file
Annotation for function names.
void deserializeFromBinaryStream(std::istream &in_archive_stream, T &output, const std::string &name="data")
deserializes from a stream in binary
bool deserializeFromBinaryFile(const std::string &filename, T &output, const std::string &name="data")
deserializes from a binary file
std::string serializeBinary(const T &input, const std::string &name="data")
serializes to a string in binary
std::string serializeToString(const T &input)
serializes to a string
void serializeToXMLStream(const T &input, std::ostream &out_archive_stream, const std::string &name="data")