lib
Kross::Api::Variant Class Reference
#include <variant.h>
Inheritance diagram for Kross::Api::Variant:

Detailed Description
Variant value to wrap a QVariant into a Kross::Api::Value to enable primitive types like strings or numerics.
Definition at line 37 of file variant.h.
Public Member Functions | |
Variant (const QVariant &value, const QString &name="variant") | |
operator bool () | |
operator int () | |
operator uint () | |
operator double () | |
operator const char * () | |
operator QString () | |
operator const QString () | |
operator const QString & () | |
operator QCString () | |
operator const QCString () | |
operator const QCString & () | |
operator const QVariant & () | |
virtual | ~Variant () |
virtual const QString | getClassName () const |
virtual const QString | toString () |
Static Public Member Functions | |
static const QString | getVariantType (Object::Ptr object) |
static const QVariant & | toVariant (Object::Ptr object) |
static const QString | toString (Object::Ptr object) |
static int | toInt (Object::Ptr object) |
static uint | toUInt (Object::Ptr object) |
static double | toDouble (Object::Ptr object) |
static Q_LLONG | toLLONG (Object::Ptr object) |
static Q_ULLONG | toULLONG (Object::Ptr object) |
static bool | toBool (Object::Ptr object) |
static QValueList< QVariant > | toList (Object::Ptr object) |
Friends | |
class | Value< Variant, QVariant > |
Constructor & Destructor Documentation
Variant::Variant | ( | const QVariant & | value, | |
const QString & | name = "variant" | |||
) |
Constructor.
- Parameters:
-
value The initial QVariant-value this Variant-Object has. name The name this Value has.
Definition at line 28 of file variant.cpp.
Variant::~Variant | ( | ) | [virtual] |
Member Function Documentation
const QString Variant::getClassName | ( | ) | const [virtual] |
- See also:
- Kross::Api::Object::getClassName()
Implements Kross::Api::Object.
Definition at line 37 of file variant.cpp.
const QString Variant::getVariantType | ( | Object::Ptr | object | ) | [static] |
- Returns:
- a more detailed classname for the passed
object
variant type.
- Exceptions:
-
TypeException If the object
isn't a valid Variant instance.
- Parameters:
-
object the variant object we should return a more detailed classname for.
- Returns:
- If as example the passed
object
is a QVariant::String then "Kross::Api::Variant::String" will be returned.
Definition at line 47 of file variant.cpp.
bool Variant::toBool | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a boolean value.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a bool converted object.
Definition at line 132 of file variant.cpp.
double Variant::toDouble | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a uint.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a uint converted object.
Definition at line 108 of file variant.cpp.
int Variant::toInt | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a int.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a int converted object.
Definition at line 92 of file variant.cpp.
QValueList< QVariant > Variant::toList | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a QValueList of QVariant's.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a QValueList converted object.
Definition at line 140 of file variant.cpp.
Q_LLONG Variant::toLLONG | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a Q_LLONG.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a Q_LLONG converted object.
Definition at line 116 of file variant.cpp.
const QString Variant::toString | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a QString.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a QString converted object.
Definition at line 84 of file variant.cpp.
const QString Variant::toString | ( | ) | [virtual] |
- Returns:
- a string representation of the variant.
- See also:
- Kross::Api::Object::toString()
Reimplemented from Kross::Api::Object.
Definition at line 42 of file variant.cpp.
uint Variant::toUInt | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a uint.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a uint converted object.
Definition at line 100 of file variant.cpp.
Q_ULLONG Variant::toULLONG | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a Q_ULLONG.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a Q_ULLONG converted object.
Definition at line 124 of file variant.cpp.
const QVariant & Variant::toVariant | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a QVariant.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a QVariant converted object.
Definition at line 79 of file variant.cpp.
The documentation for this class was generated from the following files: