use wcs(n)casecmp() if available; use wxStricmp() to implement wxString::CmpNoCase() as it's significantly more efficient than wx code (closes #10375)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-16 19:03:26 +00:00
parent ca44dbde5f
commit 6689960c3c
5 changed files with 47 additions and 27 deletions

View File

@@ -1115,6 +1115,7 @@ size_t wxString::find_last_not_of(const wxOtherCharType* sz, size_t nStart,
int wxString::CmpNoCase(const wxString& s) const
{
#if wxUSE_UNICODE_UTF8
// FIXME-UTF8: use wxUniChar::ToLower/ToUpper once added
const_iterator i1 = begin();
@@ -1138,6 +1139,9 @@ int wxString::CmpNoCase(const wxString& s) const
else if ( len1 > len2 )
return 1;
return 0;
#else // wxUSE_UNICODE_WCHAR or ANSI
return wxStricmp(m_impl.c_str(), s.m_impl.c_str());
#endif
}