Base class for all exceptions. More...
#include <exception.h>
Public Member Functions | |
| Generic () throw () | |
| Generic (const std::string &context) throw () | |
| virtual | ~Generic () throw () |
| virtual const char * | type () const throw () |
| Get a string tag identifying the exception type. | |
| virtual std::string | desc () const throw () |
| Get a string describing what happened that threw the exception. | |
| virtual const std::string & | fullInfo () const throw () |
| Format in a string all available information about the exception. | |
| virtual const char * | what () const throw () |
Protected Attributes | |
| std::string | m_formatted |
Base class for all exceptions.
This is the base class for all exceptions used in the system. It provides an interface to get a (hopefully detailed) textual description of the exception, and a tag describing the type of exception. Further functionality will be provided by subclassers
| wibble::exception::Generic::Generic | ( | ) | throw () [inline] |
| wibble::exception::Generic::Generic | ( | const std::string & | context | ) | throw () [inline] |
| virtual wibble::exception::Generic::~Generic | ( | ) | throw () [inline, virtual] |
| virtual std::string wibble::exception::Generic::desc | ( | ) | const throw () [inline, virtual] |
Get a string describing what happened that threw the exception.
Reimplemented in wibble::exception::BadOption, wibble::exception::Consistency, wibble::exception::BadCast, wibble::exception::OutOfRange, wibble::exception::ValOutOfRange< C >, wibble::exception::System, wibble::exception::File, and wibble::exception::Regexp.
Referenced by fullInfo().
| virtual const std::string& wibble::exception::Generic::fullInfo | ( | ) | const throw () [inline, virtual] |
Format in a string all available information about the exception.
The formatted version is cached because this function is used to implement the default what() method, which needs to return a stable c_str() pointer.
References desc(), wibble::exception::Context::formatContext(), and m_formatted.
Referenced by TestException::badCast(), TestException::generic(), main(), TestException::system(), what(), and withCommands().
| virtual const char* wibble::exception::Generic::type | ( | ) | const throw () [inline, virtual] |
Get a string tag identifying the exception type.
Reimplemented in wibble::exception::BadOption, wibble::exception::Interrupted, wibble::exception::WaitInterrupted, wibble::exception::Consistency, wibble::exception::OutOfRange, wibble::exception::ValOutOfRange< C >, wibble::exception::System, wibble::exception::File, and wibble::exception::Regexp.
Referenced by main().
| virtual const char* wibble::exception::Generic::what | ( | ) | const throw () [inline, virtual] |
References fullInfo().
std::string wibble::exception::Generic::m_formatted [mutable, protected] |
Referenced by fullInfo().
1.6.3