MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / split

Function split

lib/cppcheck.cpp:317–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317static std::vector<std::string> split(const std::string &str, const std::string &sep=" ")
318{
319 std::vector<std::string> ret;
320 for (std::string::size_type startPos = 0U; startPos < str.size();) {
321 startPos = str.find_first_not_of(sep, startPos);
322 if (startPos == std::string::npos)
323 break;
324
325 if (str[startPos] == '\"') {
326 const std::string::size_type endPos = str.find('\"', startPos + 1);
327 ret.push_back(str.substr(startPos + 1, endPos - startPos - 1));
328 startPos = (endPos < str.size()) ? (endPos + 1) : endPos;
329 continue;
330 }
331
332 const std::string::size_type endPos = str.find(sep, startPos + 1);
333 ret.push_back(str.substr(startPos, endPos - startPos));
334 startPos = endPos;
335 }
336
337 return ret;
338}
339
340static std::string getDumpFileName(const Settings& settings, const FileWithDetails& file)
341{

Callers 6

detectPythonFunction · 0.85
executeAddonFunction · 0.85
getDefinesFlagsFunction · 0.85
checkClangMethod · 0.85
checkInternalMethod · 0.85
analyseClangTidyMethod · 0.85

Calls 3

sizeMethod · 0.45
findMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected