]> Creatis software - gdcm.git/blob - src/gdcmElValSet.h
a8c4cdf5087b11b0591118d7170a70a7f521d98d
[gdcm.git] / src / gdcmElValSet.h
1 // $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.8 2003/04/08 15:03:35 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 public: 
21         void Add(gdcmElValue*); 
22         // TODO
23         //void ReplaceOrCreate(gdcmElValue*);           
24         void Print(ostream &);
25         void PrintByName(ostream &);
26         int  Write(FILE *fp, FileType type);
27
28         gdcmElValue* GetElementByNumber(guint16 group, guint16 element);
29         gdcmElValue* GetElementByName  (string);
30         string   GetElValueByNumber(guint16 group, guint16 element);
31         string   GetElValueByName  (string);
32         
33         TagElValueHT & GetTagHt(void);  
34         
35         int SetElValueByNumber(string content, guint16 group, guint16 element);
36         int SetElValueByName  (string content, string TagName);
37         
38         int SetElValueLengthByNumber(guint32 l, guint16 group, guint16 element);
39         int SetElValueLengthByName  (guint32 l, string TagName);
40
41    guint32 GenerateFreeTagKeyInGroup(guint16 group);
42         
43 private:
44    void UpdateGroupLength(bool SkipSequence = false);
45    void WriteElements(FileType type, FILE *);
46
47 };
48
49 #endif