igor::iResourceManager Class Reference

#include <iResourceManager.h>

Inherits igor::iModule< iResourceManager >.

Public Member Functions

void addSearchPath (const iaString &folder)
 
void removeSearchPath (const iaString &folder)
 
const std::vector< iaString > & getSearchPaths () const
 
void clearSearchPaths ()
 
const iaString resolvePath (const iaString &filepath)
 
const iaString getFilename (const iResourceID &id)
 
const iaString getAlias (const iResourceID &id)
 
void setAlias (const iResourceID &id, const iaString &alias)
 
iaString getRelativePath (const iaString &filename)
 
bool fileExists (const iaString &filename)
 
iResourcePtr requestResource (const iParameters &parameters)
 
iResourcePtr loadResource (const iParameters &parameters)
 
iResourcePtr createResource (const iParameters &parameters)
 
template<typename T >
std::shared_ptr< T > requestResource (const iParameters &parameters)
 
template<typename T >
std::shared_ptr< T > loadResource (const iParameters &parameters)
 
template<typename T >
std::shared_ptr< T > createResource ()
 
template<typename T >
std::shared_ptr< T > requestResource (const iaString &alias, iResourceCacheMode cacheMode=iResourceCacheMode::Cache)
 
template<typename T >
std::shared_ptr< T > loadResource (const iaString &alias, iResourceCacheMode cacheMode=iResourceCacheMode::Cache)
 
template<typename T >
std::shared_ptr< T > requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode=iResourceCacheMode::Cache)
 
template<typename T >
std::shared_ptr< T > loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode=iResourceCacheMode::Cache)
 
iResourcePtr getResource (const iResourceID &id)
 
template<typename T >
std::shared_ptr< T > getResource (const iResourceID &id)
 
template<typename T >
std::shared_ptr< T > getResource (const iaString &alias)
 
void getMaterials (std::vector< iShaderMaterialPtr > &materials)
 
void flush (iResourceCacheMode cacheModeLevel=iResourceCacheMode::Free)
 
void interruptFlush ()
 
void registerFactory (iFactoryPtr factory)
 
void unregisterFactory (iFactoryPtr factory)
 
void setLoadMode (iResourceManagerLoadMode loadMode)
 
iResourceManagerLoadMode getLoadMode () const
 
void loadResourceDictionary (const iaString &filename)
 
void saveResourceDictionary (const iaString &filename)
 
void clearResourceDictionary ()
 
const iResourceID getResourceID (const iaString &aliasOrFilename) const
 
void addResource (const iaString &filename, const iaString &alias="")
 
void removeResource (const iResourceID &resourceID)
 
const iaString getType (const iaString &filename) const
 
const iaString getType (const iResourceID &resourceID) const
 
bool saveResource (iResourcePtr resource, const iaString &filename="")
 
bool saveResource (iResourceID resourceID, const iaString &filename="")
 
template<>
iTexturePtr requestResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iTexturePtr loadResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iTexturePtr requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iTexturePtr loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iTexturePtr requestResource (const iParameters &param)
 
template<>
iTexturePtr loadResource (const iParameters &param)
 
template<>
iTexturePtr createResource ()
 
template<>
iTexturePtr getResource (const iResourceID &id)
 
template<>
iTexturePtr getResource (const iaString &alias)
 
template<>
iSoundPtr requestResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iSoundPtr loadResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iSoundPtr requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iSoundPtr loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iSoundPtr requestResource (const iParameters &param)
 
template<>
iSoundPtr loadResource (const iParameters &param)
 
template<>
iSoundPtr createResource ()
 
template<>
iSoundPtr getResource (const iResourceID &id)
 
template<>
iSoundPtr getResource (const iaString &alias)
 
template<>
iSpritePtr requestResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iSpritePtr loadResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iSpritePtr requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iSpritePtr loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iSpritePtr requestResource (const iParameters &param)
 
template<>
iSpritePtr loadResource (const iParameters &param)
 
template<>
iSpritePtr createResource ()
 
template<>
iSpritePtr getResource (const iResourceID &id)
 
template<>
iSpritePtr getResource (const iaString &alias)
 
template<>
iAnimationPtr requestResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iAnimationPtr loadResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iAnimationPtr requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iAnimationPtr loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iAnimationPtr requestResource (const iParameters &param)
 
