#include <gdcmException.h>
Inheritance diagram for GDCM_NAME_SPACE::FormatError:
Public Member Functions | |
FormatError (const std::string &from, const std::string &error="Invalid file format") throw () | |
Builds a file-related exception with minimal information: name of the thrower method and error message. | |
const std::string & | getError () const throw () |
returns error message | |
virtual std::string | getName () const throw () |
getName | |
virtual const char * | what () const throw () |
returns exception name string (overloads std::exception::what) | |
operator const char * () const throw () | |
Exception. | |
Static Public Member Functions | |
static void | fatal (const char *from) throw () |
fatal | |
Protected Attributes | |
std::string | From |
error message part 1 | |
std::string | Error |
error message part 2 | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Exception &e) |
Exception::operator <<. |
Definition at line 116 of file gdcmException.h.
|
Builds a file-related exception with minimal information: name of the thrower method and error message.
Definition at line 123 of file gdcmException.h. 00125 : FormatUnexpected( from, error ) { }
|
|
fatal
Definition at line 51 of file gdcmException.cxx. Referenced by GDCM_NAME_SPACE::operator<<(). 00052 { 00053 try 00054 { 00055 std::cerr << "Fatal: exception received in " << from 00056 << " while handling exception." << std::endl; 00057 exit(-1); 00058 } 00059 catch(...) 00060 { 00061 try 00062 { 00063 std::cerr << "Fatal: exception received in Exception::fatal while handling exception." 00064 << std::endl; 00065 exit(-1); 00066 } 00067 catch(...) 00068 { 00069 exit(-1); 00070 } 00071 } 00072 }
|
|
returns error message
Definition at line 56 of file gdcmException.h. References Error(). Referenced by GDCM_NAME_SPACE::operator<<(). 00056 { return Error;}
|
|
getName
Definition at line 78 of file gdcmException.cxx. Referenced by GDCM_NAME_SPACE::Exception::operator const char *(), and GDCM_NAME_SPACE::operator<<(). 00079 { 00080 try 00081 { 00082 #if defined(__GNUC__) && 0 // GNU C++ compiler class name demangling 00083 unsigned int nested = 1, i, nb; 00084 int offset; 00085 std::string one; 00086 00087 std::string name; 00088 std::string iname = typeid(*this).name(); 00089 if ( iname[0] == 'Q' ) 00090 { 00091 nested = iname[1] - '0'; 00092 iname = std::string(iname, 2, std::string::npos); 00093 } 00094 for(i = 0; i < nested; i++) 00095 { 00096 ::sscanf(iname.c_str(), "%u%n", &nb, &offset); 00097 iname = std::string(iname, offset, std::string::npos); 00098 name += std::string(iname, 0, nb); 00099 if ( i + 1 < nested) name += "::"; 00100 iname = std::string(iname, nb, std::string::npos ); 00101 } 00102 return name; 00103 #else // no class name demangling 00104 std::string name = typeid(*this).name(); 00105 return name; 00106 #endif 00107 } 00108 catch(...) 00109 { 00110 fatal("Exception::getName(std::string &)"); 00111 return ""; 00112 } 00113 }
|
|
Definition at line 118 of file gdcmException.cxx. References GDCM_NAME_SPACE::Exception::getName(). 00119 { 00120 return getName().c_str(); 00121 }
|
|
returns exception name string (overloads std::exception::what)
Definition at line 62 of file gdcmException.h.
|
|
Definition at line 129 of file gdcmException.cxx. 00130 { 00131 try 00132 { 00133 os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl; 00134 } 00135 catch(...) 00136 { 00137 Exception::fatal("operator<<(std::ostream &, const Exception&)"); 00138 } 00139 return os; 00140 }
|
|
error message part 2
Definition at line 73 of file gdcmException.h. |
|
error message part 1
Definition at line 71 of file gdcmException.h. |