#include <settings.h>
Public Member Functions | |
| Settings () | |
| initializes settings with default values | |
| bool | loadSettings (const char *filename) |
| Load setting from config XML. | |
| bool | saveSettings (const char *filename) |
| Save setttings to file. | |
| double | getDouble (const char *entry) |
| Get double asociated with key. | |
| int | getInt (const char *entry) |
| Return variable from setting converted to int. | |
| string | getString (const char *entry) |
| bool | compare (const char *entry, const char *value) |
| bool | isTrue (const char *entry) |
| void | set (const std::string &key, const std::string &value) |
| template<class T> | |
| void | set (const std::string &key, const T &val) |
| bool | exist (const char *entry) |
| Check if entry is known. | |
Private Member Functions | |
| map< string, string >::iterator | find (const char *entry) |
Private Attributes | |
| map< string, string > | m_map |
Definition at line 15 of file settings.h.
|
|
initializes settings with default values Set default values for all settings. Definition at line 25 of file settings.cpp. |
|
||||||||||||
|
Definition at line 121 of file settings.cpp. References find(). Here is the call graph for this function: ![]() |
|
|
Check if entry is known.
Definition at line 172 of file settings.cpp. References m_map. Referenced by CommanderClient::command_getvar(), CommanderClient::command_setvar(), and saveSettings(). |
|
|
Definition at line 158 of file settings.cpp. References DIE(), LOGE, and m_map. Referenced by compare(), getDouble(), getInt(), and isTrue(). Here is the call graph for this function: ![]() |
|
|
Get double asociated with key. If the entry doesn't exist or can't be converted to double the method kills the program
Definition at line 192 of file settings.cpp. References find(), get_double(), and LOGT. Referenced by GameServer::GameServer(), TaskSimulationServer::init(), and GameServer::setSpeedMultiplicator(). Here is the call graph for this function: ![]() |
|
|
Return variable from setting converted to int. Die if entry not found. Die if not a number. Definition at line 184 of file settings.cpp. References find(), and get_long(). Referenced by Console::Console(), TerrainServer::init(), ApplicationServer::init(), ApplicationClient::init(), and GFX::loadVideoSettings(). Here is the call graph for this function: ![]() |
|
|
Search for entry in settings. If entry doesn't exist, the program die. If you need store any entry in Settings, add it's default value to constructor. Else the program may fall. Definition at line 112 of file settings.cpp. Referenced by CommanderClient::command_getvar(), ApplicationServer::init(), ApplicationClient::init(), Application::initBasicSubsystems(), Application::loadUserConfigFile(), GFX::loadVideoSettings(), saveSettings(), and Application::saveUserConfigFile(). |
|
|
Die if not found, die if invalind conversion. Definition at line 150 of file settings.cpp. References find(), and get_bool(). Referenced by TerrainGeoMipMap::init(), TaskRender::init(), SFX::init(), ApplicationServer::init(), ApplicationClient::init(), GFX::loadVideoSettings(), TerrainGeoMipMap::render(), and LayerGame::setView(). Here is the call graph for this function: ![]() |
|
|
Load setting from config XML. Not yet known keys are added and old values are rewriten. You may call this function more times on one object.
Definition at line 34 of file settings.cpp. References assertL, TiXmlElement::Attribute(), TiXmlHandle::Element(), TiXmlHandle::FirstChild(), TiXmlDocument::LoadFile(), LOGD, LOGE, set(), and TIN. Referenced by Application::initBasicSubsystems(), and Application::loadUserConfigFile(). Here is the call graph for this function: ![]() |
|
|
Save setttings to file. Opens and scans file. Only rewrite values in file to new values. Doesn't add any new variables. Note that indentation may change but all data including comments are kept.
Definition at line 71 of file settings.cpp. References assertL, TiXmlElement::Attribute(), TiXmlHandle::Element(), exist(), TiXmlHandle::FirstChild(), getString(), TiXmlDocument::LoadFile(), LOGE, LOGW, TIN, and TVARIABLE2. Referenced by Application::saveUserConfigFile(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 202 of file settings.cpp. References set(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 130 of file settings.cpp. References m_map. Referenced by CommanderClient::command_setvar(), loadSettings(), and set(). |
|
|
Definition at line 101 of file settings.h. |
1.4.5