diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 4ce1f26d8..1bed24f7c 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -564,7 +564,8 @@ void File::readLines (StringArray& destLines) const int File::findChildFiles (Array& results, const int whatToLookFor, const bool searchRecursively, - const String& wildCardPattern) const + const String& wildCardPattern, + bool sortNatural) const { int total = 0; @@ -574,6 +575,12 @@ int File::findChildFiles (Array& results, ++total; } + if (sortNatural) + { + File::NaturalFileComparator sorter (false); + results.sort (sorter); + } + return total; } diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index 0520f8de0..101411566 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -570,7 +570,8 @@ public: int findChildFiles (Array& results, int whatToLookFor, bool searchRecursively, - const String& wildCardPattern = "*") const; + const String& wildCardPattern = "*", + bool sortNatural = false) const; /** Searches inside a directory and counts how many files match a wildcard pattern.