Pyrogenesis  trunk
Namespaces | Macros | Typedefs | Functions | Variables
ConfigDB.cpp File Reference
#include "precompiled.h"
#include "ConfigDB.h"
#include <boost/algorithm/string.hpp>
#include "lib/allocators/shared_ptr.h"
#include "ps/CLogger.h"
#include "ps/Filesystem.h"
#include "ps/ThreadUtil.h"
Include dependency graph for ConfigDB.cpp:

Namespaces

 anonymous_namespace{ConfigDB.cpp}
 

Macros

#define CHECK_NS(rval)
 
#define GETVAL(type)
 

Typedefs

typedef std::map< CStr, CConfigValueSetTConfigMap
 

Functions

template<typename T >
void anonymous_namespace{ConfigDB.cpp}::Get (const CStr &value, T &ret)
 
template<>
void anonymous_namespace{ConfigDB.cpp}::Get (const CStr &value, bool &ret)
 
template<>
void anonymous_namespace{ConfigDB.cpp}::Get (const CStr &value, std::string &ret)
 
std::string anonymous_namespace{ConfigDB.cpp}::EscapeString (const CStr &str)
 

Variables

static pthread_mutex_t cfgdb_mutex = PTHREAD_MUTEX_INITIALIZER
 

Macro Definition Documentation

#define CHECK_NS (   rval)
Value:
do {\
if (ns < 0 || ns >= CFG_LAST)\
{\
debug_warn(L"CConfigDB: Invalid ns value");\
return rval;\
}\
} while (false)
Definition: ConfigDB.h:44
#define debug_warn(expr)
display the error dialog with the given text.
Definition: debug.h:329
#define GETVAL (   type)
Value:
void CConfigDB::GetValue(EConfigNamespace ns, const CStr& name, type& value)\
{\
CScopeLock s(&cfgdb_mutex);\
TConfigMap::iterator it = m_Map[CFG_COMMAND].find(name);\
if (it != m_Map[CFG_COMMAND].end())\
{\
Get(it->second[0], value);\
return;\
}\
for (int search_ns = ns; search_ns >= 0; --search_ns)\
{\
it = m_Map[search_ns].find(name);\
if (it != m_Map[search_ns].end())\
{\
Get(it->second[0], value);\
return;\
}\
}\
}
#define CHECK_NS(rval)
Definition: ConfigDB.cpp:51
static pthread_mutex_t cfgdb_mutex
Definition: ConfigDB.cpp:34
void GetValue(EConfigNamespace ns, const CStr &name, bool &value)
Attempt to retrieve the value of a config variable with the given name; will search CFG_COMMAND first...
void Get(const CStr &value, std::string &ret)
Definition: ConfigDB.cpp:70
EConfigNamespace
Definition: ConfigDB.h:37
Definition: ConfigDB.h:43

Typedef Documentation

typedef std::map<CStr, CConfigValueSet> TConfigMap

Variable Documentation