3 #ifndef _GENERICEXCEPTION_H_
4 #define _GENERICEXCEPTION_H_
12 #ifdef USE_STD_EXCEPTION
46 #ifdef USE_STD_EXCEPTION
47 :
public std::exception
54 : sourcefile(sourcefile), line(line)
59 const char *format, ...)
60 __attribute__ ((format (printf, 4, 5)));
70 virtual const char*
what()
const throw ();
74 {
return sourcefile; }
88 mutable std::string error_info;
91 mutable std::string detail;
95 const char *sprintf(std::string &s,
const char *format, ...)
const throw ();
99 const
char *sprintf(std::
string &s, const
char *format, va_list ap) const throw ()
100 __attribute__ ((format (printf, 3, 0)));
104 const
char *sourcefile;
109 #endif // !defined(_GENERICEXCEPTION_H_)
GenericException(const char *sourcefile, size_t line)
Construct with file and line info.
Definition: GenericException.h:53
const char * getSourceFile() const
Source file where exception was thrown.
Definition: GenericException.h:73
size_t getSourceLine() const
Line in source file where exception was thrown.
Definition: GenericException.h:77
Generic Exception: Base class for exceptions.
Definition: GenericException.h:45
const std::string & getDetail() const
Return detail text (if set)
Definition: GenericException.h:81
virtual const char * what() const
Retrieve an explanatory string.