Pyrogenesis
13997
|
#include <ConfigDB.h>
Public Member Functions | |
CConfigDB () | |
CConfigValue * | GetValue (EConfigNamespace ns, const CStr &name) |
Attempt to find a config variable with the given name; will search CFG_COMMAND first, and then all namespaces from the specified namespace down to system. More... | |
CConfigValueSet * | GetValues (EConfigNamespace ns, const CStr &name) |
Attempt to retrieve a vector of values corresponding to the given setting; will search CFG_COMMAND first, and then all namespaces from the specified namespace down to system. More... | |
EConfigNamespace | GetValueNamespace (EConfigNamespace ns, const CStr &name) |
Returns the namespace that the value returned by GetValues was defined in, or CFG_LAST if it wasn't defined at all. More... | |
std::map< CStr, CConfigValueSet > | GetValuesWithPrefix (EConfigNamespace ns, const CStr &prefix) |
Retrieve a map of values corresponding to settings whose names begin with the given prefix; will search all namespaces from system up to the specified namespace. More... | |
CConfigValue * | CreateValue (EConfigNamespace ns, const CStr &name) |
Create a new config value in the specified namespace. More... | |
void | SetConfigFile (EConfigNamespace ns, const VfsPath &path) |
Set the path to the config file used to populate the specified namespace Note that this function does not actually load the config file. More... | |
bool | Reload (EConfigNamespace) |
Reload the config file associated with the specified config namespace (the last config file path set with SetConfigFile) More... | |
bool | WriteFile (EConfigNamespace ns, const VfsPath &path) |
Write the current state of the specified config namespace to the file specified by 'path'. More... | |
bool | WriteFile (EConfigNamespace ns) |
Write the current state of the specified config namespace to the file it was originally loaded from. More... | |
![]() | |
Singleton () | |
~Singleton () | |
Static Private Attributes | |
static std::map< CStr, CConfigValueSet > | m_Map [] |
static VfsPath | m_ConfigFile [] |
Additional Inherited Members | |
![]() | |
static CConfigDB & | GetSingleton () |
static CConfigDB * | GetSingletonPtr () |
static bool | IsInitialised () |
Definition at line 54 of file ConfigDB.h.
CConfigDB::CConfigDB | ( | ) |
Definition at line 33 of file ConfigDB.cpp.
CConfigValue * CConfigDB::CreateValue | ( | EConfigNamespace | ns, |
const CStr & | name | ||
) |
Create a new config value in the specified namespace.
If such a variable already exists in this namespace, the old value is returned.
Returns a pointer to the value of the newly created config variable, or that of the already existing config variable.
Definition at line 113 of file ConfigDB.cpp.
CConfigValue * CConfigDB::GetValue | ( | EConfigNamespace | ns, |
const CStr & | name | ||
) |
Attempt to find a config variable with the given name; will search CFG_COMMAND first, and then all namespaces from the specified namespace down to system.
Returns a pointer to the config value structure for the variable, or NULL if such a variable could not be found.
Definition at line 37 of file ConfigDB.cpp.
EConfigNamespace CConfigDB::GetValueNamespace | ( | EConfigNamespace | ns, |
const CStr & | name | ||
) |
Returns the namespace that the value returned by GetValues was defined in, or CFG_LAST if it wasn't defined at all.
Definition at line 67 of file ConfigDB.cpp.
CConfigValueSet * CConfigDB::GetValues | ( | EConfigNamespace | ns, |
const CStr & | name | ||
) |
Attempt to retrieve a vector of values corresponding to the given setting; will search CFG_COMMAND first, and then all namespaces from the specified namespace down to system.
Returns a pointer to the vector, or NULL if the setting could not be found.
Definition at line 45 of file ConfigDB.cpp.
std::map< CStr, CConfigValueSet > CConfigDB::GetValuesWithPrefix | ( | EConfigNamespace | ns, |
const CStr & | prefix | ||
) |
Retrieve a map of values corresponding to settings whose names begin with the given prefix; will search all namespaces from system up to the specified namespace.
Definition at line 89 of file ConfigDB.cpp.
bool CConfigDB::Reload | ( | EConfigNamespace | ns | ) |
Reload the config file associated with the specified config namespace (the last config file path set with SetConfigFile)
Returns: true: if the reload succeeded, false: if the reload failed
Definition at line 140 of file ConfigDB.cpp.
void CConfigDB::SetConfigFile | ( | EConfigNamespace | ns, |
const VfsPath & | path | ||
) |
Set the path to the config file used to populate the specified namespace Note that this function does not actually load the config file.
Use the Reload() method if you want to read the config file at the same time.
'path': The path to the config file.
Definition at line 129 of file ConfigDB.cpp.
bool CConfigDB::WriteFile | ( | EConfigNamespace | ns, |
const VfsPath & | path | ||
) |
Write the current state of the specified config namespace to the file specified by 'path'.
Returns: true: if the config namespace was successfully written to the file false: if an error occurred
Definition at line 236 of file ConfigDB.cpp.
bool CConfigDB::WriteFile | ( | EConfigNamespace | ns | ) |
Write the current state of the specified config namespace to the file it was originally loaded from.
Returns: true: if the config namespace was successfully written to the file false: if an error occurred
Definition at line 225 of file ConfigDB.cpp.
|
staticprivate |
Definition at line 57 of file ConfigDB.h.
|
staticprivate |
Definition at line 56 of file ConfigDB.h.