added overloads taking pairs of const char/wchar_t pointers for wxString methods working with const_iterators for backwards compatibility with old wxString::const_iterator which used to be convertible to/from const wxChar *

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-05 21:55:29 +00:00
parent a9dce709f5
commit f2a1b1bd23
4 changed files with 142 additions and 18 deletions

View File

@@ -170,17 +170,15 @@ void wxStringImpl::InitWith(const wxChar *psz, size_t nPos, size_t nLength)
}
}
// poor man's iterators are "void *" pointers
wxStringImpl::wxStringImpl(const void *pStart, const void *pEnd)
wxStringImpl::wxStringImpl(const_iterator first, const_iterator last)
{
if ( pEnd >= pStart )
if ( last >= first )
{
InitWith((const wxChar *)pStart, 0,
(const wxChar *)pEnd - (const wxChar *)pStart);
InitWith(first, 0, last - first);
}
else
{
wxFAIL_MSG( _T("pStart is not before pEnd") );
wxFAIL_MSG( _T("first must be before last") );
Init();
}
}