template<>
iAnimationPtr loadResource (const iParameters &param)
 
template<>
iAnimationPtr createResource ()
 
template<>
iAnimationPtr getResource (const iResourceID &id)
 
template<>
iAnimationPtr getResource (const iaString &alias)
 
template<>
iModelPtr requestResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iModelPtr loadResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iModelPtr requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iModelPtr loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iModelPtr requestResource (const iParameters &param)
 
template<>
iModelPtr loadResource (const iParameters &param)
 
template<>
iModelPtr createResource ()
 
template<>
iModelPtr getResource (const iResourceID &id)
 
template<>
iModelPtr getResource (const iaString &alias)
 
template<>
iShaderMaterialPtr requestResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iShaderMaterialPtr loadResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iShaderMaterialPtr requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iShaderMaterialPtr loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iShaderMaterialPtr requestResource (const iParameters &param)
 
template<>
iShaderMaterialPtr loadResource (const iParameters &param)
 
template<>
iShaderMaterialPtr createResource ()
 
template<>
iShaderMaterialPtr getResource (const iResourceID &id)
 
template<>
iShaderMaterialPtr getResource (const iaString &alias)
 
template<>
iMaterialPtr requestResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iMaterialPtr loadResource (const iaString &alias, iResourceCacheMode cacheMode)
 
template<>
iMaterialPtr requestResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iMaterialPtr loadResource (const iResourceID &resourceID, iResourceCacheMode cacheMode)
 
template<>
iMaterialPtr requestResource (const iParameters &param)
 
template<>
iMaterialPtr loadResource (const iParameters &param)
 
template<>
iMaterialPtr createResource ()
 
template<>
iMaterialPtr getResource (const iResourceID &id)
 
template<>
iMaterialPtr getResource (const iaString &alias)
 

Friends

class iModule< iResourceManager >
 

Additional Inherited Members

- Static Public Member Functions inherited from igor::iModule< iResourceManager >
static IGOR_INLINE iResourceManagergetInstance ()
 
static IGOR_INLINE bool isInstantiated ()
 
static void create ()
 
static void destroy ()
 
- Protected Member Functions inherited from igor::iModule< iResourceManager >
 iModule ()=default
 
virtual ~iModule ()=default
 

Detailed Description

manages resources and their factories

Member Function Documentation

◆ addResource()

void igor::iResourceManager::addResource ( const iaString filename,
const iaString alias = "" 
)

adds new resource to dictionary

Parameters
filenamepath to resource (must be relative to search paths)
aliasoptional alias

◆ addSearchPath()

void igor::iResourceManager::addSearchPath ( const iaString folder)

adds search path to list

Parameters
foldersearch path to add

◆ clearResourceDictionary()

void igor::iResourceManager::clearResourceDictionary ( )

clear resource dictionary

(means it will only contain igor internal resources)

◆ clearSearchPaths()

void igor::iResourceManager::clearSearchPaths ( )

clears search path list

◆ createResource() [1/9]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::createResource ( )

creates a new resource of given type

template version for more convenience

Returns
shared pointer to resource

◆ createResource() [2/9]

template<>
iTexturePtr igor::iResourceManager::createResource ( )
inline

◆ createResource() [3/9]

template<>
iSoundPtr igor::iResourceManager::createResource ( )
inline

◆ createResource() [4/9]

template<>
iSpritePtr igor::iResourceManager::createResource ( )
inline

◆ createResource() [5/9]

template<>
iAnimationPtr igor::iResourceManager::createResource ( )
inline

◆ createResource() [6/9]

template<>
iModelPtr igor::iResourceManager::createResource ( )
inline

◆ createResource() [7/9]

template<>
iShaderMaterialPtr igor::iResourceManager::createResource ( )
inline

◆ createResource() [8/9]

template<>
iMaterialPtr igor::iResourceManager::createResource ( )
inline

◆ createResource() [9/9]

iResourcePtr igor::iResourceManager::createResource ( const iParameters parameters)

creates a new resource

Parameters
paramparameters for creating resource
Returns
shared pointer to resource

◆ fileExists()

bool igor::iResourceManager::fileExists ( const iaString filename)
Returns
true if filename is a file in our search paths or an absolute path to an existing file
Parameters
filenamethe file we are looking for

◆ flush()

