]> Creatis software - gdcm.git/blob - src/gdcmElValSet.h
add '\0' after ostringstream to avoid oddities on Solrais
[gdcm.git] / src / gdcmElValSet.h
1 // $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.19 2003/11/13 18:08:34 jpr 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 #include <list>       // for linking together *all* the Dicom Elements
12
13 ////////////////////////////////////////////////////////////////////////////
14 // Container for a set of successfully parsed ElValues.
15
16 typedef std::map<TagKey,      gdcmElValue*> TagElValueHT;
17 typedef std::map<std::string, gdcmElValue*> TagElValueNameHT;
18    
19 typedef std::string GroupKey;
20 typedef std::map<GroupKey, int> GroupHT;
21
22 typedef std::list<gdcmElValue*> ListTag; // for linking together the Elements
23
24 class GDCM_EXPORT gdcmElValSet {
25    TagElValueHT tagHt;             // Both accesses with a TagKey or with a
26    TagElValueNameHT NameHt;        // the DictEntry.Name are required.
27    ListTag listElem;
28
29 public: 
30    ~gdcmElValSet();
31    void Add(gdcmElValue*);
32                         
33    void Print(std::ostream &);
34    void PrintByName(std::ostream &);
35    int  Write(FILE *fp, FileType type);
36
37    gdcmElValue* GetElementByNumber(guint16 group, guint16 element);
38    gdcmElValue* GetElementByName  (std::string);
39    std::string  GetElValueByNumber(guint16 group, guint16 element);
40    std::string  GetElValueByName  (std::string);
41         
42    TagElValueHT & GetTagHt(void)     {return tagHt;};   
43    ListTag      & GetListElem(void)  {return listElem;};        
44         
45    int SetElValueByNumber(std::string content, guint16 group, guint16 element);
46    int SetElValueByName  (std::string content, std::string TagName);
47         
48    int SetElValueLengthByNumber(guint32 l, guint16 group, guint16 element);
49    int SetElValueLengthByName  (guint32 l, std::string TagName);
50    
51    int SetVoidAreaByNumber(void *a, guint16 Group, guint16 Elem );
52
53    guint32 GenerateFreeTagKeyInGroup(guint16 group);
54    int CheckIfExistByNumber(guint16 Group, guint16 Elem );
55         
56 private:
57    void UpdateGroupLength(bool SkipSequence = false, FileType type = ImplicitVR);
58    void WriteElements(FileType type, FILE *);
59 };
60
61 #endif