#include <libsswf.h>
Public Member Functions | |
bool | HasIdentification (void) const |
Test whether a tag which should have an ID really has one. | |
virtual sswf_id_t | Identification (void) const |
Return this tag identifier. | |
void | NoIdentification (void) |
Release the identification for this tag. | |
ErrorManager::error_code_t | ParseID (const Data &data) |
Read the ID of this object from data. | |
int | SaveID (Data &data) const |
Save the object identifier in a Data buffer. | |
TagBaseID (const char *name, TagBase *parent) | |
Initialize the base information of a tag with an identifier. | |
virtual | ~TagBaseID () |
Destroys the base information of a tag with an identifier. | |
Private Attributes | |
sswf_id_t | f_id |
bool | f_identified |
The TagBaseID class is used to manage the identifiers.
It knows how to allocate a new identifier, how to forfeit an identifier, how to save an identifier.
For instance, a TagSprite derives from the TagBaseID()
TagBaseID::~TagBaseID | ( | ) | [virtual] |
The destructor releases the identification of the object and returns.
References NoIdentification().
TagBaseID::TagBaseID | ( | const char * | name, | |
TagBase * | parent | |||
) |
Tag which include an identifier will be derived from this TagBaseID class.
Whenever created, they are automatically assigned a unique identifier (see the sswf::TagHeader::NextID(void) function).
The TagBaseID is itself derived from the TagBase object. The name and parent parameters are directly passed down to the TagBase constructor.
name | The type of the tag in the form of a string | |
parent | The parent tag (a header or a sprite) |
References sswf::assert(), f_id, f_identified, sswf::TagBase::Header(), sswf::TagHeader::NextID(), and SSWF_ID_NONE.
bool TagBaseID::HasIdentification | ( | void | ) | const |
This function checks whether a tag supposed to have an identifier really has one.
References f_identified.
Referenced by sswf::TagBase::FindID().
sswf_id_t TagBaseID::Identification | ( | void | ) | const [virtual] |
This function returns the identifier which was given to this tag or SSWF_ID_NONE when it was cancelled by a call to TagBaseID::NoIdentification().
References f_id.
Referenced by sswf::TagSprite::Save(), and sswf::TagButton::Save().
void TagBaseID::NoIdentification | ( | void | ) |
It is possible that a tag which usually has an identifier does not actually need it (at this time this is the case only for Glyphs which are shapes without identification.)
This function will release the identification which can then not be used.
Whenever possible, the identifier of this object will be returned to the pool of available identifiers.
References f_id, f_identified, sswf::TagBase::Header(), sswf::TagHeader::RemoveID(), and SSWF_ID_NONE.
Referenced by sswf::TagShape::Glyph(), and ~TagBaseID().
ErrorManager::error_code_t TagBaseID::ParseID | ( | const Data & | data | ) |
This function reads the identifier of this object and saves it in the object.
ReadAlign()
was called on the data
object.[in] | data | Retrieve the object identifier from this data buffer |
References f_id, f_identified, and sswf::Data::GetShort().
Referenced by sswf::TagSprite::ParseTag(), sswf::TagEditText::ParseTag(), sswf::TagCSMTextSettings::ParseTag(), sswf::TagButton::ParseTag(), and sswf::TagBinaryData::ParseTag().
int TagBaseID::SaveID | ( | Data & | data | ) | const |
This function will save the identifier of 'this' tag in the specified Data buffer.
data | The data buffer used to save the tag |
References sswf::assert(), f_id, f_identified, and sswf::Data::PutShort().
Referenced by sswf::TagText::Save(), sswf::TagSprite::Save(), sswf::TagSound::Save(), sswf::TagShape::Save(), sswf::TagImage::Save(), sswf::TagFont::Save(), sswf::TagEditText::Save(), sswf::TagButton::Save(), sswf::TagBinaryData::Save(), and sswf::TagCSMTextSettings::SaveCSMTextSettings().
sswf_id_t sswf::TagBaseID::f_id [private] |
Referenced by Identification(), NoIdentification(), ParseID(), SaveID(), and TagBaseID().
bool sswf::TagBaseID::f_identified [private] |
Referenced by HasIdentification(), NoIdentification(), ParseID(), SaveID(), and TagBaseID().