Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save c++ object into a xml file and restore back?

How to save c++ object into a xml file and restore back?

like image 691
yesraaj Avatar asked Jun 10 '09 10:06

yesraaj


3 Answers

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.

like image 78
Josh Kelley Avatar answered Nov 15 '22 01:11

Josh Kelley


Boost's serialization library might be implementing a lot of the functionality you are looking for.

like image 25
Oliver N. Avatar answered Nov 15 '22 01:11

Oliver N.


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.

like image 6
Tobias Avatar answered Nov 15 '22 01:11

Tobias