akonadi
20 #include "exception.h"
27 using namespace Akonadi;
29 class Exception::Private
33 QByteArray assembledWhat;
36 Exception::Exception(
const char* what)
throw() :
40 std::auto_ptr<Private> nd(
new Private );
46 Exception::Exception(
const QByteArray& what)
throw() :
50 std::auto_ptr<Private> nd(
new Private );
56 Exception::Exception(
const QString& what)
throw() :
60 std::auto_ptr<Private> nd(
new Private );
61 nd->what = what.toUtf8();
66 Exception::Exception(
const Akonadi::Exception& other)
throw() :
67 std::exception( other ), d( 0 )
72 std::auto_ptr<Private> nd(
new Private( *other.d ) );
77 Exception::~Exception() throw()
82 QByteArray Exception::type()
const throw()
84 static const char mytype[] =
"Akonadi::Exception";
86 return QByteArray::fromRawData(
"Akonadi::Exception",
sizeof(mytype)-1 );
92 const char* Exception::what()
const throw()
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Sep 24 2012 09:06:26 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.