]> Creatis software - bbtk.git/commitdiff
2023 Bug FilesFromDirectory order files
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 5 Jun 2013 14:50:26 +0000 (16:50 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 5 Jun 2013 14:50:26 +0000 (16:50 +0200)
packages/std/src/bbstdFilesFromDirectory.cxx

index e8d919cebccaf8c3044abbf892d482ddea6de5d2..b85757fc528d0fafb85b0bf7b6eb03a138f6aa2c 100644 (file)
@@ -214,6 +214,21 @@ int FilesFromDirectory::Explore(std::string const &dirpath, bool recursive)
    }
 #endif
 
+  std::string tmpString;
+  int i,ii,sizeFilenames = Filenames.size();
+  for (i=0; i<sizeFilenames; i++)
+  {
+    for (ii=i; ii<sizeFilenames; ii++)
+    {
+       if (Filenames[i]>Filenames[ii]) 
+        {
+          tmpString=Filenames[i];
+          Filenames[i]=Filenames[ii];
+          Filenames[ii]=tmpString;
+        } // if 
+    } // for ii
+  } // for i
+
   return numberOfFiles;
 }