]> Creatis software - gdcm.git/blobdiff - src/gdcmDocEntry.h
Add error handling in jpeg code
[gdcm.git] / src / gdcmDocEntry.h
index d41fbf510ba1d93e45beab52df98354e0e48d638..4acd164dbd421bede02f35adfb20948721d81cd3 100644 (file)
@@ -3,12 +3,12 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/08/31 14:24:47 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2004/10/08 04:52:55 $
+  Version:   $Revision: 1.24 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
-  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
                                                                                 
      This software is distributed WITHOUT ANY WARRANTY; without even
      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
                                                                                 
 =========================================================================*/
 
-#ifndef GDCMDocEntry_H
-#define GDCMDocEntry_H
-
-#include <iostream>
-#include <stdio.h>
+#ifndef GDCMDOCENTRY_H
+#define GDCMDOCENTRY_H
 
 #include "gdcmDictEntry.h"
+#include <iostream>
 
 class gdcmHeader;
 class gdcmValEntry;
@@ -39,6 +37,7 @@ class GDCM_EXPORT gdcmDocEntry
 {
 public:
    gdcmDocEntry(gdcmDictEntry*);
+   virtual ~gdcmDocEntry() {};
 
    /// Returns the Dicom Group number of the current Dicom Header Entry
    uint16_t      GetGroup()     { return DictEntry->GetGroup();  };
@@ -47,7 +46,10 @@ public:
    uint16_t      GetElement()   { return DictEntry->GetElement();};
 
    /// Returns the 'key' of the current Dicom Header Entry
-   std::string  GetKey()       { return DictEntry->GetKey();    };
+   void  SetKey( gdcmTagKey key ) { Key = key; }
+
+   /// Returns the 'key' of the current Dicom Header Entry
+   std::string GetKey() { return Key; }
 
    /// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom
    /// Dictionnary of the current Dicom Header Entry
@@ -59,7 +61,7 @@ public:
    std::string  GetVR()        { return DictEntry->GetVR();     };
 
    /// \brief Returns offset (since the beginning of the file, including
-   /// the File Pramble, if any) of the value of the current Dicom HeaderEntry
+   /// the File Preamble, if any) of the value of the current Dicom HeaderEntry
    /// \warning offset of the *value*, not of the Dicom Header Entry
    size_t       GetOffset()    { return Offset;             };
 
@@ -104,7 +106,7 @@ public:
    bool IsImplicitVR() { return ImplicitVR; };
 
    /// \brief Tells us if the VR of the current Dicom Element is Unknown
-   /// @return true if the VR is unkonwn
+   /// @return true if the VR is unknown
    bool IsVRUnknown() { return DictEntry->IsVRUnknown(); };
 
    /// \brief   Sets the DicEntry of the current Dicom Element
@@ -132,14 +134,6 @@ public:
    bool IsItemDelimitor();
    bool IsSequenceDelimitor();   
 
-   /// \brief Gets the depth level of a Dicom header entry embedded in
-   ///        a SeQuence
-   int GetDepthLevel() { return SQDepthLevel; }
-
-   /// \brief Sets the depth level of a Dicom header entry embedded in
-   ///        a SeQuence
-   void SetDepthLevel(int depth) { SQDepthLevel = depth; }
-
 private:
    // FIXME: In fact we should be more specific and use :
    // friend gdcmDocEntry * gdcmHeader::ReadNextElement(void);
@@ -170,9 +164,10 @@ protected:
 
    /// How many details are to be printed (value : 0,1,2)      
    int PrintLevel;
-   
-   /// Gives the depth level of elements inside SeQuences   
-   int SQDepthLevel;
+
+   /// \brief Generalized key (i.e. a gdcmBaseTagKey prepending a gdcmTagKey)
+   ///        of this gdcmDocEntry
+   gdcmTagKey Key;
 };
 
 //-----------------------------------------------------------------------------