[program_options] Config file and/or response file

Hello, Couple of questions about program options config file (and/or response file). I've got an options set that is starting to get fairly verbose, it's rich, but is also impractical to expect users to type that many options. So I would like to capture some (or all) of those options in one or more different config files, depending on the options that need to be set for a given session. With config files, can the parse_config_file method build a vector of options? For instance if I define "value" as vector<int>, can I specify value=1, value=2, value=3 and expect {1,2,3}? Or does the convention go something like this, value=1 2 3, and so on? Next, how does the parse_config_file method treat boiler plate iterative sections? In other words, if I've got a pattern and would like to capture zero or more of that pattern: [pattern] name=test param=1 expected=2 actual=3 [pattern] name=result param=4 expected=5 actual=6 Those might inform a vector<pattern> type concern downstream of the parser. Possible? Third, in a response file, there is a statement about "limitations", which was left at that. Can we be more specific? What kind of limitations are we talking about? Obvious ones like the delimiters between tokens come to mind, but other than that, that's a nebulous statement at best. Thank you. Regards, Michael Powell

Michael Powell wrote:
Hello,
Couple of questions about program options config file (and/or response file)...
I went through somewhat of the same last week. As I'm not that practiced with templates I think it was easier to roll my own as I would not be using strict ini format. The program_options ini is parsed in boost/property_tree/ini_parser.hpp I just took that as a basis. (rather than paste, here are my project files with 'profile.ini') <lakeweb.net/content/resize_jpeg.zip> So I parse the ini to get all the categories. Category 'arguments' is passed directly to program_options. Then I can do what I'd like with the rest of the categories. I've also wrapped program_options with my own class and only see what I need to in main. I think my implementation circumvents 'limitations', but can't say. Best, Dan.
participants (2)
-
Dan Bloomquist
-
Michael Powell