MCPcopy Create free account
hub / github.com/bbuchfink/diamond / tokenize

Function tokenize

src/util/string/string.cpp:119–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119vector<string> tokenize(const char* str, const char* delimiters)
120{
121 vector<string> out;
122 string token;
123 while (*str != 0) {
124 while (*str != 0 && strchr(delimiters, *str))
125 ++str;
126 token.clear();
127 while (*str != 0 && strchr(delimiters, *str) == nullptr)
128 token += *(str++);
129 if (token.length() > 0)
130 out.push_back(token);
131 }
132 if (out.size() == 0)
133 out.push_back(string());
134 return out;
135}
136
137set<int32_t> parse_csv(const string& s)
138{

Callers 3

get_seqMethod · 0.85
ReductionMethod · 0.85
parse_csvFunction · 0.85

Calls 5

stringClass · 0.85
clearMethod · 0.45
lengthMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected