Boost logo

Boost :

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


On 26.11.2010 13:04, Vladimir Prus wrote:
> Denis Shevchenko wrote:
>
>> 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.
> You might want to clarify what are "more complex configuration files".
> Also, note that the property_tree library has support for some flavour(s)
> of configuration files, so you might want to compare your solution with
> it.
>
> - Volodya
>
>
> _______________________________________________
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Hi, Volodya!

This is example of more complex configuration file:
--------------------------------------------------------------------------------------
/*
  * more_complex.conf
  */

DbName : my_database
DbHost : localhost
DbPort : 100
DbUser : some_user
DbPassword : some_password

<Server>
     Host : 12.45.46.15 // IP semantic may be check.
     Port : 1080 // Value must be
unsigned integer number.
     Admin/*this is comment with unnecessary info
     asf*/istrator : admin_at_[hidden] // e-mail semantic
may be check.

     StorePath : /some/path // path
semantic may be check.

<Internal>
         Logfile : /some/path/to/logfile // path
semantic may be check.
         MaxLogFileSize : 10 MB // size
semantic may be check, result in bytes.
</Internal>

     ReconnectPeriod : 10 m // time-period semantic may be check,
result in seconds.
</Server>

<Plugins>
     plugins : a_plug b_plug
     plugins : c_plug
     plugins : d_plug
     plugins : e_plug
</Plugins>
----------------------------------------------------------------------------------------

I know boost::property_tree, this is very good library, but (imho) it is
designed specifically to advanced work with XML (though not only with
him). In other words, primaryarea of this library is notwork with
configuration files(imho). I could not find in the documentation (or in
examples) of boost::property_tree features such as option's default
value or necessary.

My library designed exactly for work with configuration files and not
for anything more, so it usageis very simple for THIS task.


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