]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDir.cxx
Forget this one
[gdcm.git] / src / gdcmDicomDir.cxx
index cbaa1367c19faa72266857ca40c538b3fa3486f0..1d5bed3a7f603d460b6a32cd922da8bf39421fe4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/13 12:19:58 $
-  Version:   $Revision: 1.100 $
+  Date:      $Date: 2005/01/17 10:59:52 $
+  Version:   $Revision: 1.103 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -163,7 +163,7 @@ DicomDir::~DicomDir()
 /**
  * \brief  Canonical Printer 
  */
-void DicomDir::Print(std::ostream &os)
+void DicomDir::Print(std::ostream &os, std::string const & )
 {
    if( MetaElems )
    {
@@ -414,12 +414,14 @@ bool DicomDir::WriteDicomDir(std::string const &fileName)
 void DicomDir::CreateDicomDirChainedList(std::string const & path)
 {
    CallStartMethod();
-   DirList fileList(path,1); // gets recursively the file list
+   DirList dirList(path,1); // gets recursively the file list
    unsigned int count = 0;
    VectDocument list;
    Header *header;
 
-   for( DirList::iterator it  = fileList.begin();
+   DirListType fileList = dirList.GetFilenames();
+
+   for( DirListType::iterator it  = fileList.begin();
                               it != fileList.end();
                               ++it )
    {
@@ -452,7 +454,7 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path)
    // sorts Patient/Study/Serie/
    std::sort(list.begin(), list.end(), DicomDir::HeaderLessThan );
    
-   std::string tmp = fileList.GetDirName();      
+   std::string tmp = dirList.GetDirName();      
    //for each Header of the chained list, add/update the Patient/Study/Serie/Image info
    SetElements(tmp, list);
    CallEndMethod();
@@ -985,6 +987,34 @@ bool DicomDir::HeaderLessThan(Document *header1, Document *header2)
 {
    return *header1 < *header2;
 }
+
+/**
+ * \brief   Initialise the visit of the DicomDirPatients of the DicomDir
+ */
+void DicomDir::InitTraversal()
+{
+   ItDicomDirPatient = Patients.begin();
+}
+
+/**
+ * \brief   Get the next entry while visiting the DicomDirPatients
+ * \return  The next DicomDirPatient if found, otherwhise NULL
+ */
+DicomDirPatient *DicomDir::GetNextEntry()
+{
+   if (ItDicomDirPatient != Patients.end())
+   {
+      DicomDirPatient *tmp = *ItDicomDirPatient;
+      ++ItDicomDirPatient;
+      return tmp;
+   }
+   else
+   {
+      return NULL;
+   }
+}
+
+
 } // end namespace gdcm
 
 //-----------------------------------------------------------------------------