MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / tokenizeString

Function tokenizeString

src/tokenize.cpp:8–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6// Empty tokens will not be included in the result.
7
8vector<string>
9tokenizeString(const string &s, const string &delims, bool allowEmptyTokens)
10{
11 size_t offset = -1;
12
13 vector<string>tokens;
14
15 do {
16 offset += 1;
17 size_t j = s.find_first_of(delims, offset);
18
19 string token = s.substr(offset, j - offset);
20
21 if (allowEmptyTokens || token.length() > 0) {
22 tokens.push_back(token);
23 }
24
25 offset = j;
26 } while (offset != string::npos);
27
28 return tokens;
29}
30} // namespace dmtcp

Callers 2

serializeMethod · 0.85
getUpdatedLdPreloadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected