Add functions for sorting strings in natural sort order
Use StrCmpLogicalW() under MSW and generic implementation under the other platforms. See https://github.com/wxWidgets/wxWidgets/pull/780
This commit is contained in:
committed by
Vadim Zeitlin
parent
a2e4e6ebcf
commit
371c4b1366
@@ -42,12 +42,30 @@ wxDictionaryStringSortAscending(const wxString& s1, const wxString& s2)
|
||||
return cmp ? cmp : s1.Cmp(s2);
|
||||
}
|
||||
|
||||
|
||||
inline int wxCMPFUNC_CONV
|
||||
wxDictionaryStringSortDescending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
return wxDictionaryStringSortAscending(s2, s1);
|
||||
}
|
||||
|
||||
WXDLLIMPEXP_BASE
|
||||
int wxCMPFUNC_CONV wxCmpNatural(const wxString& s1, const wxString& s2);
|
||||
|
||||
WXDLLIMPEXP_BASE
|
||||
int wxCMPFUNC_CONV wxCmpNaturalNative(const wxString& s1, const wxString& s2);
|
||||
|
||||
inline int wxCMPFUNC_CONV wxNaturalStringSortAscending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
return wxCmpNatural(s1, s2);
|
||||
}
|
||||
|
||||
inline int wxCMPFUNC_CONV wxNaturalStringSortDescending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
return wxCmpNatural(s2, s1);
|
||||
}
|
||||
|
||||
|
||||
#if wxUSE_STD_CONTAINERS
|
||||
|
||||
typedef int (wxCMPFUNC_CONV *CMPFUNCwxString)(wxString*, wxString*);
|
||||
|
Reference in New Issue
Block a user