Elaztek Developer Hub
Blamite Game Engine - Strings  00402.09.29.23.0627.blamite
A library containing general purpose utilities and classes for use in multiple projects.
BlamStrings::Resources::Strings Namespace Reference

Namespace containing functions for Blamite string resources. More...

Functions

STRINGS_API bool LoadCommonStrings (std::string base_dir)
 Loads the string tables editor_strings, error_strings, shared_strings, and config_strings. More...
 
STRINGS_API bool LoadStrings (std::string file_path)
 Loads all strings in the given file into the universal string list. More...
 
STRINGS_API bool LoadErrorStrings (std::string file_path)
 Loads all strings in the given file as error description strings. More...
 
STRINGS_API std::string LookupString (std::string id)
 Finds a string with a given ID. More...
 
STRINGS_API std::string LookupErrorString (int error_code)
 Finds a string message associated with a given error code. More...
 
STRINGS_API std::map< std::string, BlamEngineString > * GetUniversalStrings ()
 Retrieves the list of all loaded strings. More...
 
STRINGS_API std::map< int, BlamEngineString * > * GetErrorStrings ()
 Retrieves the list of all loaded error code strings. More...
 
STRINGS_API bool StringExists (std::string id)
 Looks through the list of loaded engine strings to see if a given string has been loaded. More...
 
STRINGS_API bool ErrorStringExists (int error_code)
 Looks through the list of loaded error strings to see if a given error string has been loaded. More...
 

Detailed Description

Namespace containing functions for Blamite string resources.

Function Documentation

◆ ErrorStringExists()

bool BlamStrings::Resources::Strings::ErrorStringExists ( int  error_code)

Looks through the list of loaded error strings to see if a given error string has been loaded.

Parameters
id- The error code to look for.
Returns
true if the string exists, otherwise returns false.

◆ GetErrorStrings()

std::map< int, BlamEngineString * > * BlamStrings::Resources::Strings::GetErrorStrings ( )

Retrieves the list of all loaded error code strings.

Returns
Pointer to the list of all loaded error strings.

◆ GetUniversalStrings()

std::map< std::string, BlamEngineString > * BlamStrings::Resources::Strings::GetUniversalStrings ( )

Retrieves the list of all loaded strings.

Returns
Pointer to the list of all loaded strings.

◆ LoadCommonStrings()

bool BlamStrings::Resources::Strings::LoadCommonStrings ( std::string  base_dir)

Loads the string tables editor_strings, error_strings, shared_strings, and config_strings.

Parameters
base_dir- The base directory containing the 3 string tables. Should generally be ./data/.
Returns
true if all string tables were loaded without error, otherwise returns false.
+ Here is the call graph for this function:

◆ LoadErrorStrings()

bool BlamStrings::Resources::Strings::LoadErrorStrings ( std::string  file_path)

Loads all strings in the given file as error description strings.

Parameters
file_path- The file to parse strings from.
Returns
true if all strings were loaded successfully, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadStrings()

bool BlamStrings::Resources::Strings::LoadStrings ( std::string  file_path)

Loads all strings in the given file into the universal string list.

Parameters
file_path- The file to parse strings from.
Returns
true if all strings were loaded successfully, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LookupErrorString()

std::string BlamStrings::Resources::Strings::LookupErrorString ( int  error_code)

Finds a string message associated with a given error code.

If no matching string is found, then a fallback string is used instead.

Parameters
error_code- The error code to look up.
Returns
A string associated with this error code.
+ Here is the call graph for this function:

◆ LookupString()

std::string BlamStrings::Resources::Strings::LookupString ( std::string  id)

Finds a string with a given ID.

Parameters
id- The ID of the desired string.
Returns
A string that has a given ID. If no matching string is found, a fallback string is used instead.
+ Here is the caller graph for this function:

◆ StringExists()

bool BlamStrings::Resources::Strings::StringExists ( std::string  id)

Looks through the list of loaded engine strings to see if a given string has been loaded.

Parameters
id- The string ID to look for.
Returns
true if the string exists, otherwise returns false.
+ Here is the caller graph for this function: