sftools
2.0 dev
Bunch of tools for SFML application development
|
Generic resource loader. More...
#include <Loaders.hpp>
Public Member Functions | |
virtual | ~ResourceLoader () |
Virtual destructor. | |
R * | operator() (std::string const &id) |
Load operator. | |
virtual bool | load (R &res, std::string src)=0 |
Load the content of a resource with the given file. | |
Generic resource loader.
It's primary use is to help the GenericManager. This generic loader must be specialized by implementing load().
R | Resource type |
Definition at line 61 of file Loaders.hpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 66 of file Loaders.hpp.
|
pure virtual |
Load the content of a resource with the given file.
res | Resource to be feed with a new content |
src | File containing the new content to be loaded |
Implemented in sftools::loader::OpenFromFile< R >, and sftools::loader::LoadFromFile< R >.
Referenced by sftools::loader::ResourceLoader< R >::operator()().
|
inline |
Load operator.
It create a resource and use load() to initialize its content.
id | Resource id to load |
Definition at line 80 of file Loaders.hpp.
References sftools::Locations::begin(), sftools::Locations::end(), sftools::Singleton< T, F >::getInstance(), and sftools::loader::ResourceLoader< R >::load().