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