X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDicomDir.cxx;h=cc41e96dd951fbe7bb27058dcc6448bd4ef11642;hb=8a69df0f4018beae8c78a35bef30590e318128e5;hp=1bfa211d9112c0fd2d07dc7f0fc2d3c49cd96198;hpb=ef0c45b292557174c768c2cc7fc11fea4d57e218;p=gdcm.git diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 1bfa211d..cc41e96d 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 07:53:41 $ - Version: $Revision: 1.104 $ + Date: $Date: 2005/01/19 08:57:14 $ + Version: $Revision: 1.106 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -938,22 +938,20 @@ void DicomDir::SetElements(std::string const & path, VectDocument const &list) } /** - * \brief Move the content of the src SQItem to the dst SQItem + * \brief Move the content of the source SQItem to the destination SQItem * Only DocEntry's are moved - * + * @param dst destination SQItem + * @param src source SQItem */ void DicomDir::MoveSQItem(SQItem *dst,SQItem *src) { DocEntry *entry; - src->Initialize(); - entry = src->GetNextEntry(); + entry = src->GetFirstEntry(); while(entry) { src->RemoveEntryNoDestroy(entry); dst->AddEntry(entry); - - src->Initialize(); entry = src->GetNextEntry(); } } @@ -969,12 +967,14 @@ bool DicomDir::HeaderLessThan(Document *header1, Document *header2) /** * \brief Get the first entry while visiting the DicomDirPatients - * \return The next DicomDirPatient if found, otherwhise NULL + * \return The first DicomDirPatient if found, otherwhise NULL */ DicomDirPatient *DicomDir::GetFirstEntry() { ItDicomDirPatient = Patients.begin(); - return *ItDicomDirPatient; + if ( ItDicomDirPatient != Patients.end() ) + return *ItDicomDirPatient; + return NULL; } /** @@ -984,16 +984,13 @@ DicomDirPatient *DicomDir::GetFirstEntry() */ DicomDirPatient *DicomDir::GetNextEntry() { - if (ItDicomDirPatient != Patients.end()) + gdcmAssertMacro (ItDicomDirPatient != Patients.end()); { - DicomDirPatient *tmp = *ItDicomDirPatient; ++ItDicomDirPatient; - return tmp; - } - else - { - return NULL; + if ( ItDicomDirPatient != Patients.end() ) + return *ItDicomDirPatient; } + return NULL; }