Core::ResourceFiles
A collection of file paths in the filesystem that are together required to load a single resource like a model. More...
#include "Core/Resources/ResourceFiles.h"
Inherited by Core::ModelResourceFiles
Public Functions
| Name | |
|---|---|
| ResourceFiles(fs::path path, std::string name) | |
| virtual | ~ResourceFiles() =default |
| void | addFile(fs::path filePath) |
| bool | changeLocation(fs::path newDir, bool deleteOriginals)<br>Change the location of the managed files. |
| bool | deleteFiles() |
| virtual bool | fetchFiles() =0<br>Derive and fetch all required files from the primary file path. |
| virtual bool | fetchFiles(void * data) =0<br>Derive and fetch all required files from the primary file path and supplied arbitrary data. |
| bool | operator!=(const ResourceFiles & rhs) const |
| bool | operator<(const ResourceFiles & rhs) const |
| bool | operator==(const ResourceFiles & rhs) const |
Public Attributes
| Name | |
|---|---|
| std::set< fs::path > | m_files |
| std::string | m_name <br>Arbitrary name, can be used as a name for the root subfolder. |
| fs::path | m_path <br>Path to the "primary" file, from which other paths are derived. |
| fs::path | m_rootDir <br>Root directory of the resource. Derived from m_path. |
Detailed Description
class Core::ResourceFiles;class Core::ResourceFiles;A collection of file paths in the filesystem that are together required to load a single resource like a model.
An instance of this class helps keep track of actual files that a resource was loaded from and allows them to be deleted when not used anymore.
Public Functions Documentation
function ResourceFiles
ResourceFiles(
fs::path path,
std::string name
)ResourceFiles(
fs::path path,
std::string name
)function ~ResourceFiles
virtual ~ResourceFiles() =defaultvirtual ~ResourceFiles() =defaultfunction addFile
void addFile(
fs::path filePath
)void addFile(
fs::path filePath
)function changeLocation
bool changeLocation(
fs::path newDir,
bool deleteOriginals
)bool changeLocation(
fs::path newDir,
bool deleteOriginals
)Change the location of the managed files.
Parameters:
- newDir New file structure root.
- deleteOriginals Delete the original files.
Return: True on success, false otherwise
function deleteFiles
bool deleteFiles()bool deleteFiles()function fetchFiles
virtual bool fetchFiles() =0virtual bool fetchFiles() =0Derive and fetch all required files from the primary file path.
Reimplemented by: Core::ModelResourceFiles::fetchFiles
function fetchFiles
virtual bool fetchFiles(
void * data
) =0virtual bool fetchFiles(
void * data
) =0Derive and fetch all required files from the primary file path and supplied arbitrary data.
Reimplemented by: Core::ModelResourceFiles::fetchFiles
function operator!=
inline bool operator!=(
const ResourceFiles & rhs
) constinline bool operator!=(
const ResourceFiles & rhs
) constfunction operator<
inline bool operator<(
const ResourceFiles & rhs
) constinline bool operator<(
const ResourceFiles & rhs
) constfunction operator==
inline bool operator==(
const ResourceFiles & rhs
) constinline bool operator==(
const ResourceFiles & rhs
) constPublic Attributes Documentation
variable m_files
std::set< fs::path > m_files;std::set< fs::path > m_files;variable m_name
std::string m_name;std::string m_name;Arbitrary name, can be used as a name for the root subfolder.
variable m_path
fs::path m_path;fs::path m_path;Path to the "primary" file, from which other paths are derived.
variable m_rootDir
fs::path m_rootDir;fs::path m_rootDir;Root directory of the resource. Derived from m_path.
Updated on 2025-09-07 at 16:13:51 +0000