GDCM  2.4.5
gdcmParseException.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMPARSEEXCEPTION_H
15 #define GDCMPARSEEXCEPTION_H
16 
17 #include "gdcmException.h"
18 #include "gdcmDataElement.h"
19 
20 // Disable clang warning "dynamic exception specifications are deprecated".
21 // We need to be C++03 and C++11 compatible, and if we remove the 'throw()'
22 // specifier we'll get an error in C++03 by not matching the superclass.
23 #if defined(__clang__) && defined(__has_warning)
24 # if __has_warning("-Wdeprecated")
25 # pragma clang diagnostic push
26 # pragma clang diagnostic ignored "-Wdeprecated"
27 # endif
28 #endif
29 
30 namespace gdcm_ns
31 {
36 class ParseException : public Exception
37 {
38 public:
40  {
41  }
42  virtual ~ParseException() throw() {}
43 
45  ParseException &operator= ( const ParseException &orig )
46  {
47  (void)orig;
48  //TODO
49  return *this;
50  }
51 
53 /* virtual bool operator==( const ParseException &orig )
54  {
55  return true;
56  }*/
57 
58 /*
59  // Multiple calls to what ??
60  const char* what() const throw()
61  {
62  static std::string strwhat;
63  std::ostringstream oswhat;
64  oswhat << File << ":" << Line << ":\n";
65  oswhat << Description;
66  strwhat = oswhat.str();
67  return strwhat.c_str();
68  }
69 */
71  {
72  LastElement = de;
73  }
74  const DataElement& GetLastElement() const { return LastElement; }
75 
76 private:
77  // Store last parsed element before error:
78  DataElement LastElement;
79 };
80 
81 } // end namespace gdcm_ns
82 
83 // Undo warning suppression.
84 #if defined(__clang__) && defined(__has_warning)
85 # if __has_warning("-Wdeprecated")
86 # pragma clang diagnostic pop
87 # endif
88 #endif
89 
90 #endif
void SetLastElement(DataElement &de)
Definition: gdcmParseException.h:70
ParseException Standard exception handling object.
Definition: gdcmParseException.h:36
ParseException()
Definition: gdcmParseException.h:39
virtual ~ParseException()
Definition: gdcmParseException.h:42
Class to represent a Data Element either Implicit or Explicit.
Definition: gdcmDataElement.h:58
const DataElement & GetLastElement() const
Definition: gdcmParseException.h:74
Exception.
Definition: gdcmException.h:43

Generated on Fri Sep 25 2015 17:58:23 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo