]> Creatis software - gdcm.git/blobdiff - src/gdcmDict.cxx
Some normalizations :
[gdcm.git] / src / gdcmDict.cxx
index dc7e5c0c14f7be0ad3292fb974fe3469e2250d05..162b79c04237662ef239768e29903e397fe99736 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:49:41 $
-  Version:   $Revision: 1.66 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.69 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -91,6 +91,7 @@ Dict::~Dict()
  * \brief   Print all the dictionary entries contained in this dictionary.
  *          Entries will be sorted by tag i.e. the couple (group, element).
  * @param   os The output stream to be written to.
+ * @param indent Indentation string to be prepended during printing
  */
 void Dict::Print(std::ostream &os, std::string const & )
 {
@@ -276,7 +277,9 @@ DictEntry *Dict::GetDictEntry(uint16_t group, uint16_t elem)
 DictEntry *Dict::GetFirstEntry()
 {
    ItKeyHt = KeyHt.begin();
-   return &(ItKeyHt->second);
+   if( ItKeyHt != KeyHt.end() )
+      return &(ItKeyHt->second);
+   return NULL;
 }
 
 /**
@@ -286,17 +289,14 @@ DictEntry *Dict::GetFirstEntry()
  */
 DictEntry *Dict::GetNextEntry()
 {
-   if (ItKeyHt != KeyHt.end())
-   {
-      DictEntry *tmp = &(ItKeyHt->second);
-      ++ItKeyHt;
+   gdcmAssertMacro (ItKeyHt != KeyHt.end());
 
-      return tmp;
-   }
-   else
    {
-      return NULL;
+      ++ItKeyHt;
+      if (ItKeyHt != KeyHt.end())
+         return &(ItKeyHt->second);
    }
+   return NULL;
 }
 
 //-----------------------------------------------------------------------------