Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-04-02 14:11:37


Ovanes Markarian wrote:

> Hello *!
>
> I would like to know if there is any interest to support hierarchical
> configuraitons in boost program options library.
>
> The idea is mainly:
>
> [Level1]
> Option1
> Option2
> Option3
>
> [[Level2]]
> Option1
> Option2
> Option3

I think this syntax may be helpful, and should not harm anybody, so
patches to support will be welcome.

> Access rules would be:
> Level1.Option1
> or
> Level1.Level2.Option1
>
>
> Sometimes it is very useful to introduce an additional level instead of
> putting a prefix to each option. On the other hand it might be beneficial
> during access.
>
> PSEUDOCODE:
> option_group g = parsed_options["Level1.Level2"].as<option_group>();
> do_smth(g["Option1"]);

I've though about providing access to a specific set of options, probably
on the level of variables_map, and probably making use of the property_tree
library, but no concrete design yet.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net