How do you manually insert options into boost.Program_options?

Posted by windfinder on Stack Overflow See other posts from Stack Overflow or by windfinder
Published on 2009-05-08T19:35:15Z Indexed on 2010/04/22 11:13 UTC
Read the original article Hit count: 157

I have an application that uses Boost.Program_options to store and manage its configuration options. We are currently moving away from configuration files and using database loaded configuration instead. I've written an API that reads configuration options from the database by hostname and instance name. (cool!) However, as far as I can see there is no way to manually insert these options into the boost Program_options. Has anyone used this before, any ideas? The docs from boost seem to indicate the only way to get stuff in that map is by the store function, which either reads from the command line or config file (not what I want). Basically looking for a way to manually insert the DB read values in to the map.

© Stack Overflow or respective owner

Related posts about configuration

Related posts about boost-program-options