MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::ResourceManager Class Reference

This is the manager responsible for the loading and unloading of files. More...

#include <resourcemanager.h>

+ Inheritance diagram for Mezzanine::ResourceManager:
+ Collaboration diagram for Mezzanine::ResourceManager:

Public Types

typedef
DataStreamContainer::const_iterator 
ConstDataStreamIterator
 Const Iterator type for DataStream instances stored by this class.
 
typedef
NamedDataStreamContainer::const_iterator 
ConstNamedDataStreamIterator
 Const Iterator type for named DataStream instances stored by this class.
 
typedef std::vector
< Resource::DataStreamPtr
DataStreamContainer
 Basic container type for DataStream storage by this class.
 
typedef
DataStreamContainer::iterator 
DataStreamIterator
 Iterator type for DataStream instances stored by this class.
 
typedef std::map< String,
Resource::DataStreamPtr
NamedDataStreamContainer
 Basic container type for named DataStream storage by this class.
 
typedef
NamedDataStreamContainer::iterator 
NamedDataStreamIterator
 Iterator type for named DataStream instances stored by this class.
 
- Public Types inherited from Mezzanine::ManagerBase
enum  ManagerType {
  MT_AudioManager = 1, MT_AnimationManager, MT_CollisionShapeManager, MT_CompositorManager,
  MT_GraphicsManager, MT_EventManager, MT_InputManager, MT_LogManager,
  MT_MaterialManager, MT_MeshManager, MT_NetworkManager, MT_ResourceManager,
  MT_ScriptingManager, MT_UIManager, MT_ActorManager = 100, MT_AreaEffectManager,
  MT_CameraManager, MT_DebrisManager, MT_PagingManager, MT_PhysicsManager,
  MT_SceneManager, MT_SoundScapeManager, MT_TerrainManager, MT_VehicleManager,
  MT_UserCreated = 512
}
 

