GDCM
2.0.18
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 00005 Copyright (c) 2006-2011 Mathieu Malaterre 00006 All rights reserved. 00007 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 #ifndef GDCMPARSEEXCEPTION_H 00015 #define GDCMPARSEEXCEPTION_H 00016 00017 #include "gdcmException.h" 00018 #include "gdcmDataElement.h" 00019 00020 namespace gdcm 00021 { 00026 class ParseException : public Exception 00027 { 00028 public: 00029 ParseException() 00030 { 00031 } 00032 virtual ~ParseException() throw() {} 00033 00035 ParseException &operator= ( const ParseException &orig ) 00036 { 00037 (void)orig; 00038 //TODO 00039 return *this; 00040 } 00041 00043 /* virtual bool operator==( const ParseException &orig ) 00044 { 00045 return true; 00046 }*/ 00047 00048 /* 00049 // Multiple calls to what ?? 00050 const char* what() const throw() 00051 { 00052 static std::string strwhat; 00053 std::ostringstream oswhat; 00054 oswhat << File << ":" << Line << ":\n"; 00055 oswhat << Description; 00056 strwhat = oswhat.str(); 00057 return strwhat.c_str(); 00058 } 00059 */ 00060 void SetLastElement(DataElement& de) 00061 { 00062 LastElement = de; 00063 } 00064 const DataElement& GetLastElement() const { return LastElement; } 00065 00066 private: 00067 // Store last parsed element before error: 00068 DataElement LastElement; 00069 }; 00070 00071 } // end namespace gdcm 00072 00073 #endif