Boost logo

Boost Users :

From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-06-04 00:59:59


Chris Ross wrote:

>
> I'm trying to load a bunch of information out of a file, and I see
> that with boost::program_options 1.35.0, there's a way to pass a
> parameter to parse_config_file() to tell it to read in unknown
> "options". I am doing this, but with a config file as such:
>
> [tale]
> name = bob
> name = Jerry
> value = 7
>
> I get back three options, each of which is a vector<> with only one
> value. Is there a way to get program_options to return tale.name as a
> single option with two values in the vector?

No. parse_config_file is concerned with syntax only, and three options is
what the file contains, syntactically. It's easy to write custom code to
merge values of options with the same name.

- 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