c++xml-serializationserializationtinyxml

XML Serialization/Deserialization in C++


I am using C++ from Mingw, which is the windows version of GNC C++.

What I want to do is: serialize C++ object into an XML file and deserialize object from XML file on the fly. I check TinyXML. It's pretty useful, and (please correct me if I misunderstand it) it basically add all the nodes during processing, and finally put them into a file in one chunk using TixmlDocument::saveToFile(filename) function.

I am working on real-time processing, and how can I write to a file on the fly and append the following result to the file?

Thanks.


Solution

  • I notice that each TiXmlBase Class has a Print method and also supports streaming to strings and streams.

    You could walk the new parts of the document in sequence and output those parts as they are added, maybe?

    Give it a try.....

    Tony