+// all the functions below taking non-const wxString::const_iterator p advance
+// it until the end of the match
+
+// scans all digits (but no more than len) and returns the resulting number
+bool GetNumericToken(size_t len,
+ wxString::const_iterator& p,
+ const wxString::const_iterator& end,
+ unsigned long *number)
+{
+ size_t n = 1;
+ wxString s;
+ while ( p != end && wxIsdigit(*p) )
+ {
+ s += *p++;
+
+ if ( len && ++n > len )
+ break;
+ }
+
+ return !s.empty() && s.ToULong(number);
+}
+
+// scans all alphabetic characters and returns the resulting string
+wxString
+GetAlphaToken(wxString::const_iterator& p,
+ const wxString::const_iterator& end)
+{
+ wxString s;
+ while ( p != end && wxIsalpha(*p) )
+ {
+ s += *p++;
+ }
+
+ return s;
+}
+