Skip to content

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)
boolchangeLocation(fs::path newDir, bool deleteOriginals)<br>Change the location of associated ResourceFiles instance.

Public Attributes

Name
std::stringalias <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::stringpath <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.
ResourceTyperesourceType

Friends

Name
classResourceManager

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 2024-11-06 at 20:16:54 +0000