A ResourceLoader that loads ResourceDescriptor from XML files. More...
#include <XMLResourceLoader.h>
Public Member Functions | |
XMLResourceLoader () | |
Creates a new XMLResourceLoader. | |
virtual | ~XMLResourceLoader () |
Deletes this XMLResourceLoader. | |
void | addPath (const string &path) |
Adds a search path where ResourceDescriptor can be looked for. | |
void | addArchive (const string &archive) |
Adds an XML archive file where ResourceDescriptor can be looked for. | |
virtual string | findResource (const string &name) |
Returns the path of the resource of the given name. | |
virtual ptr< ResourceDescriptor > | loadResource (const string &name) |
Loads the ResourceDescriptor of the given name. | |
virtual ptr< ResourceDescriptor > | reloadResource (const string &name, ptr< ResourceDescriptor > currentValue) |
Reloads the ResourceDescriptor of the given name. |
A ResourceLoader that loads ResourceDescriptor from XML files.
This loader can load resources from individual XML files, each file containing a single ResourceDescriptor, and from so called XML archive files, each archive file containing one or more ResourceDescriptor. This loader can search for these files in several directories and archives files configured with addPath and addArchive.
ork::XMLResourceLoader::XMLResourceLoader | ( | ) |
Creates a new XMLResourceLoader.
virtual ork::XMLResourceLoader::~XMLResourceLoader | ( | ) | [virtual] |
Deletes this XMLResourceLoader.
void ork::XMLResourceLoader::addArchive | ( | const string & | archive | ) |
Adds an XML archive file where ResourceDescriptor can be looked for.
void ork::XMLResourceLoader::addPath | ( | const string & | path | ) |
Adds a search path where ResourceDescriptor can be looked for.
virtual string ork::XMLResourceLoader::findResource | ( | const string & | name | ) | [virtual] |
Returns the path of the resource of the given name.
name | the name of a resource. |
exception | if the resource is not found. |
Implements ork::ResourceLoader.
Reimplemented in ork::ResourceCompiler.
virtual ptr<ResourceDescriptor> ork::XMLResourceLoader::loadResource | ( | const string & | name | ) | [virtual] |
Loads the ResourceDescriptor of the given name.
name | the name of the ResourceDescriptor to be loaded. |
Implements ork::ResourceLoader.
Reimplemented in ork::ResourceCompiler.
virtual ptr<ResourceDescriptor> ork::XMLResourceLoader::reloadResource | ( | const string & | name, | |
ptr< ResourceDescriptor > | currentValue | |||
) | [virtual] |
Reloads the ResourceDescriptor of the given name.
name | the name of the ResourceDescriptor to be loaded. | |
currentValue | the current value of this ResourceDescriptor. |
Implements ork::ResourceLoader.