How to make file readable and editable when serialize object to xml by C++

Viewed 34

I am using Qt C++ for desktop software development and have lots of config files to save and read. I'm now using QDataStream to save config object to binary file. It works to some extent, but the file saved can't read directly ,meanwhile, when I change the class member, then old file will not able to be parsed to object. So I'm wondering that, If there any method can fulfill the requirements below?

  1. can save object to a xml file and parse a xml file to an object.
  2. the xml file can be edit by any text editor manually
  3. when class definition modified,file generate by old class,can also parsed correctly.

I knew some realizations by C# which match fields name with xml node by reflection.Is there any similar framework in C++?

0 Answers
Related