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
QDBusUtil Namespace Reference

\inmodule QtDBus More...

Enumerations

enum  AllowEmptyFlag { EmptyAllowed , EmptyNotAllowed }
 

Functions

QString argumentToString (const QVariant &arg)
 
bool isValidPartOfObjectPath (QStringView part)
 
bool isValidInterfaceName (const QString &ifaceName)
 Returns true if this is ifaceName is a valid interface name.
 
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 isValidMemberName (QStringView memberName)
 Returns true if memberName is a valid member name.
 
bool isValidErrorName (const QString &errorName)
 Returns true if errorName is a valid error name.
 
bool isValidObjectPath (const QString &path)
 Returns true if path is valid object path.
 
bool isValidBasicType (int c)
 Returns true if c is a valid, basic D-Bus type.
 
bool isValidFixedType (int c)
 Returns true if c is a valid, fixed 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 isValidSingleSignature (const QString &signature)
 Returns true if signature is a valid D-Bus type signature for exactly one full type.
 
bool checkInterfaceName (const QString &name, AllowEmptyFlag empty, QDBusError *error)
 
bool checkBusName (const QString &name, AllowEmptyFlag empty, QDBusError *error)
 
bool checkObjectPath (const QString &path, AllowEmptyFlag empty, QDBusError *error)
 
bool checkMemberName (const QString &name, AllowEmptyFlag empty, QDBusError *error, const char *nameType=nullptr)
 
bool checkErrorName (const QString &name, AllowEmptyFlag empty, QDBusError *error)
 
QString dbusService ()
 
QString dbusPath ()
 
QString dbusPathLocal ()
 
QString dbusInterface ()
 
QString dbusInterfaceProperties ()
 
QString dbusInterfaceIntrospectable ()
 
QString nameOwnerChanged ()
 
QString disconnectedErrorMessage ()
 

Detailed Description

\inmodule QtDBus

The QDBusUtil namespace contains a few functions that are of general use when dealing with D-Bus strings.

Enumeration Type Documentation

◆ AllowEmptyFlag

Enumerator
EmptyAllowed 
EmptyNotAllowed 

Definition at line 57 of file qdbusutil_p.h.

Function Documentation

◆ argumentToString()

Q_DBUS_EXPORT QString QDBusUtil::argumentToString ( const QVariant & arg)
Since
4.5 Dumps the contents of a Qt D-Bus argument from arg into a string.

Definition at line 296 of file qdbusutil.cpp.

References arg, out, Q_UNUSED, and variantToString().

Referenced by debugVariantList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkBusName()

bool QDBusUtil::checkBusName ( const QString & name,
AllowEmptyFlag empty,
QDBusError * error )
inline

Definition at line 74 of file qdbusutil_p.h.

References arg, checkBusName(), EmptyAllowed, error, QDBusError::InvalidService, and isValidBusName().

Referenced by QDBusAbstractInterfacePrivate::canMakeCalls(), checkBusName(), checkIfValid(), and QDBusMessagePrivate::toDBusMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkErrorName()

bool QDBusUtil::checkErrorName ( const QString & name,
AllowEmptyFlag empty,
QDBusError * error )
inline

Definition at line 112 of file qdbusutil_p.h.

References arg, checkErrorName(), EmptyAllowed, error, QDBusError::InvalidInterface, and isValidErrorName().

Referenced by checkErrorName(), and QDBusMessagePrivate::toDBusMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkInterfaceName()

bool QDBusUtil::checkInterfaceName ( const QString & name,
AllowEmptyFlag empty,
QDBusError * error )
inline

Definition at line 62 of file qdbusutil_p.h.

References arg, checkInterfaceName(), EmptyAllowed, error, QDBusError::InvalidInterface, and isValidInterfaceName().

Referenced by checkIfValid(), checkInterfaceName(), and QDBusMessagePrivate::toDBusMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkMemberName()

bool QDBusUtil::checkMemberName ( const QString & name,
AllowEmptyFlag empty,
QDBusError * error,
const char * nameType = nullptr )
inline

Definition at line 98 of file qdbusutil_p.h.

References arg, checkMemberName(), EmptyAllowed, error, QDBusError::InvalidMember, and isValidMemberName().

Referenced by checkMemberName(), and QDBusMessagePrivate::toDBusMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkObjectPath()

bool QDBusUtil::checkObjectPath ( const QString & path,
AllowEmptyFlag empty,
QDBusError * error )
inline

