1 // $Header: /cvs/public/gdcm/src/Attic/gdcmElValue.h,v 1.10 2004/01/12 13:12:28 regrain Exp $
6 #include "gdcmDictEntry.h"
12 * The dicom header of a Dicom file contains a set of such ELement VALUES
13 * (when successfuly parsed against a given Dicom dictionary)
15 class GDCM_EXPORT gdcmElValue {
18 guint32 UsableLength; // Updated from ReadLength, by FixFoungLentgh()
19 // for fixing a bug in the header or helping
20 // the parser going on
22 guint32 ReadLength; // Length actually read on disk
23 // (before FixFoundLength)
24 // ReadLength will be updated only when
25 // FixFoundLength actually fixes a bug in the header,
26 // not when it performs a trick to help the Parser
28 // *for internal* use only
30 bool ImplicitVr; // Even when reading explicit vr files, some
31 // elements happen to be implicit. Flag them here
32 // since we can't use the entry->vr without breaking
33 // the underlying dictionary.
35 void SetOffset(size_t of){ Offset = of; };
37 // FIXME: In fact we should be more specific and use :
38 // friend gdcmElValue * gdcmHeader::ReadNextElement(void);
39 friend class gdcmHeader;
43 void * voidArea; // unsecure memory area to hold 'non string' values
44 // (ie : Lookup Tables, overlays)
45 size_t Offset; // Offset from the begining of file for direct user access
47 gdcmElValue(gdcmDictEntry*);
48 void SetDictEntry(gdcmDictEntry *NewEntry) { entry = NewEntry; };
49 bool IsVrUnknown(void) { return entry->IsVrUnknown(); };
50 void SetImplicitVr(void) { ImplicitVr = true; };
51 bool IsImplicitVr(void) { return ImplicitVr; };
53 gdcmDictEntry * GetDictEntry(void) { return entry; };
55 guint16 GetGroup(void) { return entry->GetGroup(); };
56 guint16 GetElement(void) { return entry->GetElement();};
57 std::string GetKey(void) { return entry->GetKey(); };
58 std::string GetName(void) { return entry->GetName(); };
59 std::string GetVR(void) { return entry->GetVR(); };
60 std::string GetValue(void) { return value; };
61 void * GetVoidArea(void) { return voidArea; };
62 size_t GetOffset(void) { return Offset; };
63 guint32 GetLength(void) { return UsableLength; };
64 // for internal use only!
65 guint32 GetReadLength(void){ return ReadLength; };
67 void SetVR(std::string v) { entry->SetVR(v); };
68 void SetLength(guint32 l) { ReadLength=UsableLength=l;};
69 // The following 2 members, for internal use only !
70 void SetReadLength(guint32 l) { ReadLength = l; };
71 void SetUsableLength(guint32 l){ UsableLength = l; };
73 void SetValue(std::string val) { value = val; };
74 void SetVoidArea(void * area) { voidArea = area; };