NuriaProject Framework  0.1
The NuriaProject Framework
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Nuria::LuaValue Class Reference

Stores a value from LUA. More...

#include <luavalue.hpp>

Public Types

enum  Type {
  Nil = 0, Boolean = 1, LightUserData = 2, Number = 3,
  String = 4, Table = 5, Function = 6, UserData = 7,
  Thread = 8
}
 

Public Member Functions

 LuaValue ()
 
 LuaValue (const LuaValue &other)
 
 LuaValue (const LuaObject &object)
 
 LuaValue (LuaRuntime *runtime, const QVariant &variant)
 
 ~LuaValue ()
 
bool isValid () const
 
LuaObject object () const
 
LuaValueoperator= (const LuaValue &other)
 
LuaRuntimeruntime () const
 
QVariant toVariant () const
 
Type type () const
 

Static Public Member Functions

static LuaValue fromStack (LuaRuntime *runtime, int idx)
 
static Type qtTypeToLua (int type)
 

Friends

class LuaMetaObject
 
class LuaMetaObjectWrapper
 
class LuaObject
 
class LuaRuntime
 
class LuaStackUtils
 

Detailed Description

Stores a value from LUA.

Member Enumeration Documentation

LUA types.

Constructor & Destructor Documentation

Nuria::LuaValue::LuaValue ( )

Constructs a invalid instance.

Nuria::LuaValue::LuaValue ( const LuaValue other)

Copy constructor.

Nuria::LuaValue::LuaValue ( const LuaObject object)

Constructs a value out of a LuaObject.

Nuria::LuaValue::LuaValue ( LuaRuntime runtime,
const QVariant &  variant 
)

Constructs a LuaValue out of a QVariant.

Nuria::LuaValue::~LuaValue ( )

Destructor.

Member Function Documentation

static LuaValue Nuria::LuaValue::fromStack ( LuaRuntime runtime,
int  idx 
)
static

Constructs a instance from the value at stack idx of runtime.

Note
This method is intended for internal use.
bool Nuria::LuaValue::isValid ( ) const

Returns true if this instance is valid.

LuaObject Nuria::LuaValue::object ( ) const

Returns the LuaObject if this value is a LUA user-data pointing to a type with a Nuria::MetaObject. If this isn't an object, the returned instance is invalid.

LuaValue& Nuria::LuaValue::operator= ( const LuaValue other)

Assignment operator.

static Type Nuria::LuaValue::qtTypeToLua ( int  type)
static

Returns the LUA type that'd be used to represent type. If there's no known way to store type in LUA, Nil is returned.

LuaRuntime* Nuria::LuaValue::runtime ( ) const

Returns the associated LUA runtime.

QVariant Nuria::LuaValue::toVariant ( ) const

Converts the value into a QVariant.

Type Nuria::LuaValue::type ( ) const

Returns the LUA type of this instance.


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