lib

#include <variant.h>

Inheritance diagram for Kross::Api::Variant:
Kross::Api::Value< Variant, TQVariant > Kross::Api::Object

Public Member Functions

 Variant (const TQVariant &value)
 operator bool ()
 operator int ()
 operator uint ()
 operator double ()
 operator const char * ()
 operator TQString ()
 operator const TQString ()
 operator const TQString & ()
 operator TQCString ()
 operator const TQCString ()
 operator const TQCString & ()
 operator TQVariant ()
 operator const TQVariant ()
 operator const TQVariant & ()
 operator TQStringList ()
 operator TQValueList< TQVariant > ()
virtual ~Variant ()
virtual const TQString getClassName () const
virtual const TQString toString ()
Public Member Functions inherited from Kross::Api::Value< Variant, TQVariant >
 Value (TQVariant value)
virtual ~Value ()
TQVariant & getValue ()
Public Member Functions inherited from Kross::Api::Object
 Object ()
virtual ~Object ()
virtual Object::Ptr call (const TQString &name, TDESharedPtr< List > arguments)
virtual TQStringList getCalls ()

Static Public Member Functions

static const TQVariant & toVariant (Object::Ptr object)
static const TQString toString (Object::Ptr object)
static int toInt (Object::Ptr object)
static uint toUInt (Object::Ptr object)
static double toDouble (Object::Ptr object)
static TQ_LLONG toLLONG (Object::Ptr object)
static TQ_ULLONG toULLONG (Object::Ptr object)
static bool toBool (Object::Ptr object)
static TQStringList toStringList (Object::Ptr object)
static TQValueList< TQVariant > toList (Object::Ptr object)
Static Public Member Functions inherited from Kross::Api::Value< Variant, TQVariant >
static Object::Ptr toObject (TYPE t)
Static Public Member Functions inherited from Kross::Api::Object
template<class T>
static T * fromObject (Object::Ptr object)
template<typename TYPE>
static Object::Ptr toObject (TYPE t)

Friends

class Value< Variant, TQVariant >

Additional Inherited Members

Public Types inherited from Kross::Api::Object
typedef TDESharedPtr< Object > Ptr

Detailed Description

Variant value to wrap a TQVariant into a Kross::Api::Value to enable primitive types like strings or numerics.

Definition at line 38 of file variant.h.

Constructor & Destructor Documentation

◆ Variant()

Variant::Variant ( const TQVariant & value)

Constructor.

Parameters
valueThe initial TQVariant-value this Variant-Object has.
nameThe name this Value has.

Definition at line 27 of file variant.cpp.

◆ ~Variant()

Variant::~Variant ( )
virtual

Destructor.

Definition at line 32 of file variant.cpp.

Member Function Documentation

◆ getClassName()

const TQString Variant::getClassName ( ) const
virtual
See also
Kross::Api::Object::getClassName()

Implements Kross::Api::Object.

Definition at line 36 of file variant.cpp.

◆ operator bool()

Kross::Api::Variant::operator bool ( )
inline

Definition at line 52 of file variant.h.

◆ operator const char *()

Kross::Api::Variant::operator const char * ( )
inline

Definition at line 56 of file variant.h.

◆ operator const TQCString()

Kross::Api::Variant::operator const TQCString ( )
inline

Definition at line 63 of file variant.h.

◆ operator const TQCString &()

Kross::Api::Variant::operator const TQCString & ( )
inline

Definition at line 64 of file variant.h.

◆ operator const TQString()

Kross::Api::Variant::operator const TQString ( )
inline

Definition at line 59 of file variant.h.

◆ operator const TQString &()

Kross::Api::Variant::operator const TQString & ( )
inline

Definition at line 60 of file variant.h.

◆ operator const TQVariant()

Kross::Api::Variant::operator const TQVariant ( )
inline

Definition at line 67 of file variant.h.

◆ operator const TQVariant &()

Kross::Api::Variant::operator const TQVariant & ( )
inline

