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