Is there a library that supports Java-like .properties files? I have
several settings for each of my classes. So, I want to have a file like
this:
MainClass.numOfLoops = 3232 # the number of loops
MainClass.version = 0.95
OtherClass.readDirectory = /etc/passwd
OtherClass.whatever = true
The library should read and parse this and provide the values in a
global/singleton hash or so. I tried boost::program_options, but there
you have to define exactly which options you are expecting. It's really
for command line options for executables. I want that the user can
define all kinds of keys/values in such a file. Each class should also
be allowed to read its own .properties file. In that case, the
keys/values are only visible for that class.
I should be able to say something like:
double version = properties.get("MainClass.version").toBool();
bool whatever = properties.get("OtherClass.whatever").toDouble();
Thanks!
Markus