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... | |
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.
|
pure virtual |
Workaround method to load an asset from the filesystem.
File | The complete file path and a name of the asset to be loaded. |
|
pure virtual |
Workaround method to save an asset to the filesystem.
File | The complete file path and a name of the asset to be saved. |
|
pure virtual |
Loads an asset from an input stream.
Stream | The stream this asset will be read from. |
|
pure virtual |
Saves an asset to an output stream.
Stream | The stream this asset will written to. |