1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-01 03:10:06 +00:00

Reverted File::compareFilenames() method to not compare filenames naturally and added an optional argument to use a natural comparison

This commit is contained in:
ed 2016-12-02 16:18:15 +00:00
parent fa7768ae2e
commit d6fc589b6d

View file

@ -226,12 +226,12 @@ bool File::areFileNamesCaseSensitive()
#endif
}
static int compareFilenames (const String& name1, const String& name2) noexcept
static int compareFilenames (const String& name1, const String& name2, bool shouldSortNaturally = false) noexcept
{
#if NAMES_ARE_CASE_SENSITIVE
return name1.compareNatural (name2, true);
return (shouldSortNaturally ? name1.compareNatural (name2, true) : name1.compare (name2));
#else
return name1.compareNatural (name2, false);
return (shouldSortNaturally ? name1.compareNatural (name2, false) : name1.compareIgnoreCase (name2));
#endif
}