libHSPlasma
|
Stores the contents of a Creatable without actually parsing it. More...
#include <plCreatable.h>
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 |
![]() | |
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 *) |
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.
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 |
|
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.
size_t plCreatableStub::getLength | ( | ) | const |
Returns the size of the creatable's data buffer
|
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.
|
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 |
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 |
Read this creatable from a PRC tag. If any keys are parsed, they will be added to the plResManager automatically.
Reimplemented from plCreatable.
|
virtual |
Writes this creatable to a PRC document.
Reimplemented from plCreatable.
|
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 |
Writes this creatable directly to the stream. The plResManager is used to manage any key references written by this creatable.
Reimplemented from plCreatable.