
4 Jun
2008
4 Jun
'08
4:59 a.m.
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