I have a bunch of classes that each read in their values from an XML file using TinyXML.
I've done this so everything is in memory, and my user is using the app and making changes. If the user presses Save, I need to iterate through my objects and call the Save() function which writes out the XML file. Should I rebuild the XML file programmatically from scratch and write it out? Or should I use the same TiXmlHandle
that I used to read the file, modify that and then write it back out? That way, the original order is kept. If I recreate the XML, then the order of the original would be changed.
I want the user to be able to modify the XML by hand, so I think it would be wierd for them to change it manually, only to have it reshuffled when saving. Am I understanding my options correctly?
Never used TinyXML before, or XML for that matter.