Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | List of all members
Mezzanine::Resource::Asset Class Referenceabstract

A convenience base class for objects that may need common IO operations exposed for them. More...

#include <asset.h>

Public Member Functions

 Asset ()
 Class constructor.
 
virtual ~Asset ()
 Class destructor.
 
virtual void _LoadAsset (const String &File)=0
 Workaround method to load an asset from the filesystem. More...
 
virtual void _LoadAsset (const String &FilePath, const String &FileName)
 Workaround method to load an asset from the filesystem. More...
 
virtual void _SaveAsset (const String &File)=0
 Workaround method to save an asset to the filesystem. More...
 
virtual void _SaveAsset (const String &FilePath, const String &FileName)
 Workaround method to save an asset to the filesystem. More...
 
virtual void LoadAsset (std::istream *Stream)=0
 Loads an asset from an input stream. More...
 
virtual void LoadAsset (const String &FileName, const String &GroupName)
 Loads an asset from an asset group. More...
 
virtual void SaveAsset (std::ostream *Stream)=0
 Saves an asset to an output stream. More...
 
virtual void SaveAsset (const String &FileName, const String &GroupName)
 Saves an asset to an asset group. More...
 

Detailed Description

A convenience base class for objects that may need common IO operations exposed for them.

An Asset is just a class that may need saving or loading operations present on the class. Any data that has IO performed on it can be an Asset, regardless of whether or not it is represented by this class.

The internal IO methods bypass the resource system and access the resource directly. This should be avoided in most use cases as you could be opening multiple streams to the same assets or creating race conditions, or generating large delays for the WorkUnit if it is being executed in a WorkUnit. They were primarily created to facilitate testing.

Definition at line 59 of file asset.h.

Member Function Documentation

virtual void Mezzanine::Resource::Asset::_LoadAsset ( const String File)
pure virtual

Workaround method to load an asset from the filesystem.

Parameters
FileThe complete file path and a name of the asset to be loaded.
void Mezzanine::Resource::Asset::_LoadAsset ( const String FilePath,
const String FileName 
)
virtual

Workaround method to load an asset from the filesystem.

Parameters
FilePathThe directory path the file should be loaded from.
FileNameThe name of the file to search for.

Definition at line 88 of file asset.cpp.

virtual void Mezzanine::Resource::Asset::_SaveAsset ( const String File)
pure virtual

Workaround method to save an asset to the filesystem.

Parameters
FileThe complete file path and a name of the asset to be saved.
void Mezzanine::Resource::Asset::_SaveAsset ( const String FilePath,
const String FileName 
)
virtual

Workaround method to save an asset to the filesystem.

Parameters
FilePathThe directory path the file should be saved to.
FileNameThe name of the file to save as.

Definition at line 94 of file asset.cpp.

virtual void Mezzanine::Resource::Asset::LoadAsset ( std::istream *  Stream)
pure virtual

Loads an asset from an input stream.

Parameters
StreamThe stream this asset will be read from.
void Mezzanine::Resource::Asset::LoadAsset ( const String FileName,
const String GroupName 
)
virtual

Loads an asset from an asset group.

Parameters
FileNameThe name of the file to search for.
GroupNameThe name of the asset group to look for the resource in.

Definition at line 62 of file asset.cpp.

virtual void Mezzanine::Resource::Asset::SaveAsset ( std::ostream *  Stream)
pure virtual

Saves an asset to an output stream.

Parameters
StreamThe stream this asset will written to.
void Mezzanine::Resource::Asset::SaveAsset ( const String FileName,
const String GroupName 
)
virtual

Saves an asset to an asset group.

Parameters
FileNameThe name of the file to save as.
GroupNameThe name of the asset group to save to.

Definition at line 75 of file asset.cpp.


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