Boost logo

Boost Users :

From: Alex Ott (ott_at_[hidden])
Date: 2006-01-19 09:13:08


Hi/re

But what if i don't want to use dedicated variables, and want to store all
configuration in one place? For example, i need to load configuration from
file, but set some variables from the command-line, that will override values
from file. Option processing will done in dedicated thread, and i want to pass
only one argument - program_options object

Paul Giaccone wrote:
> Daniel Weiss wrote:
>
>> Hi
>>
>> Is there any possibility to posteriorily change the values stored in the
>> options map read from the config file? I.e.:
>>
>> I have assigned the following option:
>> ( "AutomZoneDetect", po::value<std::string>() ->default_value( "off" ), "To
>> detect zones automatically" );
>>
>> Now I would like to e.g. set this option to "on" at some point in my code...
>>
>>
>> Greets, Dan!
>>
>>
> Just store it in a string variable so you can set it later.
>
> std::string my_option;
>
> ( "AutomZoneDetect", po::value<std::string>(&my_option) ->default_value( "off" ), "To
> detect zones automatically" );
>
> my_option = "on";
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

-- 
With best wishes,      Alex Ott
Jet Infosystems,       Head of software development group, MBA
+7 (095) 411 76 01     http://www.jetsoft.ru/

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