void igor::iResourceManager::flush ( iResourceCacheMode  cacheModeLevel = iResourceCacheMode::Free)

works like a garbage collector.

Iterates through all resources and checks how many references every resource has. If reference count goes down to 1 then the resource will be released. If reference count is greater 1 and the resource was not loaded yet then the resource will be loaded.

Parameters
cacheModeLevellevel of cache mode to be released

◆ getAlias()

const iaString igor::iResourceManager::getAlias ( const iResourceID id)
Returns
alias for given resource id (if available)
Parameters
idthe given resource id

◆ getFilename()

const iaString igor::iResourceManager::getFilename ( const iResourceID id)
Returns
filename for given resource id
Parameters
idthe given resource id

◆ getLoadMode()

iResourceManagerLoadMode igor::iResourceManager::getLoadMode ( ) const
Returns
the load mode

◆ getMaterials()

void igor::iResourceManager::getMaterials ( std::vector< iShaderMaterialPtr > &  materials)

returns all materials

Parameters
[out]materialsthe materials

TODO how about a more general interface?

◆ getRelativePath()

iaString igor::iResourceManager::getRelativePath ( const iaString filename)
Returns
relative path to search path. returns full path if no matching search path found
Parameters
filenamefull path to file

◆ getResource() [1/17]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::getResource ( const iaString alias)
Returns
resource by name

typed version

Parameters
namethe name of the resource

◆ getResource() [2/17]

template<>
iTexturePtr igor::iResourceManager::getResource ( const iaString &  alias)
inline

◆ getResource() [3/17]

template<>
iSoundPtr igor::iResourceManager::getResource ( const iaString &  alias)
inline

◆ getResource() [4/17]

template<>
iSpritePtr igor::iResourceManager::getResource ( const iaString &  alias)
inline

◆ getResource() [5/17]

template<>
iAnimationPtr igor::iResourceManager::getResource ( const iaString &  alias)
inline

◆ getResource() [6/17]

template<>
iModelPtr igor::iResourceManager::getResource ( const iaString &  alias)
inline

◆ getResource() [7/17]

template<>
iShaderMaterialPtr igor::iResourceManager::getResource ( const iaString &  alias)
inline

◆ getResource() [8/17]

template<>
iMaterialPtr igor::iResourceManager::getResource ( const iaString &  alias)
inline

◆ getResource() [9/17]

iResourcePtr igor::iResourceManager::getResource ( const iResourceID id)
Returns
resource by id
Parameters
idthe id of the resource

◆ getResource() [10/17]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::getResource ( const iResourceID id)
Returns
resource by id

typed version

Parameters
idthe id of the resource

◆ getResource() [11/17]

template<>
iTexturePtr igor::iResourceManager::getResource ( const iResourceID id)
inline

◆ getResource() [12/17]

template<>
iSoundPtr igor::iResourceManager::getResource ( const iResourceID id)
inline

◆ getResource() [13/17]

template<>
iSpritePtr igor::iResourceManager::getResource ( const iResourceID id)
inline

◆ getResource() [14/17]

template<>
iAnimationPtr igor::iResourceManager::getResource ( const iResourceID id)
inline

◆ getResource() [15/17]

template<>
iModelPtr igor::iResourceManager::getResource ( const iResourceID id)
inline

◆ getResource() [16/17]

template<>
iShaderMaterialPtr igor::iResourceManager::getResource ( const iResourceID id)
inline

◆ getResource() [17/17]

template<>
iMaterialPtr igor::iResourceManager::getResource ( const iResourceID id)
inline

◆ getResourceID()

const iResourceID igor::iResourceManager::getResourceID ( const iaString aliasOrFilename) const
Returns
resource id for given alias or filepath

If it does not exist yet but it represents a valid file path within one of the search path. We add a new resource.

Parameters
aliasOrFilenamethe given alias or filename

◆ getSearchPaths()

const std::vector< iaString > & igor::iResourceManager::getSearchPaths ( ) const
Returns
list of search paths

◆ getType() [1/2]

const iaString igor::iResourceManager::getType ( const iaString filename) const
Returns
resource type for given filename

this is purely based on file extension

Parameters
filenamethe file name to guess the type of

◆ getType() [2/2]

const iaString igor::iResourceManager::getType ( const iResourceID resourceID) const
Returns
resource type for given resource id

this is purely based on file extension

Parameters
resourceIDthe given resource id

