#include <Exception.h>
Public Member Functions | |
virtual const char * | className () const throw () |
Returns a static string describing the exception. | |
virtual Exception * | clone () const |
int | code () const |
Returns the message text. | |
std::string | displayText () const |
Returns the exception code if defined. | |
Exception (const std::string &msg, int code=0) | |
Exception (const std::string &msg, const std::string &arg, int code=0) | |
Creates an exception. | |
Exception (const std::string &msg, const Exception &nested, int code=0) | |
Creates an exception. | |
Exception (const Exception &exc) | |
const std::string & | message () const |
virtual const char * | name () const throw () |
Assignment operator. | |
const Exception * | nested () const |
Exception & | operator= (const Exception &exc) |
Destroys the exception and deletes the nested exception. | |
virtual void | rethrow () const |
virtual const char * | what () const throw () |
Returns the name of the exception class. | |
~Exception () throw () | |
Copy constructor. | |
Protected Member Functions | |
Exception (int code=0) | |
Private Attributes | |
int | _code |
std::string | _msg |
Standard constructor. | |
Exception * | _pNested |
This is the base class for all exceptions defined in the Poco class library.
Definition at line 50 of file Exception.h.
Poco::Exception::Exception | ( | const std::string & | msg, |
int | code = 0 |
||
) |
Definition at line 49 of file Exception.cpp.
Poco::Exception::Exception | ( | const std::string & | msg, |
const std::string & | arg, | ||
int | code = 0 |
||
) |
Creates an exception.
Definition at line 54 of file Exception.cpp.
Poco::Exception::Exception | ( | const std::string & | msg, |
const Exception & | nested, | ||
int | code = 0 |
||
) |
Creates an exception.
Definition at line 64 of file Exception.cpp.
Poco::Exception::Exception | ( | const Exception & | exc | ) |
Creates an exception and stores a clone of the nested exception.
Definition at line 69 of file Exception.cpp.
Poco::Exception::~Exception | ( | ) | throw () |
Copy constructor.
Definition at line 78 of file Exception.cpp.
Poco::Exception::Exception | ( | int | code = 0 | ) | [protected] |
(Re)Throws the exception.
This is useful for temporarily storing a copy of an exception (see clone()), then throwing it again.
Definition at line 44 of file Exception.cpp.
const char * Poco::Exception::className | ( | ) | const throw () [virtual] |
Returns a static string describing the exception.
Definition at line 103 of file Exception.cpp.
Exception * Poco::Exception::clone | ( | ) | const [virtual] |
Returns a string consisting of the message name and the message text.
Definition at line 127 of file Exception.cpp.
int Poco::Exception::code | ( | ) | const [inline] |
Returns the message text.
Definition at line 138 of file Exception.h.
std::string Poco::Exception::displayText | ( | ) | const |
Returns the exception code if defined.
Definition at line 115 of file Exception.cpp.
const std::string & Poco::Exception::message | ( | ) | const [inline] |
Returns a pointer to the nested exception, or null if no nested exception exists.
Definition at line 132 of file Exception.h.
const char * Poco::Exception::name | ( | ) | const throw () [virtual] |
Assignment operator.
Definition at line 97 of file Exception.cpp.
const Exception * Poco::Exception::nested | ( | ) | const [inline] |
Returns a static string describing the exception.
Same as name(), but for compatibility with std::exception.
Definition at line 126 of file Exception.h.
Destroys the exception and deletes the nested exception.
Definition at line 84 of file Exception.cpp.
void Poco::Exception::rethrow | ( | ) | const [virtual] |
Creates an exact copy of the exception.
The copy can later be thrown again by invoking rethrow() on it.
Definition at line 133 of file Exception.cpp.
const char * Poco::Exception::what | ( | ) | const throw () [virtual] |
Returns the name of the exception class.
Definition at line 109 of file Exception.cpp.
int Poco::Exception::_code [private] |
Definition at line 119 of file Exception.h.
std::string Poco::Exception::_msg [private] |
Standard constructor.
Definition at line 117 of file Exception.h.
Exception* Poco::Exception::_pNested [private] |
Definition at line 118 of file Exception.h.