I have a small programming project which makes use of TinyXML in msvc++ 2003. Everything works fine, but I can't figure out how to duplicate a TiXmlDocument instance. In my prog I have two in-memory documents, let's say pool1 and pool2. There's an iteration going on which reads pool1 for input and inserts resulting data into pool2. Before the next iteration, I need to empty pool1, duplicate the resultant pool2 into it, and then empty the pool2 as well - so that the results are there for the next iteration.
So how to switch/duplicate TiXmlDocument in a case like this.. ?
Regards,
- PM
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello!
I have a small programming project which makes use of TinyXML in msvc++ 2003. Everything works fine, but I can't figure out how to duplicate a TiXmlDocument instance. In my prog I have two in-memory documents, let's say pool1 and pool2. There's an iteration going on which reads pool1 for input and inserts resulting data into pool2. Before the next iteration, I need to empty pool1, duplicate the resultant pool2 into it, and then empty the pool2 as well - so that the results are there for the next iteration.
So how to switch/duplicate TiXmlDocument in a case like this.. ?
Regards,
- PM
PM --
That's moving a lot of memory around. You might look for a simpler approach? But you can certainly copy and clear with the current API:
TiXmlDocument doc1, doc2;
...
doc1 = doc2; // copies document 2 to 1
doc2.Clear(); // clears the children of the document
good luck,
lee