Public Member Functions

 ResourceManager (const String &EngineDataPath=".", const ArchiveType ArchType=AT_FileSystem, int ArgCount=0, char **ArgVars=NULL)
 Class constructor. More...
 
 ResourceManager (XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~ResourceManager ()
 
void AddAssetLocation (const String &Location, const ArchiveType Type, const String &Group, const bool Recursive=false)
 Adds a location for graphical resources. More...
 
void CreateAssetGroup (const String &GroupName)
 Creates an asset group. More...
 
Resource::DataStreamPtr CreateDataStream (void *Buffer, const UInt32 BufferSize)
 Creates a stream from a memory buffer. More...
 
Resource::DataStreamPtr CreateDataStream (const String &AssetName, void *Buffer, const UInt32 BufferSize)
 Creates a named stream from a memory buffer. More...
 
Resource::DataStreamPtr CreateDataStream (const String &AssetName, const String &AssetGroup, void *Buffer, const UInt32 BufferSize)
 Creates a named stream from a memory buffer and adds it to the named AssetGroup. More...
 
bool CreateDirectoryPath (const String &DirectoryPath)
 Creates all directories that do not exist in the provided path. More...
 
void DeclareAsset (const String &Name, const String &Type, const String &Group)
 Prepares the asset for use. More...
 
virtual void Deinitialize ()
 Removes this manager from any necessary configuration so it can be safely disposed of. More...
 
void DestroyAssetGroup (const String &GroupName)
 Destroys an asset group, unloading all of it's resources. More...
 
String GetAssetPath (const String &FileName, const String &Group)
 Gets the actual path to an asset. More...
 
String GetCommonUserDataDir () const
 Gets the path to the directory intended for game saves and user profile data for all users. More...
 
String GetCurrentUserDataDir () const
 Gets the path to the directory intended for game saves and user profile data for the current user. More...
 
String GetEngineDataDirectory () const
 Get the pathname where engine data is stored. More...
 
String GetExecutableDir () const
 Get the Path to the current executable, in a fast way if possible. More...
 
String GetExecutableDirFromArg () const
 Uses the main parameters stored on an instance of Mezzanine::ResourceManager to attempt determine executable directory. More...
 
virtual String GetImplementationTypeName () const
 This Allows any manager name to be sent to a stream. Primarily used for logging. More...
 
virtual ManagerType GetInterfaceType () const
 This returns the type of this manager. More...
 
String GetLocalAppDataDir () const
 Gets the path to the directory intended for game and engine config data that is not meant to be shared. More...
 
String GetPluginExtension () const
 Gets the dot-and-extention of this platforms plugins. More...
 
ResourceInputStreamGetResourceStream (const String &FileName)
 Get a stream to read from the specified file. More...
 
String GetShareableAppDataDir () const
 Gets the path to the directory intended for game and engine config data that is allowed to be shared. More...
 
void InitAssetGroup (const String &Name)
 Makes a asset group ready to use. More...
 
virtual void Initialize ()
 Configures this manager for use prior to entering the main loop. More...
 
Resource::DataStreamPtr OpenAssetStream (const String &AssetName, const String &AssetGroup)
 Opens a stream to an asset in an AssetGroup. More...
 
String ResolveDataPathFromString (const String &PathVar)
 Resolves a string describing one of the platform data paths to the actual path it is. More...
 
void SetMainArgs (int ArgCount, char **ArgVars)
 Store the Main arguments for later use. More...
 
- Public Member Functions inherited from Mezzanine::ManagerBase
 ManagerBase ()
 Class constructor.
 
virtual ~ManagerBase ()
 Class destructor.
 
virtual String GetInterfaceTypeAsString () const
 Gets a string of the interface type of this manager. More...
 
bool IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 
- Public Member Functions inherited from Mezzanine::Singleton< ResourceManager >
 Singleton ()
 Class constructor.
 
 ~Singleton ()
 Class destructor.
 

Static Public Member Functions

static String BaseName (const String &FileName)
 Get the filename portion of a string. More...
 
static void ChangeDirectory (const String &ChangeTo)
 Change directory, to the directory indicated. More...
 
static bool CreateDirectory (const String &DirectoryPath)
 Creates a single new directory. More...
 
static String DirName (const String &FileName)
 Get the directory portion of a string. More...
 
static bool DoesDirectoryExist (const String &DirectoryPath)
 Checks to see if the given path exists and if it is a folder. More...
 
static ArchiveType GetArchiveTypeFromString (const String &FromString)
 Gets an ArchiveType from a string. More...
 
static StringSet GetDirContents (const String &Dir=".")
 Get a Listing of the files and subdirectories in a directory. More...
 
static char GetDirectorySeparator ()
 Get the character used to separate directories. More...
 
static String GetExecutableDir (int ArgCount, char **ArgVars)
 Get the Path to the current executable, fast from Args if Possible or from a system call otherwise. More...
 
static String GetExecutableDirFromArg (int ArgCount, char **ArgVars)
 Attempt to get the executable directory from the a set of variables like those passed into Main. More...
 
static String GetExecutableDirFromSystem ()
 Used a system call to get the curent Directory the executable is in. This make an external system call and is likely slower than GetExecutableDirFromArg. More...
 
static char GetPathSeparator ()
 Get the character used to separate entries in the system PATH. More...
 
static String GetStringFromArchiveType (const Mezzanine::ArchiveType ArchType)
 Gets a string that describes an ArchiveType. More...
 
static StringVector GetSystemPATH (const String &PATH=String(getenv("PATH")))
 Get the $PATH or PATH% split and order for easy checking of how the OS does it. More...
 
static String GetWorkingDirectory ()
 Get the working directory as a Mezzanine::String. More...
 
static void RemoveDirectory (const String &DirectoryPath)
 Remove an empty directory. More...
 
static String Which (String ExecutableName)
 Search the system path the same way most systems do to find an executable. More...
 
- Static Public Member Functions inherited from Mezzanine::ManagerBase
static String GetTypeAsString (const ManagerType &ManagerType)
 Gets the string form of the type of manager. More...
 
static ManagerType GetTypeFromString (const String &ManagerName)
 Gets the type of manager requested from a string. More...
 
- Static Public Member Functions inherited from Mezzanine::Singleton< ResourceManager >
static ResourceManagerGetSingletonPtr ()
 Fetches a pointer to the singleton. More...
 
static bool SingletonValid ()
 Checks to see if the singleton pointer is valid. More...
 

Protected Member Functions

void AddAssetGroupName (String Name)
 Adds an asset group name to the list of known AssetGroups. More...
 

Protected Attributes

int ArgC
 ArgC as it was passed into Main. More...
 
char ** ArgV
 ArgC as it was passed into Main. More...
 
DataStreamContainer DataStreams
 A container storing all un-named, un-grouped data streams known by the resource system. More...
 
std::vector
< ResourceInputStream * > 
DeleteList
 A vector of Pointers to streams created to delete periodically. More...
 
String EngineDataDir
 The location of engine data. More...
 
NamedDataStreamContainer NamedDataStreams
 A container storing all named but un-grouped data streams known by the resource system. More...
 
Ogre::ResourceGroupManager * OgreResource
 Encapsulates the functionality of the ogre resource group manager. More...
 
std::vector< StringResourceGroups
 A vector of all the known internal Asset Groups. More...
 
- Protected Attributes inherited from Mezzanine::ManagerBase
bool Initialized
 Simple bool indicating whether or not this manager has been initialized. More...
 
EntresolTheEntresol
 The actual pointer to the Entresol core class. More...
 

Additional Inherited Members

- Static Protected Attributes inherited from Mezzanine::Singleton< ResourceManager >
static ResourceManagerSingletonPtr
 

Detailed Description

This is the manager responsible for the loading and unloading of files.

This class is responsible for the reading and writing of files of all kinds, be it graphical meshes, physics data, or XMl files.

Definition at line 76 of file resourcemanager.h.

Constructor & Destructor Documentation

Mezzanine::ResourceManager::ResourceManager ( const String EngineDataPath = ".",
const ArchiveType  ArchType = AT_FileSystem,
int  ArgCount = 0,
char **  ArgVars = NULL 
)

Class constructor.

Standard manager constructor.

Parameters
EngineDataPathThe directory for engine specific data.
ArchiveTypeThe name of the type of archive at this path.
ArgCountHow many arguments will be passed in ArgVars. Defaults to 0
ArgVarsA pointer to an array, with ArgCount elements, of char* which point to null terminated c strings. Defaults to NULL.

Definition at line 99 of file resourcemanager.cpp.

Mezzanine::ResourceManager::ResourceManager ( XML::Node XMLNode)

XML constructor.

Parameters
XMLNodeThe node of the xml document to construct from.
Todo:
This class currently doesn't initialize anything from XML, if that changes this constructor needs to be expanded.

Definition at line 107 of file resourcemanager.cpp.

Mezzanine::ResourceManager::~ResourceManager ( )
virtual

Class Destructor.

Definition at line 113 of file resourcemanager.cpp.

Member Function Documentation

void Mezzanine::ResourceManager::AddAssetGroupName ( String  Name)
protected

Adds an asset group name to the list of known AssetGroups.

Definition at line 564 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::AddAssetLocation ( const String Location,
const ArchiveType  Type,
const String Group,
const bool  Recursive = false 
)

Adds a location for graphical resources.

This function will add a location on the disk to find files needed to create and manipulate graphical objects. Once an asset is added it must be initalized using ResourceManager::InitResourceGroup(String Group).

Parameters
LocationThe location on the file system the asset can be found.
TypeThe kind of file system the location can be found in.
Options are: filesystem, zip.
GroupThe name of the group the resources at this location belong to. If the group does not exist it will be created.
RecursiveWhether or not to search sub-directories.

Definition at line 574 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::BaseName ( const String FileName)
static

Get the filename portion of a string.

Parameters
FileNameA whole path and filename
Returns
If passed "/a/b/c.txt" or "c:\windirs\crash.exe" this will return "c.txt" or "crash.exe"

Definition at line 204 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::ChangeDirectory ( const String ChangeTo)
static

Change directory, to the directory indicated.

Parameters
ChangeToThe new directory to work from.

Definition at line 344 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::CreateAssetGroup ( const String GroupName)

Creates an asset group.

Parameters
GroupNameThe name to be given to the created asset group.

Definition at line 580 of file resourcemanager.cpp.

Resource::DataStreamPtr Mezzanine::ResourceManager::CreateDataStream ( void *  Buffer,
const UInt32  BufferSize 
)

Creates a stream from a memory buffer.

Note
The created stream will take ownership of the buffer you provide. If you want it to have a separate buffer then create a copy and pass that in.
Parameters
BufferA pointer to the memory to stream from.
BufferSizeThe size of the provided buffer in bytes.
Returns
Returns a CountedPtr to the stream to the provided buffer.

Definition at line 537 of file resourcemanager.cpp.

Resource::DataStreamPtr Mezzanine::ResourceManager::CreateDataStream ( const String AssetName,
void *  Buffer,
const UInt32  BufferSize 
)

Creates a named stream from a memory buffer.

Note
The created stream will take ownership of the buffer you provide. If you want it to have a separate buffer then create a copy and pass that in.
Parameters
AssetNameThe name to be given to the created stream.
BufferA pointer to the memory to stream from.
BufferSizeThe size of the provided buffer in bytes.
Returns
Returns a CountedPtr to the stream to the provided buffer.

Definition at line 544 of file resourcemanager.cpp.

Resource::DataStreamPtr Mezzanine::ResourceManager::CreateDataStream ( const String AssetName,
const String AssetGroup,
void *  Buffer,
const UInt32  BufferSize 
)

Creates a named stream from a memory buffer and adds it to the named AssetGroup.

Note
The created stream will take ownership of the buffer you provide. If you want it to have a separate buffer then create a copy and pass that in.
Parameters
AssetNameThe name to be given to the created stream.
AssetGroupThe name of the AssetGroup this stream will be added to.
BufferA pointer to the memory to stream from.
BufferSizeThe size of the provided buffer in bytes.
Returns
Returns a CountedPtr to the stream to the provided buffer.
Todo:
Once we have our own AssetGroup implementation we need to implement this.

Definition at line 551 of file resourcemanager.cpp.

bool Mezzanine::ResourceManager::CreateDirectory ( const String DirectoryPath)
static

Creates a single new directory.

Remarks
This function will only create the directory specified at the end of the path.
Parameters
DirectoryPathThe path for the newly created directory.
Returns
Returns true if the directory was created, false in the case of a non-critical error.

Definition at line 130 of file resourcemanager.cpp.

bool Mezzanine::ResourceManager::CreateDirectoryPath ( const String DirectoryPath)

Creates all directories that do not exist in the provided path.

Parameters
DirectoryPathThe path for the newly created directory or directories.
Returns
Returns true if all directories were created, false in the case of a non-critical error.

Definition at line 358 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::DeclareAsset ( const String Name,
const String Type,
const String Group 
)

Prepares the asset for use.

This function can be thought of as a preloader. This will prepare the defined asset located on the disk for use.

Parameters
NameName of the file/asset to be 'prepared'.
TypeThe type of asset that the file is.
Options are: Font, GpuProgram, HighLevelGpuProgram, Material, Mesh, Skeleton, Texture.
GroupName of the group the asset belongs to.

Definition at line 608 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::Deinitialize ( )
virtual

Removes this manager from any necessary configuration so it can be safely disposed of.

Implements Mezzanine::ManagerBase.

Definition at line 667 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::DestroyAssetGroup ( const String GroupName)

Destroys an asset group, unloading all of it's resources.

Parameters
GroupNameThe name of the asset group to destroy.
Todo:
This is a bit of a hack, but needs to be here until we can upgrade our resource system.

Definition at line 586 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::DirName ( const String FileName)
static

Get the directory portion of a string.

Parameters
FileNameA whole path and filename
Returns
If passed "/a/b/c.txt" or "c:\windirs\crash.exe" this will return "/a/b/" or "c:\windirs\"

Definition at line 190 of file resourcemanager.cpp.

bool Mezzanine::ResourceManager::DoesDirectoryExist ( const String DirectoryPath)
static

Checks to see if the given path exists and if it is a folder.

Parameters
DirectoryPathA String containing the path to test.
Returns
True if the item indicated by DirectoryPath exists and it is a directory, false if it does not exist or exists but is a file.
Exceptions
OnError this might throw a Mezzanine::IOException with detail about why it failed

Definition at line 168 of file resourcemanager.cpp.

Mezzanine::ArchiveType Mezzanine::ResourceManager::GetArchiveTypeFromString ( const String FromString)
static

Gets an ArchiveType from a string.

Parameters
FromStringThe string to be converted to an archive type.
Returns
Returns a ArchiveType corresponding to the string provided, or AT_Invalid if it is invalid.

Definition at line 686 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetAssetPath ( const String FileName,
const String Group 
)

Gets the actual path to an asset.

Note
This function currently only returns the first match, and doesn't check for multiple matches.
Parameters
FileNameThe name of the file to search for.
GroupThe asset group to search in for the file.
Returns
Returns a string containing the path to the file.

Definition at line 621 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetCommonUserDataDir ( ) const

Gets the path to the directory intended for game saves and user profile data for all users.

Returns
Returns a string containing the path to the Common User Data Directory.

Definition at line 500 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetCurrentUserDataDir ( ) const

Gets the path to the directory intended for game saves and user profile data for the current user.

Returns
Returns a string containing the path to the Current User Data Directory.

Definition at line 482 of file resourcemanager.cpp.

StringSet Mezzanine::ResourceManager::GetDirContents ( const String Dir = ".")
static

Get a Listing of the files and subdirectories in a directory.

This follows normal command line conventions, "." is the current directory, ".." is the parent directory. To access the file system root you will need to use a leading "c:/", "c:\\", or "/" as appropriate for the operating system the software will run on.

Returns
This will return a pointer to a set of Strings the caller is responsible for deleting or a null pointer on an error.
Parameters
DirThe directory to check.

Definition at line 386 of file resourcemanager.cpp.

char Mezzanine::ResourceManager::GetDirectorySeparator ( )
static

Get the character used to separate directories.

Returns
Backslash '\' on windows and Forward slash '/' on other operating systems.

Definition at line 218 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetEngineDataDirectory ( ) const

Get the pathname where engine data is stored.

Returns
A String that contains the pathname

Definition at line 418 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetExecutableDir ( int  ArgCount,
char **  ArgVars 
)
static

Get the Path to the current executable, fast from Args if Possible or from a system call otherwise.

Parameters
ArgCountHow many arguments will be passed in ArgVars.
ArgVarsA pointer to an array, with ArgCount elements, of char* which point to null terminated c strings.
Warning
If you pass bogus arguments to this bad things can and will happen. Infinite loops, segfaults etc... Just pass what main gives you
Not all system provide all the needed information to determine the executable directory
Returns
A String containing the path to the current executable.

Definition at line 330 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetExecutableDir ( ) const

Get the Path to the current executable, in a fast way if possible.

Returns
A String containing the path to the current executable.

Definition at line 341 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetExecutableDirFromArg ( int  ArgCount,
char **  ArgVars 
)
static

Attempt to get the executable directory from the a set of variables like those passed into Main.

This is the fastest way to get the Executable location, but might not work on all platforms.

Parameters
ArgCountHow many arguments will be passed in ArgVars.
ArgVarsA pointer to an array, with ArgCount elements, of char* which point to null terminated c strings.
Warning
If you pass bogus arguments to this bad things can and will happen. Infinite loops, segfaults etc... Just pass what main gives you
Not all system provide all the needed information to determine the executable directory
Returns
If a whole path is present in ArgVars[0] this returns the directory part of that path, if this uses the executable file this returns '.', otherwise this with return "" indicating it is not usable.

Definition at line 272 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetExecutableDirFromArg ( ) const

Uses the main parameters stored on an instance of Mezzanine::ResourceManager to attempt determine executable directory.

Returns
Either a valid Path, '.' if the working dir is likely correct or "" if nothing could be determined.

Definition at line 298 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetExecutableDirFromSystem ( )
static

Used a system call to get the curent Directory the executable is in. This make an external system call and is likely slower than GetExecutableDirFromArg.

Returns
This will return the current path this executable is stored in.

Definition at line 301 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetImplementationTypeName ( ) const
virtual

This Allows any manager name to be sent to a stream. Primarily used for logging.

Returns
This returns a String that contains the name.

Implements Mezzanine::ManagerBase.

Definition at line 702 of file resourcemanager.cpp.

ManagerBase::ManagerType Mezzanine::ResourceManager::GetInterfaceType ( ) const
virtual

This returns the type of this manager.

This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.

Returns
This returns a ManagerTypeName to identify what this can be safely cast to.

Implements Mezzanine::ManagerBase.

Definition at line 699 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetLocalAppDataDir ( ) const

Gets the path to the directory intended for game and engine config data that is not meant to be shared.

Returns
Returns a string containing the path to the Local Application Data Directory.

Definition at line 437 of file resourcemanager.cpp.

char Mezzanine::ResourceManager::GetPathSeparator ( )
static

Get the character used to separate entries in the system PATH.

Returns
Semicolon ';' on windows and Forward slash ':' on other operating systems.

Definition at line 227 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetPluginExtension ( ) const

Gets the dot-and-extention of this platforms plugins.

Returns
Returns the platform appropriate extention for plugin files.

Definition at line 637 of file resourcemanager.cpp.

ResourceInputStream * Mezzanine::ResourceManager::GetResourceStream ( const String FileName)

Get a stream to read from the specified file.

The returned ResourceInputStream is the Caller's responsibility to deal with. If it is not deleted it is a memory leak.

Parameters
FileNameThe name of the File you want to stream data from.
Returns
An derivative of std::istream a ResourceInputStream that will pull it's data from the desired resource.

Definition at line 648 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetShareableAppDataDir ( ) const

Gets the path to the directory intended for game and engine config data that is allowed to be shared.

Returns
Returns a string containing the path to the Shareable Application Data Directory.

Definition at line 464 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetStringFromArchiveType ( const Mezzanine::ArchiveType  ArchType)
static

Gets a string that describes an ArchiveType.

Parameters
ArchTypeA ArchiveType That you want to log or pass to Ogre, or just need a String that represents it.
Returns
A String that represents the ArchiveType passed.

Definition at line 672 of file resourcemanager.cpp.

StringVector Mezzanine::ResourceManager::GetSystemPATH ( const String PATH = String(getenv("PATH")))
static

Get the $PATH or PATH% split and order for easy checking of how the OS does it.

Parameters
PATHDefaults to the PATH environment variable. But any value like a system path will be split the return of GetPathSeparator().
Returns
A collection of directories that this system will for executables in the order they will be checked.

Definition at line 236 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::GetWorkingDirectory ( )
static

Get the working directory as a Mezzanine::String.

Returns
The Directory the game was called from (not nescessarilly the location of the executable), as a Mezzanine::String

Definition at line 406 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::InitAssetGroup ( const String Name)

Makes a asset group ready to use.

After adding all of your assets and declaring them as nessessary, this function is the final step. After calling this function any and all assets within the defined group will be ready to use. Do not initialize any more groups then you need to however, as that will take up memory and drop performance.

Parameters
NameName of the asset group.

Definition at line 613 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::Initialize ( )
virtual

Configures this manager for use prior to entering the main loop.

Implements Mezzanine::ManagerBase.

Definition at line 662 of file resourcemanager.cpp.

Resource::DataStreamPtr Mezzanine::ResourceManager::OpenAssetStream ( const String AssetName,
const String AssetGroup 
)

Opens a stream to an asset in an AssetGroup.

Parameters
AssetNameThe identity of the asset to be opened (commonly a file name).
AssetGroupThe name of the AssetGroup where the Asset can be found.
Todo:
This entire method is a bit of a hack. When the resource system gets refactored it should go through our archives or whatever equivalent. Since we currently have to put up with Ogre's system, we'll use it for now as a hack.

Definition at line 521 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::RemoveDirectory ( const String DirectoryPath)
static

Remove an empty directory.

Parameters
DirectoryPathDirectory to remove.
Exceptions
OnError this might throw a Mezzanine::IOException with details about why it failed.

Definition at line 180 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::ResolveDataPathFromString ( const String PathVar)

Resolves a string describing one of the platform data paths to the actual path it is.

Remarks
Currently there are only 4 preset path variables, and depending on platform they two or more may go to the same location. The valid variables are as follows: LocalAppData, ShareableAppData, CurrentUserData, and CommonUserData. These are not case sensative.
Parameters
PathVarString containing the name of the path variable.
Returns
Returns the actual path of the variable provided.

Definition at line 423 of file resourcemanager.cpp.

void Mezzanine::ResourceManager::SetMainArgs ( int  ArgCount,
char **  ArgVars 
)

Store the Main arguments for later use.

Parameters
ArgCountHow many arguments will be passed in ArgVars.
ArgVarsA pointer to an array, with ArgCount elements, of char* which point to null terminated c strings.

Definition at line 121 of file resourcemanager.cpp.

String Mezzanine::ResourceManager::Which ( String  ExecutableName)
static

Search the system path the same way most systems do to find an executable.

Parameters
ExecutableNameThe executable to look for.
Returns
If the executable is not found "" is returned otherwise the first directory in the PATH containing it is returned.
Warning
This function is case sensitive and not all operating systems are.
Todo:
Add support for extension handling on windows. "cmd" should find "cmd.exe" in system32, but currently "cmd.exe" needs to be searched

Definition at line 257 of file resourcemanager.cpp.

Member Data Documentation

int Mezzanine::ResourceManager::ArgC
protected

ArgC as it was passed into Main.

This cannot be set statically, it must wait for main(int, char**) to be initialized, then call the appropriate function to set this.

Definition at line 116 of file resourcemanager.h.

char** Mezzanine::ResourceManager::ArgV
protected

ArgC as it was passed into Main.

This cannot be set statically, it must wait for main(int, char**) to be initialized, then call the appropriate function to set this.

Definition at line 120 of file resourcemanager.h.

DataStreamContainer Mezzanine::ResourceManager::DataStreams
protected

A container storing all un-named, un-grouped data streams known by the resource system.

Definition at line 101 of file resourcemanager.h.

std::vector<ResourceInputStream*> Mezzanine::ResourceManager::DeleteList
protected

A vector of Pointers to streams created to delete periodically.

Definition at line 108 of file resourcemanager.h.

String Mezzanine::ResourceManager::EngineDataDir
protected

The location of engine data.

Definition at line 97 of file resourcemanager.h.

NamedDataStreamContainer Mezzanine::ResourceManager::NamedDataStreams
protected

A container storing all named but un-grouped data streams known by the resource system.

Definition at line 104 of file resourcemanager.h.

Ogre::ResourceGroupManager* Mezzanine::ResourceManager::OgreResource
protected

Encapsulates the functionality of the ogre resource group manager.

Definition at line 94 of file resourcemanager.h.

std::vector<String> Mezzanine::ResourceManager::ResourceGroups
protected

A vector of all the known internal Asset Groups.

Definition at line 111 of file resourcemanager.h.


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