#include <libsswf.h>
Public Member Functions | |
void | GetData (const char *&data, size_t &size) const |
Retrieve the current data. | |
virtual ErrorManager::error_code_t | Save (Data &data) |
Save the binary data tag in the Data buffer. | |
void | SetData (const char *data, size_t size) |
Save the specified data in the tag. | |
TagBinaryData (TagBase *parent) | |
Initializes the TagBinaryData. | |
virtual swf_type_t | TypeFlags (void) const |
The type of this tag. | |
virtual | ~TagBinaryData () |
Cleanup the TagBinaryData. | |
Private Member Functions | |
virtual ErrorManager::error_code_t | ParseTag (swf_tag_t tag, const Data &data) |
Parse data from a file into a BinaryData tag. | |
virtual ErrorManager::error_code_t | PreSave (void) |
This tag appeared in version 9 of SWF. | |
Private Attributes | |
char * | f_data |
size_t | f_size |
The data is identifier with an ID like other objects, for later reference.
TagBinaryData::TagBinaryData | ( | TagBase * | parent | ) |
TagBinaryData::~TagBinaryData | ( | ) | [virtual] |
This function cleans up the Binary Data tag objects.
void TagBinaryData::GetData | ( | const char *& | data, | |
size_t & | size | |||
) | const |
This function retreives a direct reference pointer to the internal buffer of the Binary Data tag and its size.
[out] | data | A reference to a pointer where the tag buffer pointer is saved |
[out] | size | A reference to a size_t variable to receive the size |
ErrorManager::error_code_t TagBinaryData::ParseTag | ( | swf_tag_t | tag, | |
const Data & | data | |||
) | [private, virtual] |
This function reads the data associated with this binary data object.
[in] | tag | The tag that generated this call |
[in] | data | The Data buffer from the Flash file being loaded |
Implements sswf::TagBase.
References sswf::Data::ByteSize(), sswf::ErrorManager::ERROR_CODE_NONE, f_data, f_size, sswf::Data::GetLong(), sswf::MemoryManager::MemRealloc(), sswf::TagBaseID::ParseID(), and sswf::Data::ReadBytes().
ErrorManager::error_code_t TagBinaryData::PreSave | ( | void | ) | [private, virtual] |
Tells the TagHeader that a version 9+ movie is required.
Reimplemented from sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_NONE, and sswf::TagBase::MinimumVersion().
ErrorManager::error_code_t TagBinaryData::Save | ( | Data & | data | ) | [virtual] |
This function saves the Binary Data tag in the specified Data buffer. The tag must have an identifier for later reference.
[in,out] | data | The Data buffer where the result is saved |
Implements sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_NONE, f_data, f_size, sswf::Data::PutLong(), sswf::TagBaseID::SaveID(), sswf::TagBase::SaveTag(), sswf::TagBase::SWF_TAG_DEFINE_BINARY_DATA, and sswf::Data::Write().
void TagBinaryData::SetData | ( | const char * | data, | |
size_t | size | |||
) |
This function makes a copy of the specified data in this tag. Later, it is saved in the SWF animation with the Save() function.
A size of zero is valid.
[in] | data | A valid pointer to the data to save in the tag |
[in] | size | The number of bytes of data to save in the tag |
References f_data, f_size, sswf::MemoryManager::MemAlloc(), and sswf::MemoryManager::MemFree().
TagBase::swf_type_t TagBinaryData::TypeFlags | ( | void | ) | const [virtual] |
The TagProductInfo is a DEFINE type.
Implements sswf::TagBase.
References SWF_TYPE_DEFINE.
char* sswf::TagBinaryData::f_data [private] |
Referenced by GetData(), ParseTag(), Save(), SetData(), and TagBinaryData().
size_t sswf::TagBinaryData::f_size [private] |
Referenced by GetData(), ParseTag(), Save(), SetData(), and TagBinaryData().