Program configuration

I'm rather new to C++ I've programmed in other languages before but never anything significant and I have no clue about using ini or xml files or whatever I need to use for this, I'm talking like opening a program and entering some information just once then the next time you use it it will already be configured with the previous information, how would I go about this? What is the best way to do this and can you give me a link to a tutorial or some kind of help on the subject, Thanks in advance.
XML would be a nice thing, you can use libxml++ for it if you work under linux. However, for very simple tasks simply writing to a text file is easier. Have a look at the tutorial section.
The tutorial section doesn't have anything about XML or INI parseing, or registery usage.
However, for very simple tasks simply writing to a text file is easier.
I'd have a look at the Boost libraries if your going down the XML path.
http://www.boost.org/doc/libs/1_35_0
Last edited on
Thank you Zaita, exactly what I needed, thank you also exception and firedraco but what I need isnt really that simple ;)
They don't seem to have an XML one. But they have
http://www.boost.org/doc/libs/1_35_0/doc/html/program_options/overview.html#id1252432

:) I'd go with libxml or the gtk XML library otherwise.
I'd go with libxml or the gtk XML library otherwise.

libxml++ would be the C++ wrapper for libxml, a part of the gnome project (I think that't what you mean with GTK?)
See
http://libxmlplusplus.sourceforge.net/
Yea. Problem with using GTK stuff if they change fairly frequently. The community is currently arguing about what will be/won't be in the GTK3.0 release. Then once that's done you have the lag before all of the ++ libraries are bought upto date.

Unfortunately, I am not aware of any good standard XML libraries for C++.
Problem with using GTK stuff if they change fairly frequently

I use libgtk++ since ~2years fequently. I remember writing a new version number in the makefile some time ago, but I didn't have to change anything in the code. I guess the xml library is pretty much stable and will most likely be backward compatible for the next years.
TinyXML is supposed to be quite a good C++ XML package (not as comprehensive as libxml), it's on sourceforge

http://sourceforge.net/projects/tinyxml/

Last edited on
Topic archived. No new replies allowed.