configuration file parser library

  • Thread starter Damiano G. Preatoni
  • Start date
D

Damiano G. Preatoni

Hi all,
I'msearching for a free/open implementation of a class able to read and
process variables in a configuration (text) file. since I'm not wanting to
reinvent the wheel, I did some preliminray search work, but none of the
sources I found satisfied me (or worked at all).

Any hints?

TIA
 
J

Jeff Flinn

Damiano G. Preatoni said:
Hi all,
I'msearching for a free/open implementation of a class able to read and
process variables in a configuration (text) file. since I'm not wanting to
reinvent the wheel, I did some preliminray search work, but none of the
sources I found satisfied me (or worked at all).

Any hints?

"configuration file" is pretty vague, but you can try:

http://www.boost.org/doc/html/program_options.html

or the more general parser library:

http://www.boost.org/libs/spirit/index.html

Jeff Flinn
 
D

Damiano G. Preatoni

Damiano said:
Hi all,
I'msearching for a free/open implementation of a class able to read and
process variables in a configuration (text) file.

More on the 'ocnfiguration file': it is a classical ASCII text file, holding
name = value pairs, with the possibility to group things with braces,
a-là-C... maybe an example will suit better:

----------------8<----------------snip-------------
# this is a comment
global {
base = BASEDIR
user = test
}

population {
beast1 {
xpos = 123
ypos = 150
sex = M
C = 0.6
}

}
----------------8<----------------snip-------------

After a (rather) thorough googling I found:

http://www-personal.engin.umich.edu/~wagnerr/ConfigFile.html
By Rick Wagner, author of my favourite random number generator.
Alas, I don't like the file format, and array support.

http://www.gubbe.ch/code/libcfgparse/index.html
Nice thing. Compiles and installs, but I have some trouble linking.

http://freshmeat.net/projects/libconfigduo/ or
http://www.dystance.net/software/libconfig/
More compact, recent, but at present capable only to read.
Yesterday I contacted the author asking for a more complete documentation,
but I had no answer yet.

http://voodoo.com.ua/
A C++ clone of dotconf (which works in C, and I want C++). Too big,
problems with the installer.

http://www.nongnu.org/cfl/
a classic...

http://alumni.media.mit.edu/~rahimi/configuration/
I like the design, but can't compile it at all!


Of course, I also saw stuff like libconfusion and other C stuff.
I am searching for a working library (or a half made one as well), but I
haven't time and skill to build one from scratch or even to code a
wrapper... call it laziness :)


--
-----------------------------------------------------------
Damiano G. Preatoni, PhD

Unità  di Analisi e Gestione delle Risorse Ambientali
Dipartimento "Ambiente-Salute-Sicurezza"
Università  degli Studi dell'Insubria
Via J.H. Dunant, 3 - 21100 Varese (ITALY)

http://biocenosi.dipbsf.uninsubria.it/
ICQ: 78690321
Odigo: 2645129
-----------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top