]> Creatis software - gdcm.git/blob - src/gdcmElValue.h
* src/*.[h] all occurences of stl classes are now prefixed with
[gdcm.git] / src / gdcmElValue.h
1 // $Header: /cvs/public/gdcm/src/Attic/gdcmElValue.h,v 1.5 2003/05/21 14:42:46 frog Exp $
2
3 #ifndef GDCMELVALUE_H
4 #define GDCMELVALUE_H
5
6 #include "gdcmDictEntry.h"
7 class gdcmHeader;
8
9 #include <stdio.h>
10
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 {
15 private:
16         gdcmDictEntry *entry;
17         guint32 LgrElem;
18         bool ImplicitVr;       // Even when reading explicit vr files, some
19                                // elements happen to be implicit. Flag them here
20                                // since we can't use the entry->vr without breaking
21                                // the underlying dictionary.
22         void SetOffset(size_t of){ Offset = of; };
23    // FIXME: In fact we should be more specific and use :
24    //friend gdcmElValue * gdcmHeader::ReadNextElement(void);
25    friend class gdcmHeader;
26 public:
27    std::string  value;
28         size_t Offset;     // Offset from the begining of file for direct user access
29         
30         gdcmElValue(gdcmDictEntry*);
31         void SetDictEntry(gdcmDictEntry *NewEntry) { entry = NewEntry; };
32         bool   IsVrUnknown(void) { return entry->IsVrUnknown(); };
33         void SetImplicitVr(void) { ImplicitVr = true; };
34         bool  IsImplicitVr(void) { return ImplicitVr; };
35         
36         gdcmDictEntry * GetDictEntry(void) { return entry;    };
37         guint16      GetGroup(void)   { return entry->GetGroup();  };
38         guint16      GetElement(void) { return entry->GetElement();};
39    std::string  GetKey(void)     { return entry->GetKey();    };
40    std::string  GetName(void)    { return entry->GetName();   };
41    std::string  GetVR(void)      { return entry->GetVR();     };
42         void         SetVR(std::string v)  { entry->SetVR(v);      }; 
43         void         SetLength(guint32 l){ LgrElem = l;            };
44         guint32      GetLength(void)  { return LgrElem;            };
45         
46         void         SetValue(std::string val){ value = val; };
47    std::string  GetValue(void)    { return value;};
48
49         size_t  GetOffset(void)  { return Offset;};
50 };
51
52
53 #endif