Public Member Functions | Protected Attributes | List of all members
G::Exception Class Reference

A general-purpose exception class derived from std::exception and containing a std::string. More...

#include <gexception.h>

Inheritance diagram for G::Exception:
G::Pam::Error

Public Member Functions

 Exception ()
 Default constructor. More...
 
 Exception (const char *what)
 Constructor. More...
 
 Exception (const std::string &what)
 Constructor. More...
 
 Exception (const char *what, const std::string &more)
 Constructor. More...
 
 Exception (const std::string &what, const std::string &more)
 Constructor. More...
 
 Exception (const std::string &what, const std::string &more1, const std::string &more2)
 Constructor. More...
 
virtual ~Exception () throw ()
 Destructor. More...
 
virtual const char * what () const throw ()
 Override from std::exception. More...
 
void prepend (const char *context)
 Prepends context to the what string. More...
 
void append (const char *more)
 Appends 'more' to the what string. More...
 
void append (const std::string &more)
 Appends 'more' to the what string. More...
 

Protected Attributes

std::string m_what
 

Detailed Description

A general-purpose exception class derived from std::exception and containing a std::string.

Provides constructors that simplify the assembly of multi-part error messages.

Usage:

throw G::Exception( "initialisation error" , "no such file" , path ) ;

Definition at line 44 of file gexception.h.

Constructor & Destructor Documentation

G::Exception::Exception ( )

Default constructor.

Definition at line 24 of file gexception.cpp.

G::Exception::Exception ( const char *  what)
explicit

Constructor.

Definition at line 28 of file gexception.cpp.

G::Exception::Exception ( const std::string &  what)
explicit

Constructor.

Definition at line 33 of file gexception.cpp.

G::Exception::Exception ( const char *  what,
const std::string &  more 
)

Constructor.

Definition at line 38 of file gexception.cpp.

References append().

G::Exception::Exception ( const std::string &  what,
const std::string &  more 
)

Constructor.

Definition at line 44 of file gexception.cpp.

References append().

G::Exception::Exception ( const std::string &  what,
const std::string &  more1,
const std::string &  more2 
)

Constructor.

Definition at line 50 of file gexception.cpp.

References append().

G::Exception::~Exception ( )
throw (
)
virtual

Destructor.

Definition at line 58 of file gexception.cpp.

Member Function Documentation

void G::Exception::append ( const char *  more)

Appends 'more' to the what string.

Inserts a separator as needed.

Definition at line 67 of file gexception.cpp.

Referenced by G::Pam::Error::Error(), and Exception().

void G::Exception::append ( const std::string &  more)

Appends 'more' to the what string.

Inserts a separator as needed.

Definition at line 76 of file gexception.cpp.

void G::Exception::prepend ( const char *  context)

Prepends context to the what string.

Inserts a separator as needed.

Definition at line 85 of file gexception.cpp.

const char * G::Exception::what ( ) const
throw (
)
virtual

Override from std::exception.

Definition at line 62 of file gexception.cpp.

Referenced by GAuth::SaslServerPamImp::apply().

Member Data Documentation

std::string G::Exception::m_what
protected

Definition at line 47 of file gexception.h.

Referenced by G::Pam::Error::Error().


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