#pragma implementation "tokenzr.h"
#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#endif
+
#include "wx/object.h"
#include "wx/string.h"
#include "wx/tokenzr.h"
return (m_string.Length() != 0);
}
+// AVS - added to fix leading whitespace / mult. delims bugs
+void wxStringTokenizer::EatLeadingDelims()
+{
+ int pos;
+
+ while ((pos=FindDelims(m_string, m_delims))==0) { // while leading delims
+ m_string = m_string.Mid((size_t)1); // trim 'em from the left
+ }
+}
+
wxString wxStringTokenizer::NextToken()
{
register off_t pos, pos2;
if (m_string.IsNull())
return m_string;
+ if (!m_retdelims)
+ EatLeadingDelims(); // AVS - added to fix leading whitespace /
+ // mult. delims bugs
+
pos = FindDelims(m_string, m_delims);
if (pos == -1) {
r_string = m_string;
- m_string = (char *)NULL;
+ m_string = wxEmptyString;
return r_string;
}