#include <libsswf.h>
Inheritance diagram for sswf::ActionPushData:
Public Member Functions | |
ActionPushData (TagBase *tag) | |
The PushData constructor initialize an ActionPushData object. | |
void | AddBoolean (bool value) |
Add a boolean value to the ActionPushData. | |
void | AddDouble (double value) |
Add a floating point to the ActionPushData. | |
void | AddEmptyString (void) |
Add an empty string on the stack. | |
void | AddFalse (void) |
Add the boolean value False. | |
void | AddFloat (float value) |
Add a floating point value to the ActionPushData. | |
void | AddInteger (long value) |
Add an integer to the ActionPushData. | |
void | AddLookup (unsigned short index) |
Add a string from the dictionary. | |
void | AddNull (void) |
Add the special value NULL to the ActionPushData. | |
void | AddRegister (unsigned char reg_index) |
Add the content of a register. | |
void | AddString (const char *string) |
Add a string to the ActionPushData. | |
void | AddTrue (void) |
Add the boolean value True. | |
void | AddUndefined (void) |
Add the undefined value to the ActionPushData. | |
Private Types | |
ACTION_IMMEDIATE_TYPE_BOOLEAN = 0x05 | |
ACTION_IMMEDIATE_TYPE_DOUBLE = 0x06 | |
ACTION_IMMEDIATE_TYPE_FLOAT = 0x01 | |
ACTION_IMMEDIATE_TYPE_INTEGER = 0x07 | |
ACTION_IMMEDIATE_TYPE_LOOKUP = 0x08 | |
ACTION_IMMEDIATE_TYPE_LOOKUP_LARGE = 0x09 | |
ACTION_IMMEDIATE_TYPE_NULL = 0x02 | |
ACTION_IMMEDIATE_TYPE_REGISTER = 0x04 | |
ACTION_IMMEDIATE_TYPE_STRING = 0x00 | |
enum | action_immediate_type_t { ACTION_IMMEDIATE_TYPE_UNKNOWN = -1, ACTION_IMMEDIATE_TYPE_STRING = 0x00, ACTION_IMMEDIATE_TYPE_FLOAT = 0x01, ACTION_IMMEDIATE_TYPE_NULL = 0x02, ACTION_IMMEDIATE_TYPE_UNDEFINED = 0x03, ACTION_IMMEDIATE_TYPE_REGISTER = 0x04, ACTION_IMMEDIATE_TYPE_BOOLEAN = 0x05, ACTION_IMMEDIATE_TYPE_DOUBLE = 0x06, ACTION_IMMEDIATE_TYPE_INTEGER = 0x07, ACTION_IMMEDIATE_TYPE_LOOKUP = 0x08, ACTION_IMMEDIATE_TYPE_LOOKUP_LARGE = 0x09 } |
ACTION_IMMEDIATE_TYPE_UNDEFINED = 0x03 | |
ACTION_IMMEDIATE_TYPE_UNKNOWN = -1 | |
Private Member Functions | |
virtual Action * | Duplicate (void) const |
Duplicate an ActionPushData. | |
virtual int | GetMaxRegister (void) const |
Search the action for registers and return the largest number. | |
virtual ErrorManager::error_code_t | SaveData (Data &data, Data &nested_data) |
Save the ActionPushData data. | |
Private Attributes | |
Vectors | f_data |
Classes | |
struct | action_immediate_t |
One data entry of a PushData action. More... |
enum sswf::ActionPushData::action_immediate_type_t [private] |
ActionPushData::ActionPushData | ( | TagBase * | tag | ) |
The ActionPushData constructor expects a valid parent tag (a TagHeader or a TagSprite.) Call the Add functions to add the different values necessary on the stack.
[in] | tag | The tag in which this action is inserted |
void ActionPushData::AddBoolean | ( | bool | value | ) |
This function adds a boolean value (true or false) to the ActionPushData. Note that it is a good idea to use a boolean value for an ACTION_BRANCH_IF_TRUE byte code. However, this is very similar to an integer or even a float.
[in] | value | The boolean value (true or false) |
void ActionPushData::AddDouble | ( | double | value | ) |
This function adds a 64 bits floating point value to the ActionPushData object
[in] | value | The 64 bits floating point value |
sswf::ActionPushData::AddEmptyString | ( | void | ) | [inline] |
sswf::ActionPushData::AddFalse | ( | void | ) | [inline] |
void ActionPushData::AddFloat | ( | float | value | ) |
This function adds a 32 bits floating point to the ActionPushData object.
[in] | value | A 32 bits floating point value |
void ActionPushData::AddInteger | ( | long | value | ) |
void ActionPushData::AddLookup | ( | unsigned short | index | ) |
This function adds a string to the ActionPushData object. The index is the string index in this ActionScript dictionary.
Don't forget that you can have only one dictionary within one tag.
[in] | index | The index of the string to be added on the stack |
void ActionPushData::AddNull | ( | void | ) |
This function is used to add the special value NULL to an ActionPushData. This value is also called Nil in some ActionScripts. It represents a "no object reference".
void ActionPushData::AddRegister | ( | unsigned char | reg_index | ) |
This function adds the content of the specified register. This is particularly useful for version 7+ functions which can save all their parameters in registers. Then you avoid an ActionGetVariable.
The register index is limited to 0, 1, 2 and 3 for the main script and any scripts before version 7. Since version 7, registers can be set from 0 to 254 within a function 2 declaration.
[in] | reg_index | The index of the register to read |
void ActionPushData::AddString | ( | const char * | string | ) |
This function adds a string to the action.
[in] | string | The string to add to the action |
sswf::ActionPushData::AddTrue | ( | void | ) | [inline] |
void ActionPushData::AddUndefined | ( | void | ) |
This function is used to add the special value Undefined to an ActionPushData. This is value is used to test whether some object, function, variable is defined or not.
It can also be used to pass as a parameter to a function which requires a parameter you cannot define.
Action * ActionPushData::Duplicate | ( | void | ) | const [private, virtual] |
This function creates a new ActionPushData object and copies 'this' ActionPushData in it.
The function copies all the data which was added to the ActionPushData.
Reimplemented from sswf::Action.
int ActionPushData::GetMaxRegister | ( | void | ) | const [private, virtual] |
This function defines what the largest register is in this ActionPushData.
Reimplemented from sswf::Action.
ErrorManager::error_code_t ActionPushData::SaveData | ( | Data & | data, | |
Data & | nested_data | |||
) | [private, virtual] |
This function is used to save the actual data of the ActionPushData in the Data buffer.
[in] | data | The Data buffer where the ActionPushData is saved |
[in] | nested_data | There is no nested data in an ActionPushData |
Reimplemented from sswf::Action.
Vectors sswf::ActionPushData::f_data [private] |