Project

General

Profile

SO3Engine
Hikari::FlashValue Class Reference

#include <FlashValue.h>

Public Member Functions

 FlashValue ()
 
 FlashValue (bool booleanValue)
 
 FlashValue (int numericValue)
 
 FlashValue (float numericValue)
 
 FlashValue (const char *stringValue)
 
 FlashValue (const std::string &stringValue)
 
 FlashValue (const std::wstring &wstringValue)
 
short getType () const
 
bool isNull () const
 
void setNull ()
 
bool getBool () const
 
float getNumber () const
 
colorValueBase getNumberAsColor () const
 
std::string getString () const
 
std::wstring getWString () const
 

Detailed Description

FlashValue represents a Flash ActionScript variable. The currently supported types are: null, boolean, number, and string.

Definition at line 61 of file FlashValue.h.

Constructor & Destructor Documentation

◆ FlashValue() [1/7]

FlashValue::FlashValue ( )

Creates a null FlashValue.

Definition at line 70 of file FlashValue.cpp.

◆ FlashValue() [2/7]

FlashValue::FlashValue ( bool  booleanValue)

Creates a FlashValue as a boolean type.

Parameters
booleanValueThe value to initialize this FlashValue with.

Definition at line 74 of file FlashValue.cpp.

◆ FlashValue() [3/7]

FlashValue::FlashValue ( int  numericValue)

Creates a FlashValue as a number type.

Parameters
numericValueThe value to initialize this FlashValue with.

Definition at line 78 of file FlashValue.cpp.

◆ FlashValue() [4/7]

FlashValue::FlashValue ( float  numericValue)

Creates a FlashValue as a number type.

Parameters
numericValueThe value to initialize this FlashValue with.

Definition at line 82 of file FlashValue.cpp.

◆ FlashValue() [5/7]

FlashValue::FlashValue ( const char *  stringValue)

Creates a FlashValue as a string type.

Parameters
stringValueThe value to initialize this FlashValue with.

Definition at line 86 of file FlashValue.cpp.

◆ FlashValue() [6/7]

FlashValue::FlashValue ( const std::string &  stringValue)

Creates a FlashValue as a string type.

Parameters
stringValueThe value to initialize this FlashValue with. Creates a FlashValue as a string type.
stringValueThe value to initialize this FlashValue with.

Definition at line 96 of file FlashValue.cpp.

◆ FlashValue() [7/7]

FlashValue::FlashValue ( const std::wstring &  wstringValue)

Creates a FlashValue as a string type.

Parameters
stringValueThe value to initialize this FlashValue with.

Definition at line 100 of file FlashValue.cpp.

Member Function Documentation

◆ getBool()

bool FlashValue::getBool ( ) const

Retrieves the value as a boolean.

Note
If the actual value type is FT_BOOLEAN, this directly retrieves the actual value. Otherwise this function will make an interpretation of the value as that of a boolean. Number values will be cast to boolean and string values will be parsed lexically ("true" and "false" are valid). A value type of null will always return false.

Definition at line 127 of file FlashValue.cpp.

◆ getNumber()

float FlashValue::getNumber ( ) const

Retrieves the value as a number.

Note
If the actual value type is FT_NUMBER, this directly retrieves the actual value. Otherwise this function will make an interpretation of the value as that of a number type. Boolean values will be cast to a number and string values will be parsed lexically. A value type of null will always return '0'.

Definition at line 139 of file FlashValue.cpp.

◆ getNumberAsColor()

colorValueBase FlashValue::getNumberAsColor ( ) const

If this FlashValue is a number type, retrieves the number value interpreted as a color.

Note
Color values in ActionScript are generally encoded as a number, hence this function's utility.

Definition at line 151 of file FlashValue.cpp.

◆ getString()

std::string FlashValue::getString ( ) const

Retrieves the value as a string.

Note
If the actual value type is FT_STRING, this directly retrieves the actual value. Otherwise this function will make an interpretation of the value as that of a string type. Boolean values will either be "true" or "false", number values will be output in standard form, and null value types will always return an empty string.

Definition at line 168 of file FlashValue.cpp.

◆ getType()

short FlashValue::getType ( ) const

Creates a FlashValue as a string type.

Parameters
stringValueThe value to initialize this FlashValue with. Retrieves the FlashType of this FlashValue.

Definition at line 109 of file FlashValue.cpp.

◆ getWString()

std::wstring FlashValue::getWString ( ) const

Definition at line 180 of file FlashValue.cpp.

◆ isNull()

bool FlashValue::isNull ( ) const

Returns whether or not this FlashValue is of a null type.

Definition at line 114 of file FlashValue.cpp.

◆ setNull()

void FlashValue::setNull ( )

Sets this FlashValue as a null type.

Definition at line 119 of file FlashValue.cpp.


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