![]() |
Blamite Game Engine - Strings
00313.05.23.21.2038.blamite
A library containing general purpose utilities and classes for use in multiple projects.
|
Class representing a configuration setting. More...
#include <config.h>
Public Member Functions | |
| BlamConfigurationSetting (std::string line, int line_number, std::string comment_delimeter, std::string _filename) | |
| Prepares a new configuration setting. More... | |
| bool | IsValid () |
| Whether or not the provided file line was able to be interpreted as a valid setting. More... | |
| std::string * | AsString () |
| Retrieves the setting value as a string. More... | |
| bool * | AsBool () |
| Retrieves the setting value as a bool. More... | |
| float * | AsFloat () |
| Retrieves the setting value as a float. More... | |
| int * | AsInt () |
| Retrieves the setting value as an int. More... | |
| BlamColor * | AsColor () |
| Retrieves the setting value as a color. More... | |
| std::string | ConvertRawValueToString () |
| Converts the raw setting value to a string, with no placeholders expanded. More... | |
| void | UpdateValue (std::string new_value) |
| Updates the configuration setting with a new value. More... | |
| std::string * | GetRawValue () |
| Retrieves the raw value of the setting, with no placeholders expanded. More... | |
Public Attributes | |
| std::string | id |
| The name of the setting. More... | |
| BlamConfigurationSettingType | type |
| The type of setting that's being stored. More... | |
Class representing a configuration setting.
| BlamConfigurationSetting::BlamConfigurationSetting | ( | std::string | line, |
| int | line_number, | ||
| std::string | comment_delimeter, | ||
| std::string | _filename | ||
| ) |
Prepares a new configuration setting.
This method will create new setting data, as well as convert the setting value to the appropriate type.
| line | - The line in the file to interpret as a configuration setting. |
| comment_delimeter | - The prefix to use when checking if the line is a comment. |
| _filename | - The name of the configuration file this setting belongs to. |
| bool * BlamConfigurationSetting::AsBool | ( | ) |
Retrieves the setting value as a bool.
nullptr will be returned instead. | BlamColor * BlamConfigurationSetting::AsColor | ( | ) |
Retrieves the setting value as a color.
nullptr will be returned instead. | float * BlamConfigurationSetting::AsFloat | ( | ) |
Retrieves the setting value as a float.
nullptr will be returned instead. | int * BlamConfigurationSetting::AsInt | ( | ) |
Retrieves the setting value as an int.
nullptr will be returned instead. | std::string * BlamConfigurationSetting::AsString | ( | ) |
Retrieves the setting value as a string.
| std::string BlamConfigurationSetting::ConvertRawValueToString | ( | ) |
Converts the raw setting value to a string, with no placeholders expanded.
| std::string * BlamConfigurationSetting::GetRawValue | ( | ) |
Retrieves the raw value of the setting, with no placeholders expanded.
| bool BlamConfigurationSetting::IsValid | ( | ) |
Whether or not the provided file line was able to be interpreted as a valid setting.
true if the setting is valid, otherwise returns false. | void BlamConfigurationSetting::UpdateValue | ( | std::string | new_value | ) |
Updates the configuration setting with a new value.
| std::string BlamConfigurationSetting::id |
The name of the setting.
| BlamConfigurationSettingType BlamConfigurationSetting::type |
The type of setting that's being stored.