From 03a066dcb92e4c070326bfc42f29548ba7c6c636 Mon Sep 17 00:00:00 2001 From: robocop Date: Sun, 25 Dec 2005 03:59:49 +0000 Subject: [PATCH] [s|g]etConfigFile renamed [s|g]setConfigFilePath. Clearer, since we have a class named ConfigFile but the function only returns a string with the path, not an object. --- src/common/config/config.cpp | 10 ++++++---- src/common/config/config_file.h | 4 ++-- src/config/Configuration.cpp | 2 +- src/config/Configuration.h | 2 +- src/jrd/db_alias.cpp | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/common/config/config.cpp b/src/common/config/config.cpp index bf16aace99..7afd7a770d 100644 --- a/src/common/config/config.cpp +++ b/src/common/config/config.cpp @@ -139,20 +139,22 @@ static Firebird::Mutex config_init_lock; const ConfigImpl& ConfigImpl::instance() { - if (!sys_config) { + if (!sys_config) + { #ifdef MULTI_THREAD try { config_init_lock.enter(); if (!sys_config) { -#endif sys_config = FB_NEW(*getDefaultMemoryPool()) ConfigImpl(*getDefaultMemoryPool()); -#ifdef MULTI_THREAD } } catch(const std::exception&) { config_init_lock.leave(); throw; } config_init_lock.leave(); +#else + sys_config = FB_NEW(*getDefaultMemoryPool()) ConfigImpl(*getDefaultMemoryPool()); + #endif } return *sys_config; @@ -175,7 +177,7 @@ ConfigImpl::ConfigImpl(MemoryPool& p) : ConfigRoot(p) values = FB_NEW(p) ConfigValue[size]; string val_sep = ","; - file.setConfigFile(getConfigFile()); + file.setConfigFilePath(getConfigFilePath()); /* Iterate through the known configuration entries */ diff --git a/src/common/config/config_file.h b/src/common/config/config_file.h index aebe4f7ad6..ded4daf437 100644 --- a/src/common/config/config_file.h +++ b/src/common/config/config_file.h @@ -68,8 +68,8 @@ public: fExceptionOnError(ExceptionOnError), parameters(getPool()) {} // configuration file management - const string getConfigFile() { return configFile; } - void setConfigFile(const string& newFile) { configFile = newFile; } + const string getConfigFilePath() const { return configFile; } + void setConfigFilePath(const string& newFile) { configFile = newFile; } bool isLoaded() const { return isLoadedFlg; } diff --git a/src/config/Configuration.cpp b/src/config/Configuration.cpp index 8e74d27116..adb2ee1547 100644 --- a/src/config/Configuration.cpp +++ b/src/config/Configuration.cpp @@ -63,7 +63,7 @@ void Configuration::loadConfigFile(void) configFile = new ConfigFile (0); } -void Configuration::setConfigFile(const char* filename) +void Configuration::setConfigFilePath(const char* filename) { if (!configFile) configFile = new ConfigFile (filename, 0); diff --git a/src/config/Configuration.h b/src/config/Configuration.h index ec4f25b293..2282c1ec21 100644 --- a/src/config/Configuration.h +++ b/src/config/Configuration.h @@ -41,7 +41,7 @@ public: static ConfObject* findObject(const char* objectType, const char* objectName); static const char* getRootDirectory(void); static void loadConfigFile(void); - static void setConfigFile (const char* filename); + static void setConfigFilePath(const char* filename); static ConfObject* getObject(const char* objectType); static ConfObject* getObject(const char* objectType, const char* objectName); }; diff --git a/src/jrd/db_alias.cpp b/src/jrd/db_alias.cpp index 56a81f43fc..fe1193f542 100644 --- a/src/jrd/db_alias.cpp +++ b/src/jrd/db_alias.cpp @@ -36,7 +36,7 @@ bool ResolveDatabaseAlias(const string& alias, string& database) string alias_filename; Firebird::Prefix(alias_filename, ALIAS_FILE); ConfigFile aliasConfig(false); - aliasConfig.setConfigFile(alias_filename); + aliasConfig.setConfigFilePath(alias_filename); const char correct_dir_sep = PathUtils::dir_sep; const char incorrect_dir_sep = (correct_dir_sep == '/') ? '\\' : '/';