Qt 4.8
|
The QDBusArgument class is used to marshall and demarshall D-Bus arguments. More...
#include <qdbusargument.h>
Public Types | |
enum | ElementType { BasicType, VariantType, ArrayType, StructureType, MapType, MapEntryType, UnknownType = -1 } |
This enum describes the type of element held by the argument. More... | |
Public Functions | |
void | appendVariant (const QVariant &v) |
Appends the variant v. More... | |
QVariant | asVariant () const |
Returns the current argument in the form of a QVariant. More... | |
bool | atEnd () const |
Returns true if there are no more elements to be extracted from this QDBusArgument. More... | |
void | beginArray (int elementMetaTypeId) |
Opens a new D-Bus array suitable for appending elements of meta-type id. More... | |
void | beginArray () const |
Recurses into the D-Bus array to allow extraction of the array elements. More... | |
void | beginMap (int keyMetaTypeId, int valueMetaTypeId) |
Opens a new D-Bus map suitable for appending elements. More... | |
void | beginMap () const |
Recurses into the D-Bus map to allow extraction of the map's elements. More... | |
void | beginMapEntry () |
Opens a D-Bus map entry suitable for appending the key and value entries. More... | |
void | beginMapEntry () const |
Recurses into the D-Bus map entry to allow extraction of the key and value pair. More... | |
void | beginStructure () |
Opens a new D-Bus structure suitable for appending new arguments. More... | |
void | beginStructure () const |
Opens a D-Bus structure suitable for extracting elements. More... | |
QString | currentSignature () const |
Returns the type signature of the D-Bus type this QDBusArgument object is currently pointing to. More... | |
ElementType | currentType () const |
Returns the classification of the current element type. More... | |
void | endArray () |
Closes a D-Bus array opened with beginArray(). More... | |
void | endArray () const |
Closes the D-Bus array and allow extracting of the next element after the array. More... | |
void | endMap () |
Closes a D-Bus map opened with beginMap(). More... | |
void | endMap () const |
Closes the D-Bus map and allow extracting of the next element after the map. More... | |
void | endMapEntry () |
Closes a D-Bus map entry opened with beginMapEntry(). More... | |
void | endMapEntry () const |
Closes the D-Bus map entry and allow extracting of the next element on the map. More... | |
void | endStructure () |
Closes a D-Bus structure opened with beginStructure(). More... | |
void | endStructure () const |
Closes the D-Bus structure and allow extracting of the next element after the structure. More... | |
QDBusArgument & | operator<< (uchar arg) |
Appends the primitive value arg of type BYTE to the D-Bus stream. More... | |
QDBusArgument & | operator<< (bool arg) |
Appends the primitive value arg of type BOOLEAN to the D-Bus stream. More... | |
QDBusArgument & | operator<< (short arg) |
Appends the primitive value arg of type INT16 to the D-Bus stream. More... | |
QDBusArgument & | operator<< (ushort arg) |
Appends the primitive value arg of type UINT16 to the D-Bus stream. More... | |
QDBusArgument & | operator<< (int arg) |
Appends the primitive value arg of type INT32 to the D-Bus stream. More... | |
QDBusArgument & | operator<< (uint arg) |
Appends the primitive value arg of type UINT32 to the D-Bus stream. More... | |
QDBusArgument & | operator<< (qlonglong arg) |
Appends the primitive value arg of type INT64 to the D-Bus stream. More... | |
QDBusArgument & | operator<< (qulonglong arg) |
Appends the primitive value arg of type UINT64 to the D-Bus stream. More... | |
QDBusArgument & | operator<< (double arg) |
Appends the primitive value arg of type DOUBLE (double-precision floating-point) to the D-Bus stream. More... | |
QDBusArgument & | operator<< (const QString &arg) |
Appends the primitive value arg of type STRING (Unicode character string) to the D-Bus stream. More... | |
QDBusArgument & | operator<< (const QDBusVariant &arg) |
Appends the primitive value arg of type VARIANT to the D-Bus stream. More... | |
QDBusArgument & | operator<< (const QDBusObjectPath &arg) |
Appends the primitive value arg of type OBJECT_PATH (path to a D-Bus object) to the D-Bus stream. More... | |
QDBusArgument & | operator<< (const QDBusSignature &arg) |
Appends the primitive value arg of type SIGNATURE (D-Bus type signature) to the D-Bus stream. More... | |
QDBusArgument & | operator<< (const QDBusUnixFileDescriptor &arg) |
Appends the primitive value arg of type UNIX_FILE_DESCRIPTOR (Unix File Descriptor) to the D-Bus stream. More... | |
QDBusArgument & | operator<< (const QStringList &arg) |
Appends the QStringList given by arg as ARRAY of STRING to the D-Bus stream. More... | |
QDBusArgument & | operator<< (const QByteArray &arg) |
Appends the QByteArray given by arg as ARRAY of BYTE to the D-Bus stream. More... | |
QDBusArgument & | operator= (const QDBusArgument &other) |
Copies the other QDBusArgument object into this one. More... | |
const QDBusArgument & | operator>> (uchar &arg) const |
Extracts one D-BUS primitive argument of type BYTE from the D-BUS stream and puts it into arg. More... | |
const QDBusArgument & | operator>> (bool &arg) const |
Extracts one D-Bus primitive argument of type BOOLEAN from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (short &arg) const |
Extracts one D-Bus primitive argument of type INT16 from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (ushort &arg) const |
Extracts one D-Bus primitive argument of type UINT16 from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (int &arg) const |
Extracts one D-Bus primitive argument of type INT32 from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (uint &arg) const |
Extracts one D-Bus primitive argument of type UINT32 from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (qlonglong &arg) const |
Extracts one D-Bus primitive argument of type INT64 from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (qulonglong &arg) const |
Extracts one D-Bus primitive argument of type UINT64 from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (double &arg) const |
Extracts one D-Bus primitive argument of type DOUBLE (double-precision floating pount) from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (QString &arg) const |
Extracts one D-Bus primitive argument of type STRING (Unicode character string) from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (QDBusVariant &arg) const |
Extracts one D-Bus primitive argument of type VARIANT from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (QDBusObjectPath &arg) const |
Extracts one D-Bus primitive argument of type OBJECT_PATH (D-Bus path to an object) from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (QDBusSignature &arg) const |
Extracts one D-Bus primitive argument of type SIGNATURE (D-Bus type signature) from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (QDBusUnixFileDescriptor &arg) const |
Extracts one D-Bus primitive argument of type UNIX_FILE_DESCRIPTOR (Unix file descriptor) from the D-Bus stream. More... | |
const QDBusArgument & | operator>> (QStringList &arg) const |
Extracts an array of strings from the D-Bus stream and return it as a QStringList. More... | |
const QDBusArgument & | operator>> (QByteArray &arg) const |
Extracts an array of bytes from the D-Bus stream and return it as a QByteArray. More... | |
QDBusArgument () | |
Constructs an empty QDBusArgument argument. More... | |
QDBusArgument (const QDBusArgument &other) | |
Constructs a copy of the other QDBusArgument object. More... | |
~QDBusArgument () | |
Disposes of the resources associated with this QDBusArgument object. More... | |
Protected Functions | |
QDBusArgument (QDBusArgumentPrivate *d) | |
Protected Variables | |
QDBusArgumentPrivate * | d |
Friends | |
class | QDBusArgumentPrivate |
Related Functions | |
(Note that these are not member functions.) | |
qdbus_cast (const QDBusArgument &argument) | |
Attempts to demarshall the contents of argument into the type T . More... | |
int | qDBusRegisterMetaType () |
Registers T with the qdbustypesystem . More... | |
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
QDBusArgument is the central class in the QtDBus type system, providing functions to marshall and demarshall the primitive types. The compound types are then created by association of one or more of the primitive types in arrays, dictionaries or structures.
The following example illustrates how a structure containing an integer and a string can be constructed using the QtDBus type system:
struct MyStructure { int count; QString name; }; Q_DECLARE_METATYPE(MyStructure) // Marshall the MyStructure data into a D-Bus argument QDBusArgument &operator<<(QDBusArgument &argument, const MyStructure &mystruct) { argument.beginStructure(); argument << mystruct.count << mystruct.name; argument.endStructure(); return argument; } // Retrieve the MyStructure data from the D-Bus argument const QDBusArgument &operator>>(const QDBusArgument &argument, MyStructure &mystruct) { argument.beginStructure(); argument >> mystruct.count >> mystruct.name; argument.endStructure(); return argument; }
The type has to be registered with qDBusRegisterMetaType() before it can be used with QDBusArgument. Therefore, somewhere in your program, you should add the following code:
qDBusRegisterMetaType();
Once registered, a type can be used in outgoing method calls (placed with QDBusAbstractInterface::call()), signal emissions from registered objects or in incoming calls from remote applications.
It is important to note that the operator<< and operator>> streaming functions must always produce the same number of entries in case of structures, both in reading and in writing (marshalling and demarshalling), otherwise calls and signals may start to silently fail.
The following example illustrates this wrong usage in context of a class that may contain invalid data:
Wrongly marshall the MyTime data into a D-Bus argument QDBusArgument &operator<<(QDBusArgument &argument, const MyTime &mytime) { argument.beginStructure(); if (mytime.isValid) argument << true << mytime.hour << mytime.minute << mytime.second; else argument << false; argument.endStructure(); return argument; }
In this example, both the operator<<
and the operator>>
functions may produce a different number of reads/writes. This can confuse the QtDBus type system and should be avoided.
Definition at line 69 of file qdbusargument.h.
This enum describes the type of element held by the argument.
Enumerator | |
---|---|
BasicType | |
VariantType | |
ArrayType | |
StructureType | |
MapType | |
MapEntryType | |
UnknownType |
Definition at line 72 of file qdbusargument.h.
QDBusArgument::QDBusArgument | ( | ) |
Constructs an empty QDBusArgument argument.
An empty QDBusArgument object does not allow either reading or writing to be performed.
Definition at line 299 of file qdbusargument.cpp.
QDBusArgument::QDBusArgument | ( | const QDBusArgument & | other | ) |
Constructs a copy of the other QDBusArgument object.
Both objects will therefore contain the same state from this point forward. QDBusArguments are explicitly shared and, therefore, any modification to either copy will affect the other one too.
Definition at line 321 of file qdbusargument.cpp.
QDBusArgument::~QDBusArgument | ( | ) |
Disposes of the resources associated with this QDBusArgument object.
Definition at line 353 of file qdbusargument.cpp.
|
protected |
Definition at line 331 of file qdbusargument.cpp.
void QDBusArgument::appendVariant | ( | const QVariant & | v | ) |
Appends the variant v.
Definition at line 616 of file qdbusargument.cpp.
QVariant QDBusArgument::asVariant | ( | ) | const |
Returns the current argument in the form of a QVariant.
Basic types will be decoded and returned in the QVariant, but for complex types, this function will return a QDBusArgument object in the QVariant. It is the caller's responsibility to decode the argument (for example, by calling asVariant() in it).
For example, if the current argument is an INT32, this function will return a QVariant with an argument of type QVariant::Int. For an array of INT32, it will return a QVariant containing a QDBusArgument.
If an error occurs or if there are no more arguments to decode (i.e., we are at the end of the argument list), this function will return an invalid QVariant.
Definition at line 1211 of file qdbusargument.cpp.
Referenced by argToString().
bool QDBusArgument::atEnd | ( | ) | const |
Returns true if there are no more elements to be extracted from this QDBusArgument.
This function is usually used in QDBusArgument objects returned from beginMap() and beginArray().
Definition at line 1180 of file qdbusargument.cpp.
Referenced by argToString(), and operator>>().
void QDBusArgument::beginArray | ( | int | id | ) |
Opens a new D-Bus array suitable for appending elements of meta-type id.
This function is used usually in operator<<
streaming operators, as in the following example:
If the type you want to marshall is a QList, QVector or any of the Qt's Container Classes that take one template parameter, you need not declare an operator<<
function for it, since QtDBus provides generic templates to do the job of marshalling the data. The same applies for STL's sequence containers, such as {std::list}
, {std::vector}
, etc.
Definition at line 971 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::beginArray | ( | ) | const |
Recurses into the D-Bus array to allow extraction of the array elements.
This function is used usually in operator>>
streaming operators, as in the following example:
If the type you want to demarshall is a QList, QVector or any of the Qt's Container Classes that take one template parameter, you need not declare an operator>>
function for it, since QtDBus provides generic templates to do the job of demarshalling the data. The same applies for STL's sequence containers, such as {std::list}
, {std::vector}
, etc.
Definition at line 1098 of file qdbusargument.cpp.
void QDBusArgument::beginMap | ( | int | kid, |
int | vid | ||
) |
Opens a new D-Bus map suitable for appending elements.
Maps are containers that associate one entry (the key) to another (the value), such as Qt's QMap or QHash. The ids of the map's key and value meta types must be passed in kid and vid respectively.
This function is used usually in operator<<
streaming operators, as in the following example:
If the type you want to marshall is a QMap or QHash, you need not declare an operator<<
function for it, since QtDBus provides generic templates to do the job of marshalling the data.
Definition at line 1007 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::beginMap | ( | ) | const |
Recurses into the D-Bus map to allow extraction of the map's elements.
This function is used usually in operator>>
streaming operators, as in the following example:
If the type you want to demarshall is a QMap or QHash, you need not declare an operator>>
function for it, since QtDBus provides generic templates to do the job of demarshalling the data.
Definition at line 1131 of file qdbusargument.cpp.
void QDBusArgument::beginMapEntry | ( | ) |
Opens a D-Bus map entry suitable for appending the key and value entries.
This function is only valid when a map has been opened with beginMap().
See beginMap() for an example of usage of this function.
Definition at line 1034 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::beginMapEntry | ( | ) | const |
Recurses into the D-Bus map entry to allow extraction of the key and value pair.
See beginMap() for an example of how this function is usually used.
Definition at line 1157 of file qdbusargument.cpp.
void QDBusArgument::beginStructure | ( | ) |
Opens a new D-Bus structure suitable for appending new arguments.
This function is used usually in operator<<
streaming operators, as in the following example:
Structures can contain other structures, so the following code is also valid:
Definition at line 936 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::beginStructure | ( | ) | const |
Opens a D-Bus structure suitable for extracting elements.
This function is used usually in operator>>
streaming operators, as in the following example:
Definition at line 1062 of file qdbusargument.cpp.
QString QDBusArgument::currentSignature | ( | ) | const |
Returns the type signature of the D-Bus type this QDBusArgument object is currently pointing to.
Definition at line 630 of file qdbusargument.cpp.
Referenced by argToString(), copyArgument(), QDBusAbstractInterfacePrivate::property(), and qDBusReplyFill().
QDBusArgument::ElementType QDBusArgument::currentType | ( | ) | const |
Returns the classification of the current element type.
This function only makes sense when demarshalling arguments. If it is used while marshalling, it will always return UnknownType.
Definition at line 652 of file qdbusargument.cpp.
Referenced by argToString().
void QDBusArgument::endArray | ( | ) |
Closes a D-Bus array opened with beginArray().
This function must be called same number of times that beginArray() is called.
Definition at line 983 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::endArray | ( | ) | const |
Closes the D-Bus array and allow extracting of the next element after the array.
Definition at line 1110 of file qdbusargument.cpp.
void QDBusArgument::endMap | ( | ) |
Closes a D-Bus map opened with beginMap().
This function must be called same number of times that beginMap() is called.
Definition at line 1019 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::endMap | ( | ) | const |
Closes the D-Bus map and allow extracting of the next element after the map.
Definition at line 1143 of file qdbusargument.cpp.
void QDBusArgument::endMapEntry | ( | ) |
Closes a D-Bus map entry opened with beginMapEntry().
This function must be called same number of times that beginMapEntry() is called.
Definition at line 1046 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::endMapEntry | ( | ) | const |
Closes the D-Bus map entry and allow extracting of the next element on the map.
Definition at line 1169 of file qdbusargument.cpp.
void QDBusArgument::endStructure | ( | ) |
Closes a D-Bus structure opened with beginStructure().
This function must be called same number of times that beginStructure() is called.
Definition at line 948 of file qdbusargument.cpp.
Referenced by argToString(), operator<<(), and operator>>().
void QDBusArgument::endStructure | ( | ) | const |
Closes the D-Bus structure and allow extracting of the next element after the structure.
Definition at line 1074 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | uchar | arg | ) |
Appends the primitive value arg of type BYTE
to the D-Bus stream.
Definition at line 362 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | bool | arg | ) |
Appends the primitive value arg of type BOOLEAN
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 376 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | short | arg | ) |
Appends the primitive value arg of type INT16
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 390 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | ushort | arg | ) |
Appends the primitive value arg of type UINT16
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 404 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | int | arg | ) |
Appends the primitive value arg of type INT32
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 418 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | uint | arg | ) |
Appends the primitive value arg of type UINT32
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 432 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | qlonglong | arg | ) |
Appends the primitive value arg of type INT64
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 446 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | qulonglong | arg | ) |
Appends the primitive value arg of type UINT64
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 460 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | double | arg | ) |
Appends the primitive value arg of type DOUBLE
(double-precision floating-point) to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 475 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | const QString & | arg | ) |
Appends the primitive value arg of type STRING
(Unicode character string) to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 490 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | const QDBusVariant & | arg | ) |
Appends the primitive value arg of type VARIANT
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
A D-Bus variant type can contain any type, including other variants. It is similar to the Qt QVariant type.
Definition at line 556 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | const QDBusObjectPath & | arg | ) |
Appends the primitive value arg of type OBJECT_PATH
(path to a D-Bus object) to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 506 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | const QDBusSignature & | arg | ) |
Appends the primitive value arg of type SIGNATURE
(D-Bus type signature) to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 522 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | const QDBusUnixFileDescriptor & | arg | ) |
Appends the primitive value arg of type UNIX_FILE_DESCRIPTOR
(Unix File Descriptor) to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 539 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | const QStringList & | arg | ) |
Appends the QStringList given by arg as ARRAY of STRING
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.
Other arrays are supported through compound types in QtDBus.
Definition at line 577 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator<< | ( | const QByteArray & | arg | ) |
Appends the QByteArray given by arg as ARRAY of BYTE
to the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.
Other arrays are supported through compound types in QtDBus.
Definition at line 598 of file qdbusargument.cpp.
QDBusArgument & QDBusArgument::operator= | ( | const QDBusArgument & | other | ) |
Copies the other QDBusArgument object into this one.
Both objects will therefore contain the same state from this point forward. QDBusArguments are explicitly shared and, therefore, any modification to either copy will affect the other one too.
Definition at line 343 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | uchar & | arg | ) | const |
Extracts one D-BUS primitive argument of type BYTE
from the D-BUS stream and puts it into arg.
Definition at line 665 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | bool & | arg | ) | const |
Extracts one D-Bus primitive argument of type BOOLEAN
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 680 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | short & | arg | ) | const |
Extracts one D-Bus primitive argument of type INT16
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 710 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | ushort & | arg | ) | const |
Extracts one D-Bus primitive argument of type UINT16
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 695 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | int & | arg | ) | const |
Extracts one D-Bus primitive argument of type INT32
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 725 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | uint & | arg | ) | const |
Extracts one D-Bus primitive argument of type UINT32
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 740 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | qlonglong & | arg | ) | const |
Extracts one D-Bus primitive argument of type INT64
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 755 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | qulonglong & | arg | ) | const |
Extracts one D-Bus primitive argument of type UINT64
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 770 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | double & | arg | ) | const |
Extracts one D-Bus primitive argument of type DOUBLE
(double-precision floating pount) from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 785 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | QString & | arg | ) | const |
Extracts one D-Bus primitive argument of type STRING
(Unicode character string) from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 800 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | QDBusVariant & | arg | ) | const |
Extracts one D-Bus primitive argument of type VARIANT
from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
A D-Bus variant type can contain any type, including other variants. It is similar to the Qt QVariant type.
In case the variant contains a type not directly supported by QDBusArgument, the value of the returned QDBusVariant will contain another QDBusArgument. It is your responsibility to further demarshall it into another type.
Definition at line 872 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | QDBusObjectPath & | arg | ) | const |
Extracts one D-Bus primitive argument of type OBJECT_PATH
(D-Bus path to an object) from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 816 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | QDBusSignature & | arg | ) | const |
Extracts one D-Bus primitive argument of type SIGNATURE
(D-Bus type signature) from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 832 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | QDBusUnixFileDescriptor & | arg | ) | const |
Extracts one D-Bus primitive argument of type UNIX_FILE_DESCRIPTOR
(Unix file descriptor) from the D-Bus stream.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 849 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | QStringList & | arg | ) | const |
Extracts an array of strings from the D-Bus stream and return it as a QStringList.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.
Other arrays are supported through compound types in QtDBus.
Definition at line 893 of file qdbusargument.cpp.
const QDBusArgument & QDBusArgument::operator>> | ( | QByteArray & | arg | ) | const |
Extracts an array of bytes from the D-Bus stream and return it as a QByteArray.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.
Other arrays are supported through compound types in QtDBus.
Definition at line 914 of file qdbusargument.cpp.
|
related |
Attempts to demarshall the contents of argument into the type T
.
For example:
Note that it is equivalent to the following:
Definition at line 155 of file qdbusargument.h.
|
friend |
Definition at line 151 of file qdbusargument.h.
|
related |
Registers T
with the QtDBus type system and the Qt QMetaType system, if it's not already registered.
To register a type, it must be declared as a meta-type with the Q_DECLARE_METATYPE() macro, and then registered as in the following example:
#includeqDBusRegisterMetaType ();
If T isn't a type derived from one of Qt's container classes, the operator<< and operator>> streaming operators between T and QDBusArgument must be already declared. See the QtDBus type system page for more information on how to declare such types.
This function returns the Qt meta type id for the type (the same value that is returned from qRegisterMetaType()).
\sa QtDBus type system, qRegisterMetaType(), QMetaTypeDefinition at line 79 of file qdbusmetatype.h.
|
mutableprotected |
Definition at line 152 of file qdbusargument.h.
Referenced by appendVariant(), asVariant(), atEnd(), beginArray(), beginMap(), beginMapEntry(), beginStructure(), QDBusArgumentPrivate::createSignature(), currentSignature(), currentType(), QDBusArgumentPrivate::d(), endArray(), endMap(), endMapEntry(), endStructure(), operator<<(), operator=(), operator>>(), operator>>(), QDBusArgument(), and ~QDBusArgument().