Inheritance diagram for mortic::IConfigManager:
Public Member Functions | |
IConfigManager (IRoot *root) | |
Constructor. | |
virtual | ~IConfigManager () |
Never use this, use drop(). | |
virtual std::string | getOption (std::string section, std::string key, std::string def)=0 |
Get an option from the file. | |
template<typename T> | |
T | getOption (std::string section, std::string key, T def) |
Get a converted option. | |
virtual void | setOption (std::string section, std::string key, std::string value)=0 |
Set an option. | |
template<typename T> | |
void | setOption (std::string section, std::string key, T value) |
Set a converted option. |
This class deals with the configuration XML file. It loads the options at start up, and then the options can be messed with while the game is running. Currently there is no way to reload options in all the other parts of the engine. When mortic shuts down, this manager saves all the changes to configuration. This is a simple settings.xml file:
<MorticConfig> <Section1> <option1>value1</option1> <option2>value2</option2> </Section1> <Section2> <option3>value3</option3> </Section2> </MorticConfig>
Definition at line 91 of file IConfigManager.h.
|
Constructor. Do not use this, ever.
Definition at line 98 of file IConfigManager.h. |
|
Never use this, use drop().
Definition at line 104 of file IConfigManager.h. |
|
Get a converted option. This function is identical to getOption(std::string section, std::string key, std::string def), but it converts the value to something else beforehand, for example, an integer.
Definition at line 130 of file IConfigManager.h. References getOption(). |
|
Get an option from the file. This function gets the value from a certain key and section. It also has a default return if the option is not found. In that case, the default is written to the file as the option. For example, with the file above, section "Section2", option "option3", has value "value3". But, if I look for "Section 2, option4" with a default of "wohba", the manager will make this option and set it to "wohba" for me when it rewrites it.
Referenced by getOption(). |
|
Set a converted option. This function is identical to setOption(std::string section, std::string key, std::string value), except it accepts any value, not just strings.
Definition at line 157 of file IConfigManager.h. References setOption(). |
|
Set an option. This function sets a value in the file based off the given section and key.
Referenced by setOption(). |