ResourceManager Class Reference

#include <resourcemanager.h>

List of all members.


Detailed Description

A class for loading and managing resources.

Definition at line 33 of file resourcemanager.h.

Public Member Functions

 ResourceManager ()
 Constructor.
 ~ResourceManager ()
 Destructor.
void * loadFile (const std::string &fileName, int &fileSize)
 Allocates data into a buffer pointer for raw data loading.
std::vector< std::string > loadTextFile (const std::string &fileName)
 Retrieves the contents of a text file.

Static Public Member Functions

ResourceManagergetInstance ()
 Returns an instance of the class, creating one if it does not already exist.
void deleteInstance ()
 Deletes the class instance if it exists.

Private Member Functions

void searchAndAddZipFiles ()
 Searches for zip files and adds them to the PhysicsFS search path.

Static Private Attributes

ResourceManagerinstance = NULL


Constructor & Destructor Documentation

ResourceManager::ResourceManager  ) 
 

Constructor.

Definition at line 42 of file resourcemanager.cpp.

ResourceManager::~ResourceManager  ) 
 

Destructor.

Definition at line 48 of file resourcemanager.cpp.


Member Function Documentation

void ResourceManager::deleteInstance  )  [static]
 

Deletes the class instance if it exists.

Definition at line 61 of file resourcemanager.cpp.

ResourceManager * ResourceManager::getInstance  )  [static]
 

Returns an instance of the class, creating one if it does not already exist.

Definition at line 53 of file resourcemanager.cpp.

void* ResourceManager::loadFile const std::string &  fileName,
int &  fileSize
 

Allocates data into a buffer pointer for raw data loading.

The returned data is expected to be freed using free().

Parameters:
fileName The name of the file to be loaded.
fileSize The size of the file that was loaded.
Returns:
An allocated byte array containing the data that was loaded, or NULL on fail.

std::vector<std::string> ResourceManager::loadTextFile const std::string &  fileName  ) 
 

Retrieves the contents of a text file.

void ResourceManager::searchAndAddZipFiles  )  [private]
 

Searches for zip files and adds them to the PhysicsFS search path.

Definition at line 70 of file resourcemanager.cpp.


Member Data Documentation

ResourceManager * ResourceManager::instance = NULL [static, private]
 

Definition at line 40 of file resourcemanager.cpp.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 15:39:18 2007 for TMW Server by  doxygen 1.3.9.1