akonadi
20 #include "exception.h" 29 class Exception::Private
33 QByteArray assembledWhat;
40 std::auto_ptr<Private> nd(
new Private);
50 std::auto_ptr<Private> nd(
new Private);
60 std::auto_ptr<Private> nd(
new Private);
61 nd->what = what.toUtf8();
67 : std::exception(other)
74 std::auto_ptr<Private> nd(
new Private(*other.d));
86 static const char mytype[] =
"Akonadi::Exception";
88 return QByteArray::fromRawData(
"Akonadi::Exception",
sizeof (mytype) - 1);
96 static const char fallback[] =
"<some exception was thrown during construction: message lost>";
100 if (d->assembledWhat.isEmpty()) {
102 d->assembledWhat = QByteArray(
type() +
": " + d->what);
104 return "caught some exception while assembling Akonadi::Exception::what() return value";
107 return d->assembledWhat.constData();
110 #define AKONADI_EXCEPTION_IMPLEMENT_TRIVIAL_INSTANCE( classname ) \ 111 Akonadi::classname::~classname() throw() {} \ 112 QByteArray Akonadi::classname::type() const throw() { \ 113 static const char mytype[] = "Akonadi::" #classname ; \ 115 return QByteArray::fromRawData( mytype, sizeof (mytype)-1 ); \ 117 return QByteArray(); \ 121 AKONADI_EXCEPTION_IMPLEMENT_TRIVIAL_INSTANCE(PayloadException)
123 #undef AKONADI_EXCEPTION_IMPLEMENT_TRIVIAL_INSTANCE Exception(const char *what)
Creates a new exception with the error message what.
virtual QByteArray type() const
Returns the type of this exception.
virtual ~Exception()
Destructor.
FreeBusyManager::Singleton.
Base class for exceptions used by the Akonadi library.
const char * what() const
Returns the error message associated with this exception.
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Fri Apr 5 2019 15:20:41 by
doxygen 1.8.15 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.