]> Creatis software - gdcm.git/blobdiff - src/gdcmElValue.h
*FIX : gdcmHeader::LoadElements is now based
[gdcm.git] / src / gdcmElValue.h
index 0d91c3d78df545554238ba533865d8010abbbdb9..400a03b89331f601ec6c38196e88f56000987e35 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/Attic/gdcmElValue.h,v 1.8 2003/10/09 13:22:54 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmElValue.h,v 1.9 2003/11/10 14:17:12 jpr Exp $
 
 #ifndef GDCMELVALUE_H
 #define GDCMELVALUE_H
@@ -14,11 +14,23 @@ class gdcmHeader;
 class GDCM_EXPORT gdcmElValue {
 private:
    gdcmDictEntry *entry;
-   guint32 LgrElem;
+   guint32 UsableLength;  // Updated from ReadLength, by FixFoungLentgh()
+                          // for fixing a bug in the header or helping
+                         // the parser going on 
+                         
+   guint32 ReadLength;    // Length actually read on disk
+                          // (before FixFoundLength)
+                         // ReadLength will be updated only when
+                         // FixFoundLength actually fixes a bug in the header,
+                         // not when it performs a trick to help the Parser
+                         // going on.
+                         // *for internal* use only
+       
    bool ImplicitVr;       // Even when reading explicit vr files, some
                          // elements happen to be implicit. Flag them here
                          // since we can't use the entry->vr without breaking
                          // the underlying dictionary.
+                         
    void SetOffset(size_t of){ Offset = of; };
    // FIXME: In fact we should be more specific and use :
    //friend gdcmElValue * gdcmHeader::ReadNextElement(void);
@@ -37,21 +49,27 @@ public:
        
    gdcmDictEntry * GetDictEntry(void) { return entry;    };
    
-   guint16      GetGroup(void)    { return entry->GetGroup();  };
-   guint16      GetElement(void)  { return entry->GetElement();};
-   std::string  GetKey(void)      { return entry->GetKey();    };
-   std::string  GetName(void)     { return entry->GetName();   };
-   std::string  GetVR(void)       { return entry->GetVR();     };
-   std::string  GetValue(void)    { return value;              };
-   void *       GetVoidArea(void) { return voidArea;           };
-   size_t       GetOffset(void)   { return Offset;             };   
-   guint32      GetLength(void)   { return LgrElem;            };
+   guint16      GetGroup(void)     { return entry->GetGroup();  };
+   guint16      GetElement(void)   { return entry->GetElement();};
+   std::string  GetKey(void)       { return entry->GetKey();    };
+   std::string  GetName(void)      { return entry->GetName();   };
+   std::string  GetVR(void)        { return entry->GetVR();     };
+   std::string  GetValue(void)     { return value;              };
+   void *       GetVoidArea(void)  { return voidArea;           };
+   size_t       GetOffset(void)    { return Offset;             };   
+   guint32      GetLength(void)    { return UsableLength;       };
+   // for internal use only!
+   guint32      GetReadLength(void){ return ReadLength;         };
    
-   void         SetVR(std::string v)     { entry->SetVR(v);   }; 
-   void         SetLength(guint32 l)     { LgrElem = l;       };       
-   void         SetValue(std::string val){ value = val;       };
-   void         SetVoidArea(void * area) { voidArea = area;   };       
-
+   void         SetVR(std::string v)      { entry->SetVR(v);          };    
+   void         SetLength(guint32 l)      { ReadLength=UsableLength=l;};   
+   // The following 2 members, for internal use only ! 
+   void         SetReadLength(guint32 l)  { ReadLength = l;           };       
+   void         SetUsableLength(guint32 l){ UsableLength = l;         };       
+       
+   void         SetValue(std::string val) { value = val;       };
+   void         SetVoidArea(void * area)  { voidArea = area;   };      
 };
 
 #endif