Cocos2d-x  v3.17
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
LuaValue Class Reference

Wrap different general types of data into a same specific type named LuaValue. More...

Public Member Functions

 LuaValue (void)
 Default constructor of LuaValue. More...
 
 LuaValue (const LuaValue &rhs)
 Copy constructor of Data.
 
LuaValueoperator= (const LuaValue &rhs)
 Override of operator= .
 
 ~LuaValue (void)
 Destructor.
 
LuaValueType getType () const
 Get the type of LuaValue object. More...
 
const std::string & getObjectTypename (void) const
 Get the typename of the Ref object. More...
 
int intValue (void) const
 Get the int value of LuaValue object. More...
 
float floatValue (void) const
 Get the float value of LuaValue object. More...
 
bool booleanValue (void) const
 Get the boolean value of LuaValue object. More...
 
const std::string & stringValue (void) const
 Get the boolean value of LuaValue object. More...
 
const LuaValueDict & dictValue (void) const
 Get the LuaValueDict value of LuaValue object. More...
 
const LuaValueArray & arrayValue (void) const
 Get the LuaValueArray value of LuaValue object. More...
 
RefccobjectValue (void) const
 Get the Ref object of LuaValue object. More...
 

Static Public Member Functions

static const LuaValue intValue (const int intValue)
 Construct a LuaValue object by a int value. More...
 
static const LuaValue floatValue (const float floatValue)
 Construct a LuaValue object by a float value. More...
 
static const LuaValue booleanValue (const bool booleanValue)
 Construct a LuaValue object by a boolean value. More...
 
static const LuaValue stringValue (const char *stringValue)
 Construct a LuaValue object by a string pointer. More...
 
static const LuaValue stringValue (const std::string &stringValue)
 Construct a LuaValue object by a std::string object. More...
 
static const LuaValue dictValue (const LuaValueDict &dictValue)
 Construct a LuaValue object by a LuaValueDict value. More...
 
static const LuaValue arrayValue (const LuaValueArray &arrayValue)
 Construct a LuaValue object by a LuaValueArray value. More...
 
static const LuaValue ccobjectValue (Ref *ccobjectValue, const char *objectTypename)
 Construct a LuaValue object by a Ref object. More...
 
static const LuaValue ccobjectValue (Ref *ccobjectValue, const std::string &objectTypename)
 Construct a LuaValue object by a Ref object. More...
 

Detailed Description

Wrap different general types of data into a same specific type named LuaValue.

The general types supported as follows:int,float,bool,std::string,const char*,LuaValueDict,LuaValueArray,Ref.

Constructor & Destructor Documentation

LuaValue ( void  )
inline

Default constructor of LuaValue.

Set the default value for _type(LuaValueTypeInt) and _ccobjectType(nullptr),and init the _field.

Member Function Documentation

static const LuaValue intValue ( const int  intValue)
static

Construct a LuaValue object by a int value.

Parameters
intValuea int value.
Returns
a LuaValue object.
static const LuaValue floatValue ( const float  floatValue)
static

Construct a LuaValue object by a float value.

Parameters
floatValuea float value.
Returns
a LuaValue object.
static const LuaValue booleanValue ( const bool  booleanValue)
static

Construct a LuaValue object by a boolean value.

Parameters
booleanValuea bool value.
Returns
a LuaValue object.
static const LuaValue stringValue ( const char *  stringValue)
static

Construct a LuaValue object by a string pointer.

Parameters
stringValuea string pointer.
Returns
a LuaValue object.
static const LuaValue stringValue ( const std::string &  stringValue)
static

Construct a LuaValue object by a std::string object.

Parameters
stringValuea std::string object.
Returns
a LuaValue object.
static const LuaValue dictValue ( const LuaValueDict &  dictValue)
static

Construct a LuaValue object by a LuaValueDict value.

Parameters
dictValuea LuaValueDict object.
Returns
a LuaValue object.
static const LuaValue arrayValue ( const LuaValueArray &  arrayValue)
static

Construct a LuaValue object by a LuaValueArray value.

Parameters
arrayValuea LuaValueArray object.
Returns
a LuaValue object.
static const LuaValue ccobjectValue ( Ref ccobjectValue,
const char *  objectTypename 
)
static

Construct a LuaValue object by a Ref object.

Parameters
ccobjectValuea Ref object.
objectTypenamea string pointer point to the typename of object.
Returns
a LuaValue object.
static const LuaValue ccobjectValue ( Ref ccobjectValue,
const std::string &  objectTypename 
)
static

Construct a LuaValue object by a Ref object.

Parameters
ccobjectValuea Ref object.
objectTypenamea std::string object represent the typename of object.
Returns
a LuaValue object.
LuaValueType getType ( ) const
inline

Get the type of LuaValue object.

Returns
the type of LuaValue object.
const std::string&
getObjectTypename
( void  ) const
inline

Get the typename of the Ref object.

Returns
the reference of _ccobjectType.
int intValue ( void  ) const
inline

Get the int value of LuaValue object.

Returns
the int value.
float floatValue ( void  ) const
inline

Get the float value of LuaValue object.

Returns
the float value.
bool booleanValue ( void  ) const
inline

Get the boolean value of LuaValue object.

Returns
the boolean value.
const std::string& stringValue ( void  ) const
inline

Get the boolean value of LuaValue object.

Returns
the reference about string value.
const LuaValueDict& dictValue ( void  ) const
inline

Get the LuaValueDict value of LuaValue object.

Returns
the LuaValueDict value.
const LuaValueArray& arrayValue ( void  ) const
inline

Get the LuaValueArray value of LuaValue object.

Returns
the LuaValueArray value.
Ref* ccobjectValue ( void  ) const
inline

Get the Ref object of LuaValue object.

Returns
the pointer point to a Ref object.

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