20 namespace opensubdiv {
24 const string &separators,
27 size_t token_start = 0, token_length = 0;
28 for (
size_t i = 0; i <
str.length(); ++i) {
29 const char ch =
str[i];
30 if (separators.find(ch) == string::npos) {
36 if (token_length > 0 || !skip_empty) {
37 string token =
str.substr(token_start, token_length);
38 tokens->push_back(token);
46 if ((token_length != 0) ||
47 (!skip_empty && token_start > 0 && separators.find(
str[token_start - 1]) != string::npos)) {
48 string token =
str.substr(token_start, token_length);
49 tokens->push_back(token);
void stringSplit(vector< string > *tokens, const string &str, const string &separators, bool skip_empty)