Definition at line 68 of file variant.h.

◆ operator double()

Kross::Api::Variant::operator double ( )
inline

Definition at line 55 of file variant.h.

◆ operator int()

Kross::Api::Variant::operator int ( )
inline

Definition at line 53 of file variant.h.

◆ operator TQCString()

Kross::Api::Variant::operator TQCString ( )
inline

Definition at line 62 of file variant.h.

◆ operator TQString()

Kross::Api::Variant::operator TQString ( )
inline

Definition at line 58 of file variant.h.

◆ operator TQStringList()

Kross::Api::Variant::operator TQStringList ( )
inline

Operator to return a TQStringList.

We can not just use getValue().toStringList() here cause maybe this Kross::Api::Variant is a Kross::Api::List which could be internaly used for list of strings as well. So, we use the toStringList() function which will take care of translating a Kross::Api::List to a TQStringList if possible or to throw an exception if the Kross::Api::List isn't a TQStringList.

Definition at line 80 of file variant.h.

◆ operator TQValueList< TQVariant >()

Kross::Api::Variant::operator TQValueList< TQVariant > ( )
inline

Definition at line 83 of file variant.h.

◆ operator TQVariant()

Kross::Api::Variant::operator TQVariant ( )
inline

Definition at line 66 of file variant.h.

◆ operator uint()

Kross::Api::Variant::operator uint ( )
inline

Definition at line 54 of file variant.h.

◆ toBool()

bool Variant::toBool ( Object::Ptr object)
static

Try to convert the given Object into a boolean value.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a bool converted object.

Definition at line 128 of file variant.cpp.

◆ toDouble()

double Variant::toDouble ( Object::Ptr object)
static

Try to convert the given Object into a uint.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a uint converted object.

Definition at line 104 of file variant.cpp.

◆ toInt()

int Variant::toInt ( Object::Ptr object)
static

Try to convert the given Object into a int.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a int converted object.

Definition at line 88 of file variant.cpp.

◆ toList()

TQValueList< TQVariant > Variant::toList ( Object::Ptr object)
static

Try to convert the given Object into a TQValueList of TQVariant's.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a TQValueList converted object.

Definition at line 153 of file variant.cpp.

◆ toLLONG()

TQ_LLONG Variant::toLLONG ( Object::Ptr object)
static

Try to convert the given Object into a TQ_LLONG.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a TQ_LLONG converted object.

Definition at line 112 of file variant.cpp.

◆ toString() [1/2]

const TQString Variant::toString ( )
virtual
Returns
a string representation of the variant.
See also
Kross::Api::Object::toString()

Reimplemented from Kross::Api::Object.

Definition at line 41 of file variant.cpp.

◆ toString() [2/2]

const TQString Variant::toString ( Object::Ptr object)
static

Try to convert the given Object into a TQString.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a TQString converted object.

Definition at line 80 of file variant.cpp.

◆ toStringList()

TQStringList Variant::toStringList ( Object::Ptr object)
static

Try to convert the given Object into a TQStringList.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a TQValueList converted object.

Definition at line 136 of file variant.cpp.

◆ toUInt()

uint Variant::toUInt ( Object::Ptr object)
static

Try to convert the given Object into a uint.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a uint converted object.

Definition at line 96 of file variant.cpp.

◆ toULLONG()

TQ_ULLONG Variant::toULLONG ( Object::Ptr object)
static

Try to convert the given Object into a TQ_ULLONG.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a TQ_ULLONG converted object.

Definition at line 120 of file variant.cpp.

◆ toVariant()

const TQVariant & Variant::toVariant ( Object::Ptr object)
static

Try to convert the given Object into a TQVariant.

Exceptions
TypeExceptionIf the convert failed.
Parameters
objectThe object to convert.
Returns
The to a TQVariant converted object.

Definition at line 75 of file variant.cpp.

◆ Value< Variant, TQVariant >

friend class Value< Variant, TQVariant >
friend

Definition at line 38 of file variant.h.


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