Boost logo

Boost :

Subject: [boost] Library for configuration file parsing
From: Denis Shevchenko (for.dshevchenko_at_[hidden])
Date: 2010-11-25 11:59:26


Hi all!

Is there any interest in a library for configuration file parsing?

I know there is a good library Program_options, but it supports (asit is
written in the documentation) "parsing of simple INI-like configuration
files". If all you need for configure your programs is INI-like files -
use Program_options and forget about this letter. But if you want to use
a more complex configuration files, you may be interested in my library,
Configurator.

simplest.conf:
Host = 127.0.0.1

Code for work with this config:
cf::configurator configurator;
configurator.add_option( "Host" );
configurator.parse( "/some/path/to/simplest.conf" );
std::cout << "Value of host: " << configurator.get_value( "Host" )<<
std::endl;

Features
- Header-only
- Allows to set option's default value or/and necessity.
- Allows to use arbitrary nesting of sections.
- Provides "standard" checks of value's semantic, like correct path, IP
validity, email correctness, etc.
- Provides "extended" checks of value's semantic, like time period and
file size.
- Provides common checks of options and sections, like duplication,
incorrection, etc.
- Supports single-line and multi-line comments (in C++ style).
- Allow to register values with multi-values.
- Allows to set another "name-value" separator (including space symbol),
instead default '='.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk