Blamite Game Engine - blam!  00285.12.18.20.1411.blamite
The core library for the Blamite Game Engine.
BlamConfigurationSetting Class Reference

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...
 
BlamColorAsColor ()
 Retrieves the setting value as a color. More...
 
std::string ConvertRawValueToString ()
 
void UpdateValue (std::string new_value)
 
std::string * GetRawValue ()
 
void ExpandSettingPlaceholders ()
 

Public Attributes

std::string id
 The name of the setting. More...
 
BlamConfigurationSettingType type
 The type of setting that's being stored. More...
 

Detailed Description

Class representing a configuration setting.

Constructor & Destructor Documentation

◆ BlamConfigurationSetting()

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.

Parameters
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.

Member Function Documentation

◆ AsBool()

bool * BlamConfigurationSetting::AsBool ( )

Retrieves the setting value as a bool.

Returns
Pointer to the setting value as a bool. If the value could not be converted to a bool, then nullptr will be returned instead.

◆ AsColor()

BlamColor * BlamConfigurationSetting::AsColor ( )

Retrieves the setting value as a color.

Returns
Pointer to the setting value as a color. If the value could not be converted to a color, then nullptr will be returned instead.

◆ AsFloat()

float * BlamConfigurationSetting::AsFloat ( )

Retrieves the setting value as a float.

Returns
Pointer to the setting value as a float. If the value could not be converted to a float, then nullptr will be returned instead.

◆ AsInt()

int * BlamConfigurationSetting::AsInt ( )

Retrieves the setting value as an int.

Returns
Pointer to the setting value as an int. If the value could not be converted to an int, then nullptr will be returned instead.

◆ AsString()

std::string * BlamConfigurationSetting::AsString ( )

Retrieves the setting value as a string.

Returns
Pointer to the setting value as a string.

◆ ConvertRawValueToString()

std::string BlamConfigurationSetting::ConvertRawValueToString ( )

◆ ExpandSettingPlaceholders()

void BlamConfigurationSetting::ExpandSettingPlaceholders ( )

◆ GetRawValue()

std::string * BlamConfigurationSetting::GetRawValue ( )

◆ IsValid()

bool BlamConfigurationSetting::IsValid ( )

Whether or not the provided file line was able to be interpreted as a valid setting.

Returns
true if the setting is valid, otherwise returns false.

◆ UpdateValue()

void BlamConfigurationSetting::UpdateValue ( std::string  new_value)

Member Data Documentation

◆ id

std::string BlamConfigurationSetting::id

The name of the setting.

◆ type

BlamConfigurationSettingType BlamConfigurationSetting::type

The type of setting that's being stored.


The documentation for this class was generated from the following files: