wibble  1.1
Public Member Functions | Protected Attributes | List of all members
wibble::exception::Generic Class Reference

Base class for all exceptions. More...

#include <exception.h>

Inheritance diagram for wibble::exception::Generic:
Inheritance graph
[legend]
Collaboration diagram for wibble::exception::Generic:
Collaboration graph
[legend]

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. More...
 
virtual std::string desc () const throw ()
 Get a string describing what happened that threw the exception. More...
 
virtual const std::string & fullInfo () const throw ()
 Format in a string all available information about the exception. More...
 
virtual const char * what () const throw ()
 
- Public Member Functions inherited from wibble::exception::Context
 Context () throw ()
 
 Context (const std::string &context) throw ()
 
void addContext (const std::string &c) throw ()
 
std::string formatContext () const throw ()
 
const std::vector< std::string > & context () const throw ()
 

Protected Attributes

std::string m_formatted
 
- Protected Attributes inherited from wibble::exception::Context
std::vector< std::string > m_context
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Generic() [1/2]

wibble::exception::Generic::Generic ( )
throw (
)
inline

◆ Generic() [2/2]

wibble::exception::Generic::Generic ( const std::string &  context)
throw (
)
inline

◆ ~Generic()

virtual wibble::exception::Generic::~Generic ( )
throw (
)
inlinevirtual

Member Function Documentation

◆ desc()

virtual std::string wibble::exception::Generic::desc ( ) const
throw (
)
inlinevirtual

◆ fullInfo()

virtual const std::string& wibble::exception::Generic::fullInfo ( ) const
throw (
)
inlinevirtual

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(), main(), TestException::system(), what(), and withCommands().

◆ type()

virtual const char* wibble::exception::Generic::type ( ) const
throw (
)
inlinevirtual

◆ what()

virtual const char* wibble::exception::Generic::what ( ) const
throw (
)
inlinevirtual

References fullInfo().

Referenced by TestFs::_mkdirIfMissing(), and main().

Member Data Documentation

◆ m_formatted

std::string wibble::exception::Generic::m_formatted
mutableprotected

Referenced by fullInfo().


The documentation for this class was generated from the following file: