KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
ResourceLibraryResource Class Reference

A resource that contains a ResourceLibrary. Useful for hierarchical resource libraries. More...

#include <ResourceLibrary.h>

Inheritance diagram for ResourceLibraryResource:
CompoundResourceBase ResourceBase

Public Member Functions

virtual bool Load (const std::string &fn)
 
virtual bool Save (const std::string &fn)
 
virtual bool Load (AnyCollection &c)
 
virtual bool Save (AnyCollection &c)
 
virtual const char * Type () const
 
virtual ResourceBaseMake ()
 
virtual ResourceBaseCopy ()
 
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)
 
- 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 ()
 
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)
 

Public Attributes

ResourceLibrary library
 
- Public Attributes inherited from ResourceBase
std::string name
 
std::string fileName
 

Detailed Description

A resource that contains a ResourceLibrary. Useful for hierarchical resource libraries.

Member Function Documentation

ResourceBase * ResourceLibraryResource::Copy ( )
virtual

Make a ResourceBase that copies all the contents of this. (Copying the name and fileName are optional)

Reimplemented from ResourceBase.

bool ResourceLibraryResource::Extract ( const char *  subtype,
std::vector< ResourcePtr > &  subobjects 
)
virtual

Extracts all items of the given subtype. Default uses Unpack to find objects of the right type.

Reimplemented from CompoundResourceBase.

virtual ResourceBase* ResourceLibraryResource::Make ( )
inlinevirtual

Make a ResourceBase of the same dynamic type as this. ResourceBase instances are their own factories.

Reimplemented from ResourceBase.

References ResourceBase::Copy().

bool ResourceLibraryResource::Pack ( std::vector< ResourcePtr > &  subobjects,
std::string *  errorMessage = NULL 
)
virtual

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.

virtual const char* ResourceLibraryResource::Type ( ) const
inlinevirtual

A unique type string used for type indexing and xml output, only alphanumeric characters allowed.

Reimplemented from ResourceBase.

bool ResourceLibraryResource::Unpack ( std::vector< ResourcePtr > &  subobjects,
bool *  incomplete = NULL 
)
virtual

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.


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