Ignore:
Timestamp:
Jul 24, 2009, 8:53:41 PM (15 years ago)
Author:
Christoph Mayer
Message:

merge from bootstrap branch

Location:
source/ariba/utility/configuration
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/configuration/Configuration.cpp

    r3690 r5316  
    5151void Configuration::setConfigFilename(string filename){
    5252        CONFIG_FILE = filename;
    53         instance().reload();
     53        if(haveConfig())
     54                instance().reload();
    5455}
    5556
    5657Configuration::~Configuration(){
    5758        delete config;
     59}
     60
     61bool Configuration::haveConfig(){
     62        std::ifstream in( CONFIG_FILE.c_str() );
     63        if( !in ) return false;
     64
     65        in.close();
     66        return true;
    5867}
    5968
     
    6473
    6574bool Configuration::exists(const string& name){
     75        if(config == NULL) return false;
    6676        return config->keyExists( name );
    6777}
  • source/ariba/utility/configuration/Configuration.h

    r3690 r5316  
    6363        static Configuration& instance();
    6464        static void setConfigFilename(string filename);
     65        static bool haveConfig();
    6566
    6667        /**
Note: See TracChangeset for help on using the changeset viewer.