![]() |
Blamite Game Engine - Strings
00386.06.16.23.0646.blamite
A library containing general purpose utilities and classes for use in multiple projects.
|
Functions used in loading and accessing resources. More...
Namespaces | |
Strings | |
Namespace containing functions for Blamite string resources. | |
VersionInfo | |
Namespace containing functions related to product versions. | |
Functions | |
STRINGS_API BlamResourceGroup | ParseResourceGroupXML (std::string base_dir, std::string resource_file, rapidxml::xml_node<> *root_node, BlamResult *result) |
Parses a resource group from the resource group's XML file. More... | |
STRINGS_API BlamResult | LoadResources (std::string resource_file) |
Loads a new resource group. More... | |
STRINGS_API std::string | GetResourcePath (std::string group_id, std::string id) |
Retrieves the file path for a given resource. More... | |
STRINGS_API bool | ResourceExists (std::string group_id, std::string id) |
Determines if a resource exists within a given group. More... | |
STRINGS_API BlamResourceGroup * | GetResourceGroup (std::string group_id) |
Retrieves a resource group. More... | |
STRINGS_API std::map< std::string, BlamResourceGroup > | GetResourceGroups () |
Retrieves the map of all resource groups. More... | |
Functions used in loading and accessing resources.
These resources can refer to any kind of file, though the most common use case is images or icons. This system was originally restricted to the Keystone library for use with theming, but is now accessible to the entire engine in order to aid in the use of cross-platform resources.
BlamResourceGroup * BlamStrings::Resources::GetResourceGroup | ( | std::string | group_id | ) |
Retrieves a resource group.
group_id | - The ID of the desired resource group. |
nullptr
. std::map< std::string, BlamResourceGroup > BlamStrings::Resources::GetResourceGroups | ( | ) |
Retrieves the map of all resource groups.
The key of the map represents the group name, while the value stores the resource group data.
std::string BlamStrings::Resources::GetResourcePath | ( | std::string | group_id, |
std::string | id | ||
) |
Retrieves the file path for a given resource.
group_id | - The ID of the group the resource belongs to. |
id | - The ID of the resource. |
BlamResult BlamStrings::Resources::LoadResources | ( | std::string | resource_file | ) |
Loads a new resource group.
resource_file | - The path to the resource file to load. |
BlamResourceGroup BlamStrings::Resources::ParseResourceGroupXML | ( | std::string | base_dir, |
std::string | resource_file, | ||
rapidxml::xml_node<> * | root_node, | ||
BlamResult * | result | ||
) |
Parses a resource group from the resource group's XML file.
base_dir | - The base directory of the resource group. This is prefixed onto all resource file paths. |
resource_file | - The path to the resource file. Used in debug log messages. |
root_node | - The root XML node of this resource group. |
result | - This is set to the parse result of the group. |
result
parameter should be verified before use. bool BlamStrings::Resources::ResourceExists | ( | std::string | group_id, |
std::string | id | ||
) |
Determines if a resource exists within a given group.
group_id | - The ID of the group the resource belongs to. |
id | - The ID of the resource. |
true
if the resource exists, otherwise returns false
.