ValueBase internal class members

enum Bool  

Boolean type used for Value constructor.

The native C++ bool type is not used here due to implicit cast between bool and pointers which prevent proper constructor overloading.

IdentifierValueDescription
False0
True1

enum Operation  

Specify lua operations performed on lua values.

IdentifierDescription
OpAddLua add binary operator +
OpSubLua subtract binary operator -
OpMulLua multiply binary operator *
OpDivLua divied binary operator /
OpModLua modulo binary operator %
OpPowLua power binary operator ^
OpUnmLua negative unary operator -
OpConcatLua concatenation binary operator ..
OpLenLua length unary operator #
OpEqLua equal binary operator ==
OpLtLua less than binary operator <
OpLeLua less than or equal binary operator <=
OpIndexTable index operation
OpNewindexTable newindex operation
OpCallFunction call operation
OpIterateIteration operation
OpAllAll operations mask

See also UserData::meta_operation function, UserData::support function and ValueBase::Operations typedef.

typedef ValueBase::Operation Operations  

No documentation available

enum ValueType  

Specify lua value types. This is the same as LUA_T* macros defined in lua headers

IdentifierDescription
TNoneNo type
TNilNil value
TBoolBoolean value
TNumberNumber value
TStringString value
TTableLua table value
TFunctionLua function value
TUserDataLua userdata value
TThreadLua thread value

Value at(const Value &key) const  

Index operation on a lua userdata or lua table value.

template <typename T> Value at(const T &key) const  

Index operation on a lua userdata or lua table value.

ValueBase::iterator begin()  

Get an ValueBase::iterator to traverse a lua userdata or lua table value.

ValueBase::const_iterator begin() const  

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

ValueBase::List call(const ValueBase::List &args) const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::const_iterator cbegin() const  

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

ValueBase::const_iterator cend() const  

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

bool connect(QObject *obj, const char *signal)  

Connect a QObject signal to a lua value. The value will be called when the signal is emited.

See also ValueBase::disconnect function, QObject::connect and QObject wrapping section.

bool disconnect(QObject *obj, const char *signal)  

Disconnect a QObject signal from a lua value.

See also ValueBase::connect function, QObject::disconnect and QObject wrapping section.

ValueBase::iterator end()  

Get an ValueBase::iterator to traverse a lua userdata or lua table value.

ValueBase::const_iterator end() const  

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

State * get_state() const  

Get associated lua state.

bool is_dead() const  

Returns true if the value is a coroutine which is not resumable. This function always returns false if State::lua_version() returns a value less than 501.

bool is_empty() const  

Check if a table or userdata contains at leasts one entry. For lua tables this is different from comparing the result of the ValueBase::len function with zero because this function will return true even if the table keys are not integers.

bool is_nil() const  

Check if the value is nil

int len() const  

Return the lua len of tables and strings. Return the result of the ValueBase::OpLen operation on UserData objects if ValueBase::OpLen is supported.

Ref<Iterator> new_iterator() const  

Return an Iterator object suitable to iterate over lua value. This works for lua tables and UserData objects.

operator Bool() const  

Convert a lua value to a boolean. Throw exception if conversion fails.

template <typename Key, typename Val> operator QHash<Key,Val>() const  

Create a QHash with elements from lua table.

See also Qt/Lua types conversion section.

template <typename X> operator QList<X>() const  

Create a QList with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

template <typename Key, typename Val> operator QMap<Key,Val>() const  

Create a QMap with elements from lua table.

See also Qt/Lua types conversion section.

operator QString() const  

Convert a lua string value to a String object. Throw exception if conversion fails.

operator QVariant() const  

Convert a bool, string or number value to a QVariant. The ValueBase::to_qvariant alternate function can be used to attempt a conversion of the value to a specified registered Qt type.

See also Qt/Lua types conversion section.

template <typename X> operator QVector<X>() const  

Create a QVector with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

template <typename X> operator Ref<X>() const  

See ValueBase::to_userdata_cast function.

operator String() const  

Convert a lua string value to a String object. Throw exception if conversion fails.

operator Value() const  

No documentation available

operator double() const  

Convert a lua number value to a double. Throw exception if conversion fails.

operator float() const  

Convert a lua number value to a double. Throw exception if conversion fails.

operator signed char() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

operator signed int() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

operator signed long() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

operator signed short() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned char() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned int() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned long() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned short() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

ValueBase::List operator()() const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1) const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2) const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3) const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3, const Value &arg4) const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3, const Value &arg4, const Value &arg5) const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3, const Value &arg4, const Value &arg5, const Value &arg6) const  

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

bool operator<(const Value &lv) const  

Compare two lua values. This function may not give the same result as the lua compare operation depending on value type. This function is designed to be used by ordered containers like QMap. This function can compare values of different types and never fails.

