Add wxDictionaryStringSortAscending comparison function.
Add "dictionary sort" callbacks and document them and the already existing wxStringSortAscending() and wxStringSortDescending(). See #16330. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -27,6 +27,22 @@ inline int wxCMPFUNC_CONV wxStringSortDescending(const wxString& s1, const wxStr
|
||||
return wxStringSortAscending(s2, s1);
|
||||
}
|
||||
|
||||
// This comparison function ignores case when comparing strings differing not
|
||||
// in case only, i.e. this ensures that "Aa" comes before "AB", unlike with
|
||||
// wxStringSortAscending().
|
||||
inline int wxCMPFUNC_CONV
|
||||
wxDictionaryStringSortAscending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
const int cmp = s1.CmpNoCase(s2);
|
||||
return cmp ? cmp : s1.Cmp(s2);
|
||||
}
|
||||
|
||||
inline int wxCMPFUNC_CONV
|
||||
wxDictionaryStringSortDescending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
return wxDictionaryStringSortAscending(s2, s1);
|
||||
}
|
||||
|
||||
#if wxUSE_STD_CONTAINERS
|
||||
|
||||
#include "wx/dynarray.h"
|
||||
|
Reference in New Issue
Block a user