xoreos  0.0.5
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Aurora::ActionScript::Variable Class Reference

An action script variable. More...

#include <variable.h>

Collaboration diagram for Aurora::ActionScript::Variable:
Collaboration graph
[legend]

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::UStringasString () 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
 

Detailed Description

An action script variable.

Definition at line 44 of file variable.h.

Constructor & Destructor Documentation

◆ Variable() [1/10]

Aurora::ActionScript::Variable::Variable ( )

Definition at line 39 of file variable.cpp.

◆ Variable() [2/10]

Aurora::ActionScript::Variable::Variable ( const Common::UString value)

Definition at line 42 of file variable.cpp.

References _value.

◆ Variable() [3/10]

Aurora::ActionScript::Variable::Variable ( const char *  value)

Definition at line 46 of file variable.cpp.

References _value.

◆ Variable() [4/10]

Aurora::ActionScript::Variable::Variable ( Object value)

Definition at line 50 of file variable.cpp.

References _value.

◆ Variable() [5/10]

Aurora::ActionScript::Variable::Variable ( double  value)

Definition at line 54 of file variable.cpp.

References _value.

◆ Variable() [6/10]

Aurora::ActionScript::Variable::Variable ( unsigned int  value)

Definition at line 58 of file variable.cpp.

References _value.

◆ Variable() [7/10]

Aurora::ActionScript::Variable::Variable ( unsigned long  value)

Definition at line 62 of file variable.cpp.

References _value.

◆ Variable() [8/10]

Aurora::ActionScript::Variable::Variable ( bool  value)

Definition at line 66 of file variable.cpp.

References _value.

◆ Variable() [9/10]

Aurora::ActionScript::Variable::Variable ( ObjectPtr  value)

Definition at line 70 of file variable.cpp.

References _value.

◆ Variable() [10/10]

Aurora::ActionScript::Variable::Variable ( const Variable variable)

◆ ~Variable()

Aurora::ActionScript::Variable::~Variable ( )

Definition at line 95 of file variable.cpp.

Member Function Documentation

◆ as()

template<typename T >
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().

Here is the caller graph for this function:

◆ asBoolean()

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().

Here is the caller graph for this function:

◆ asNumber()

double Aurora::ActionScript::Variable::asNumber ( ) const

◆ asObject()

ObjectPtr Aurora::ActionScript::Variable::asObject ( )

◆ asString()

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().

Here is the caller graph for this function:

◆ isFunction()

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().

Here is the caller graph for this function:

◆ isNumber()

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().

Here is the caller graph for this function:

◆ isObject()

bool Aurora::ActionScript::Variable::isObject ( ) const

Definition at line 102 of file variable.cpp.

References _type, and Aurora::ActionScript::kTypeObject.

◆ isString()

bool Aurora::ActionScript::Variable::isString ( ) const

◆ isUndefined()

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().

Here is the caller graph for this function:

◆ Null()

Variable Aurora::ActionScript::Variable::Null ( )
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().

Here is the caller graph for this function:

◆ operator &&()

Variable Aurora::ActionScript::Variable::operator&& ( Variable  v)

◆ operator!()

bool Aurora::ActionScript::Variable::operator! ( )

◆ operator*()

Variable Aurora::ActionScript::Variable::operator* ( Variable  v)

Definition at line 232 of file variable.cpp.

References asNumber().

Here is the call graph for this function:

◆ operator+()

Variable Aurora::ActionScript::Variable::operator+ ( Variable  v)

Definition at line 225 of file variable.cpp.

References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.

Here is the call graph for this function:

◆ operator++()

Variable Aurora::ActionScript::Variable::operator++ ( )

Definition at line 240 of file variable.cpp.

References asNumber().

Here is the call graph for this function:

◆ operator-()

Variable Aurora::ActionScript::Variable::operator- ( Variable  v)

Definition at line 218 of file variable.cpp.

References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.

Here is the call graph for this function:

◆ operator/()

Variable Aurora::ActionScript::Variable::operator/ ( Variable  v)

Definition at line 236 of file variable.cpp.

References asNumber().

Here is the call graph for this function:

◆ operator<()

Variable Aurora::ActionScript::Variable::operator< ( Variable  v)

Definition at line 211 of file variable.cpp.

References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.

Here is the call graph for this function:

◆ operator=()

void Aurora::ActionScript::Variable::operator= ( Variable  v)

◆ operator==()

Variable Aurora::ActionScript::Variable::operator== ( Variable  v)

◆ operator||()

Variable Aurora::ActionScript::Variable::operator|| ( Variable  v)

Definition at line 190 of file variable.cpp.

References _type, asNumber(), and Aurora::ActionScript::kTypeNumber.

Here is the call graph for this function:

Member Data Documentation

◆ _type

Type Aurora::ActionScript::Variable::_type
private

◆ _value

struct { ... } Aurora::ActionScript::Variable::_value

◆ boolean

bool Aurora::ActionScript::Variable::boolean

Definition at line 99 of file variable.h.

Referenced by operator=(), and Variable().

◆ number

double Aurora::ActionScript::Variable::number

Definition at line 98 of file variable.h.

Referenced by operator=(), operator==(), and Variable().

◆ object

ObjectPtr Aurora::ActionScript::Variable::object

Definition at line 96 of file variable.h.

Referenced by operator=(), and Variable().

◆ string

Common::UString Aurora::ActionScript::Variable::string

Definition at line 101 of file variable.h.

Referenced by operator=(), and Variable().


The documentation for this class was generated from the following files: