Boost logo

Boost :

Subject: Re: [boost] Library for configuration file parsing
From: Denis Shevchenko (for.dshevchenko_at_[hidden])
Date: 2010-11-26 07:15:02


Imho, one of the strengths of my library is informative error messages.
Almost any error in configuration file will be "clearly" detected (with
specifying the place where it detected). For example:
-------------------------------------------------
<Server>
<Security>
         Usr = user // There is mistake in name of option "User"
</Security>
</Server>
-------------------------------------------------
Error message:
[Configurator] Incorrect option detected in configuration file:
'Server> Security> Usr'

Or:
-------------------------------------------------
<Server>
<Security>
         User = user
<Security>// There is mistake in name of section, user forget '/' symbol
</Server>
-------------------------------------------------
Error message:
[Configurator] Duplication of open tag for section 'Server > Security'
detected!

Also will be detected problems such as unclosed (or unopened) multi-line
comments, meaningless strings (if user forget the comment out of it),
dissymmetry of sections, etc.

Imho, if the config file is large and there are a lot of sections, such
messages will be useful.

Errors in user code also detected, for example:
configurator.in( "Server" ).in( "Security" ).add_option_here( "User" );
// ...
std::string user = configurator.from( "Server" ).from( "Security"
).get_value_from_here( "Usr" );

Error message:
[Configurator] You request a value of option 'Server > Security > Usr',
but such option not registered!


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