Blamite Game Engine - Blam (Core)
Blam::Config Namespace Reference

Namespace to contain anything related to Configuration files. More...

Classes

class  ConfigFile
 Class to contain data related to a Config file. More...
 
struct  ConfigOption
 Structure to contain data for an option within a Config file. More...
 

Functions

BLAM int LoadConfig (std::string filename)
 Loads a configuration file from the specified path. More...
 
BLAM int LoadConfig (std::string filename, bool load_defaults)
 Loads a configuration file from the specified path. More...
 
BLAM int LoadConfig (std::string filename, bool load_defaults, int defaults_resource_id)
 Loads a configuration file from the specified path. More...
 
BLAM int LoadConfig (std::string filename, bool load_defaults, int defaults_resource_id, const char *defaults_res_type)
 Loads a configuration file from the specified path. More...
 
BLAM int LoadConfig ()
 Loads the default engine configuration file (engine.cfg) More...
 
BLAM ConfigFileGetConfig (std::string filename)
 Retrieves the specified configuration file. More...
 
BLAM ConfigFileGetConfig ()
 Retrieves the default engine configuration file. More...
 
BLAM void ApplyPlaceholdersToAllConfigFiles ()
 Applies placeholder values to all configuration files. More...
 
BLAM void ExpandConfigOptionPlaceholders ()
 Expands all placeholders, and converts them to their evaluated values. More...
 
BLAM void InsertConfigFile (ConfigFile config)
 Inserts a loaded ConfigFile into the map of loaded configuration files. More...
 
BLAM ConfigFileGetConfigData (std::string filename)
 Retrieves the specified configuration file. More...
 

Detailed Description

Namespace to contain anything related to Configuration files.

Function Documentation

◆ ApplyPlaceholdersToAllConfigFiles()

void Blam::Config::ApplyPlaceholdersToAllConfigFiles ( )

Applies placeholder values to all configuration files.

◆ ExpandConfigOptionPlaceholders()

void Blam::Config::ExpandConfigOptionPlaceholders ( )

Expands all placeholders, and converts them to their evaluated values.

◆ GetConfig() [1/2]

Blam::Config::ConfigFile * Blam::Config::GetConfig ( )

Retrieves the default engine configuration file.

◆ GetConfig() [2/2]

Blam::Config::ConfigFile * Blam::Config::GetConfig ( std::string  filename)

Retrieves the specified configuration file.

Parameters
filename- The configuration file path. Should be the same as what was passed into LoadConfig()

◆ GetConfigData()

Blam::Config::ConfigFile * Blam::Config::GetConfigData ( std::string  filename)

Retrieves the specified configuration file.

◆ InsertConfigFile()

void Blam::Config::InsertConfigFile ( ConfigFile  config)

Inserts a loaded ConfigFile into the map of loaded configuration files.

◆ LoadConfig() [1/5]

int Blam::Config::LoadConfig ( )

Loads the default engine configuration file (engine.cfg)

Returns
- Will return negative if the file failed to load, will return 0 if file was loaded without error.

◆ LoadConfig() [2/5]

int Blam::Config::LoadConfig ( std::string  filename)

Loads a configuration file from the specified path.

Parameters
filename- The path to the configuration file
Returns
- Will return negative if the file failed to load, will return 0 if file was loaded without error.

◆ LoadConfig() [3/5]

int Blam::Config::LoadConfig ( std::string  filename,
bool  load_defaults 
)

Loads a configuration file from the specified path.

Resource type is assumed to be "CFG", and resource ID is set to 0. Will error if load_defaults is set to true.

TODO: Remove this shit

Parameters
filename- The path to the configuration file
load_defaults- Whether or not to load defaults from an embedded resource.
Returns
- Will return negative if the file failed to load, will return 0 if file was loaded without error.

◆ LoadConfig() [4/5]

int Blam::Config::LoadConfig ( std::string  filename,
bool  load_defaults,
int  defaults_resource_id 
)

Loads a configuration file from the specified path.

Resource type is assumed to be "CFG".

Parameters
filename- The path to the configuration file
load_defaults- Whether or not to load defaults from an embedded resource.
defaults_resource_id- The resource ID that refers to the file containing the default configuration file contents.
Returns
- Will return negative if the file failed to load, will return 0 if file was loaded without error.

◆ LoadConfig() [5/5]

int Blam::Config::LoadConfig ( std::string  filename,
bool  load_defaults,
int  defaults_resource_id,
const char *  defaults_res_type 
)

Loads a configuration file from the specified path.

Parameters
filename- The path to the configuration file
load_defaults- Whether or not to load defaults from an embedded resource.
defaults_resource_id- The resource ID that refers to the file containing the default configuration file contents.
defaults_res_type- The type of resource that the default configuration file is stored in. Should almost always be "CFG"
Returns
- Will return negative if the file failed to load, will return 0 if file was loaded without error.