X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDict.cxx;h=162b79c04237662ef239768e29903e397fe99736;hb=0ad9dae4659b21bfd5c834c1af724eab4dcdf4f6;hp=dc7e5c0c14f7be0ad3292fb974fe3469e2250d05;hpb=ef0c45b292557174c768c2cc7fc11fea4d57e218;p=gdcm.git diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index dc7e5c0c..162b79c0 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -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; } //-----------------------------------------------------------------------------