Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdbusargument_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QDBUSARGUMENT_P_H
5#define QDBUSARGUMENT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the QLibrary class. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtDBus/private/qtdbusglobal_p.h>
19#include <qdbusargument.h>
20#include "qdbusconnection.h"
22#include "qdbus_symbols_p.h"
23
24#ifndef QT_NO_DBUS
25
26#ifndef DBUS_TYPE_UNIX_FD
27# define DBUS_TYPE_UNIX_FD int('h')
28# define DBUS_TYPE_UNIX_FD_AS_STRING "h"
29#endif
30
32
33class QDBusMarshaller;
36{
37 Q_DISABLE_COPY_MOVE(QDBusArgumentPrivate)
38public:
40
41 virtual ~QDBusArgumentPrivate();
42
43 static bool checkRead(QDBusArgumentPrivate *d);
45 static bool checkWrite(QDBusArgumentPrivate *&d);
46
49
52 {
54 return q;
55 }
57 { return q.d; }
58
59 DBusMessage *message = nullptr;
61 QDBusConnection::ConnectionCapabilities capabilities;
63
64protected:
66 QDBusConnection::ConnectionCapabilities flags = {})
68 {
69 }
70};
71
73{
74public:
75 explicit QDBusMarshaller(QDBusConnection::ConnectionCapabilities flags = {})
77 {
78 }
80
82
83 void append(uchar arg);
84 void append(bool arg);
85 void append(short arg);
86 void append(ushort arg);
87 void append(int arg);
88 void append(uint arg);
89 void append(qlonglong arg);
90 void append(qulonglong arg);
91 void append(double arg);
92 void append(const QString &arg);
93 void append(const QDBusObjectPath &arg);
94 void append(const QDBusSignature &arg);
96 void append(const QStringList &arg);
97 void append(const QByteArray &arg);
98 bool append(const QDBusVariant &arg); // this one can fail
99
108 QDBusMarshaller *beginCommon(int code, const char *signature);
110 void open(QDBusMarshaller &sub, int code, const char *signature);
111 void close();
112 void error(const QString &message);
113
115 bool appendRegisteredType(const QVariant &arg);
117
120 QByteArray *ba = nullptr;
122 char closeCode = 0;
123 bool ok = true;
124 bool skipSignature = false;
125
126private:
127 Q_DECL_COLD_FUNCTION void unregisteredTypeError(QMetaType t);
128 Q_DISABLE_COPY_MOVE(QDBusMarshaller)
129};
130
132{
133public:
134 explicit QDBusDemarshaller(QDBusConnection::ConnectionCapabilities flags = {})
136 {
137 }
139
141
142 uchar toByte();
143 bool toBool();
145 short toShort();
146 int toInt();
147 uint toUInt();
150 double toDouble();
158
170 inline void close() { }
171
172 bool atEnd();
173
177
180
181private:
182 Q_DISABLE_COPY_MOVE(QDBusDemarshaller)
183 QString toStringUnchecked();
184 QDBusObjectPath toObjectPathUnchecked();
185 QDBusSignature toSignatureUnchecked();
186 QStringList toStringListUnchecked();
187 QByteArray toByteArrayUnchecked();
188};
189
191{ return static_cast<QDBusMarshaller *>(this); }
192
194{ return static_cast<QDBusDemarshaller *>(this); }
195
197
198#endif // QT_NO_DBUS
199#endif
\inmodule QtCore
Definition qatomic.h:112
\inmodule QtCore
Definition qbytearray.h:57
static QDBusArgument create(QDBusArgumentPrivate *d)
QDBusDemarshaller * demarshaller()
static bool checkReadAndDetach(QDBusArgumentPrivate *&d)
virtual ~QDBusArgumentPrivate()
QDBusArgumentPrivate(Direction direction, QDBusConnection::ConnectionCapabilities flags={})
QDBusConnection::ConnectionCapabilities capabilities
static QByteArray createSignature(QMetaType type)
static QDBusArgumentPrivate * d(QDBusArgument &q)
QDBusMarshaller * marshaller()
static bool checkRead(QDBusArgumentPrivate *d)
static bool checkWrite(QDBusArgumentPrivate *&d)
\inmodule QtDBus
QDBusDemarshaller * beginArray()
QDBusArgument duplicate()
QDBusDemarshaller * endArray()
QDBusDemarshaller * endStructure()
QDBusDemarshaller * endMapEntry()
QDBusSignature toSignature()
QDBusUnixFileDescriptor toUnixFileDescriptor()
QDBusObjectPath toObjectPath()
QDBusDemarshaller * beginStructure()
QDBusDemarshaller * endCommon()
QDBusDemarshaller * beginMapEntry()
QDBusDemarshaller(QDBusConnection::ConnectionCapabilities flags={})
QDBusDemarshaller * beginCommon()
DBusMessageIter iterator
QDBusDemarshaller * endMap()
QDBusDemarshaller * beginMap()
QDBusDemarshaller * parent
QDBusArgument::ElementType currentType()
void append(uchar arg)
QDBusMarshaller * parent
QDBusMarshaller * endMapEntry()
QDBusMarshaller * endCommon()
QDBusMarshaller * endStructure()
void open(QDBusMarshaller &sub, int code, const char *signature)
QString currentSignature()
bool appendVariantInternal(const QVariant &arg)
QDBusMarshaller * beginMap(QMetaType kid, QMetaType vid)
QDBusMarshaller(QDBusConnection::ConnectionCapabilities flags={})
QDBusMarshaller * endMap()
QDBusMarshaller * beginCommon(int code, const char *signature)
QDBusMarshaller * beginMapEntry()
bool appendRegisteredType(const QVariant &arg)
QDBusMarshaller * beginStructure()
QDBusMarshaller * beginArray(QMetaType id)
bool appendCrossMarshalling(QDBusDemarshaller *arg)
DBusMessageIter iterator
QDBusMarshaller * endArray()
\inmodule QtDBus
\inmodule QtDBus
\inmodule QtDBus
\inmodule QtCore
Definition qmetatype.h:341
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
#define Q_DECL_COLD_FUNCTION
DBusConnection const char DBusError * error
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter * sub
GLenum type
GLbitfield flags
GLuint GLsizei const GLchar * message
GLint ref
GLdouble GLdouble t
Definition qopenglext.h:243
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
SSL_CTX int void * arg
unsigned char uchar
Definition qtypes.h:32
quint64 qulonglong
Definition qtypes.h:64
unsigned int uint
Definition qtypes.h:34
unsigned short ushort
Definition qtypes.h:33
qint64 qlonglong
Definition qtypes.h:63