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

Function getTypeString

lib/symboldatabase.cpp:5956–5981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5954}
5955
5956static std::string getTypeString(const Token *typeToken)
5957{
5958 if (!typeToken)
5959 return "";
5960 while (Token::Match(typeToken, "%name%|*|&|::")) {
5961 if (typeToken->str() == "::") {
5962 std::string ret;
5963 while (Token::Match(typeToken, ":: %name%")) {
5964 ret += "::" + typeToken->strAt(1);
5965 typeToken = typeToken->tokAt(2);
5966 if (typeToken->str() == "<") {
5967 for (const Token *tok = typeToken; tok != typeToken->link(); tok = tok->next())
5968 ret += tok->str();
5969 ret += ">";
5970 typeToken = typeToken->link()->next();
5971 }
5972 }
5973 return ret;
5974 }
5975 if (Token::Match(typeToken, "%name% const| %var%|*|&")) {
5976 return typeToken->str();
5977 }
5978 typeToken = typeToken->next();
5979 }
5980 return "";
5981}
5982
5983static bool hasMatchingConstructor(const Scope* classScope, const ValueType* argType) {
5984 if (!classScope || !argType)

Callers 2

findFunctionMethod · 0.85
matchParameterMethod · 0.85

Calls 3

nextMethod · 0.80
strMethod · 0.45
tokAtMethod · 0.45

Tested by

no test coverage detected