Core::Resource
Object holding information about a resource.
#include "Core/Resources/Resource.h"
Public Functions
| Name | |
|---|---|
| Resource(std::string alias, std::string path, ResourceType type) | |
| bool | changeLocation(fs::path newDir, bool deleteOriginals)<br>Change the location of associated ResourceFiles instance. |
Public Attributes
| Name | |
|---|---|
| std::string | alias <br>Resource alias. |
| std::vector< std::string > | alternativeAliases <br>Any additional aliases that got registered after the first one which is not included in this list. |
| std::string | path <br>Arbitrary resource file path, doesn't necessary need to be valid. |
| Ptr< ResourceFiles > | resourceFiles <br>The resource CAN have an assigned ResourceFiles instance tracking any associated files. |
| ResourceType | resourceType |
Friends
| Name | |
|---|---|
| class | ResourceManager |
Public Functions Documentation
function Resource
cpp
Resource(
std::string alias,
std::string path,
ResourceType type
)Resource(
std::string alias,
std::string path,
ResourceType type
)function changeLocation
cpp
bool changeLocation(
fs::path newDir,
bool deleteOriginals
)bool changeLocation(
fs::path newDir,
bool deleteOriginals
)Change the location of associated ResourceFiles instance.
Parameters:
- newDir New file structure root.
- deleteOriginals Delete the original files.
Return: True on success, false otherwise
This method is a delegate to the ResourceFiles::changeLocation() method that updates this Resource's m_path upon success. Should only be called when this resource actually does have a ResourceFiles instance assigned.
Public Attributes Documentation
variable alias
cpp
std::string alias;std::string alias;Resource alias.
variable alternativeAliases
cpp
std::vector< std::string > alternativeAliases;std::vector< std::string > alternativeAliases;Any additional aliases that got registered after the first one which is not included in this list.
variable path
cpp
std::string path;std::string path;Arbitrary resource file path, doesn't necessary need to be valid.
variable resourceFiles
cpp
Ptr< ResourceFiles > resourceFiles;Ptr< ResourceFiles > resourceFiles;The resource CAN have an assigned ResourceFiles instance tracking any associated files.
variable resourceType
cpp
ResourceType resourceType = ResourceType::Model;ResourceType resourceType = ResourceType::Model;Friends
friend ResourceManager
cpp
friend class ResourceManager(
ResourceManager
);friend class ResourceManager(
ResourceManager
);Updated on 2025-09-07 at 16:13:51 +0000