Re: xml parsing



> All I really need is something simple such as was provided by Windows
> ini files.

I have something for you if you didn't get lucky with the Glib::KeyFile.
I have a class that does what you want, you can create hierarchies of
sections with key=value pairs in it. Really easy to use. Take a look here:

http://lonestar.exhale.de/viewvc/src/conf.h?revision=1&root=gtkevemon&view=markup

All you need as dependency is the ref_ptr.h in the same directory.

A config file created with this class looks like this:

-------8<-------

[section]
  key = Hello World

[section.subsection]
  key1 = 23.56
  key2 = true

-------8<-------

Use it like:

ConfValuePtr value = conf.get_value("section.subsection.key1");
std::cout << "Double: " << value->get_double() << std::endl;

Regards,
Simon


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]