diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-05-15 07:54:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-15 07:54:02 +0200 |
commit | 2065d304147e5d919d92c321188862f663917131 (patch) | |
tree | 67f972764b9b4935397f4dab2ab79bc6b3927185 /core/ustring.h | |
parent | 1b5c57916688b384be8aeacfb3aaedcf6e956d6e (diff) | |
parent | f2564ca97fd6a25bc68f2e7302461970306fc837 (diff) |
Merge pull request #8717 from damianday/master
Fix natural sorting order in EditorFileDialog, FileDialog and EditorFileSystemDirectory
Diffstat (limited to 'core/ustring.h')
-rw-r--r-- | core/ustring.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/ustring.h b/core/ustring.h index 9ee3c2042c..d00bfa59b5 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -98,6 +98,7 @@ public: signed char casecmp_to(const String &p_str) const; signed char nocasecmp_to(const String &p_str) const; + signed char naturalnocasecmp_to(const String &p_str) const; const CharType *c_str() const; /* standard size stuff */ @@ -256,6 +257,14 @@ struct NoCaseComparator { } }; +struct NaturalNoCaseComparator { + + bool operator()(const String &p_a, const String &p_b) const { + + return p_a.naturalnocasecmp_to(p_b) < 0; + } +}; + /* end of namespace */ //tool translate |