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

Function getContainerName

lib/checkstl.cpp:430–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430static std::string getContainerName(const Token *containerToken)
431{
432 if (!containerToken)
433 return std::string();
434 std::string ret(containerToken->str());
435 for (const Token *nametok = containerToken; nametok; nametok = nametok->tokAt(-2)) {
436 if (!Token::Match(nametok->tokAt(-2), "%name% ."))
437 break;
438 ret = nametok->strAt(-2) + '.' + ret;
439 }
440 return ret;
441}
442
443static bool isVector(const Token* tok)
444{

Callers 1

iteratorsMethod · 0.85

Calls 2

strMethod · 0.45
tokAtMethod · 0.45

Tested by

no test coverage detected