Elaztek Developer Hub
Blamite Game Engine - Keystone  00326.06.27.21.0407.blamite
A library that enables the use of Qt in Blamite's editing tools.
resources.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <map>
5 #include <Strings/components/diagnostics/errors/errors.h>
6 #include <Strings/components/3rdparty/rapidxml/rapidxml.hpp>
7 
8 #ifndef KEYSTONE
9 #define KEYSTONE
10 #endif
11 
22 {
23  std::string id;
24  std::string file_path;
25 };
26 
35 {
36  std::string group_name;
37  std::map<std::string, BlamKeystoneResource> resources;
38 };
39 
46 {
57  KEYSTONE BlamKeystoneResourceGroup ParseResourceGroupXML(std::string base_dir, std::string resource_file, rapidxml::xml_node<>* root_node, BlamResult* result);
58 
66  KEYSTONE BlamResult LoadResources(std::string resource_file);
67 
76  KEYSTONE std::string GetResourcePath(std::string group_id, std::string id);
77 
86  KEYSTONE bool ResourceExists(std::string group_id, std::string id);
87 
96 }
BlamKeystone::Resources::GetResourceGroup
KEYSTONE BlamKeystoneResourceGroup * GetResourceGroup(std::string group_id)
Retrieves a resource group.
Definition: resources.cpp:150
BlamKeystone::Resources::GetResourcePath
KEYSTONE std::string GetResourcePath(std::string group_id, std::string id)
Retrieves the file path for a given resource.
Definition: resources.cpp:127
BlamKeystone::Resources
Functions used in loading and accessing Keystone resources.
Definition: resources.h:45
BlamKeystone::Resources::LoadResources
KEYSTONE BlamResult LoadResources(std::string resource_file)
Loads a new resource group.
Definition: resources.cpp:85
BlamKeystone::Resources::ParseResourceGroupXML
KEYSTONE BlamKeystoneResourceGroup 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
BlamKeystoneResourceGroup
Structure representing a Keystone resource group.
Definition: resources.h:34
BlamKeystoneResource
Structure representing a Keystone resource.
Definition: resources.h:21
KEYSTONE
#define KEYSTONE
Definition: resources.h:9
BlamKeystoneResourceGroup::resources
std::map< std::string, BlamKeystoneResource > resources
The list of resources contained within this group.
Definition: resources.h:37
BlamKeystoneResource::file_path
std::string file_path
The path to the file associated with this resource.
Definition: resources.h:24
BlamKeystone::Resources::ResourceExists
KEYSTONE bool ResourceExists(std::string group_id, std::string id)
Determines if a resource exists within a given group.
Definition: resources.cpp:137
BlamKeystoneResource::id
std::string id
The ID of the resource.
Definition: resources.h:23
BlamKeystoneResourceGroup::group_name
std::string group_name
The name/ID of this group.
Definition: resources.h:36