MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / delimitedStringToVector

Function delimitedStringToVector

src/server/gui/core/utils/StringUtil.cpp:251–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249//////////////////////////////////////////////////////////////////////////
250
251 stringVector delimitedStringToVector(const std::string& _string, const std::string& _delimiter, bool sort)
252 {
253 stringVector vector;
254 size_t start = 0;
255 size_t comma = _string.find(_delimiter);
256
257 while(comma != std::string::npos)
258 {
259 vector.push_back(_string.substr(start, comma - start));
260 start = comma + 1;
261 comma = _string.find(_delimiter, start);
262 }
263
264 vector.push_back(_string.substr(start));
265 if (sort)
266 std::sort(vector.begin(), vector.end());
267
268 return vector;
269
270 } // delimitedStringToVector
271
272//////////////////////////////////////////////////////////////////////////
273

Callers 3

parseElementMethod · 0.85
ignoreLeadingArticlesFunction · 0.85

Calls 5

sortFunction · 0.85
push_backMethod · 0.80
findMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected