8#include <QtCore/qlist.h>
9#include <QtCore/qstringlist.h>
10#include <private/qtools_p.h>
32 || (u ==
'_') || (u ==
'-');
40#ifndef QT_BOOTSTRAPPED
45 int argType =
arg.metaType().id();
47 if (argType == QMetaType::QStringList) {
51 out += u
'\"' +
item +
"\", "_L1;
55 }
else if (argType == QMetaType::QByteArray) {
65 }
else if (argType == QMetaType::QVariantList) {
76 }
else if (argType == QMetaType::Char || argType == QMetaType::Short || argType == QMetaType::Int
77 || argType == QMetaType::Long || argType == QMetaType::LongLong) {
79 }
else if (argType == QMetaType::UChar || argType == QMetaType::UShort || argType == QMetaType::UInt
80 || argType == QMetaType::ULong || argType == QMetaType::ULongLong) {
82 }
else if (argType == QMetaType::Double) {
84 }
else if (argType == QMetaType::Bool) {
85 out +=
arg.toBool() ?
"true"_L1 :
"false"_L1;
86 }
else if (argType == qMetaTypeId<QDBusArgument>()) {
88 }
else if (argType == qMetaTypeId<QDBusObjectPath>()) {
90 out +=
"[ObjectPath: "_L1;
93 }
else if (argType == qMetaTypeId<QDBusSignature>()) {
94 out +=
"[Signature: "_L1 + qvariant_cast<QDBusSignature>(
arg).signature();
96 }
else if (argType == qMetaTypeId<QDBusUnixFileDescriptor>()) {
97 out +=
"[Unix FD: "_L1;
98 out += qvariant_cast<QDBusUnixFileDescriptor>(
arg).isValid() ?
"valid"_L1 :
"not valid"_L1;
100 }
else if (argType == qMetaTypeId<QDBusVariant>()) {
101 const QVariant v = qvariant_cast<QDBusVariant>(
arg).variant();
102 out +=
"[Variant"_L1;
104 if (vUserType != QMetaType::fromType<QDBusVariant>()
105 && vUserType != QMetaType::fromType<QDBusSignature>()
106 && vUserType != QMetaType::fromType<QDBusObjectPath>()
107 && vUserType != QMetaType::fromType<QDBusArgument>())
114 out += u
'\"' +
arg.toString() + u
'\"';
127 bool doIterate =
false;
132 out +=
"[Argument: "_L1 + busSig + u
' ';
134 switch (elementType) {
165 out +=
"<ERROR - Unknown Type>"_L1;
168 if (doIterate && !busArg.
atEnd()) {
169 while (!busArg.
atEnd()) {
176 switch (elementType) {
229 return signature + 1;
258 return signature + 1;
285#ifndef QT_BOOTSTRAPPED
305 for (
int i = 0;
i < part.
size(); ++
i)
338 if (parts.size() < 2)
341 for (
auto part : parts)
361 const auto parts = connName.
mid(1).
split(u
'.');
362 if (parts.size() < 1)
369 const QChar*
c = part.data();
370 for (
int j = 0;
j < part.size(); ++
j)
408 if (parts.size() < 1)
415 const QChar *
c = part.data();
418 for (
int j = 0;
j < part.size(); ++
j)
440 for (
int j = 0;
j < memberName.
size(); ++
j)
480 if (!
path.startsWith(u
'/') ||
path.indexOf(
"//"_L1) != -1 ||
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
void endArray()
Closes a D-Bus array opened with beginArray().
QVariant asVariant() const
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
void endMap()
Closes a D-Bus map opened with beginMap().
bool atEnd() const
Returns true if there are no more elements to be extracted from this QDBusArgument.
QString currentSignature() const
void endStructure()
Closes a D-Bus structure opened with beginStructure().
ElementType currentType() const
void beginArray(int elementMetaTypeId)
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
bool startsWith(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
constexpr qsizetype size() const noexcept
Returns the size of this string view, in UTF-16 code units (that is, surrogate pairs count as two for...
const_pointer data() const noexcept
Q_CORE_EXPORT QList< QStringView > split(QStringView sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the view into substring views wherever sep occurs, and returns the list of those string views.
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
qsizetype size() const
Returns the number of characters in this string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
#define DBUS_DICT_ENTRY_END_CHAR
#define DBUS_STRUCT_BEGIN_CHAR
#define DBUS_MAXIMUM_NAME_LENGTH
#define DBUS_TYPE_INVALID
#define DBUS_DICT_ENTRY_BEGIN_CHAR
#define DBUS_STRUCT_END_CHAR
bool isValidMemberName(QStringView memberName)
Returns true if memberName is a valid member name.
bool isValidInterfaceName(const QString &ifaceName)
Returns true if this is ifaceName is a valid interface name.
bool isValidErrorName(const QString &errorName)
Returns true if errorName is a valid error name.
bool isValidPartOfObjectPath(QStringView part)
bool isValidUniqueConnectionName(QStringView connName)
Returns true if connName is a valid unique connection name.
bool isValidBusName(const QString &busName)
Returns true if busName is a valid bus name.
bool isValidObjectPath(const QString &path)
Returns true if path is valid object path.
QString argumentToString(const QVariant &arg)
bool isValidBasicType(int c)
Returns true if c is a valid, basic D-Bus type.
bool isValidSignature(const QString &signature)
Returns true if signature is a valid D-Bus type signature for one or more types.
bool isValidFixedType(int c)
Returns true if c is a valid, fixed D-Bus type.
bool isValidSingleSignature(const QString &signature)
Returns true if signature is a valid D-Bus type signature for exactly one full type.
Combined button and popup list for selecting options.
constexpr bool isAsciiDigit(char32_t c) noexcept
constexpr bool isAsciiLetterOrNumber(char32_t c) noexcept
static bool argToString(const QDBusArgument &arg, QString &out)
static bool isFixedType(int c)
static const char basicTypes[]
static bool variantToString(const QVariant &arg, QString &out)
static const char * validateSingleType(const char *signature)
static bool isBasicType(int c)
static const char fixedTypes[]
static bool isValidCharacterNoDash(QChar c)
static const char oneLetterTypes[]
static bool isValidCharacter(QChar c)
static bool isValidNumber(QChar c)
GLsizei const GLfloat * v
[13]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei const GLchar *const * path
QTextStream out(stdout)
[7]