#include <gdcmException.h>
Inheritance diagram for gdcmException:
Public Member Functions | |
gdcmException (const std::string &from, const std::string &error="") throw () | |
virtual | ~gdcmException () throw () |
const std::string & | getError (void) const throw () |
virtual std::string | getName () const throw () |
virtual const char * | what () const throw () |
operator const char * () const throw () | |
Static Public Member Functions | |
void | fatal (const char *from) throw () |
Protected Attributes | |
std::string | from |
std::string | error |
Friends | |
std::ostream & | operator<< (std::ostream &os, const gdcmException &e) |
|
Definition at line 16 of file gdcmException.cxx.
|
|
Definition at line 30 of file gdcmException.h.
00030 { 00031 } |
|
Definition at line 34 of file gdcmException.cxx. Referenced by operator<<().
00034 { 00035 try { 00036 std::cerr << "Fatal: exception received in " << from 00037 << " while handling exception." << std::endl; 00038 exit(-1); 00039 } 00040 catch(...) { 00041 try { 00042 std::cerr << "Fatal: exception received in Exception::fatal while handling exception." 00043 << std::endl; 00044 exit(-1); 00045 } 00046 catch(...) { 00047 exit(-1); 00048 } 00049 } 00050 } |
|
Definition at line 37 of file gdcmException.h. Referenced by operator<<().
00037 { 00038 return error; 00039 } |
|
Definition at line 57 of file gdcmException.cxx. Referenced by operator<<().
00057 { 00058 try { 00059 #ifdef __GNUC__ // GNU C++ compiler class name demangling 00060 unsigned int nested = 1, i, nb, offset; 00061 std::string one; 00062 00063 std::string name; 00064 std::string iname = typeid(*this).name(); 00065 if(iname[0] == 'Q') { 00066 nested = iname[1] - '0'; 00067 iname = std::string(iname, 2, std::string::npos); 00068 } 00069 for(i = 0; i < nested; i++) { 00070 ::sscanf(iname.c_str(), "%u%n", &nb, &offset); 00071 iname = std::string(iname, offset, std::string::npos); 00072 name += std::string(iname, 0, nb); 00073 if(i + 1 < nested) name += "::"; 00074 iname = std::string(iname, nb, std::string::npos); 00075 } 00076 return name; 00077 #else // no class name demangling 00078 //name = typeid(*this).name(); 00079 return "Exception"; 00080 #endif 00081 } 00082 catch(...) { 00083 fatal("Exception::getName(std::string &)"); 00084 return ""; 00085 } 00086 } |
|
Definition at line 93 of file gdcmException.cxx.
00093 { 00094 return getName().c_str(); 00095 } |
|
Definition at line 45 of file gdcmException.h.
00045 { 00046 return (const char *) *this; 00047 } |
|
Definition at line 103 of file gdcmException.cxx.
00103 { 00104 try { 00105 os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl; 00106 } 00107 catch(...) { 00108 gdcmException::fatal("operator<<(std::ostream &, const gdcmException&)"); 00109 } 00110 return os; 00111 } |
|
Definition at line 58 of file gdcmException.h. |
|
Definition at line 56 of file gdcmException.h. |