akonadi
20 #include "exception.h"
27 using namespace Akonadi;
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 ), d( 0 )
72 std::auto_ptr<Private> nd(
new Private( *other.d ) );
84 static const char mytype[] =
"Akonadi::Exception";
86 return QByteArray::fromRawData(
"Akonadi::Exception",
sizeof(mytype) - 1 );
94 static const char fallback[] =
"<some exception was thrown during construction: message lost>";
97 if ( d->assembledWhat.isEmpty() )
99 d->assembledWhat = QByteArray(
type() +
": " + d->what );
101 return "caught some exception while assembling Akonadi::Exception::what() return value";
103 return d->assembledWhat.constData();
106 #define AKONADI_EXCEPTION_IMPLEMENT_TRIVIAL_INSTANCE( classname ) \
107 Akonadi::classname::~classname() throw() {} \
108 QByteArray Akonadi::classname::type() const throw() { \
109 static const char mytype[] = "Akonadi::" #classname ; \
111 return QByteArray::fromRawData( mytype, sizeof(mytype)-1 ); \
113 return QByteArray(); \
117 AKONADI_EXCEPTION_IMPLEMENT_TRIVIAL_INSTANCE( PayloadException )
119 #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.
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-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.