Namespace to contain anything related to Configuration files.
More...
Namespace to contain anything related to Configuration files.
- Todo:
- move documentation comments into header
- Deprecated:
- Will be replaced in favor of the new configuration system. See Blam::Settings::Config for details.
◆ ApplyPlaceholdersToAllConfigFiles()
void Blam::Config::ApplyPlaceholdersToAllConfigFiles |
( |
| ) |
|
Applies placeholder values to all configuration files.
◆ CheckDefaultConfig()
int Blam::Config::CheckDefaultConfig |
( |
| ) |
|
Checks if the default engine configuration file exists.
If the file doesn't exist, the default file is created.
- Returns
- 0 if the file already exists, 1 if the file did not exist but was created, or -1 if the file does not exist and a new one could not be created.
- Todo:
- Set up with new error code system (TBA).
◆ ExpandConfigOptionPlaceholders()
void Blam::Config::ExpandConfigOptionPlaceholders |
( |
| ) |
|
Expands all placeholders, and converts them to their evaluated values.
◆ GetConfig() [1/2]
Retrieves the default engine configuration file.
◆ GetConfig() [2/2]
Retrieves the specified configuration file.
- Parameters
-
filename | - The configuration file path. Should be the same as what was passed into LoadConfig() |
◆ GetConfigData()
Retrieves the specified configuration file.
◆ InsertConfigFile()
void Blam::Config::InsertConfigFile |
( |
ConfigFile |
config | ) |
|
Inserts a loaded ConfigFile into the map of loaded configuration files.
◆ IsDefaultConfigReady()
bool Blam::Config::IsDefaultConfigReady |
( |
| ) |
|
◆ LoadConfig() [1/5]
int Blam::Config::LoadConfig |
( |
| ) |
|
Loads the default engine configuration file (engine.cfg)
- Returns
- 0 if file was loaded without error, otherwise returns -1
- Todo:
- Migrate into new error code system (TBA).
◆ 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.