#include <ResourceExplorer.hpp>
Searches for resource folders and explores them for valid resource files.
void Ocular::Core::ResourceExplorer::findRootDirectories |
( |
std::list< Directory > & |
rootDirectories | ) |
|
|
protected |
Finds all root directories to explore for resource files.
- Parameters
-
std::string Ocular::Core::ResourceExplorer::getRelativePath |
( |
File const & |
file | ) |
|
Retrieves the relative path, if it exists, of the file from the Resource directory.
std::string Ocular::Core::ResourceExplorer::getRelativePathFromResourceRoot |
( |
Directory |
root, |
|
|
File |
file |
|
) |
| |
|
protected |
Composes the relative path from the root directory to the file.
Example:
Dir: /path/to/Resources
File: /path/to/Resources/Textures/Grass.png
Rel: Textures/Grass
The returned path is formatted to be used as a resource map key.
- Parameters
-
[in] | root | The root resource directory that contains the file |
[in] | file | The resource file |
- Returns
- The relative path from the root to the file
bool Ocular::Core::ResourceExplorer::isBlacklisted |
( |
std::string const & |
extension | ) |
|
|
protected |
- Returns
- TRUE if the extension is blacklisted.
void Ocular::Core::ResourceExplorer::populateFileMap |
( |
std::unordered_map< std::string, File > & |
fileMap, |
|
|
ResourceLoaderManager * |
loader |
|
) |
| |
- Parameters
-
[out] | resourceMap | Map of all resource files. |
void Ocular::Core::ResourceExplorer::setBlacklist |
( |
std::list< std::string > const & |
blacklist | ) |
|
Sets the blacklist for the explorer.
- Parameters
-
[in] | blacklist | Container with all of the file extensions (including the '.') to add to the blacklist. |
- Note
- populateResourceMap will need to be called to update entries with new blacklist
void Ocular::Core::ResourceExplorer::setIsExtensionSensitive |
( |
bool |
sensitive | ) |
|
If extension-sensitive, then map keys will include the file extension.
Example:
/path/to/Resources/Textures/Grass.png
Sensitive Key: Textures/Grass.png
Insensitive Key: Textures/Grass
Default behaviour is insensitive keys.
- Parameters
-
- Note
- populateResourceMap will need to be called to update keys for new sensitivity.
void Ocular::Core::ResourceExplorer::setResourceDirectoryName |
( |
std::string const & |
name | ) |
|
- Parameters
-
[in] | name | Name of root directories that contain resource files. |
- Note
- populateResourceMap will need to be called to update entries with new directories
The documentation for this class was generated from the following files:
- C:/Projects/OcularEngine/OcularCore/include/Resources/ResourceExplorer.hpp
- C:/Projects/OcularEngine/OcularCore/src/Resources/ResourceExplorer.cpp