+ if ( mode == wxTOKEN_DEFAULT )
+ {
+ // by default, we behave like strtok() if the delimiters are only
+ // whitespace characters and as wxTOKEN_RET_EMPTY otherwise (for
+ // whitespace delimiters, strtok() behaviour is better because we want
+ // to count consecutive spaces as one delimiter)
+ const wxChar *p;
+ for ( p = delims.c_str(); *p; p++ )
+ {
+ if ( !wxIsspace(*p) )
+ break;
+ }
+
+ if ( *p )
+ {
+ // not whitespace char in delims
+ mode = wxTOKEN_RET_EMPTY;
+ }
+ else
+ {
+ // only whitespaces
+ mode = wxTOKEN_STRTOK;
+ }
+ }
+