Elaztek Developer Hub
Blamite Game Engine - Strings  00379.04.17.23.2049.blamite
A library containing general purpose utilities and classes for use in multiple projects.
resources.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <map>
7 
8 #ifdef STRINGS_EXPORTS
9 #define STRINGS_API __declspec(dllexport)
10 #else
11 #define STRINGS_API __declspec(dllimport)
12 #endif
13 
24 {
25  std::string id;
26  std::string file_path;
27 };
28 
37 {
38  std::string group_name;
39  std::map<std::string, BlamResource> resources;
40 };
41 
50 {
61  STRINGS_API BlamResourceGroup ParseResourceGroupXML(std::string base_dir, std::string resource_file, rapidxml::xml_node<>* root_node, BlamResult* result);
62 
70  STRINGS_API BlamResult LoadResources(std::string resource_file);
71 
80  STRINGS_API std::string GetResourcePath(std::string group_id, std::string id);
81 
90  STRINGS_API bool ResourceExists(std::string group_id, std::string id);
91 
99  STRINGS_API BlamResourceGroup* GetResourceGroup(std::string group_id);
100 
108  STRINGS_API std::map<std::string, BlamResourceGroup> GetResourceGroups();
109 }
BlamStrings::Resources
Functions used in loading and accessing resources.
Definition: resources.h:49
BlamStrings::Resources::GetResourcePath
STRINGS_API std::string GetResourcePath(std::string group_id, std::string id)
Retrieves the file path for a given resource.
Definition: resources.cpp:127
BlamStrings::Resources::ParseResourceGroupXML
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.
Definition: resources.cpp:11
BlamResource
Structure representing a Keystone resource.
Definition: resources.h:23
BlamResourceGroup::resources
std::map< std::string, BlamResource > resources
The list of resources contained within this group.
Definition: resources.h:39
errors.h
BlamResult
BlamResult
Enumerator containing any and all result codes used throughout the engine.
Definition: errors.h:9
BlamStrings::Resources::LoadResources
STRINGS_API BlamResult LoadResources(std::string resource_file)
Loads a new resource group.
Definition: resources.cpp:85
BlamResourceGroup::group_name
std::string group_name
The name/ID of this group.
Definition: resources.h:38
BlamResource::file_path
std::string file_path
The path to the file associated with this resource.
Definition: resources.h:26
BlamResourceGroup
Structure representing a Keystone resource group.
Definition: resources.h:36
BlamStrings::Resources::GetResourceGroup
STRINGS_API BlamResourceGroup * GetResourceGroup(std::string group_id)
Retrieves a resource group.
Definition: resources.cpp:150
STRINGS_API
#define STRINGS_API
Definition: resources.h:11
rapidxml::xml_node
Class representing a node of XML document.
Definition: rapidxml.hpp:137
rapidxml.hpp
BlamResource::id
std::string id
The ID of the resource.
Definition: resources.h:25
BlamStrings::Resources::ResourceExists
STRINGS_API bool ResourceExists(std::string group_id, std::string id)
Determines if a resource exists within a given group.
Definition: resources.cpp:137
BlamStrings::Resources::GetResourceGroups
STRINGS_API std::map< std::string, BlamResourceGroup > GetResourceGroups()
Retrieves the map of all resource groups.
Definition: resources.cpp:160