}
}
-// 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();
}
}
if ( !Alloc(len + n) || !CopyBeforeWrite() ) {
wxFAIL_MSG( _T("out of memory in wxStringImpl::append") );
+ return *this;
}
GetStringData()->nDataLength = len + n;
m_pchData[len + n] = '\0';
if ( !Alloc(length() + n) || !CopyBeforeWrite() ) {
wxFAIL_MSG( _T("out of memory in wxStringImpl::insert") );
+ return *this;
}
memmove(m_pchData + nPos + n, m_pchData + nPos,