sswf::TagBinaryData Class Reference

Binary data reusable by the ActionScripts. More...

#include <libsswf.h>

Inheritance diagram for sswf::TagBinaryData:

sswf::TagBaseID sswf::TagBase sswf::MemoryManager List of all members.

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 PreSave (void)
 This tag appeared in version 9 of SWF.

Private Attributes

char * f_data
size_t f_size

Detailed Description

This tag supports any type of binary data that the ActionScripts may need at some point.

The data is identifier with an ID like other objects, for later reference.

See also:
SWF Alexis' Reference—Binary Data

SWF Alexis' Reference—swf_tag


Constructor & Destructor Documentation

TagBinaryData::TagBinaryData ( TagBase parent  ) 

By default, the TagBinaryData is empty.

Parameters:
[in] parent a TagHeader tag

TagBinaryData::~TagBinaryData (  )  [virtual]

This function cleans up the Binary Data tag objects.


Member Function Documentation

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.

Warning:
If the size is zero, the pointer will be NULL. This is a valid case that you must be prepared to manage.
Parameters:
[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
Bug:
Do NOT free the memory buffer returned to you. The TagBinaryData is responsible for that task. If you want to free the buffer, call the SetData() function with a size of zero and any data pointer.
Bug:
Also, do NOT use the pointer and size returned by this function after calling the SetData() function since the buffer is likely to move.
See also:
void sswf::TagBinaryData::SetData(const char *data, size_t size)

ErrorManager::error_code_t TagBinaryData::PreSave ( void   )  [private, virtual]

Tells the TagHeader that a version 9+ movie is required.

Returns:
ErrorManager::ERROR_CODE_NONE or some other ErrorManager error

Reimplemented from sswf::TagBase.

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.

Parameters:
[in,out] data The Data buffer where the result is saved
Returns:
And sswf::ErrorManager error (ErrorManager::ERROR_CODE_NONE when no errors)

Implements sswf::TagBase.

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.

Parameters:
[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
See also:
void sswf::TagBinaryData::GetData(const char *& data, size_t& size)

TagBase::swf_type_t TagBinaryData::TypeFlags ( void   )  const [virtual]

The TagProductInfo is a DEFINE type.

Returns:
SWF_TYPE_DEFINE
See also:
TagBase::swf_type_t sswf::TagBase::TypeFlags(void) const

Implements sswf::TagBase.


Member Data Documentation

char* sswf::TagBinaryData::f_data [private]

size_t sswf::TagBinaryData::f_size [private]


The documentation for this class was generated from the following files:
Generated on Tue Jun 26 02:36:45 2007 for libsswf by  doxygen 1.4.7