removed Matches(const wxChar *, int=0) overload: it creates ambiguity with Matches(const wxString&, int=0) one when re.Matches(s.c_str()) is called now that c_str() returns wxCStrData which can be converted to both const wxChar * and wxString

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-03-22 15:20:50 +00:00
parent 191abe25ad
commit 6346588525
2 changed files with 6 additions and 16 deletions

View File

@ -97,10 +97,9 @@ public:
// len may be the length of text (ignored by most system regex libs)
//
// may only be called after successful call to Compile()
bool Matches(const wxChar *text, int flags = 0) const;
bool Matches(const wxChar *text, int flags, size_t len) const;
bool Matches(const wxString& text, int flags = 0) const
{ return Matches(text.c_str(), flags, text.length()); }
bool Matches(const wxString& text, int flags = 0) const;
bool Matches(const wxChar *text, int flags, size_t len) const
{ return Matches(wxString(text, len), flags); }
// get the start index and the length of the match of the expression
// (index 0) or a bracketed subexpression (index != 0)

View File

@ -634,21 +634,12 @@ bool wxRegEx::Compile(const wxString& expr, int flags)
return true;
}
bool wxRegEx::Matches(const wxChar *str, int flags, size_t len) const
{
wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
(void)len;
return m_impl->Matches(WXREGEX_CHAR(str), flags WXREGEX_IF_NEED_LEN(len));
}
bool wxRegEx::Matches(const wxChar *str, int flags) const
bool wxRegEx::Matches(const wxString& str, int flags) const
{
wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
return m_impl->Matches(WXREGEX_CHAR(str),
flags
WXREGEX_IF_NEED_LEN(wxStrlen(str)));
return m_impl->Matches(WXREGEX_CHAR(str), flags
WXREGEX_IF_NEED_LEN(str.length()));
}
bool wxRegEx::GetMatch(size_t *start, size_t *len, size_t index) const