bool operator==(const Value &lv) const  

Compare two lua values. This function may not give the same result as the lua compare operation depending on value type. UserData values are considered equals if pointing to the same object. Other values are compared using the lua_rawequal function of the lua API. This function never fails.

bool operator==(const String &str) const  

Compare the lua value with the given string.

bool operator==(const char *str) const  

Compare the lua value with the given C string.

bool operator==(double n) const  

Compare the lua value with the given number.

Value operator[](const Value &key) const  

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

template <typename T> Value operator[](const T &key) const  

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

ValueRef operator[](const Value &key)  

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

template <typename T> ValueRef operator[](const T &key)  

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

ValueBase::List start(const Value &main, const ValueBase::List &args) const  

This function starts execution of a lua thread value. Resume after yield can be performed by invocation of the ValueBase::call function.

bool support(ValueBase::Operation c) const  

Check given operation support.

See also UserData::support function.

void table_shift(int pos, int count, const Value &init, int len = -1)  

Make room in a lua table at given position if count > 0 or remove entries if count < 0.

void table_shift(int pos, int count, int len = -1)  

Make room in a lua table at given position if count > 0 or remove entries if count < 0.

ValueBase::Bool to_boolean() const  

Convert a lua value to a boolean. Throw exception if conversion fails.

QByteArray to_bytecode() const  

Dump the bytecode for a function object

template <typename X> X * to_class_cast() const  

Convert a lua value into a Ref pointer to an UserData and perform a dynamic_cast<X*>. Throw exception if either conversion fails, pointer is null or cast fails.

See also ValueBase::to_class_cast_null function.

template <typename X> X * to_class_cast_null() const  

Convert a lua value into a Ref pointer to an UserData and perform a dynamic_cast<X*>. Throw exception if conversion or cast fails.

See also ValueBase::to_class_cast function.

int to_integer() const  

Convert a lua number value to an integer. Throw exception if conversion fails.

double to_number() const  

Convert a lua number value to a double. Throw exception if conversion fails.

template <typename Key, typename Val> QHash<Key, Val> to_qhash() const  

Create a QHash with elements from lua table.

See also Qt/Lua types conversion section.

template <typename X> QList<X> to_qlist() const  

Create a QList with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

template <typename Key, typename Val> QMap<Key, Val> to_qmap() const  

Create a QMap with elements from lua table.

See also Qt/Lua types conversion section.

QObject * to_qobject() const  

Convert a lua value to a QObject pointer. Throw exception if conversion or cast fails.

See also ValueBase::to_qobject_cast function.

template <typename X> X * to_qobject_cast() const  

Convert a lua value to a QObject subclass pointer. Subclass must have the Q_OBJECT macro in it's definition. Throw exception if conversion or cast fails.

See also ValueBase::to_qobject function.

QString to_qstring() const  

Convert a lua string value to a String object. Throw exception if conversion fails.

QVariant to_qvariant() const  

Convert a bool, string or number value to a QVariant. The ValueBase::to_qvariant alternate function can be used to attempt a conversion of the value to a specified registered Qt type.

See also Qt/Lua types conversion section.

QVariant to_qvariant(int qt_type) const  

Convert a lua value to a QVariant. The lua value will be converted to an object of requested Qt type if possible.

See also Qt/Lua types conversion section.

template <typename X> QVector<X> to_qvector() const  

Create a QVector with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

String to_string() const  

Convert a lua string value to a String object. Throw exception if conversion fails.

String to_string_p(bool quote_string = true) const  

Convert any type to a string representation suitable for pretty printing. Never throw.

Ref<UserData> to_userdata() const  

Convert a lua value into a Ref pointer to an UserData. Throw exception if conversion fails.

See also ValueBase::to_userdata_cast_null function and ValueBase::to_userdata_cast function.

template <typename X> Ref<X> to_userdata_cast() const  

Convert a lua value into a Ref pointer to an UserData and dynamic cast to given Ref pointer to requested type. Throw exception if either conversion fails, pointer is null or cast fails.

See also ValueBase::to_userdata function and ValueBase::to_userdata_cast function.

template <typename X> Ref<X> to_userdata_cast_null() const  

Convert a lua value into a Ref pointer to an UserData and dynamic cast to given Ref pointer to requested type. Throw exception if conversion or cast fails.

See also ValueBase::to_userdata function and ValueBase::to_userdata_cast function.

ValueBase::ValueType type() const  

Get lua value type.

String type_name() const  

Get value raw lua type name.

static String type_name(ValueBase::ValueType t)  

Get value raw lua type name.

String type_name_u() const  

Get value type name, if the value is a UserData, the type name is extracted using the UserData::get_type_name function.

Valid XHTML 1.0 StrictGenerated by diaxen on Sat Mar 30 15:29:55 2013 using MkDoc