Class for accurately representing D-Bus data types. More...
#include <qdbusdata.h>
Public Types | |
enum | Type { Invalid = 0, Bool, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Double, String, ObjectPath, List, Struct, Variant, Map } |
Enum for the data types used in D-Bus messages. More... | |
Public Member Functions | |
QDBusData () | |
Creates an empty, Invalid data object. | |
QDBusData (const QDBusData &other) | |
Copies a given other data object. | |
~QDBusData () | |
Destroys the data object. | |
QDBusData & | operator= (const QDBusData &other) |
Copies a given other data object. | |
bool | operator== (const QDBusData &other) const |
Checks if the given other data object is equal to this instance. | |
bool | operator!= (const QDBusData &other) const |
Checks if the given other data object is different from this instance. | |
bool | isValid () const |
Checks whether the data object contains a valid content. | |
Type | type () const |
Returns the Type of the data object. | |
Type | keyType () const |
Returns the Type of the key type for maps. | |
const char * | typeName () const |
Returns the string representation of the object's Type. | |
bool | toBool (bool *ok=0) const |
Tries to get the encapsulated boolean value. | |
Q_UINT8 | toByte (bool *ok=0) const |
Tries to get the encapsulated byte (unsigned char) value. | |
Q_INT16 | toInt16 (bool *ok=0) const |
Tries to get the encapsulated signed 16-bit integer value. | |
Q_UINT16 | toUInt16 (bool *ok=0) const |
Tries to get the encapsulated unsigned 16-bit integer value. | |
Q_INT32 | toInt32 (bool *ok=0) const |
Tries to get the encapsulated signed 32-bit integer value. | |
Q_UINT32 | toUInt32 (bool *ok=0) const |
Tries to get the encapsulated unsigned 32-bit integer value. | |
Q_INT64 | toInt64 (bool *ok=0) const |
Tries to get the encapsulated signed 64-bit integer value. | |
Q_UINT64 | toUInt64 (bool *ok=0) const |
Tries to get the encapsulated unsigned 64-bit integer value. | |
double | toDouble (bool *ok=0) const |
Tries to get the encapsulated double value. | |
QString | toString (bool *ok=0) const |
Tries to get the encapsulated string value. | |
QDBusObjectPath | toObjectPath (bool *ok=0) const |
Tries to get the encapsulated object path value. | |
QDBusDataList | toList (bool *ok=0) const |
Tries to get the encapsulated list. | |
QValueList< QDBusData > | toQValueList (bool *ok=0) const |
Tries to get the encapsulated list. | |
QValueList< QDBusData > | toStruct (bool *ok=0) const |
Tries to get the encapsulated struct memberList. | |
QDBusVariant | toVariant (bool *ok=0) const |
Tries to get the encapsulated variant value. | |
QDBusDataMap< Q_UINT8 > | toByteKeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< Q_INT16 > | toInt16KeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< Q_UINT16 > | toUInt16KeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< Q_INT32 > | toInt32KeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< Q_UINT32 > | toUInt32KeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< Q_INT64 > | toInt64KeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< Q_UINT64 > | toUInt64KeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< QString > | toStringKeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QDBusDataMap< QDBusObjectPath > | toObjectPathKeyMap (bool *ok=0) const |
Tries to get the encapsulated map. | |
QCString | buildDBusSignature () const |
Creates the data objects D-Bus signature. | |
Static Public Member Functions | |
static const char * | typeName (Type type) |
Returns the string representation for the given type . | |
static QDBusData | fromBool (bool value) |
Creates a data object for the given boolean value . | |
static QDBusData | fromByte (Q_UINT8 value) |
Creates a data object for the given byte (unsigned char) value . | |
static QDBusData | fromInt16 (Q_INT16 value) |
Creates a data object for the given signed 16-bit integer value . | |
static QDBusData | fromUInt16 (Q_UINT16 value) |
Creates a data object for the given unsigned 16-bit integer value . | |
static QDBusData | fromInt32 (Q_INT32 value) |
Creates a data object for the given signed 32-bit integer value . | |
static QDBusData | fromUInt32 (Q_UINT32 value) |
Creates a data object for the given unsigned 32-bit integer value . | |
static QDBusData | fromInt64 (Q_INT64 value) |
Creates a data object for the given signed 64-bit integer value . | |
static QDBusData | fromUInt64 (Q_UINT64 value) |
Creates a data object for the given unsigned 64-bit integer value . | |
static QDBusData | fromDouble (double value) |
Creates a data object for the given double value . | |
static QDBusData | fromString (const QString &value) |
Creates a data object for the given string value . | |
static QDBusData | fromObjectPath (const QDBusObjectPath &value) |
Creates a data object for the given object path value . | |
static QDBusData | fromList (const QDBusDataList &list) |
Creates a data object for the given list . | |
static QDBusData | fromQValueList (const QValueList< QDBusData > &list) |
Creates a data object for the given list . | |
static QDBusData | fromStruct (const QValueList< QDBusData > &memberList) |
Creates a data object for the given struct's memberList . | |
static QDBusData | fromVariant (const QDBusVariant &value) |
Creates a data object for the given variant value . | |
static QDBusData | fromByteKeyMap (const QDBusDataMap< Q_UINT8 > &map) |
Creates a data object for the given map . | |
static QDBusData | fromInt16KeyMap (const QDBusDataMap< Q_INT16 > &map) |
Creates a data object for the given map . | |
static QDBusData | fromUInt16KeyMap (const QDBusDataMap< Q_UINT16 > &map) |
Creates a data object for the given map . | |
static QDBusData | fromInt32KeyMap (const QDBusDataMap< Q_INT32 > &map) |
Creates a data object for the given map . | |
static QDBusData | fromUInt32KeyMap (const QDBusDataMap< Q_UINT32 > &map) |
Creates a data object for the given map . | |
static QDBusData | fromInt64KeyMap (const QDBusDataMap< Q_INT64 > &map) |
Creates a data object for the given map . | |
static QDBusData | fromUInt64KeyMap (const QDBusDataMap< Q_UINT64 > &map) |
Creates a data object for the given map . | |
static QDBusData | fromStringKeyMap (const QDBusDataMap< QString > &map) |
Creates a data object for the given map . | |
static QDBusData | fromObjectPathKeyMap (const QDBusDataMap< QDBusObjectPath > &map) |
Creates a data object for the given map . |
Class for accurately representing D-Bus data types.
The QDBusData class can be compared to Qt's QVariant class, but specialized to contain data types used in D-Bus messages.
Like QVariant objects of QDBusData use implicit sharing, i.e. copying a QDBusData object is a cheap operation and does not require that the content itself is copied.
Depending on the Type of the object, the content can be a recursive construct of QDBusData objects, e.g. a List can contain elements that are containers themselves, e.g. Map, Struct, Variant or even List again.
enum QDBusData::Type |
Enum for the data types used in D-Bus messages.
In order to provide correct mapping of C++ and Qt types and the data types used in D-Bus messages, QDBusData uses explicit naming of types where the name is usually the one used in D-Bus, with the exception of List and Map since this is closer to the Qt container they are implemented with (QValueList and QMap respectively)
Invalid |
Base type for QDBusData objects created by the default constructor. Also used as the type of returned objects when getter type methods fail due to type incompatabilties, i.e. toInt32() called on a List object.
|
Bool |
Type when encapsulating a boolean value.
|
Byte |
Type when encapsulating a byte (unsigned char) value.
|
Int16 |
Type when encapsulating a signed 16-bit integer value.
|
UInt16 |
Type when encapsulating an unsigned 16-bit integer value.
|
Int32 |
Type when encapsulating a signed 32-bit integer value.
|
UInt32 |
Type when encapsulating an unsigned 32-bit integer value.
|
Int64 |
Type when encapsulating a signed 64-bit integer value.
|
UInt64 |
Type when encapsulating an unsigned 64-bit integer value.
|
Double |
Type when encapsulating a double value.
|
String |
Type when encapsulating a string value. All strings are converted to UTF-8 during transmission
|
ObjectPath |
Type when encapsulating a D-Bus object path. D-Bus defines a special string variation for transporting the paths used to address objects within D-Bus services, see Object paths for formatting details.
|
List |
Type when encapsulating a list of values. The D-Bus type this maps to is called A list can contain any of the supported types as elements, even container types. However it can only contain elements with the same type per list object.
|
Struct |
Type when encapsulating a struct of values. A struct is basically a list of struct member variables, each member can be any of the supported types, even containers types. The C++/Qt value type used in the converter methods is a QValueList with type QDBusData. For example a QRect could be mapped like this: QRect rect(0, 0, 640, 480); QValueList<QDBusData> memberList; memberList << QDBusData::fromInt32(rect.x()); memberList << QDBusData::fromInt32(rect.y()); memberList << QDBusData::fromInt32(rect.width()); memberList << QDBusData::fromInt32(rect.height()); QDBusData data = QDBusData:fromStruct(memberList); And reconstructed like this: memberList = data.toStruct(); int x = memberList[0].toInt32(); int y = memberList[1].toInt32(); int w = memberList[2].toInt32(); int h = memberList[3].toInt32(); rect = QRect(x, y, w, h);
|
Variant |
Type when encapsulating a special variable container value. See QDBusVariant for details on variant usage.
|
Map |
Type when encapsulating a map of keys to values. The D-Bus type this maps to is called A map can contain any of the supported types as values, even container types, but only the following basic types as keys: All values need to be of the same type.
|
QDBusData::QDBusData | ( | ) |
Creates an empty, Invalid data object.
Referenced by QDBusDataMap< T >::operator=().
QDBusData::QDBusData | ( | const QDBusData & | other | ) |
Copies a given other
data object.
Since QDBusData is implicitly shared, both objects will have the same content and the last object to reference it will delete it.
other | the object to copy |
QDBusData::~QDBusData | ( | ) |
Destroys the data object.
If this is the last instance to a shared content, it will delete it as well.
QCString QDBusData::buildDBusSignature | ( | ) | const |
Creates the data objects D-Bus signature.
Recursivly builds the D-Bus signature of the data object if it holds a container type, i.e. if the object is of type List, Map or Struct
This can be used to create a signature for QDBusVariant when creating one for sending over D-Bus.
Referenced by QDBusDataMap< T >::insert(), and QDBusDataMap< T >::operator==().
static QDBusData QDBusData::fromBool | ( | bool | value | ) | [static] |
static QDBusData QDBusData::fromByte | ( | Q_UINT8 | value | ) | [static] |
static QDBusData QDBusData::fromByteKeyMap | ( | const QDBusDataMap< Q_UINT8 > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to Byte.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is Invalidstatic QDBusData QDBusData::fromDouble | ( | double | value | ) | [static] |
Creates a data object for the given double value
.
value | the value to encapsulate |
value
static QDBusData QDBusData::fromInt16 | ( | Q_INT16 | value | ) | [static] |
static QDBusData QDBusData::fromInt16KeyMap | ( | const QDBusDataMap< Q_INT16 > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to Int16.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is Invalidstatic QDBusData QDBusData::fromInt32 | ( | Q_INT32 | value | ) | [static] |
static QDBusData QDBusData::fromInt32KeyMap | ( | const QDBusDataMap< Q_INT32 > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to Int32.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is Invalidstatic QDBusData QDBusData::fromInt64 | ( | Q_INT64 | value | ) | [static] |
static QDBusData QDBusData::fromInt64KeyMap | ( | const QDBusDataMap< Q_INT64 > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to Int64.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is Invalidstatic QDBusData QDBusData::fromList | ( | const QDBusDataList & | list | ) | [static] |
Creates a data object for the given list
.
Unless the list the is empty, the convenience method fromQValueList() will usually be easier to use since it does not require to create a QDBusDataList first. For empty lists this method has to be used to make sure there is sufficient type information on the list's elements available for the binding's marshalling code.
list | the list to encapsulate |
list
or an Invalid object if the list's type is Invalidstatic QDBusData QDBusData::fromObjectPath | ( | const QDBusObjectPath & | value | ) | [static] |
Creates a data object for the given object path value
.
value | the value to encapsulate |
value
static QDBusData QDBusData::fromObjectPathKeyMap | ( | const QDBusDataMap< QDBusObjectPath > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to ObjectPath.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is InvalidCreates a data object for the given list
.
Convenience overload for fromList(), usually more straight forward to use because it doesn't require to create a QDBusDataList object first, however it can only handle lists which contain elements, for empty lists fromList() is the only option.
list | the list to encapsulate |
list
or an Invalid object if the list is empty or if elements have different types.static QDBusData QDBusData::fromString | ( | const QString & | value | ) | [static] |
Creates a data object for the given string value
.
value | the value to encapsulate |
value
static QDBusData QDBusData::fromStringKeyMap | ( | const QDBusDataMap< QString > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to String.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is InvalidCreates a data object for the given struct's memberList
.
See the documentation of Struct for an example.
memberList | the list of already encapsulated struct members |
memberList
static QDBusData QDBusData::fromUInt16 | ( | Q_UINT16 | value | ) | [static] |
Creates a data object for the given unsigned 16-bit integer value
.
value | the value to encapsulate |
value
static QDBusData QDBusData::fromUInt16KeyMap | ( | const QDBusDataMap< Q_UINT16 > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to UInt16.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is Invalidstatic QDBusData QDBusData::fromUInt32 | ( | Q_UINT32 | value | ) | [static] |
Creates a data object for the given unsigned 32-bit integer value
.
value | the value to encapsulate |
value
static QDBusData QDBusData::fromUInt32KeyMap | ( | const QDBusDataMap< Q_UINT32 > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to UInt32.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is Invalidstatic QDBusData QDBusData::fromUInt64 | ( | Q_UINT64 | value | ) | [static] |
Creates a data object for the given unsigned 64-bit integer value
.
value | the value to encapsulate |
value
static QDBusData QDBusData::fromUInt64KeyMap | ( | const QDBusDataMap< Q_UINT64 > & | map | ) | [static] |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to UInt64.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is Invalidstatic QDBusData QDBusData::fromVariant | ( | const QDBusVariant & | value | ) | [static] |
Creates a data object for the given variant value
.
value | the value to encapsulate |
value
bool QDBusData::isValid | ( | ) | const [inline] |
Type QDBusData::keyType | ( | ) | const |
bool QDBusData::operator!= | ( | const QDBusData & | other | ) | const |
Checks if the given other
data object is different from this instance.
other | the object to compare with |
false
if the two data objects are not equal, otherwise false
Copies a given other
data object.
Since QDBusData is implicitly shared, both objects will have the same content and the last object to reference it will delete it.
other | the object to copy |
Referenced by QDBusDataMap< T >::operator=().
bool QDBusData::operator== | ( | const QDBusData & | other | ) | const |
Checks if the given other
data object is equal to this instance.
Two QDBusData object are considered equal if they reference the same shared content or have the same type and the content's equality operator says the contents are equal.
other | the object to compare with |
true
if the two data objects are equal, otherwise false
bool QDBusData::toBool | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated boolean value.
If the data object is not of type Bool this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Bool) |
false
if it failsQ_UINT8 QDBusData::toByte | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated byte (unsigned char) value.
If the data object is not of type Byte this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Byte) |
0
if it failsQDBusDataMap<Q_UINT8> QDBusData::toByteKeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not Byte this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Byte) |
double QDBusData::toDouble | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated double value.
If the data object is not of type Double this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Double) |
0.0
if it failsQ_INT16 QDBusData::toInt16 | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated signed 16-bit integer value.
If the data object is not of type Int16 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Int16) |
0
if it failsQDBusDataMap<Q_INT16> QDBusData::toInt16KeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not Int16 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Int16) |
Q_INT32 QDBusData::toInt32 | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated signed 32-bit integer value.
If the data object is not of type Int32 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Int32) |
0
if it failsQDBusDataMap<Q_INT32> QDBusData::toInt32KeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not Int32 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Int32) |
Q_INT64 QDBusData::toInt64 | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated signed 64-bit integer value.
If the data object is not of type Int64 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Int64) |
0
if it failsQDBusDataMap<Q_INT64> QDBusData::toInt64KeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not Int64 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Int64) |
QDBusDataList QDBusData::toList | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated list.
If the data object is not of type List this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type List) |
QDBusObjectPath QDBusData::toObjectPath | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated object path value.
If the data object is not of type ObjectPath this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type ObjectPath) |
QDBusDataMap<QDBusObjectPath> QDBusData::toObjectPathKeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not ObjectPath this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not ObjectPath) |
QValueList<QDBusData> QDBusData::toQValueList | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated list.
Convenience overload for toList().
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type List) |
QString QDBusData::toString | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated string value.
If the data object is not of type String this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type String) |
QString::null
if it failsQDBusDataMap<QString> QDBusData::toStringKeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not String this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not String) |
QValueList<QDBusData> QDBusData::toStruct | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated struct memberList.
If the data object is not of type Struct this will fail, i.e. the parameter ok
will be set to false
if present.
See the documentation of Struct for an example.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Struct) |
Q_UINT16 QDBusData::toUInt16 | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated unsigned 16-bit integer value.
If the data object is not of type UInt16 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type UInt16) |
0
if it failsQDBusDataMap<Q_UINT16> QDBusData::toUInt16KeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not UInt16 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not UInt16) |
Q_UINT32 QDBusData::toUInt32 | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated unsigned 32-bit integer value.
If the data object is not of type UInt32 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type UInt32) |
0
if it failsQDBusDataMap<Q_UINT32> QDBusData::toUInt32KeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not UInt32 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not UInt32) |
Q_UINT64 QDBusData::toUInt64 | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated unsigned 64-bit integer value.
If the data object is not of type UInt64 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type UInt64) |
0
if it failsQDBusDataMap<Q_UINT64> QDBusData::toUInt64KeyMap | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated map.
If the data object is not of type Map or if its value type is not UInt64 this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not UInt64) |
QDBusVariant QDBusData::toVariant | ( | bool * | ok = 0 |
) | const |
Tries to get the encapsulated variant value.
If the data object is not of type Variant this will fail, i.e. the parameter ok
will be set to false
if present.
ok | optional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Variant) |
Type QDBusData::type | ( | ) | const |
Returns the Type of the data object.
Referenced by QDBusDataMap< T >::insert().
static const char* QDBusData::typeName | ( | Type | type | ) | [static] |
Returns the string representation for the given type
.
type | the Type to get the string representation for |
type
const char* QDBusData::typeName | ( | ) | const [inline] |
Returns the string representation of the object's Type.
References typeName().
Referenced by QDBusDataMap< T >::insert(), and typeName().