KSValue Class Reference
This class acts like a union. More...
#include <koscript_value.h>
Collaboration diagram for KSValue:

Public Types | |
typedef KSSharedPtr< KSValue > | Ptr |
enum | Type { Empty, StringType, IntType, BoolType, DoubleType, ListType, MapType, CharType, CharRefType, FunctionType, MethodType, PropertyType, ModuleType, StructType, StructClassType, StructBuiltinMethodType, DateType, TimeType, NTypes } |
enum | Mode { LeftExpr, Constant, Temp } |
Public Member Functions | |
KSValue (Type) | |
KSValue (const KSValue &) | |
KSValue (const QString &_v) | |
KSValue (const QValueList< Ptr > &_v) | |
KSValue (const QMap< QString, Ptr > &_v) | |
KSValue (KScript::Long _v) | |
KSValue (int _v) | |
KSValue (KScript::Boolean _v) | |
KSValue (KScript::Double _v) | |
KSValue (const KScript::Char &_v) | |
KSValue (const KScript::CharRef &_v) | |
KSValue (KSFunction *_v) | |
KSValue (KSMethod *_v) | |
KSValue (KSProperty *_v) | |
KSValue (KSModule *_v) | |
KSValue (KSStruct *_v) | |
KSValue (KSStructClass *_v) | |
KSValue (KSStructBuiltinMethod _v) | |
KSValue (const QTime &t) | |
KSValue (const QDate &d) | |
KSValue & | operator= (const KSValue &) |
void | setValue (const QString &) |
void | setValue (const QValueList< Ptr > &) |
void | setValue (const QMap< QString, Ptr > &) |
void | setValue (int _v) |
void | setValue (KScript::Long) |
void | setValue (KScript::Boolean) |
void | setValue (KScript::Double) |
void | setValue (const KScript::Char &) |
void | setValue (const KScript::CharRef &) |
void | setValue (KSFunction *) |
void | setValue (KSMethod *) |
void | setValue (KSProperty *) |
void | setValue (KSModule *) |
void | setValue (KSStruct *) |
void | setValue (KSStructClass *) |
void | setValue (KSStructBuiltinMethod) |
void | setValue (const QDate &) |
void | setValue (const QTime &) |
void | suck (KSValue *) |
Mode | mode () const |
void | setMode (Mode m) |
Type | type () const |
virtual QString | typeName () const |
bool | isEmpty () const |
const QDate & | dateValue () const |
QDate & | dateValue () |
const QTime & | timeValue () const |
QTime & | timeValue () |
const QString & | stringValue () const |
QString & | stringValue () |
const QValueList< Ptr > & | listValue () const |
QValueList< Ptr > & | listValue () |
const QMap< QString, Ptr > & | mapValue () const |
QMap< QString, Ptr > & | mapValue () |
KScript::Long | intValue () const |
KScript::Boolean | boolValue () const |
KScript::Double | doubleValue () const |
KScript::Char | charValue () const |
KScript::CharRef & | charRefValue () |
const KScript::CharRef & | charRefValue () const |
KSFunction * | functionValue () |
const KSFunction * | functionValue () const |
KSMethod * | methodValue () |
const KSMethod * | methodValue () const |
KSProperty * | propertyValue () |
const KSProperty * | propertyValue () const |
KSModule * | moduleValue () |
const KSModule * | moduleValue () const |
KSStructClass * | structClassValue () |
const KSStructClass * | structClassValue () const |
KSStruct * | structValue () |
const KSStruct * | structValue () const |
KSStructBuiltinMethod | structBuiltinMethodValue () |
bool | cast (Type) |
bool | implicitCast (Type typ) const |
QString | toString (KSContext &context) |
bool | operator== (const KSValue &v) const |
bool | cmp (const KSValue &v) const |
void | clear () |
Static Public Member Functions | |
static QString | typeToName (Type _typ) |
static Type | nameToType (const QString &_name) |
static KSValue * | null () |
Protected Attributes | |
Mode | m_mode |
Type | typ |
union { | |
KScript::Long i | |
KScript::Boolean b | |
KScript::Double d | |
ushort c | |
void * ptr | |
KSStructBuiltinMethod sm | |
QDate * date | |
QTime * time | |
} | val |
Detailed Description
This class acts like a union.It can hold one value at the time and it can hold the most common types. For CORBA people: It is a poor mans CORBA::Any.
Definition at line 48 of file koscript_value.h.
Member Function Documentation
|
DO NOT USE ANY MORE.
Definition at line 404 of file koscript_value.cc. |
|
Definition at line 700 of file koscript_value.cc. Referenced by KSUtil::checkType(). |
|
Frees all data allocated by this KSValue.
Definition at line 293 of file koscript_value.cc. |
|
Definition at line 394 of file koscript_value.cc. |
|
Definition at line 204 of file koscript_value.h. |
The documentation for this class was generated from the following files: