]> Creatis software - gdcm.git/blob - src/gdcmDocEntrySet.h
e3af97b3cbb4998ff58a706f47b218f6d434a2a8
[gdcm.git] / src / gdcmDocEntrySet.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDocEntrySet.h,v $
5   Language:  C++
6   Date:      $Date: 2004/08/01 03:20:23 $
7   Version:   $Revision: 1.14 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMDOCENTRYSET_H
20 #define GDCMDOCENTRYSET_H
21
22 #include "gdcmException.h"
23 #include "gdcmDocEntry.h"
24  
25 //-----------------------------------------------------------------------------
26
27 class GDCM_EXPORT gdcmDocEntrySet
28 {
29 public:
30
31    gdcmDocEntrySet(int depth = 0); 
32    virtual ~gdcmDocEntrySet();
33
34    /// \brief adds any type of entry to the entry set (pure vitual)
35    virtual bool AddEntry(gdcmDocEntry *Entry) = 0; // pure virtual
36  
37    /// \brief prints any type of entry to the entry set (pure vitual)
38    virtual void Print (std::ostream & os = std::cout) = 0;// pure virtual
39
40    /// \brief write any type of entry to the entry set
41    virtual void Write (FILE *fp, FileType filetype) = 0;// pure virtual
42
43    /// \brief Gets the depth level of a Dicom Header Entry embedded in a
44    ///        SeQuence
45    int GetDepthLevel() { return SQDepthLevel; }
46
47    /// \brief Sets the depth level of a Dicom Header Entry embedded in a
48    /// SeQuence
49    void SetDepthLevel(int depth) { SQDepthLevel = depth; }
50
51    virtual gdcmDocEntry* GetDocEntryByNumber(uint16_t group,
52                                              uint16_t element) = 0;
53    gdcmDocEntry *GetDocEntryByName(std::string const & name);
54    virtual std::string GetEntryByNumber(uint16_t group,uint16_t element) = 0;
55    std::string GetEntryByName(TagName const & name);
56    gdcmDictEntry *NewVirtualDictEntry(uint16_t group, 
57                                       uint16_t element,
58                                       std::string const & vr     = "unkn",
59                                       std::string const & fourth = "unkn",
60                                       std::string const & name   = "unkn");
61   
62 protected:
63
64 // DocEntry  related utilities 
65    gdcmValEntry* NewValEntryByNumber(uint16_t group, 
66                                      uint16_t element);
67    gdcmBinEntry* NewBinEntryByNumber(uint16_t group, 
68                                      uint16_t element);
69    gdcmDocEntry* NewDocEntryByNumber(uint16_t group, 
70                                      uint16_t element); 
71    gdcmDocEntry* NewDocEntryByName  (std::string const & name);
72
73 // DictEntry  related utilities
74    gdcmDictEntry *GetDictEntryByName  (std::string const & name);
75    gdcmDictEntry *GetDictEntryByNumber(uint16_t, uint16_t);
76
77    /// Gives the depth level of the element set inside SeQuences   
78    int SQDepthLevel;
79 private:
80 };
81
82
83 //-----------------------------------------------------------------------------
84 #endif
85