◆ interruptFlush()

void igor::iResourceManager::interruptFlush ( )

if a flush in a different thread is currently running. this will prevent loading new data from disk and in consequence make it stop earlier

◆ loadResource() [1/25]

template<>
iTexturePtr igor::iResourceManager::loadResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [2/25]

template<>
iSoundPtr igor::iResourceManager::loadResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [3/25]

template<>
iSpritePtr igor::iResourceManager::loadResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [4/25]

template<>
iAnimationPtr igor::iResourceManager::loadResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [5/25]

template<>
iModelPtr igor::iResourceManager::loadResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [6/25]

template<>
iShaderMaterialPtr igor::iResourceManager::loadResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [7/25]

template<>
iMaterialPtr igor::iResourceManager::loadResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [8/25]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::loadResource ( const iaString alias,
iResourceCacheMode  cacheMode = iResourceCacheMode::Cache 
)

loads a resource synchronously

template version for more convenience

Parameters
aliasthe name of the resource (this can also be a filename)
Returns
shared pointer to resource

◆ loadResource() [9/25]

template<>
iTexturePtr igor::iResourceManager::loadResource ( const iParameters param)
inline

◆ loadResource() [10/25]

template<>
iSoundPtr igor::iResourceManager::loadResource ( const iParameters param)
inline

◆ loadResource() [11/25]

template<>
iSpritePtr igor::iResourceManager::loadResource ( const iParameters param)
inline

◆ loadResource() [12/25]

template<>
iAnimationPtr igor::iResourceManager::loadResource ( const iParameters param)
inline

◆ loadResource() [13/25]

template<>
iModelPtr igor::iResourceManager::loadResource ( const iParameters param)
inline

◆ loadResource() [14/25]

template<>
iShaderMaterialPtr igor::iResourceManager::loadResource ( const iParameters param)
inline

◆ loadResource() [15/25]

template<>
iMaterialPtr igor::iResourceManager::loadResource ( const iParameters param)
inline

◆ loadResource() [16/25]

iResourcePtr igor::iResourceManager::loadResource ( const iParameters parameters)

loads a resource synchronously.

Parameters
paramparameters for loading resource
Returns
shared pointer to resource

◆ loadResource() [17/25]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::loadResource ( const iParameters parameters)

loads a resource synchronously.

template version for more convenience

Parameters
paramparameters for loading resource
Returns
shared pointer to resource

◆ loadResource() [18/25]

template<>
iTexturePtr igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [19/25]

template<>
iSoundPtr igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [20/25]

template<>
iSpritePtr igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [21/25]

template<>
iAnimationPtr igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [22/25]

template<>
iModelPtr igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [23/25]

template<>
iShaderMaterialPtr igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [24/25]

template<>
iMaterialPtr igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ loadResource() [25/25]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::loadResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode = iResourceCacheMode::Cache 
)

loads a resource synchronously by id

template version for more convenience

Parameters
resourceIDthe id of the resource
Returns
shared pointer to resource

◆ loadResourceDictionary()

void igor::iResourceManager::loadResourceDictionary ( const iaString filename)

loads resource dictionary

this will append resources to existing dictionary

Parameters
filenamefilename to resource dictionary

◆ registerFactory()

void igor::iResourceManager::registerFactory ( iFactoryPtr  factory)

registers factory to resource manager

Parameters
factorythe given factory

◆ removeResource()

void igor::iResourceManager::removeResource ( const iResourceID resourceID)

removes given resource from dictionary

Parameters
resourceIDthe given resource id

◆ removeSearchPath()

void igor::iResourceManager::removeSearchPath ( const iaString folder)

removes search path from list

Parameters
foldersearch path to remove

◆ requestResource() [1/25]

template<>
iTexturePtr igor::iResourceManager::requestResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [2/25]

template<>
iSoundPtr igor::iResourceManager::requestResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [3/25]

template<>
iSpritePtr igor::iResourceManager::requestResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [4/25]

template<>
iAnimationPtr igor::iResourceManager::requestResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [5/25]

template<>
iModelPtr igor::iResourceManager::requestResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [6/25]

template<>
iShaderMaterialPtr igor::iResourceManager::requestResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [7/25]

