DBus-1-TQt
1.0
|
#include <tqdbusdata.h>
Classes | |
class | Private |
Public Types | |
enum | Type { Invalid = 0, Bool, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Double, String, ObjectPath, UnixFd, List, Struct, Variant, Map } |
Public Member Functions | |
TQT_DBusData () | |
TQT_DBusData (const TQT_DBusData &other) | |
~TQT_DBusData () | |
TQT_DBusData & | operator= (const TQT_DBusData &other) |
bool | operator== (const TQT_DBusData &other) const |
bool | operator!= (const TQT_DBusData &other) const |
bool | isValid () const |
Type | type () const |
Type | keyType () const |
const char * | typeName () const |
bool | toBool (bool *ok=0) const |
TQ_UINT8 | toByte (bool *ok=0) const |
TQ_INT16 | toInt16 (bool *ok=0) const |
TQ_UINT16 | toUInt16 (bool *ok=0) const |
TQ_INT32 | toInt32 (bool *ok=0) const |
TQ_UINT32 | toUInt32 (bool *ok=0) const |
TQ_INT64 | toInt64 (bool *ok=0) const |
TQ_UINT64 | toUInt64 (bool *ok=0) const |
double | toDouble (bool *ok=0) const |
TQString | toString (bool *ok=0) const |
TQT_DBusObjectPath | toObjectPath (bool *ok=0) const |
TQT_DBusUnixFd | toUnixFd (bool *ok=0) const |
TQT_DBusDataList | toList (bool *ok=0) const |
TQValueList< TQT_DBusData > | toTQValueList (bool *ok=0) const |
TQValueList< TQT_DBusData > | toStruct (bool *ok=0) const |
TQT_DBusVariant | toVariant (bool *ok=0) const |
TQT_DBusData | getAsVariantData () |
TQT_DBusDataMap< TQ_UINT8 > | toByteKeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQ_INT16 > | toInt16KeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQ_UINT16 > | toUInt16KeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQ_INT32 > | toInt32KeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQ_UINT32 > | toUInt32KeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQ_INT64 > | toInt64KeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQ_UINT64 > | toUInt64KeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQString > | toStringKeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQT_DBusObjectPath > | toObjectPathKeyMap (bool *ok=0) const |
TQT_DBusDataMap< TQT_DBusUnixFd > | toUnixFdKeyMap (bool *ok=0) const |
TQCString | buildDBusSignature () const |
Private Attributes | |
Private * | d |
Class for accurately representing D-Bus data types.
The TQT_DBusData class can be compared to TQt's TQVariant class, but specialized to contain data types used in D-Bus messages.
Like TQVariant objects of TQT_DBusData use implicit sharing, i.e. copying a TQT_DBusData 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 TQT_DBusData objects, e.g. a List can contain elements that are containers themselves, e.g. Map, Struct, Variant or even List again.
Definition at line 58 of file tqdbusdata.h.
enum TQT_DBusData::Type |
Enum for the data types used in D-Bus messages.
In order to provide correct mapping of C++ and TQt types and the data types used in D-Bus messages, TQT_DBusData 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 TQt container they are implemented with (TQValueList and TQMap respectively)
Enumerator | |
---|---|
Invalid | Base type for TQT_DBusData 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.
|
UnixFd | Type when encapsulating a D-Bus unix file handle.
|
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++/TQt value type used in the converter methods is a TQValueList with type TQT_DBusData. For example a TQRect could be mapped like this: TQRect rect(0, 0, 640, 480);
TQValueList<TQT_DBusData> memberList;
memberList << TQT_DBusData::fromInt32(rect.x());
memberList << TQT_DBusData::fromInt32(rect.y());
memberList << TQT_DBusData::fromInt32(rect.width());
memberList << TQT_DBusData::fromInt32(rect.height());
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 = TQRect(x, y, w, h);
|
Variant | Type when encapsulating a special variable container value. See TQT_DBusVariant 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.
|
Definition at line 73 of file tqdbusdata.h.
TQT_DBusData::TQT_DBusData | ( | ) |
Creates an empty, Invalid data object.
Definition at line 176 of file tqdbusdata.cpp.
TQT_DBusData::TQT_DBusData | ( | const TQT_DBusData & | other | ) |
Copies a given other
data object.
Since TQT_DBusData 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 |
Definition at line 180 of file tqdbusdata.cpp.
References d.
TQT_DBusData::~TQT_DBusData | ( | ) |
Destroys the data object.
If this is the last instance to a shared content, it will delete it as well.
Definition at line 187 of file tqdbusdata.cpp.
References d.
TQCString TQT_DBusData::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 TQT_DBusVariant when creating one for sending over D-Bus.
Definition at line 1034 of file tqdbusdata.cpp.
References buildDBusSignature(), Byte, TQT_DBusDataList::containerItemType(), d, TQT_DBusDataList::hasContainerItemType(), Int16, Int32, Int64, keyType(), List, Map, ObjectPath, TQT_DBusData::Private::pointer, qDBusTypeForTQT_DBusType(), String, Struct, TQT_DBusData::Private::type, TQT_DBusDataList::type(), UInt16, UInt32, UInt64, UnixFd, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given boolean value
.
value | the value to encapsulate |
value
Definition at line 355 of file tqdbusdata.cpp.
References Bool, TQT_DBusData::Private::boolValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given byte (unsigned char) value
.
value | the value to encapsulate |
value
Definition at line 378 of file tqdbusdata.cpp.
References Byte, TQT_DBusData::Private::byteValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 742 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given double value
.
value | the value to encapsulate |
value
Definition at line 539 of file tqdbusdata.cpp.
References d, Double, TQT_DBusData::Private::doubleValue, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given signed 16-bit integer value
.
value | the value to encapsulate |
value
Definition at line 401 of file tqdbusdata.cpp.
References d, Int16, TQT_DBusData::Private::int16Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 766 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given signed 32-bit integer value
.
value | the value to encapsulate |
value
Definition at line 447 of file tqdbusdata.cpp.
References d, Int32, TQT_DBusData::Private::int32Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 815 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given signed 64-bit integer value
.
value | the value to encapsulate |
value
Definition at line 493 of file tqdbusdata.cpp.
References d, Int64, TQT_DBusData::Private::int64Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 864 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given list
.
Unless the list the is empty, the convenience method fromTQValueList() will usually be easier to use since it does not require to create a TQT_DBusDataList 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 InvalidDefinition at line 637 of file tqdbusdata.cpp.
References d, Invalid, List, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, TQT_DBusDataList::type(), and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given object path value
.
value | the value to encapsulate |
value
Definition at line 585 of file tqdbusdata.cpp.
References d, TQT_DBusObjectPath::isValid(), ObjectPath, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 937 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given string value
.
value | the value to encapsulate |
value
Definition at line 562 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::pointer, String, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 913 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates 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
Definition at line 681 of file tqdbusdata.cpp.
References d, Invalid, TQT_DBusData::Private::pointer, Struct, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates 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 TQT_DBusDataList 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.Definition at line 662 of file tqdbusdata.cpp.
References fromList().
|
static |
Creates a data object for the given unsigned 16-bit integer value
.
value | the value to encapsulate |
value
Definition at line 424 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::type, UInt16, TQT_DBusData::Private::uint16Value, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 790 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given unsigned 32-bit integer value
.
value | the value to encapsulate |
value
Definition at line 470 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::type, UInt32, TQT_DBusData::Private::uint32Value, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 839 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given unsigned 64-bit integer value
.
value | the value to encapsulate |
value
Definition at line 516 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::type, UInt64, TQT_DBusData::Private::uint64Value, and TQT_DBusData::Private::value.
|
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 InvalidDefinition at line 888 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given unix file handle value
.
value | the value to encapsulate |
value
Definition at line 611 of file tqdbusdata.cpp.
References d, TQT_DBusUnixFd::isValid(), TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, UnixFd, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given map
.
The resulting data object will have the keyType() set to UnixFd.
map | the map to encapsulate |
map
or an Invalid object if the map's value type is InvalidDefinition at line 962 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
|
static |
Creates a data object for the given variant value
.
value | the value to encapsulate |
value
Definition at line 711 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, TQT_DBusData::Private::value, and Variant.
TQT_DBusData TQT_DBusData::getAsVariantData | ( | ) |
Creates a variant from this
object and returns it as a TQT_DBusData object.
this
object Definition at line 734 of file tqdbusdata.cpp.
References buildDBusSignature(), fromVariant(), TQT_DBusVariant::signature, and TQT_DBusVariant::value.
|
inline |
Checks whether the data object contains a valid content.
This is equal to checking type() for not being Invalid
true
if the data object is valid, otherwise false
Definition at line 349 of file tqdbusdata.h.
References Invalid.
TQT_DBusData::Type TQT_DBusData::keyType | ( | ) | const |
Returns the Type of the key type for maps.
If the type of the data object is Map, this method returns the type of the map's key, String for a TQT_DBusDataMap<TQString>
If the type of the data object is not Map, it will return Invalid
Definition at line 322 of file tqdbusdata.cpp.
References d, Invalid, TQT_DBusData::Private::keyType, Map, and TQT_DBusData::Private::type.
bool TQT_DBusData::operator!= | ( | const TQT_DBusData & | 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
Definition at line 312 of file tqdbusdata.cpp.
References operator==().
TQT_DBusData & TQT_DBusData::operator= | ( | const TQT_DBusData & | other | ) |
Copies a given other
data object.
Since TQT_DBusData 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 |
Definition at line 192 of file tqdbusdata.cpp.
References d.
bool TQT_DBusData::operator== | ( | const TQT_DBusData & | other | ) | const |
Checks if the given other
data object is equal to this instance.
Two TQT_DBusData 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
Definition at line 205 of file tqdbusdata.cpp.
References Bool, TQT_DBusData::Private::boolValue, Byte, TQT_DBusData::Private::byteValue, d, Double, TQT_DBusData::Private::doubleValue, Int16, TQT_DBusData::Private::int16Value, Int32, TQT_DBusData::Private::int32Value, Int64, TQT_DBusData::Private::int64Value, Invalid, TQT_DBusData::Private::keyType, List, Map, ObjectPath, String, Struct, toByteKeyMap(), toInt16KeyMap(), toInt32KeyMap(), toInt64KeyMap(), toList(), toObjectPath(), toObjectPathKeyMap(), toString(), toStringKeyMap(), toStruct(), toUInt16KeyMap(), toUInt32KeyMap(), toUInt64KeyMap(), toUnixFd(), toUnixFdKeyMap(), toVariant(), TQT_DBusData::Private::type, typeName(), UInt16, TQT_DBusData::Private::uint16Value, UInt32, TQT_DBusData::Private::uint32Value, UInt64, TQT_DBusData::Private::uint64Value, UnixFd, TQT_DBusData::Private::value, and Variant.
bool TQT_DBusData::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 failsDefinition at line 365 of file tqdbusdata.cpp.
References Bool, TQT_DBusData::Private::boolValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQ_UINT8 TQT_DBusData::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 failsDefinition at line 388 of file tqdbusdata.cpp.
References Byte, TQT_DBusData::Private::byteValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQ_UINT8 > TQT_DBusData::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) |
Definition at line 753 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
double TQT_DBusData::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 failsDefinition at line 549 of file tqdbusdata.cpp.
References d, Double, TQT_DBusData::Private::doubleValue, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQ_INT16 TQT_DBusData::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 failsDefinition at line 411 of file tqdbusdata.cpp.
References d, Int16, TQT_DBusData::Private::int16Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQ_INT16 > TQT_DBusData::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) |
Definition at line 777 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQ_INT32 TQT_DBusData::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 failsDefinition at line 457 of file tqdbusdata.cpp.
References d, Int32, TQT_DBusData::Private::int32Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQ_INT32 > TQT_DBusData::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) |
Definition at line 826 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQ_INT64 TQT_DBusData::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 failsDefinition at line 503 of file tqdbusdata.cpp.
References d, Int64, TQT_DBusData::Private::int64Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQ_INT64 > TQT_DBusData::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) |
Definition at line 875 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusDataList TQT_DBusData::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) |
Definition at line 649 of file tqdbusdata.cpp.
References d, List, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusObjectPath TQT_DBusData::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) |
Definition at line 598 of file tqdbusdata.cpp.
References d, ObjectPath, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQT_DBusObjectPath > TQT_DBusData::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) |
Definition at line 948 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQString TQT_DBusData::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) |
TQString()
if it failsDefinition at line 572 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::pointer, String, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQString > TQT_DBusData::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) |
Definition at line 924 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQValueList< TQT_DBusData > TQT_DBusData::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) |
Definition at line 698 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::pointer, Struct, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQValueList< TQT_DBusData > TQT_DBusData::toTQValueList | ( | 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) |
Definition at line 667 of file tqdbusdata.cpp.
References toList(), and TQT_DBusDataList::toTQValueList().
TQ_UINT16 TQT_DBusData::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 failsDefinition at line 434 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::type, UInt16, TQT_DBusData::Private::uint16Value, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQ_UINT16 > TQT_DBusData::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) |
Definition at line 801 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQ_UINT32 TQT_DBusData::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 failsDefinition at line 480 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::type, UInt32, TQT_DBusData::Private::uint32Value, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQ_UINT32 > TQT_DBusData::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) |
Definition at line 850 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQ_UINT64 TQT_DBusData::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 failsDefinition at line 526 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::type, UInt64, TQT_DBusData::Private::uint64Value, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQ_UINT64 > TQT_DBusData::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) |
Definition at line 899 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusUnixFd TQT_DBusData::toUnixFd | ( | bool * | ok = 0 | ) | const |
Tries to get the encapsulated unix file handle value.
If the data object is not of type UnixFd 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 UnixFd) |
Definition at line 624 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, UnixFd, and TQT_DBusData::Private::value.
TQT_DBusDataMap< TQT_DBusUnixFd > TQT_DBusData::toUnixFdKeyMap | ( | 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 UnixFd 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 UnixFd) |
Definition at line 973 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.
TQT_DBusVariant TQT_DBusData::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) |
Definition at line 721 of file tqdbusdata.cpp.
References d, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, TQT_DBusData::Private::value, and Variant.
TQT_DBusData::Type TQT_DBusData::type | ( | ) | const |
Returns the Type of the data object.
Definition at line 317 of file tqdbusdata.cpp.
References d, and TQT_DBusData::Private::type.
|
inline |
Returns the string representation of the object's Type.
Definition at line 385 of file tqdbusdata.h.
References typeName().
|
static |
Returns the string representation for the given type
.
type | the Type to get the string representation for |
type
Definition at line 329 of file tqdbusdata.cpp.
References Bool, Byte, Double, Int16, Int32, Int64, Invalid, List, Map, ObjectPath, String, Struct, type(), UInt16, UInt32, UInt64, UnixFd, and Variant.
|
private |
Definition at line 1226 of file tqdbusdata.h.