# gdcmParseException.h

Go to the documentation of this file.

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