1 #ifndef COMPONENTS_SETTINGS_H
2 #define COMPONENTS_SETTINGS_H
32 void loadUser (
const std::string& file);
35 void saveUser (
const std::string& file);
41 static int getInt (
const std::string& setting,
const std::string& category);
42 static float getFloat (
const std::string& setting,
const std::string& category);
43 static std::string
getString (
const std::string& setting,
const std::string& category);
44 static bool getBool (
const std::string& setting,
const std::string& category);
46 static void setInt (
const std::string& setting,
const std::string& category,
const int value);
47 static void setFloat (
const std::string& setting,
const std::string& category,
const float value);
48 static void setString (
const std::string& setting,
const std::string& category,
const std::string& value);
49 static void setBool (
const std::string& setting,
const std::string& category,
const bool value);
54 #endif // _COMPONENTS_SETTINGS_H
void loadDefault(const std::string &file)
load file as the default settings (can be overridden by user settings)
Definition: settings.cpp:363
static void setBool(const std::string &setting, const std::string &category, const bool value)
Definition: settings.cpp:437
static void setFloat(const std::string &setting, const std::string &category, const float value)
Definition: settings.cpp:432
static std::string getString(const std::string &setting, const std::string &category)
Definition: settings.cpp:381
void clear()
clears all settings and default settings
Definition: settings.cpp:356
static bool getBool(const std::string &setting, const std::string &category)
Definition: settings.cpp:406
void saveUser(const std::string &file)
save user settings to file
Definition: settings.cpp:375
static void setInt(const std::string &setting, const std::string &category, const int value)
Definition: settings.cpp:427
std::set< std::pair< std::string, std::string > > CategorySettingVector
Definition: settings.hpp:11
std::map< CategorySetting, std::string > CategorySettingValueMap
Definition: settings.hpp:12
static CategorySettingVector mChangedSettings
tracks all the settings that were changed since the last apply() call
Definition: settings.hpp:23
void loadUser(const std::string &file)
load file as user settings
Definition: settings.cpp:369
std::pair< std::string, std::string > CategorySetting
Definition: settings.hpp:10
static CategorySettingValueMap mUserSettings
Definition: settings.hpp:21
static float getFloat(const std::string &setting, const std::string &category)
Definition: settings.cpp:396
static const CategorySettingVector apply()
returns the list of changed settings and then clears it
Definition: settings.cpp:442
Settings management (can change during runtime)
Definition: settings.hpp:17
static CategorySettingValueMap mDefaultSettings
Definition: settings.hpp:20
static void setString(const std::string &setting, const std::string &category, const std::string &value)
Definition: settings.cpp:411
static int getInt(const std::string &setting, const std::string &category)
Definition: settings.cpp:401