Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
Blam::Settings::Paths Namespace Reference

Namespace containing functions for fetching full paths from configuration files. More...

Functions

BLAM std::string GetDefaultEngineDataPath (BlamEngineDataFolder folder)
 Retrieves a default value of a given engine data directory. More...
 
BLAM std::string GetDefaultUserDataPath (BlamUserDataFolder folder)
 Retrieves a default value of a given user data directory. More...
 
BLAM std::string GetEngineDataPath (BlamEngineDataFolder folder)
 Retrieves the configured value of a given engine directory. More...
 
BLAM std::string GetUserDataPath (BlamUserDataFolder folder)
 Retrieves the configured value of a given user directory. More...
 
BLAM BlamUserDataFolder GetUserDataFolderFromString (std::string folder)
 Attempts to convert a string to the equivalent user data folder. More...
 
BLAM BlamEngineDataFolder GetEngineDataFolderFromString (std::string folder)
 Attempts to convert a string to the equivalent engine data folder. More...
 
BLAM std::string ParseFolderPlaceholders (std::string string)
 Parses any engine/user data folder placeholders within a string. More...
 

Detailed Description

Namespace containing functions for fetching full paths from configuration files.

Function Documentation

◆ GetDefaultEngineDataPath()

std::string Blam::Settings::Paths::GetDefaultEngineDataPath ( BlamEngineDataFolder  folder)

Retrieves a default value of a given engine data directory.

Should generally not be used as most paths are configurable, and those paths should be used instead.

Parameters
folder- The engine data folder to retrieve the path for.
Returns
The default path for the specified engine folder.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDefaultUserDataPath()

std::string Blam::Settings::Paths::GetDefaultUserDataPath ( BlamUserDataFolder  folder)

Retrieves a default value of a given user data directory.

Should generally not be used as most paths are configurable, and those paths should be used instead.

Parameters
folder- The user data folder to retrieve the path for.
Returns
The default path for the specified user folder.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEngineDataFolderFromString()

BlamEngineDataFolder Blam::Settings::Paths::GetEngineDataFolderFromString ( std::string  folder)

Attempts to convert a string to the equivalent engine data folder.

Parameters
folder- The name of the folder to convert to a BlamEngineDataFolder.
Returns
The appropriate BlamEngineDataFolder value. If no match was found, this will return the default DataRoot folder.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEngineDataPath()

std::string Blam::Settings::Paths::GetEngineDataPath ( BlamEngineDataFolder  folder)

Retrieves the configured value of a given engine directory.

Parameters
folder- The engine data folder to retrieve the path for.
Returns
The path to the specified engine folder.
+ Here is the call graph for this function:

◆ GetUserDataFolderFromString()

BlamUserDataFolder Blam::Settings::Paths::GetUserDataFolderFromString ( std::string  folder)

Attempts to convert a string to the equivalent user data folder.

Parameters
folder- The name of the folder to convert to a BlamUserDataFolder.
Returns
The appropriate BlamUserDataFolder value. If no match was found, this will return the default DataRoot folder.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetUserDataPath()

std::string Blam::Settings::Paths::GetUserDataPath ( BlamUserDataFolder  folder)

Retrieves the configured value of a given user directory.

Parameters
folder- The user data folder to retrieve the path for.
Returns
The path to the specified user folder.
+ Here is the call graph for this function:

◆ ParseFolderPlaceholders()

std::string Blam::Settings::Paths::ParseFolderPlaceholders ( std::string  string)

Parses any engine/user data folder placeholders within a string.

In some cases, we may want to reference an engine data folder within a string - ex, in a console command, script function, or elsewhere.

This function can be used to parse those out, similar to the old placeholders system.

Placeholders should be the string representations of a path (see GetEngineDataFolderFromString and GetUserDataFolderFromString) prefixed by UserPath: or EnginePath:, and surrounded by curly braces.

For example - if you wanted to parse out the 'Maps' engine data folder, the string should contain:

{EnginePath:Maps}

If you wanted to parse out the user screenshots folder, the string should contain:

{UserPath:Screenshots}

The input is case-sensetive.

Parameters
string- The string to parse placeholders for.
Returns
The string, with any detected placeholders parsed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function: