]> Creatis software - gdcm.git/blob - src/gdcmElValSet.h
Brutal commit. Changelog to come.... Frog
[gdcm.git] / src / gdcmElValSet.h
1 // $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.7 2003/04/07 15:04:40 frog Exp $
2
3 #ifndef GDCMELVALSET_H
4 #define GDCMELVALSET_H
5
6 #include <stdio.h>    // FIXME For FILE on GCC only
7 #include <map>
8 #include "gdcmCommon.h"
9 #include "gdcmElValue.h"
10
11 ////////////////////////////////////////////////////////////////////////////
12 // Container for a set of successfully parsed ElValues.
13 typedef map<TagKey, gdcmElValue*> TagElValueHT;
14 typedef map<string, gdcmElValue*> TagElValueNameHT;
15
16 class GDCM_EXPORT gdcmElValSet {
17         TagElValueHT tagHt;             // Both accesses with a TagKey or with a
18         TagElValueNameHT NameHt;        // the DictEntry.Name are required.
19 //FIXME This is redundant with gdcmHeader::FileType enum. That sux !
20 enum FileType {
21       TrueDicom,
22       ExplicitVR,
23       ACR};
24 public: 
25         void Add(gdcmElValue*); 
26         // TODO
27         //void ReplaceOrCreate(gdcmElValue*);           
28         void Print(ostream &);
29         void PrintByName(ostream &);
30         int  Write(FILE *fp);
31         int  WriteAcr(FILE *fp);
32         int  WriteExplVR(FILE *fp);
33
34         gdcmElValue* GetElementByNumber(guint16 group, guint16 element);
35         gdcmElValue* GetElementByName  (string);
36         string   GetElValueByNumber(guint16 group, guint16 element);
37         string   GetElValueByName  (string);
38         
39         TagElValueHT & GetTagHt(void);  
40         
41         int SetElValueByNumber(string content, guint16 group, guint16 element);
42         int SetElValueByName  (string content, string TagName);
43         
44         int SetElValueLengthByNumber(guint32 l, guint16 group, guint16 element);
45         int SetElValueLengthByName  (guint32 l, string TagName);
46
47    guint32 GenerateFreeTagKeyInGroup(guint16 group);
48         
49 private:
50    void UpdateGroupLength(bool SkipSequence = false);
51    void WriteElements(FileType type, FILE *);
52
53 };
54
55 #endif