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