mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:03:04 +01:00
[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.
This commit is contained in:
parent
07905b801a
commit
03a066dcb9
@ -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 */
|
||||
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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 == '/') ? '\\' : '/';
|
||||
|
Loading…
Reference in New Issue
Block a user