# 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-2010 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 #include "gdcmException.h"
    00019 #include "gdcmDataElement.h"
    00020
    00021 namespace gdcm
    00022 {
    00027 class ParseException : public Exception
    00028 {
    00029 public:
    00030   ParseException()
    00031   {
    00032   }
    00033   virtual ~ParseException() throw() {}
    00034
    00036   ParseException &operator= ( const ParseException &orig )
    00037     {
    00038     (void)orig;
    00039     //TODO
    00040     return *this;
    00041     }
    00042
    00044 /*  virtual bool operator==( const ParseException &orig )
    00045   {
    00046     return true;
    00047   }*/
    00048
    00049 /*
    00050   // Multiple calls to what ??
    00051   const char* what() const throw()
    00052     {
    00053     static std::string strwhat;
    00054     std::ostringstream oswhat;
    00055     oswhat << File << ":" << Line << ":\n";
    00056     oswhat << Description;
    00057     strwhat = oswhat.str();
    00058     return strwhat.c_str();
    00059     }
    00060 */
    00061   void SetLastElement(DataElement& de)
    00062     {
    00063     LastElement = de;
    00064     }
    00065   const DataElement& GetLastElement() const { return LastElement; }
    00066
    00067 private:
    00068   // Store last parsed element before error:
    00069   DataElement LastElement;
    00070 };
    00071
    00072 } // end namespace gdcm
    00073
    00074 #endif