]> Creatis software - gdcm.git/blobdiff - src/gdcmDirList.cxx
* src/gdcmDocument.cxx: for broken (non DICOM V3 conformal) images
[gdcm.git] / src / gdcmDirList.cxx
index e3a00ccce225bb5f5370a537021fed66ee66f0de..efdc939369ee3cf2ad6a3c1f54ca4728631fa8a0 100644 (file)
@@ -1,5 +1,21 @@
-// gdcmDirList.cxx
-//-----------------------------------------------------------------------------
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmDirList.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/06/28 09:30:58 $
+  Version:   $Revision: 1.17 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+
 #include "gdcmDirList.h"
 #include "gdcmUtil.h"
 
@@ -68,7 +84,6 @@ std::string gdcmDirList::GetDirName(void)
 void gdcmDirList::Explore(std::string dirName,bool recursive)
 {
    std::string fileName;
-
    NormalizePath(dirName);
 #if defined(_MSC_VER) || (__CYGWIN__)
    WIN32_FIND_DATA fileData; 
@@ -92,15 +107,9 @@ void gdcmDirList::Explore(std::string dirName,bool recursive)
    }
 
 #else
-   // None  of  these  functions  is  in  POSIX.  The functions scandir() and
-   // alphasort() are from BSD 4.3, and have been available under Linux since
-   // libc4.  Libc4 and libc5 use the more precise prototype
-
    struct dirent **namelist;
    int n=scandir(dirName.c_str(), &namelist, 0, alphasort);
 
-   //if n < 0 should raise error
-
    for (int i= 0;i < n; i++) 
    {
       fileName=namelist[i]->d_name;     
@@ -113,9 +122,7 @@ void gdcmDirList::Explore(std::string dirName,bool recursive)
       {
          this->push_back(dirName+fileName);
       }
-      free(namelist[i]);
    }
-   free(namelist);
 #endif
 }