]> Creatis software - gdcm.git/blob - src/gdcmDocEntrySet.h
2004-06-22 Jean-Pierre Roux
[gdcm.git] / src / gdcmDocEntrySet.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDocEntrySet.h,v $
5   Language:  C++
6   Date:      $Date: 2004/06/22 13:47:33 $
7   Version:   $Revision: 1.12 $
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
30 public:
31
32    gdcmDocEntrySet(int depth = 0); 
33    virtual ~gdcmDocEntrySet();
34
35    /// \brief adds any type of entry to the entry set (pure vitual)
36    virtual bool AddEntry(gdcmDocEntry *Entry) = 0; // pure virtual
37          
38    /// \brief prints any type of entry to the entry set (pure vitual)
39    virtual void Print (std::ostream & os = std::cout) = 0;// pure virtual
40
41    /// \brief write any type of entry to the entry set
42    virtual void Write (FILE *fp, FileType filetype)=0;// pure virtual
43
44    /// \brief Gets the depth level of a Dicom Header Entry embedded in a
45    ///        SeQuence
46    inline int GetDepthLevel(void) { return SQDepthLevel; }
47
48    /// \brief Sets the depth level of a Dicom Header Entry embedded in a
49    /// SeQuence
50    inline void SetDepthLevel(int depth) { SQDepthLevel = depth; }
51
52         virtual gdcmDocEntry *GetDocEntryByNumber(guint16 group,guint16 element) = 0;
53    gdcmDocEntry *GetDocEntryByName(std::string name);
54    virtual std::string GetEntryByNumber(guint16 group,guint16 element) = 0;
55    std::string GetEntryByName(TagName name);                     
56    gdcmDictEntry *NewVirtualDictEntry(guint16 group, 
57                                       guint16 element,
58                                       std::string vr     = "unkn",
59                                       std::string fourth = "unkn",
60                                       std::string name   = "unkn");
61                                                                                                           
62  protected:
63
64   // DocEntry  related utilities 
65   
66         gdcmValEntry *NewValEntryByNumber(guint16 group, 
67                                      guint16 element);                                                                                           
68    gdcmBinEntry *NewBinEntryByNumber(guint16 group, 
69                                      guint16 element);  
70    gdcmDocEntry *NewDocEntryByNumber(guint16 group, 
71                                      guint16 element); 
72    gdcmDocEntry *NewDocEntryByName  (std::string Name);
73         
74   // DictEntry  related utilities
75    
76    gdcmDictEntry *GetDictEntryByName  (std::string Name);
77    gdcmDictEntry *GetDictEntryByNumber(guint16, guint16);
78                         
79    /// Gives the depth level of the element set inside SeQuences   
80    int SQDepthLevel;
81
82 private:
83     
84 };
85
86
87 //-----------------------------------------------------------------------------
88 #endif
89