xoreos
0.0.5
|
An action script variable. More...
#include <variable.h>
Public Member Functions | |
Variable () | |
Variable (const Common::UString &value) | |
Variable (const char *value) | |
Variable (Object *value) | |
Variable (double value) | |
Variable (unsigned int value) | |
Variable (unsigned long value) | |
Variable (bool value) | |
Variable (ObjectPtr value) | |
Variable (const Variable &variable) | |
~Variable () | |
bool | isUndefined () const |
bool | isObject () const |
bool | isString () const |
bool | isNumber () const |
bool | isFunction () const |
double | asNumber () const |
ObjectPtr | asObject () |
const Common::UString & | asString () const |
bool | asBoolean () const |
template<typename T > | |
boost::shared_ptr< T > | as () const |
void | operator= (Variable v) |
bool | operator! () |
Variable | operator && (Variable v) |
Variable | operator|| (Variable v) |
Variable | operator== (Variable v) |
Variable | operator< (Variable v) |
Variable | operator- (Variable v) |
Variable | operator+ (Variable v) |
Variable | operator* (Variable v) |
Variable | operator/ (Variable v) |
Variable | operator++ () |
Static Public Member Functions | |
static Variable | Null () |
Private Attributes | |
Type | _type |
struct { | |
ObjectPtr object | |
double number | |
bool boolean | |
Common::UString string | |
} | _value |
An action script variable.
Definition at line 44 of file variable.h.
Aurora::ActionScript::Variable::Variable | ( | ) |
Definition at line 39 of file variable.cpp.
Aurora::ActionScript::Variable::Variable | ( | const Common::UString & | value | ) |
Definition at line 42 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | const char * | value | ) |
Definition at line 46 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | Object * | value | ) |
Definition at line 50 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | double | value | ) |
Definition at line 54 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | unsigned int | value | ) |
Definition at line 58 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | unsigned long | value | ) |
Definition at line 62 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | bool | value | ) |
Definition at line 66 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | ObjectPtr | value | ) |
Definition at line 70 of file variable.cpp.
References _value.
Aurora::ActionScript::Variable::Variable | ( | const Variable & | variable | ) |
Definition at line 74 of file variable.cpp.
References _type, _value, boolean, Aurora::ActionScript::kTypeBoolean, Aurora::ActionScript::kTypeNumber, Aurora::ActionScript::kTypeObject, Aurora::ActionScript::kTypeString, number, object, and string.
Aurora::ActionScript::Variable::~Variable | ( | ) |
Definition at line 95 of file variable.cpp.
boost::shared_ptr< T > Aurora::ActionScript::Variable::as | ( | ) | const |
Definition at line 105 of file variable.h.
References _value.
Referenced by Aurora::ActionScript::as_pop(), and Aurora::ActionScript::as_push().
bool Aurora::ActionScript::Variable::asBoolean | ( | ) | const |
Definition at line 141 of file variable.cpp.
References _type, _value, Aurora::ActionScript::kTypeBoolean, Aurora::ActionScript::kTypeNumber, and Aurora::ActionScript::kTypeObject.
Referenced by Aurora::ActionScript::ASBuffer::actionIf().
double Aurora::ActionScript::Variable::asNumber | ( | ) | const |
Definition at line 118 of file variable.cpp.
References _type, _value, Aurora::ActionScript::kTypeBoolean, and Aurora::ActionScript::kTypeNumber.
Referenced by Aurora::ActionScript::ASBuffer::actionInitArray(), operator*(), operator+(), operator++(), operator-(), operator/(), operator<(), and operator||().
ObjectPtr Aurora::ActionScript::Variable::asObject | ( | ) |
Definition at line 129 of file variable.cpp.
References _type, _value, Aurora::ActionScript::kTypeObject, and Aurora::ActionScript::kTypeUndefined.
Referenced by Aurora::ActionScript::ASBuffer::actionGetMember(), Aurora::ActionScript::ASBuffer::actionGetVariable(), Aurora::ActionScript::Object::call(), and Aurora::ActionScript::AVM::createNewObject().
const Common::UString & Aurora::ActionScript::Variable::asString | ( | ) | const |
Definition at line 137 of file variable.cpp.
References _value.
Referenced by Aurora::ActionScript::ASBuffer::actionDefineLocal(), Aurora::ActionScript::ASBuffer::actionGetURL(), and Aurora::ActionScript::AVM::registerClass().
bool Aurora::ActionScript::Variable::isFunction | ( | ) | const |
Definition at line 114 of file variable.cpp.
References _type, _value, and Aurora::ActionScript::kTypeObject.
Referenced by Aurora::ActionScript::AVM::createNewObject().
bool Aurora::ActionScript::Variable::isNumber | ( | ) | const |
Definition at line 110 of file variable.cpp.
References _type, and Aurora::ActionScript::kTypeNumber.
Referenced by Aurora::ActionScript::ASBuffer::actionInitArray().
bool Aurora::ActionScript::Variable::isObject | ( | ) | const |
Definition at line 102 of file variable.cpp.
References _type, and Aurora::ActionScript::kTypeObject.
bool Aurora::ActionScript::Variable::isString | ( | ) | const |
Definition at line 106 of file variable.cpp.
References _type, and Aurora::ActionScript::kTypeString.
Referenced by Aurora::ActionScript::ASBuffer::actionDefineLocal(), Aurora::ActionScript::ASBuffer::actionGetURL(), and Aurora::ActionScript::AVM::registerClass().
bool Aurora::ActionScript::Variable::isUndefined | ( | ) | const |
Definition at line 98 of file variable.cpp.
References _type, and Aurora::ActionScript::kTypeUndefined.
Referenced by Aurora::ActionScript::ASBuffer::actionCallMethod().
|
static |
Definition at line 33 of file variable.cpp.
References _type, and Aurora::ActionScript::kTypeNull.
Referenced by Aurora::ActionScript::ASBuffer::actionEnumerate2(), and Aurora::ActionScript::ASBuffer::actionPush().
bool Aurora::ActionScript::Variable::operator! | ( | ) |
Definition at line 172 of file variable.cpp.
References _type, _value, Aurora::ActionScript::kTypeBoolean, and Aurora::ActionScript::kTypeNumber.
Definition at line 232 of file variable.cpp.
References asNumber().
Definition at line 225 of file variable.cpp.
References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.
Variable Aurora::ActionScript::Variable::operator++ | ( | ) |
Definition at line 240 of file variable.cpp.
References asNumber().
Definition at line 218 of file variable.cpp.
References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.
Definition at line 236 of file variable.cpp.
References asNumber().
Definition at line 211 of file variable.cpp.
References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.
void Aurora::ActionScript::Variable::operator= | ( | Variable | v | ) |
Definition at line 152 of file variable.cpp.
References _type, _value, boolean, Aurora::ActionScript::kTypeBoolean, Aurora::ActionScript::kTypeNumber, Aurora::ActionScript::kTypeObject, Aurora::ActionScript::kTypeString, number, object, and string.
Definition at line 197 of file variable.cpp.
References _type, _value, Aurora::ActionScript::kTypeNull, Aurora::ActionScript::kTypeNumber, and number.
Definition at line 190 of file variable.cpp.
References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.
|
private |
Definition at line 93 of file variable.h.
Referenced by asBoolean(), asNumber(), asObject(), isFunction(), isNumber(), isObject(), isString(), isUndefined(), Null(), operator!(), operator+(), operator-(), operator<(), operator=(), operator==(), operator||(), and Variable().
struct { ... } Aurora::ActionScript::Variable::_value |
Referenced by as(), asBoolean(), asNumber(), asObject(), asString(), isFunction(), operator!(), operator=(), operator==(), and Variable().
bool Aurora::ActionScript::Variable::boolean |
Definition at line 99 of file variable.h.
Referenced by operator=(), and Variable().
double Aurora::ActionScript::Variable::number |
Definition at line 98 of file variable.h.
Referenced by operator=(), operator==(), and Variable().
ObjectPtr Aurora::ActionScript::Variable::object |
Definition at line 96 of file variable.h.
Referenced by operator=(), and Variable().
Common::UString Aurora::ActionScript::Variable::string |
Definition at line 101 of file variable.h.
Referenced by operator=(), and Variable().