Definition at line 86 of file qdbusutil_p.h.

References arg, checkObjectPath(), EmptyAllowed, error, QDBusError::InvalidObjectPath, and isValidObjectPath().

Referenced by QDBusAbstractInterfacePrivate::canMakeCalls(), checkIfValid(), checkObjectPath(), and QDBusMessagePrivate::toDBusMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbusInterface()

QString QDBusUtil::dbusInterface ( )
inline

Definition at line 130 of file qdbusutil_p.h.

References DBUS_INTERFACE_DBUS, dbusInterface(), dbusService(), and Q_ASSERT.

Referenced by dbusInterface().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbusInterfaceIntrospectable()

QString QDBusUtil::dbusInterfaceIntrospectable ( )
inline

Definition at line 138 of file qdbusutil_p.h.

References DBUS_INTERFACE_INTROSPECTABLE, dbusInterfaceIntrospectable(), and QStringLiteral.

Referenced by dbusInterfaceIntrospectable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbusInterfaceProperties()

QString QDBusUtil::dbusInterfaceProperties ( )
inline

Definition at line 136 of file qdbusutil_p.h.

References DBUS_INTERFACE_PROPERTIES, dbusInterfaceProperties(), and QStringLiteral.

Referenced by dbusInterfaceProperties(), QDBusAbstractInterfacePrivate::property(), and QDBusAbstractInterfacePrivate::setProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbusPath()

QString QDBusUtil::dbusPath ( )
inline

Definition at line 126 of file qdbusutil_p.h.

References DBUS_PATH_DBUS, dbusPath(), and QStringLiteral.

Referenced by dbusPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbusPathLocal()

QString QDBusUtil::dbusPathLocal ( )
inline

Definition at line 128 of file qdbusutil_p.h.

References DBUS_PATH_LOCAL, dbusPathLocal(), and QStringLiteral.

Referenced by dbusPathLocal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbusService()

QString QDBusUtil::dbusService ( )
inline

Definition at line 124 of file qdbusutil_p.h.

References DBUS_SERVICE_DBUS, dbusService(), and QStringLiteral.

Referenced by QDBusConnectionPrivate::QDBusConnectionPrivate(), dbusInterface(), dbusService(), and QDBusConnectionPrivate::setConnection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ disconnectedErrorMessage()

QString QDBusUtil::disconnectedErrorMessage ( )
inline

Definition at line 142 of file qdbusutil_p.h.

References disconnectedErrorMessage(), and QStringLiteral.

Referenced by QDBusAbstractInterfacePrivate::QDBusAbstractInterfacePrivate(), QDBusConnection::call(), QDBusConnection::callWithCallback(), disconnectedErrorMessage(), QDBusPendingCall::error(), QDBusConnection::lastError(), QDBusServer::lastError(), QDBusConnectionPrivate::processFinishedCall(), and QDBusConnection::send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidBasicType()

Q_DBUS_EXPORT bool QDBusUtil::isValidBasicType ( int c)

Returns true if c is a valid, basic D-Bus type.

Definition at line 489 of file qdbusutil.cpp.

References isBasicType().

Referenced by QDBusMarshaller::appendCrossMarshalling(), and QDBusMarshaller::beginMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidBusName()

Q_DBUS_EXPORT bool QDBusUtil::isValidBusName ( const QString & busName)

Returns true if busName is a valid bus name.

A valid bus name is either a valid unique connection name or follows the rules: \list

  • is not empty
  • does not exceed 255 characters in length
  • be composed of dot-separated string components that contain only ASCII letters, digits, hyphens or underscores ("_"), but don't start with a digit
  • contains at least two such elements \endlist
See also
isValidUniqueConnectionName()

Definition at line 401 of file qdbusutil.cpp.

References DBUS_MAXIMUM_NAME_LENGTH, isValidCharacter(), isValidNumber(), isValidUniqueConnectionName(), j, and QStringView::split().

Referenced by checkBusName(), and QDBusConnection::connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidErrorName()

Q_DBUS_EXPORT bool QDBusUtil::isValidErrorName ( const QString & errorName)

Returns true if errorName is a valid error name.

Valid error names are valid interface names and vice-versa, so this function is actually an alias for isValidInterfaceName.

Definition at line 450 of file qdbusutil.cpp.

References isValidInterfaceName().

Referenced by checkErrorName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidFixedType()

