How to save c++ object into a xml file and restore back?
+1 - voodoo :)
Aiden Bell
2009-06-10 10:47:56
A:
I don't know if any direct way of achieving this. You can write separate methods to serialize and de-seriealize methods in which individual data members of the object need to be written and extracted from the file.
aJ
2009-06-10 10:46:35
+7
A:
Boost's serialization library might be implementing a lot of the functionality you are looking for.
Oliver N.
2009-06-10 10:47:08
+5
A:
Serialization is a complex topic which is probably too much for a simple answer on SO. Unfortunately with C++, you don't get it for free as in other languages.
See the C++ faq lite or boost for a start.
Tobias
2009-06-10 10:47:32
+10
A:
Boost.Serialization and libs11n can both do this. The libs11n manual (available here) has an extensive comparison of the two.
As Tobias said, the C++ FAQ has good background information.
Josh Kelley
2009-06-10 10:48:26