]> Creatis software - gdcm.git/blobdiff - src/gdcmDocEntry.h
ENH: Try to sync gdcm CVS and gdcm 1.2. ~2000 lines of changes, please be gentle...
[gdcm.git] / src / gdcmDocEntry.h
index d7fecfc3418fcdc6c53b7007893c346b04cbe9e3..dc09c90a6bc7ce9b7d1c00ad3bba6974afce5fab 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.h,v $
   Language:  C++
-  Date:      $Date: 2005/10/18 08:35:49 $
-  Version:   $Revision: 1.50 $
+  Date:      $Date: 2006/02/16 20:06:14 $
+  Version:   $Revision: 1.60 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMDOCENTRY_H
 #define GDCMDOCENTRY_H
 
-#include "gdcmBase.h"
+#include "gdcmRefCounter.h"
 #include "gdcmDictEntry.h"
 
 #include <iostream>
@@ -35,13 +35,11 @@ class SeqEntry;
  * \brief   The dicom header of a Dicom file contains a set of such entries
  *          (when successfuly parsed against a given Dicom dictionary)
  */
-class GDCM_EXPORT DocEntry : public Base
+class GDCM_EXPORT DocEntry : public RefCounter
 {
-public:
-   DocEntry(DictEntry*);
-   /// \brief Canonical Destructor
-   virtual ~DocEntry() {}
+   gdcmTypeMacro(DocEntry);
 
+public:
    virtual void Print (std::ostream &os = std::cout, std::string const &indent = ""); 
    virtual void WriteContent(std::ofstream *fp, FileType filetype);
 
@@ -55,11 +53,8 @@ public:
    /// Returns the Dicom Element number of the current Dicom entry
    const uint16_t &GetElement() const { return DicomDict->GetElement();}
 
-   /// Set the 'key' of the current Dicom entry
-   void  SetKey( TagKey const &key ) { Key = key; }
-
    /// Returns the 'key' of the current Dicom entry
-   TagKey const &GetKey() const { return Key; }
+   TagKey GetKey() const { return DicomDict->GetKey(); }
 
    /// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom
    /// Dictionnary of the current Dicom Header Entry
@@ -68,9 +63,9 @@ public:
    /// \brief Returns the 'Value Representation' (e.g. "PN" : Person Name,
    /// "SL" : Signed Long), found in the Dicom header or in the Dicom
    /// Dictionnary, of the current Dicom entry
-   std::string const &GetVR() const { return DicomDict->GetVR(); }
+   VRKey const &GetVR() const { return DicomDict->GetVR(); }
 
-   /// \brief Returns the 'Value Multiplicity' (e.g. "1", "1-n", "6"),
+   /// \brief Returns the 'Value Multiplicity' (e.g. "1", "6", "1-n", "3-n"),
    /// found in the Dicom entry or in the Dicom Dictionnary
    /// of the current Dicom entry
    std::string const &GetVM() const { return DicomDict->GetVM(); }
@@ -97,10 +92,11 @@ public:
    virtual void SetLength(uint32_t l) { Length = l; }
    /// \brief Returns the actual value length of the current Dicom entry
    /// \warning this value is not *always* the one stored in the Dicom header
-   ///          in case of well knowned bugs
+   ///          in case of well known bugs
    const uint32_t &GetLength() const { return Length; }
 
    uint32_t GetFullLength();
+   virtual uint32_t ComputeFullLength() = 0;
 
 // The following 3 members, for internal use only ! 
    /// \brief   Sets the offset of the Dicom entry
@@ -126,10 +122,13 @@ public:
    bool IsItemDelimitor();
    bool IsItemStarter();
    bool IsSequenceDelimitor();   
-   
-   virtual void Copy(DocEntry *e);
+
+   virtual void Copy(DocEntry *doc);
 
 protected:
+   DocEntry(DictEntry*);
+   virtual ~DocEntry();
+
    /// \brief pointer to the underlying Dicom dictionary element
    DictEntry *DicomDict;
    
@@ -148,10 +147,6 @@ protected:
    /// Offset from the beginning of file for direct user access
    size_t Offset; 
 
-   /// \brief Generalized key of this DocEntry (for details on
-   ///        the generalized key refer to \ref TagKey documentation).
-   TagKey Key;
-
 private:
 };
 } // end namespace gdcm