]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirStudy.cxx
* src/gdcmDebug.h : remove the Debug test in the gdcmErrorMacro
[gdcm.git] / src / gdcmDicomDirStudy.cxx
index e1824d7f4296db337171c0a3a90ed0e24c49885c..92630664ab69bbbccbea9ec1f4dcf4e2ff6db468 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:53:42 $
-  Version:   $Revision: 1.25 $
+  Date:      $Date: 2005/01/18 14:28:32 $
+  Version:   $Revision: 1.27 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -20,6 +20,7 @@
 #include "gdcmDicomDirElement.h"
 #include "gdcmGlobal.h"
 #include "gdcmDicomDirSerie.h"
+#include "gdcmDebug.h"
 
 namespace gdcm 
 {
@@ -50,6 +51,7 @@ DicomDirStudy::~DicomDirStudy()
 /**
  * \brief   Prints the Object
  * @param os ostream to write to 
+ * @param   indent indent
  * @return
  */ 
 void DicomDirStudy::Print(std::ostream &os, std::string const & )
@@ -110,7 +112,9 @@ DicomDirSerie *DicomDirStudy::NewSerie()
 DicomDirSerie *DicomDirStudy::GetFirstEntry()
 {
    ItDicomDirSerie = Series.begin();
-   return *ItDicomDirSerie;
+   if (ItDicomDirSerie != Series.end())
+      return *ItDicomDirSerie;
+   return NULL;
 }
 
 /**
@@ -120,16 +124,13 @@ DicomDirSerie *DicomDirStudy::GetFirstEntry()
  */
 DicomDirSerie *DicomDirStudy::GetNextEntry()
 {
-   if (ItDicomDirSerie != Series.end())
+   gdcmAssertMacro (ItDicomDirSerie != Series.end());
    {
-      DicomDirSerie *tmp = *ItDicomDirSerie;
       ++ItDicomDirSerie;
-      return tmp;
-   }
-   else
-   {
-      return NULL;
+      if (ItDicomDirSerie != Series.end())
+         return *ItDicomDirSerie;
    }
+   return NULL;
 }  
 //-----------------------------------------------------------------------------
 // Protected