PixelLightAPI
.
|
Configuration class. More...
#include <Config.h>
Public Member Functions | |
PLCORE_API | Config () |
Constructor. | |
virtual PLCORE_API | ~Config () |
Destructor. | |
PLCORE_API String | GetVar (const String &sClass, const String &sVariable) |
Returns the value of a configuration class variable. | |
PLCORE_API int | GetVarInt (const String &sClass, const String &sVariable) |
Returns the value of a configuration class variable. | |
PLCORE_API bool | SetVar (const String &sClass, const String &sVariable, const String &sValue="") |
Set the value of a configuration class variable. | |
PLCORE_API bool | SetDefault (const String &sClass="", const String &sVariable="") |
Set default configuration settings. | |
uint32 | GetNumOfClasses () const |
Returns the number of configuration class instances. | |
ConfigGroup * | GetClassByIndex (uint32 nIndex) const |
Returns a configuration class instance by index. | |
PLCORE_API ConfigGroup * | GetClass (const String &sName) |
Returns a configuration class instance. | |
virtual PLCORE_API String | GetLoadableTypeName () const override |
Returns the loadable type name. |
Configuration class.
Usage example:
* // Somewhere deep within your custom configuration class header... * class ConfigTest : public ConfigGroup { * pl_class(ConfigTest, "PLCore", PLCore::ConfigGroup, "Test config class") * pl_constructor_0(DefaultConstructor, "Default constructor", "") * pl_attribute(Detail, float, 1.0f, ReadWrite, DirectValue, "Detail description text", "") * pl_class_end * }; * // Somewhere in your custom configuration class source code * pl_implement_class(ConfigTest) * // Set ConfigTest variable value * cConfig.SetVar("ConfigTest", "Detail", "2.0"); * // Get ConfigTest variable value * float fDetail = cConfig.GetVar("ConfigTest", "Detail").GetFloat(); *
PLCORE_API PLCore::Config::Config | ( | ) |
virtual PLCORE_API PLCore::Config::~Config | ( | ) | [virtual] |
Destructor.
PLCORE_API String PLCore::Config::GetVar | ( | const String & | sClass, |
const String & | sVariable | ||
) |
Returns the value of a configuration class variable.
[in] | sClass | Configuration class name (no empty string) |
[in] | sVariable | Name of the variable (no empty string) |
PLCORE_API int PLCore::Config::GetVarInt | ( | const String & | sClass, |
const String & | sVariable | ||
) |
Returns the value of a configuration class variable.
[in] | sClass | Configuration class name (no empty string) |
[in] | sVariable | Name of the variable (no empty string) |
PLCORE_API bool PLCore::Config::SetVar | ( | const String & | sClass, |
const String & | sVariable, | ||
const String & | sValue = "" |
||
) |
Set the value of a configuration class variable.
[in] | sClass | Configuration class name (no empty string) |
[in] | sVariable | Name of the variable (no empty string) |
[in] | sValue | Variable value |
PLCORE_API bool PLCore::Config::SetDefault | ( | const String & | sClass = "" , |
const String & | sVariable = "" |
||
) |
Set default configuration settings.
[in] | sClass | Configuration class name, if empty string, set ALL settings to default values |
[in] | sVariable | Name of the variable, if empty string, set all variables of the given configuration class to default values |
uint32 PLCore::Config::GetNumOfClasses | ( | ) | const [inline] |
Returns the number of configuration class instances.
ConfigGroup * PLCore::Config::GetClassByIndex | ( | uint32 | nIndex | ) | const [inline] |
Returns a configuration class instance by index.
[in] | nIndex | Index of the configuration class instance to return |
PLCORE_API ConfigGroup* PLCore::Config::GetClass | ( | const String & | sName | ) |
Returns a configuration class instance.
[in] | sName | Configuration class name |
virtual PLCORE_API String PLCore::Config::GetLoadableTypeName | ( | ) | const [override, virtual] |
|