]> Creatis software - gdcm.git/blob - src/gdcmDicomDirMeta.cxx
05ef4358200a760dea52a7614129167390432077
[gdcm.git] / src / gdcmDicomDirMeta.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirMeta.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/06 20:03:27 $
7   Version:   $Revision: 1.20 $
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 #include "gdcmDicomDirMeta.h"
20 #include "gdcmDocument.h"
21 #include "gdcmDocEntry.h"
22
23 namespace gdcm 
24 {
25
26 //-----------------------------------------------------------------------------
27 // Constructor / Destructor
28
29 /**
30  * \ingroup DicomDirMeta
31  * \brief  Constructor
32  */ 
33 DicomDirMeta::DicomDirMeta():
34    DicomDirObject()
35 {
36 }
37
38 /**
39  * \ingroup DicomDirMeta
40  * \brief   Canonical destructor.
41  */
42 DicomDirMeta::~DicomDirMeta() 
43 {
44 }
45
46 //-----------------------------------------------------------------------------
47 // Print
48 /**
49  * \brief   Prints the Meta Elements
50  */ 
51 void DicomDirMeta::Print(std::ostream &os)
52 {
53    os << "META" << std::endl;
54    // warning : META doesn't behave exactly like a Objet 
55    for (ListDocEntry::iterator i = DocEntries.begin();
56         i != DocEntries.end();
57         ++i)
58    {
59       (*i)->SetPrintLevel(PrintLevel);
60       (*i)->Print();
61       os << std::endl;
62    }
63 }
64
65
66 //-----------------------------------------------------------------------------
67 // Public
68
69
70 /**
71  * \brief   Writes the Meta Elements
72  * @return
73  */ 
74 void DicomDirMeta::WriteContent(std::ofstream *fp, FileType t)
75 {   
76    for (ListDocEntry::iterator i = DocEntries.begin();  
77                               i != DocEntries.end();
78                               ++i)
79    {
80       (*i)->WriteContent(fp, t);
81    }
82 }
83
84 //-----------------------------------------------------------------------------
85 // Protected
86
87 //-----------------------------------------------------------------------------
88 // Private
89
90 //-----------------------------------------------------------------------------
91
92 } // end namespace gdcm