KrisLibrary
1.0.0
|
A basic array data type. More...
#include <ResourceLibrary.h>
Public Types | |
typedef BasicResource< T > | BaseType |
Public Member Functions | |
BasicArrayResource (const std::vector< T > &val) | |
BasicArrayResource (const std::vector< T > &val, const std::string &name) | |
BasicArrayResource (const std::vector< T > &val, const std::string &name, const std::string &fileName) | |
virtual bool | Load (std::istream &in) |
virtual bool | Save (std::ostream &out) |
virtual bool | Load (const std::string &fn) |
virtual bool | Load () |
virtual bool | Save (const std::string &fn) |
virtual bool | Save () |
virtual bool | Load (AnyCollection &c) |
virtual bool | Save (AnyCollection &c) |
virtual const char * | Type () const |
virtual ResourceBase * | Make () |
virtual ResourceBase * | Copy () |
virtual std::vector< std::string > | SubTypes () const |
Returns a list of subtypes that will be produced in Unpack. | |
virtual bool | Extract (const char *subtype, std::vector< ResourcePtr > &subobjects) |
virtual bool | Pack (std::vector< ResourcePtr > &subobjects, std::string *errorMessage=NULL) |
virtual bool | Unpack (std::vector< ResourcePtr > &subobjects, bool *incomplete=NULL) |
template<> | |
bool | Load (std::istream &in) |
template<> | |
bool | Save (std::ostream &out) |
Public Member Functions inherited from CompoundResourceBase | |
CompoundResourceBase (const std::string &name) | |
CompoundResourceBase (const std::string &name, const std::string &fileName) | |
virtual std::vector< std::string > | CastTypes () const |
Returns a list of subtypes that can be used in Cast. | |
virtual std::vector< std::string > | ExtractTypes () const |
Returns a list of subtypes that can be used in Extract. | |
virtual ResourcePtr | Cast (const char *type) |
Public Member Functions inherited from ResourceBase | |
ResourceBase (const std::string &name) | |
ResourceBase (const std::string &name, const std::string &fn) | |
virtual bool | Load (TiXmlElement *in) |
virtual bool | Save (TiXmlElement *out) |
Public Attributes | |
std::vector< T > | data |
Public Attributes inherited from ResourceBase | |
std::string | name |
std::string | fileName |
A basic array data type.
Assumes the data type has std::ostream << and std::istream >> overloads.
|
inlinevirtual |
Make a ResourceBase that copies all the contents of this. (Copying the name and fileName are optional)
Reimplemented from ResourceBase.
|
inlinevirtual |
Extracts all items of the given subtype. Default uses Unpack to find objects of the right type.
Reimplemented from CompoundResourceBase.
|
inlinevirtual |
Make a ResourceBase of the same dynamic type as this. ResourceBase instances are their own factories.
Reimplemented from ResourceBase.
|
inlinevirtual |
Creates the object of out of the given resources, returning true if successful. If unsuccessful, the error message may be set to an informative description of the error.
Reimplemented from CompoundResourceBase.
|
inlinevirtual |
A unique type string used for type indexing and xml output, only alphanumeric characters allowed.
Reimplemented from ResourceBase.
|
inlinevirtual |
Creates a list of sub-objects that describe the given resource. If the decomposition succeeded, returns true If the decomposition succeeded but is incomplete, the flag incomplete is set to true (if non-null). Here "incomplete" means that calling Pack on the return array may NOT produce an exact copy of r.
Reimplemented from CompoundResourceBase.