Qt 4.8
Functions | Variables
qdbuserror.cpp File Reference
#include "qdbuserror.h"
#include <qdebug.h>
#include <qvarlengtharray.h>
#include "qdbus_symbols_p.h"
#include "qdbusmessage.h"
#include "qdbusmessage_p.h"

Go to the source code of this file.

Functions

static const char * get (QDBusError::ErrorType code)
 
static QDBusError::ErrorType get (const char *name)
 
QDebug operator<< (QDebug dbg, const QDBusError &msg)
 

Variables

static const int errorMessages_count
 
static const int errorMessages_indices []
 
static const char errorMessages_string []
 

Function Documentation

◆ get() [1/2]

static const char* get ( QDBusError::ErrorType  code)
inlinestatic

Definition at line 141 of file qdbuserror.cpp.

Referenced by QDBusError::QDBusError().

142 {
143  int intcode = qBound(0, int(code) - int(QDBusError::Other), errorMessages_count);
145 }
static const int errorMessages_count
Definition: qdbuserror.cpp:138
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
Definition: qglobal.h:1219
static const int errorMessages_indices[]
Definition: qdbuserror.cpp:131
static const char errorMessages_string[]
Definition: qdbuserror.cpp:103

◆ get() [2/2]

static QDBusError::ErrorType get ( const char *  name)
inlinestatic

Definition at line 147 of file qdbuserror.cpp.

148 {
149  if (!name || !*name)
150  return QDBusError::NoError;
151  for (int i = 0; i < errorMessages_count; ++i)
152  if (strcmp(name, errorMessages_string + errorMessages_indices[i]) == 0)
153  return QDBusError::ErrorType(i + int(QDBusError::Other));
154  return QDBusError::Other;
155 }
static const int errorMessages_count
Definition: qdbuserror.cpp:138
ErrorType
In order to facilitate verification of the most common D-Bus errors generated by the D-Bus implementa...
Definition: qdbuserror.h:63
const char * name
static const int errorMessages_indices[]
Definition: qdbuserror.cpp:131
static const char errorMessages_string[]
Definition: qdbuserror.cpp:103

◆ operator<<()

QDebug operator<< ( QDebug  dbg,
const QDBusError msg 
)

Definition at line 374 of file qdbuserror.cpp.

375 {
376  dbg.nospace() << "QDBusError(" << msg.name() << ", " << msg.message() << ')';
377  return dbg.space();
378 }
QDebug & nospace()
Clears the stream&#39;s internal flag that records whether the last character was a space and returns a r...
Definition: qdebug.h:92
QString name() const
Returns this error&#39;s name.
Definition: qdbuserror.cpp:335
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
Definition: qdebug.h:91
QString message() const
Returns the message that the callee associated with this error.
Definition: qdbuserror.cpp:346

Variable Documentation

◆ errorMessages_count

const int errorMessages_count
static
Initial value:
static const int errorMessages_indices[]
Definition: qdbuserror.cpp:131

Definition at line 138 of file qdbuserror.cpp.

Referenced by get().

◆ errorMessages_indices

const int errorMessages_indices[]
static
Initial value:
= {
0, 6, 40, 76, 118, 153, 191, 231,
273, 313, 349, 384, 421, 461, 501, 540,
581, 617, 661, 705, 746, 787, 829, 874,
918, 0
}

Definition at line 131 of file qdbuserror.cpp.

Referenced by get().

◆ errorMessages_string

const char errorMessages_string[]
static
Initial value:
=
"other\0"
"org.freedesktop.DBus.Error.Failed\0"
"org.freedesktop.DBus.Error.NoMemory\0"
"org.freedesktop.DBus.Error.ServiceUnknown\0"
"org.freedesktop.DBus.Error.NoReply\0"
"org.freedesktop.DBus.Error.BadAddress\0"
"org.freedesktop.DBus.Error.NotSupported\0"
"org.freedesktop.DBus.Error.LimitsExceeded\0"
"org.freedesktop.DBus.Error.AccessDenied\0"
"org.freedesktop.DBus.Error.NoServer\0"
"org.freedesktop.DBus.Error.Timeout\0"
"org.freedesktop.DBus.Error.NoNetwork\0"
"org.freedesktop.DBus.Error.AddressInUse\0"
"org.freedesktop.DBus.Error.Disconnected\0"
"org.freedesktop.DBus.Error.InvalidArgs\0"
"org.freedesktop.DBus.Error.UnknownMethod\0"
"org.freedesktop.DBus.Error.TimedOut\0"
"org.freedesktop.DBus.Error.InvalidSignature\0"
"org.freedesktop.DBus.Error.UnknownInterface\0"
"com.trolltech.QtDBus.Error.InternalError\0"
"org.freedesktop.DBus.Error.UnknownObject\0"
"com.trolltech.QtDBus.Error.InvalidService\0"
"com.trolltech.QtDBus.Error.InvalidObjectPath\0"
"com.trolltech.QtDBus.Error.InvalidInterface\0"
"com.trolltech.QtDBus.Error.InvalidMember\0"
"\0"

Definition at line 103 of file qdbuserror.cpp.

Referenced by get().