62 Exception(
const std::string &
what ,
const std::string & more ) ;
65 Exception(
const std::string &
what ,
const std::string & more1 ,
const std::string & more2 ) ;
71 virtual const
char *
what() const throw() ;
74 void prepend( const
char * context ) ;
78 void append( const
char * more ) ;
82 void append( const std::
string & more ) ;
87 #define G_EXCEPTION_CLASS( class_name , description ) class class_name : public G::Exception { public: class_name() : G::Exception(description) {} explicit class_name(const char *more) : G::Exception(description,more) {} explicit class_name(const std::string &more) : G::Exception(description,more) {} class_name(const std::string &more1,const std::string &more2) : G::Exception(description,more1,more2) {} }
90 #ifdef USE_SMALL_EXCEPTIONS
91 #define G_EXCEPTION( fn_name , description ) static inline int fn_name() { throw G::Exception(description) ; return 0 ; } static inline int fn_name( const std::string & more ) { throw G::Exception(description,more) ; return 0 ; }
93 #define G_EXCEPTION( class_name , description ) G_EXCEPTION_CLASS( class_name , description )
void prepend(const char *context)
Prepends context to the what string.
virtual ~Exception()
Destructor.
Exception()
Default constructor.
void append(const char *more)
Appends 'more' to the what string.
A general-purpose exception class derived from std::exception and containing a std::string.
virtual const char * what() const
Override from std::exception.