libHSPlasma
Public Member Functions | Protected Member Functions | List of all members
plCreatableStub Class Reference

Stores the contents of a Creatable without actually parsing it. More...

#include <plCreatable.h>

Inheritance diagram for plCreatableStub:
plCreatable

Public Member Functions

 plCreatableStub ()
 plCreatableStub (short hClass, size_t length)
virtual ~plCreatableStub ()
virtual short ClassIndex () const
virtual bool isStub () const
virtual void read (hsStream *S, plResManager *mgr)
virtual void write (hsStream *S, plResManager *mgr)
virtual void prcWrite (pfPrcHelper *prc)
virtual void prcParse (const pfPrcTag *tag, plResManager *mgr)
const uint8_t * getData () const
size_t getLength () const
- Public Member Functions inherited from plCreatable
 plCreatable ()
virtual ~plCreatable ()
short ClassIndex (PlasmaVer ver) const
virtual const char * ClassName () const
virtual bool ClassInstance (short) const

Protected Member Functions

virtual void IPrcWrite (pfPrcHelper *)
virtual void IPrcParse (const pfPrcTag *, plResManager *)

Detailed Description

Stores the contents of a Creatable without actually parsing it.

This stores a plCreatable (most commonly, one that isn't supported, or one found in an SDL node) as a data buffer that can easily be read or written as a chunk of data, but is not parsed. This can be useful so that files with unsupported classes don't lose information, but can also be harmful, as changes to plKeys stored in the stubbed object will not get updated if they are changed. In general, it's a good idea to use a real Creatable class whenever possible.

See Also
hsKeyedObjectStub

Constructor & Destructor Documentation

plCreatableStub::plCreatableStub ( )

Constructs an empty stub. Only useful for NULL creatables.

plCreatableStub::plCreatableStub ( short  hClass,
size_t  length 
)

Constructs a stub whose type is hClass, and size is length

virtual plCreatableStub::~plCreatableStub ( )
virtual

Member Function Documentation

virtual short plCreatableStub::ClassIndex ( ) const
virtual

Returns the Creatable Class ID for this Creatable. Use the CREATABLE macro to set this automatically in subclasses.

Implements plCreatable.

const uint8_t* plCreatableStub::getData ( ) const

Returns a pointer to the data buffer that contains the creatable's contents.

See Also
getLength()
size_t plCreatableStub::getLength ( ) const

Returns the size of the creatable's data buffer

See Also
getData()
virtual void plCreatableStub::IPrcParse ( const pfPrcTag tag,
plResManager mgr 
)
protectedvirtual

This must be overloaded by subclasses to parse PRC data specific to the class from the PRC document. It is called once for each tag that is a child to the Creatable tag itself, so subclasses should check for each supported tag and handle it accordingly if it matches. If the tag is not recognized, it should be passed along to the parent class.

Reimplemented from plCreatable.

virtual void plCreatableStub::IPrcWrite ( pfPrcHelper prc)
protectedvirtual

This must be overloaded by subclasses to write PRC data specific to the class to the PRC document. Do not write the top-level creatable tag, that is handled by prcWrite().

Implements plCreatable.

virtual bool plCreatableStub::isStub ( ) const
virtual

Returns whether this is really a plCreatableStub. Note that stubs will still report their ClassIndex and ClassName correctly, so you must use this function to determine whether a class is actually a stub or the real class.

Reimplemented from plCreatable.

virtual void plCreatableStub::prcParse ( const pfPrcTag tag,
plResManager mgr 
)
virtual

Read this creatable from a PRC tag. If any keys are parsed, they will be added to the plResManager automatically.

Reimplemented from plCreatable.

virtual void plCreatableStub::prcWrite ( pfPrcHelper prc)
virtual

Writes this creatable to a PRC document.

Reimplemented from plCreatable.

virtual void plCreatableStub::read ( hsStream ,
plResManager  
)
virtual

Reads this creatable directly from the stream. If any keys are read, they will be added to the plResManager automatically.

Reimplemented from plCreatable.

virtual void plCreatableStub::write ( hsStream ,
plResManager  
)
virtual

Writes this creatable directly to the stream. The plResManager is used to manage any key references written by this creatable.

Reimplemented from plCreatable.


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