X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmElValue.h;h=400a03b89331f601ec6c38196e88f56000987e35;hb=659604feaaaf9519d03d59d66711f6b4b8290804;hp=b1305bc6b1590c347f5df32a88984de54af716c2;hpb=565a47ec4e037897aaf770aeccc5d67d7ad7b478;p=gdcm.git diff --git a/src/gdcmElValue.h b/src/gdcmElValue.h index b1305bc6..400a03b8 100644 --- a/src/gdcmElValue.h +++ b/src/gdcmElValue.h @@ -1,53 +1,75 @@ -// gdcmElValue.h +// $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 #include "gdcmDictEntry.h" +class gdcmHeader; +#include /////////////////////////////////////////////////////////////////////////// // The dicom header of a Dicom file contains a set of such ELement VALUES // (when successfuly parsed against a given Dicom dictionary) -class GDCM_EXPORT ElValue { +class GDCM_EXPORT gdcmElValue { private: - gdcmDictEntry *entry; - guint32 LgrElem; - 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. -public: - string value; - size_t Offset; // Offset from the begining of file for direct user access + gdcmDictEntry *entry; + 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 - ElValue(gdcmDictEntry*); - void SetDictEntry(gdcmDictEntry *NewEntry) { entry = NewEntry; }; - bool IsVrUnknown(void) { return entry->IsVrUnknown(); }; - void SetImplicitVr(void) { ImplicitVr = true; }; - bool IsImplicitVr(void) { return ImplicitVr; }; + 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); + friend class gdcmHeader; +public: + std::string value; + void * voidArea; // unsecure memory area to hold 'non string' values + // (ie : Lookup Tables, overlays) + size_t Offset; // Offset from the begining of file for direct user access - guint16 GetGroup(void) { return entry->GetGroup(); }; - guint16 GetElement(void) { return entry->GetElement();}; - string GetKey(void) { return entry->GetKey(); }; - string GetName(void) { return entry->GetName(); }; - string GetVR(void) { return entry->GetVR(); }; - void SetVR(string v) { entry->SetVR(v); }; - void SetLength(guint32 l){ LgrElem = l; }; - guint32 GetLength(void) { return LgrElem; }; + gdcmElValue(gdcmDictEntry*); + void SetDictEntry(gdcmDictEntry *NewEntry) { entry = NewEntry; }; + bool IsVrUnknown(void) { return entry->IsVrUnknown(); }; + void SetImplicitVr(void) { ImplicitVr = true; }; + bool IsImplicitVr(void) { return ImplicitVr; }; - // Question : SetLength est public - // (sinon, on ne pourrait pas l'appeler dans ElValSet) - // alors que *personne* ne devrait s'en servir ! - // c'est *forcément* la lgr de la string 'value', non? - - void SetValue(string val){ value = val; }; - string GetValue(void) { return value;}; - - void SetOffset(size_t of){ Offset = of; }; - size_t GetOffset(void) { return Offset;}; - // Question : SetOffset est public ... - // Quel utilisateur serait ammené à modifier l'Offset ? + 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 UsableLength; }; + // for internal use only! + guint32 GetReadLength(void){ return ReadLength; }; + + 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