Boost logo

Boost Users :

Subject: [Boost-users] boost.program_options - reloading configuration file
From: Aljaz (aljaz.fajmut_at_[hidden])
Date: 2008-10-15 17:38:16


I want to implement function in my application which would allow me to
reload the configuration file.

At the moment I have all neccessary program_options objects inside a
configuration class, and when I do:

bool configuration::reload_config_file(std::string filename) {
try {
    std::ifstream ifs(filename.c_str());
    if (!ifs.is_open()) return false;

m_config), m_variables);

catch (std::exception &e) {
    return false;
   return true;

The options will stay the same although the configuration file is different.
Should I somehow clear the m_variables object?

Many thanks in advance!

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at