Monday, October 24, 2005

Simple XML tool in C++

XML is really a great format. It gives a lot of freedom. I can define any structure with it.

And this is really useful for game development. Especially in C++. Its build times are rather long, so storing and modifying parameters inside the code is not very useful. Testing and experimenting takes a long time in this case. If, however, the data is moved out of the code, as it should be done, the problem of performance is gone. Just go to your favorite XML editor, edit the data, save, then and simply restart the application without any recompilation.

So, I have tried to move as much as I could to XML files, so long as it did not take away a lot of time to do so. One of the things that I had stumbled upon was uneasy reading of XML files in C++ libraries what were available to me. In particular, I used tinyXML. However, reading many small and simple files across the entire framework took just too much effort for its price. So I figured it was time to create a simple wrapper around tinyXML. This way I could expose just enough features that I need, and thus keeping it very simple.

The product is the following: XML tools: a simple reader and looper of simple XML files. See their examples for yourself.

Boy, that really made it very easy to use XML anywhere. One line of code for one value from XML file. Quiet perfect.

No comments: