]> Creatis software - gdcm.git/blobdiff - src/gdcmJPEGFragmentsInfo.cxx
ENH: minor cleanup patch, use TagName instead of std:string for clarification. Don...
[gdcm.git] / src / gdcmJPEGFragmentsInfo.cxx
index f981336bb4695f64d732574b55621e493b631fd3..06f331b3e6a3f27f8edd60fa9b60151dd929cdb8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJPEGFragmentsInfo.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/10 16:44:00 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2004/10/20 14:30:40 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 #include "gdcmJPEGFragmentsInfo.h"
 
-gdcmJPEGFragmentsInfo::~gdcmJPEGFragmentsInfo()
+namespace gdcm 
+{
+
+/**
+ * \brief Default destructor
+ */
+JPEGFragmentsInfo::~JPEGFragmentsInfo()
 {
    for(JPEGFragmentsList::iterator it  = Fragments.begin();
                                    it != Fragments.end();
@@ -28,3 +34,31 @@ gdcmJPEGFragmentsInfo::~gdcmJPEGFragmentsInfo()
    }
    Fragments.clear();
 }
+
+/**
+ * \brief        Print self.
+ * @param indent Indentation string to be prepended during printing.
+ * @param os     Stream to print to.
+ */
+void JPEGFragmentsInfo::Print( std::string indent, std::ostream &os )
+{
+   os << indent
+      << "----------------- JPEG fragments --------------------------------"
+      << std::endl;
+   os << indent
+      << "Total number of fragments : " << Fragments.size()
+      << std::endl;
+   int fragmentNumber = 0;
+   for(JPEGFragmentsList::iterator it  = Fragments.begin();
+                                   it != Fragments.end();
+                                 ++it)
+   {
+      os << indent
+         << "   fragment number :" << fragmentNumber++;
+      (*it)->Print( indent + "   ", os );
+      os << std::endl;
+   }
+}
+
+
+} // end namespace gdcm