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