From: Ryan Norton Date: Sun, 14 Dec 2003 23:06:05 +0000 (+0000) Subject: Put the locale funcs here and had them call the correct CRT function via wx versions X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f97c9db7ae52fb50abe734f760f5555334701d2a Put the locale funcs here and had them call the correct CRT function via wx versions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/regex.cpp b/src/common/regex.cpp index 8983f98d02..8503538f76 100644 --- a/src/common/regex.cpp +++ b/src/common/regex.cpp @@ -188,7 +188,7 @@ bool wxRegExImpl::Compile(const wxString& expr, int flags) // compile it #if wxUSE_UNICODE - int errorcode = wx_regcomp(&m_RegEx, expr, expr.Length(), flagsRE); + int errorcode = wx_regcomp(&m_RegEx, expr, expr.Length(), REG_ADVANCED); #else int errorcode = regcomp(&m_RegEx, expr.mb_str(), flagsRE); #endif @@ -484,4 +484,38 @@ int wxRegEx::Replace(wxString *pattern, return m_impl->Replace(pattern, replacement, maxMatches); } +#ifdef wx_wchar + +/** Locale functions */ + +extern "C" { + +int wx_isdigit(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIsdigit((unsigned char) c));} +int wx_isalpha(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIsalpha((unsigned char) c));} +int wx_isalnum(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIsalnum((unsigned char) c));} +int wx_isupper(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIsupper((unsigned char) c));} +int wx_islower(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIslower((unsigned char) c));} +int wx_isgraph(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIsgraph((unsigned char) c));} +int wx_ispunct(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIspunct((unsigned char) c));} +int wx_isspace(wx_wchar c) {return (c >= 0 && c <= UCHAR_MAX && wxIsspace((unsigned char) c));} + +wx_wchar wx_toupper(wx_wchar c) +{ + if (c >= 0 && c <= UCHAR_MAX) + return wxToupper((unsigned char) c); + return c; + +} + +wx_wchar wx_tolower(wx_wchar c) +{ + if (c >= 0 && c <= UCHAR_MAX) + return wxTolower((unsigned char) c); + return c; +} + +} + +#endif + #endif // wxUSE_REGEX