Iterate over all characters of a wxString with iterator
This commit is contained in:
@@ -896,15 +896,16 @@ wxPGVIterator wxPropertyGridInterface::GetVIterator( int flags ) const
|
|||||||
static wxString EscapeDelimiters(const wxString& s)
|
static wxString EscapeDelimiters(const wxString& s)
|
||||||
{
|
{
|
||||||
wxString result;
|
wxString result;
|
||||||
result.Alloc(s.length());
|
result.reserve(s.length());
|
||||||
const wxChar* ch = s.c_str();
|
|
||||||
while (*ch)
|
for (wxString::const_iterator it = s.begin(); it != s.end(); ++it)
|
||||||
{
|
{
|
||||||
if (*ch == wxT(';') || *ch == wxT('|') || *ch == wxT(','))
|
wxStringCharType ch = *it;
|
||||||
result += wxT('\\');
|
if ( ch == wxS(';') || ch == wxS('|') || ch == wxS(',') )
|
||||||
result += *ch;
|
result += wxS('\\');
|
||||||
++ch;
|
result += ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user