Q_DBUS_EXPORT bool QDBusUtil::isValidFixedType ( int c)

Returns true if c is a valid, fixed D-Bus type.

Definition at line 498 of file qdbusutil.cpp.

References isFixedType().

Referenced by QDBusMarshaller::appendCrossMarshalling().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidInterfaceName()

Q_DBUS_EXPORT bool QDBusUtil::isValidInterfaceName ( const QString & ifaceName)

Returns true if this is ifaceName is a valid interface name.

Valid interface names must: \list

  • not be empty
  • not exceed 255 characters in length
  • be composed of dot-separated string components that contain only ASCII letters, digits and the underscore ("_") character
  • contain at least two such components \endlist

Definition at line 340 of file qdbusutil.cpp.

References DBUS_MAXIMUM_NAME_LENGTH, isValidMemberName(), and QStringView::split().

Referenced by checkInterfaceName(), QDBusConnection::connect(), QDBusConnection::disconnect(), and isValidErrorName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidMemberName()

Q_DBUS_EXPORT bool QDBusUtil::isValidMemberName ( QStringView memberName)

Returns true if memberName is a valid member name.

A valid member name does not exceed 255 characters in length, is not empty, is composed only of ASCII letters, digits and underscores, but does not start with a digit.

Definition at line 431 of file qdbusutil.cpp.

References DBUS_MAXIMUM_NAME_LENGTH, isValidCharacterNoDash(), isValidNumber(), and j.

Referenced by checkMemberName(), and isValidInterfaceName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidObjectPath()

Q_DBUS_EXPORT bool QDBusUtil::isValidObjectPath ( const QString & path)

Returns true if path is valid object path.

Valid object paths follow the rules: \list

  • start with the slash character ("/")
  • do not end in a slash, unless the path is just the initial slash
  • contain slash-separated parts, each of which is not empty, and composed only of ASCII letters, digits and underscores ("_"). \endlist

Definition at line 467 of file qdbusutil.cpp.

References isValidPartOfObjectPath(), and QStringView::mid().

Referenced by checkObjectPath(), QDBusConnection::connect(), QDBusConnection::objectRegisteredAt(), QDBusConnection::registerObject(), and QDBusConnection::unregisterObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidPartOfObjectPath()

Q_DBUS_EXPORT bool QDBusUtil::isValidPartOfObjectPath ( QStringView part)

See isValidObjectPath

Definition at line 314 of file qdbusutil.cpp.

References QStringView::data(), i, QStringView::isEmpty(), isValidCharacterNoDash(), and QStringView::size().

Referenced by generateSubObjectXml(), and isValidObjectPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidSignature()

Q_DBUS_EXPORT bool QDBusUtil::isValidSignature ( const QString & signature)

Returns true if signature is a valid D-Bus type signature for one or more types.

This function returns true if it can all of signature into valid, individual types and no characters remain in signature.

See also
isValidSingleSignature()

Definition at line 512 of file qdbusutil.cpp.

References ba, QByteArray::constBegin(), QByteArray::constEnd(), and validateSingleType().

+ Here is the call graph for this function:

◆ isValidSingleSignature()

Q_DBUS_EXPORT bool QDBusUtil::isValidSingleSignature ( const QString & signature)

Returns true if signature is a valid D-Bus type signature for exactly one full type.

This function tries to convert the type signature into a D-Bus type and, if it succeeds and no characters remain in the signature, it returns true.

Definition at line 531 of file qdbusutil.cpp.

References ba, QByteArray::constData(), and validateSingleType().

Referenced by QDBusArgumentPrivate::createSignature().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidUniqueConnectionName()

Q_DBUS_EXPORT bool QDBusUtil::isValidUniqueConnectionName ( QStringView connName)

Returns true if connName is a valid unique connection name.

Unique connection names start with a colon (":") and are followed by a list of dot-separated components composed of ASCII letters, digits, the hyphen or the underscore ("_") character.

Definition at line 363 of file qdbusutil.cpp.

References DBUS_MAXIMUM_NAME_LENGTH, QStringView::isEmpty(), isValidCharacter(), j, QStringView::mid(), QStringView::size(), and QStringView::startsWith().

Referenced by isValidBusName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nameOwnerChanged()

QString QDBusUtil::nameOwnerChanged ( )
inline

Definition at line 140 of file qdbusutil_p.h.

References nameOwnerChanged(), and QStringLiteral.

Referenced by nameOwnerChanged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: