ork::XMLResourceLoader Class Reference
[resource]

A ResourceLoader that loads ResourceDescriptor from XML files. More...

#include <XMLResourceLoader.h>

Inheritance diagram for ork::XMLResourceLoader:
ork::ResourceLoader ork::Object ork::ResourceCompiler

List of all members.

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< ResourceDescriptorloadResource (const string &name)
 Loads the ResourceDescriptor of the given name.
virtual ptr< ResourceDescriptorreloadResource (const string &name, ptr< ResourceDescriptor > currentValue)
 Reloads the ResourceDescriptor of the given name.

Detailed Description

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.


Constructor & Destructor Documentation

ork::XMLResourceLoader::XMLResourceLoader (  ) 

Creates a new XMLResourceLoader.

virtual ork::XMLResourceLoader::~XMLResourceLoader (  )  [virtual]

Deletes this XMLResourceLoader.


Member Function Documentation

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.

Parameters:
name the name of a resource.
Returns:
the path of this resource.
Exceptions:
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.

Parameters:
name the name of the ResourceDescriptor to be loaded.
Returns:
the ResourceDescriptor of the given name, or NULL if the resource is not found.

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.

Parameters:
name the name of the ResourceDescriptor to be loaded.
currentValue the current value of this ResourceDescriptor.
Returns:
the new value of this ResourceDescriptor, or NULL if this value has not changed on disk.

Implements ork::ResourceLoader.


Generated on Mon Oct 18 09:36:11 2010 for ork by  doxygen 1.6.1