Changeset 5316 for source/ariba/utility/configuration
- Timestamp:
- Jul 24, 2009, 8:53:41 PM (15 years ago)
- Location:
- source/ariba/utility/configuration
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/configuration/Configuration.cpp
r3690 r5316 51 51 void Configuration::setConfigFilename(string filename){ 52 52 CONFIG_FILE = filename; 53 instance().reload(); 53 if(haveConfig()) 54 instance().reload(); 54 55 } 55 56 56 57 Configuration::~Configuration(){ 57 58 delete config; 59 } 60 61 bool Configuration::haveConfig(){ 62 std::ifstream in( CONFIG_FILE.c_str() ); 63 if( !in ) return false; 64 65 in.close(); 66 return true; 58 67 } 59 68 … … 64 73 65 74 bool Configuration::exists(const string& name){ 75 if(config == NULL) return false; 66 76 return config->keyExists( name ); 67 77 } -
source/ariba/utility/configuration/Configuration.h
r3690 r5316 63 63 static Configuration& instance(); 64 64 static void setConfigFilename(string filename); 65 static bool haveConfig(); 65 66 66 67 /**
Note:
See TracChangeset
for help on using the changeset viewer.