Create XmlSerializer in MFC C ++

I want to implement in my MFC application project this logic written in C # looks like this:

XmlSerializer ser = new XmlSerializer(typeof(A_CLASS));
StringBuilder sb = new StringBuilder();
XmlWriterSettings sett = new XmlWriterSettings();
sett.Indent = true;
sett.IndentChars = "\t";
using (XmlWriter sw = XmlWriter.Create(sb, sett))
{
    ser.Serialize(sw, A_CLASS_Instance);
}

      

How can I write this in C ++?

+1


source to share


2 answers


MFC won't really help you, but as usual in C ++ today Boost is your friend :)

The Boost.Serialization library has xml_oarchive

and xml_iarchive

. See simple examples here: http://www.fnord.ca/articles/xml.html



However - look at the answers to this question .

+1


source


As far as I know, MFC does not provide classes for XML serialization. But there may be libraries.



0


source







All Articles