Hello all,
I've been having trouble getting TinyXML to work the way I would like it to. I don't understand it or the tutorials that I've read very well, so I'm basically asking for a solution, which should be very easy for anybody who's worked with it a lot.
The reason I need TinyXML and not some other file reading gadget is because all of the files in question (thousands) are in XML format, and TInyXML has already been somewhat implemented into my project.
The reason that I don't think the manuals are working for me is that I've generally learned programming by example, and none of the tutorials I've looked at showed the examples of the types of XML structures that I'm working with. In general, all of the data I need is stored in two ways:
1. Boolean data (flags) are stored like so:
<can-be-engaged/>
2. String or number data are stored like this:
<price integer="1500"/>
In the first case, I just need to identify that the "can-be-engaged" flag is set for this XML file and pass the information on to the program.
In the second case, I need to know that the "price" for this object is set to "1500" (I don't need to know that it is an integer).
The only other thing that I need to know is how to access the data if it's nested:
<attributes>
<can-be-engaged/>
</attributes>
So if I had a simple XML file:
<?xml version="1.0" encoding="utf-8"?>
<base-object>
<attributes>
<can-be-engaged/>
<can-be-shot/>
</attributes>
<price integer="1500"/>
<speed real="15.2"/>
</base-object>
How would I access and pass on all of the data that I need?
All help is greatly appreciated and thanks in advance!
adam_o