]> Creatis software - gdcm.git/blob - src/gdcmDocEntryArchive.h
ENH: * Huge cleanup:
[gdcm.git] / src / gdcmDocEntryArchive.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDocEntryArchive.h,v $
5   Language:  C++
6   Date:      $Date: 2004/12/03 20:16:58 $
7   Version:   $Revision: 1.3 $
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.html 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 GDCMDOCENTRYARCHIVE_H
20 #define GDCMDOCENTRYARCHIVE_H
21
22 #include "gdcmHeader.h"
23
24 namespace gdcm 
25 {
26
27 //-----------------------------------------------------------------------------
28 /*
29  * /brief Container 
30  *
31  * It's goal is to change the Header correctly. At this time, the change is 
32  * only made for the first level of the Document. In the future, it might 
33  * consider sequences.
34  * The change is made by replacing a DocEntry by an other that is created
35  * outside the class. The old value is kept. When we restore the header
36  * status, the added DocEntry is deleted and replaced by the old value.
37  */
38 class GDCM_EXPORT DocEntryArchive 
39 {
40 public:
41    DocEntryArchive(Header *header);
42    ~DocEntryArchive();
43
44    void Print(std::ostream &os = std::cout);
45
46    bool Push(DocEntry *newEntry);
47    bool Push(uint16_t group,uint16_t element);
48    bool Restore(uint16_t group,uint16_t element);
49
50    void ClearArchive(void);
51
52 private:
53    TagDocEntryHT &HeaderHT;
54    TagDocEntryHT Archive;
55 };
56 } // end namespace gdcm
57
58 //-----------------------------------------------------------------------------
59 #endif