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() =default
virtual ~ResourceFiles() =default
function 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() =0
virtual bool fetchFiles() =0
Derive and fetch all required files from the primary file path.
Reimplemented by: Core::ModelResourceFiles::fetchFiles
function fetchFiles
virtual bool fetchFiles(
void * data
) =0
virtual bool fetchFiles(
void * data
) =0
Derive 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
) const
inline bool operator!=(
const ResourceFiles & rhs
) const
function operator<
inline bool operator<(
const ResourceFiles & rhs
) const
inline bool operator<(
const ResourceFiles & rhs
) const
function operator==
inline bool operator==(
const ResourceFiles & rhs
) const
inline bool operator==(
const ResourceFiles & rhs
) const
Public 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 2024-11-06 at 20:16:54 +0000