template<>
iMaterialPtr igor::iResourceManager::requestResource ( const iaString &  alias,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [8/25]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::requestResource ( const iaString alias,
iResourceCacheMode  cacheMode = iResourceCacheMode::Cache 
)

requests a resource to be loaded asynchronously

template version for more convenience

Parameters
aliasthe name of the resource (this can also be a filename)
Returns
shared pointer to resource

◆ requestResource() [9/25]

template<>
iTexturePtr igor::iResourceManager::requestResource ( const iParameters param)
inline

◆ requestResource() [10/25]

template<>
iSoundPtr igor::iResourceManager::requestResource ( const iParameters param)
inline

◆ requestResource() [11/25]

template<>
iSpritePtr igor::iResourceManager::requestResource ( const iParameters param)
inline

◆ requestResource() [12/25]

template<>
iAnimationPtr igor::iResourceManager::requestResource ( const iParameters param)
inline

◆ requestResource() [13/25]

template<>
iModelPtr igor::iResourceManager::requestResource ( const iParameters param)
inline

◆ requestResource() [14/25]

template<>
iShaderMaterialPtr igor::iResourceManager::requestResource ( const iParameters param)
inline

◆ requestResource() [15/25]

template<>
iMaterialPtr igor::iResourceManager::requestResource ( const iParameters param)
inline

◆ requestResource() [16/25]

iResourcePtr igor::iResourceManager::requestResource ( const iParameters parameters)

requests a resource to be loaded asynchronously.

Parameters
paramparameters for loading resource
Returns
shared pointer to resource

◆ requestResource() [17/25]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::requestResource ( const iParameters parameters)

requests a resource to be loaded asynchronously.

template version for more convenience

Parameters
paramparameters for loading resource
Returns
shared pointer to resource

◆ requestResource() [18/25]

template<>
iTexturePtr igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [19/25]

template<>
iSoundPtr igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [20/25]

template<>
iSpritePtr igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [21/25]

template<>
iAnimationPtr igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [22/25]

template<>
iModelPtr igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [23/25]

template<>
iShaderMaterialPtr igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [24/25]

template<>
iMaterialPtr igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode 
)
inline

◆ requestResource() [25/25]

template<typename T >
std::shared_ptr< T > igor::iResourceManager::requestResource ( const iResourceID resourceID,
iResourceCacheMode  cacheMode = iResourceCacheMode::Cache 
)

requests a resource to be loaded asynchronously by id

template version for more convenience

Parameters
resourceIDthe id of the resource
Returns
shared pointer to resource

◆ resolvePath()

const iaString igor::iResourceManager::resolvePath ( const iaString filepath)
Returns
full path to a file

If the file does not exist it returns an empty string

It only resolves for files that are within one of the given search paths

Parameters
filepathrelative or absolute path to file

◆ saveResource() [1/2]

bool igor::iResourceManager::saveResource ( iResourceID  resourceID,
const iaString filename = "" 
)

saves a resource to the filesystem

Parameters
resourceIDthe given resource ID to save (must be valid and have a valid source/filename)
filenameoptional filename if resource is to be saved in a new location
Returns
true if successfully saved

◆ saveResource() [2/2]

bool igor::iResourceManager::saveResource ( iResourcePtr  resource,
const iaString filename = "" 
)

saves a resource to the filesystem

Parameters
resourcethe given resource to save (must be valid and have a valid source/filename)
filenameoptional filename if resource is to be saved in a new location
Returns
true if successfully saved

◆ saveResourceDictionary()

void igor::iResourceManager::saveResourceDictionary ( const iaString filename)

write resource dictionary to given filename

Parameters
filenamethe file to write the dictionary to

◆ setAlias()

void igor::iResourceManager::setAlias ( const iResourceID id,
const iaString alias 
)

sets alias for given resource id

Parameters
idthe given resource id
aliasthe given alias

◆ setLoadMode()

void igor::iResourceManager::setLoadMode ( iResourceManagerLoadMode  loadMode)

sets the load mode

Does not effect load requests that are already in queue

Parameters
loadModethe load mode to set

◆ unregisterFactory()

void igor::iResourceManager::unregisterFactory ( iFactoryPtr  factory)

unregisters factory from resource manager

Parameters
factorythe given factory

Friends And Related Function Documentation

◆ iModule< iResourceManager >

friend class iModule< iResourceManager >
friend

The documentation for this class was generated from the following files: