]> Creatis software - gdcm.git/blob - src/gdcmJPEGFragmentsInfo.cxx
* src/gdcmDocument.cxx ftell() return properly stored in a long (i.e.
[gdcm.git] / src / gdcmJPEGFragmentsInfo.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmJPEGFragmentsInfo.cxx,v $
5   Language:  C++
6   Date:      $Date: 2004/10/20 14:30:40 $
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 #include "gdcmJPEGFragmentsInfo.h"
20
21 namespace gdcm 
22 {
23
24 /**
25  * \brief Default destructor
26  */
27 JPEGFragmentsInfo::~JPEGFragmentsInfo()
28 {
29    for(JPEGFragmentsList::iterator it  = Fragments.begin();
30                                    it != Fragments.end();
31                                  ++it )
32    {
33       delete (*it);
34    }
35    Fragments.clear();
36 }
37
38 /**
39  * \brief        Print self.
40  * @param indent Indentation string to be prepended during printing.
41  * @param os     Stream to print to.
42  */
43 void JPEGFragmentsInfo::Print( std::string indent, std::ostream &os )
44 {
45    os << indent
46       << "----------------- JPEG fragments --------------------------------"
47       << std::endl;
48    os << indent
49       << "Total number of fragments : " << Fragments.size()
50       << std::endl;
51    int fragmentNumber = 0;
52    for(JPEGFragmentsList::iterator it  = Fragments.begin();
53                                    it != Fragments.end();
54                                  ++it)
55    {
56       os << indent
57          << "   fragment number :" << fragmentNumber++;
58       (*it)->Print( indent + "   ", os );
59       os << std::endl;
60    }
61 }
62
63
64 } // end namespace gdcm