KrisLibrary
1.0.0
|
A generic "resource" that can be saved/loaded to disk. More...
#include <ResourceLibrary.h>
Public Member Functions | |
ResourceBase (const std::string &name) | |
ResourceBase (const std::string &name, const std::string &fn) | |
virtual bool | Load (const std::string &fn) |
virtual bool | Load () |
virtual bool | Save (const std::string &fn) |
virtual bool | Save () |
virtual bool | Load (std::istream &in) |
virtual bool | Save (std::ostream &out) |
virtual bool | Load (TiXmlElement *in) |
virtual bool | Save (TiXmlElement *out) |
virtual bool | Load (AnyCollection &c) |
virtual bool | Save (AnyCollection &c) |
virtual const char * | Type () const |
virtual ResourceBase * | Make () |
virtual ResourceBase * | Copy () |
Public Attributes | |
std::string | name |
std::string | fileName |
A generic "resource" that can be saved/loaded to disk.
The subclass must support saving through one or more of the following methods
If the resource library is saved to a directory, then each entry is stored to a separate file.
If the resource library is saved to an xml file, then each entry that supports saving to xml is saved directly in the xml file. If it supports iostreams, then it is outputted directly as a text node in the xml file. If it only supports saving to file, then the filename is stored in the xml file and the resource is dumped to disk.
|
inlinevirtual |
Make a ResourceBase that copies all the contents of this. (Copying the name and fileName are optional)
Reimplemented in ResourceLibraryResource, BasicArrayResource< T >, and BasicResource< T >.
Referenced by ResourceLibraryResource::Make().
|
inlinevirtual |
Make a ResourceBase of the same dynamic type as this. ResourceBase instances are their own factories.
Reimplemented in ResourceLibraryResource, BasicArrayResource< T >, and BasicResource< T >.
Referenced by ResourceLibrary::LazyLoadXml().
|
inlinevirtual |
A unique type string used for type indexing and xml output, only alphanumeric characters allowed.
Reimplemented in ResourceLibraryResource, BasicArrayResource< T >, and BasicResource< T >.
Referenced by CompoundResourceBase::Pack().