2012-03-30 16:38:33 +00:00
|
|
|
#ifndef _COMPONENTS_SETTINGS_H
|
|
|
|
#define _COMPONENTS_SETTINGS_H
|
|
|
|
|
|
|
|
#include <OgreConfigFile.h>
|
|
|
|
|
|
|
|
namespace Settings
|
|
|
|
{
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \brief Settings management (can change during runtime)
|
|
|
|
///
|
|
|
|
class Manager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static Ogre::ConfigFile mFile;
|
|
|
|
static Ogre::ConfigFile mDefaultFile;
|
|
|
|
|
|
|
|
void loadDefault (const std::string& file);
|
|
|
|
///< load file as the default settings (can be overridden by user settings)
|
|
|
|
|
2012-03-31 11:35:40 +00:00
|
|
|
void copyDefaultToUserSettings ();
|
|
|
|
///< copy the default settings to the user settings (useful when there are no user settings yet)
|
|
|
|
|
|
|
|
void loadUser (const std::string& file);
|
2012-03-30 16:38:33 +00:00
|
|
|
///< load file as user settings
|
|
|
|
|
2012-03-31 11:35:40 +00:00
|
|
|
void saveUser (const std::string& file);
|
|
|
|
///< save user settings to file
|
2012-03-30 16:38:33 +00:00
|
|
|
|
|
|
|
static const int getInt (const std::string& setting, const std::string& category);
|
|
|
|
static const float getFloat (const std::string& setting, const std::string& category);
|
|
|
|
static const std::string getString (const std::string& setting, const std::string& category);
|
|
|
|
static const bool getBool (const std::string& setting, const std::string& category);
|
2012-03-31 11:35:40 +00:00
|
|
|
|
|
|
|
static void setInt (const std::string& setting, const std::string& category, const int value);
|
|
|
|
static void setFloat (const std::string& setting, const std::string& category, const float value);
|
|
|
|
static void setString (const std::string& setting, const std::string& category, const std::string& value);
|
|
|
|
static void setBool (const std::string& setting, const std::string& category, const bool value);
|
2012-03-30 16:38:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _COMPONENTS_SETTINGS_H
|