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

Function isc_strCall

lib/checkstl.cpp:1956–1970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1954}
1955
1956static bool isc_strCall(const Token* tok, const Library::Container* container)
1957{
1958 if (!Token::simpleMatch(tok, "("))
1959 return false;
1960 const Token* dot = tok->astOperand1();
1961 if (!Token::simpleMatch(dot, "."))
1962 return false;
1963 const Token* obj = dot->astOperand1();
1964 if (!obj || !obj->valueType())
1965 return false;
1966 const Library::Container* objContainer = obj->valueType()->container;
1967 if (!objContainer || !container || !objContainer->stdStringLike || (objContainer != container && !container->view))
1968 return false;
1969 return Token::Match(dot->astOperand2(), "c_str|data ( )");
1970}
1971
1972static bool isc_strConcat(const Token* tok)
1973{

Callers 3

isc_strConcatFunction · 0.85
isc_strInPlusChainFunction · 0.85
isc_strAssignmentFunction · 0.85

Calls 3

astOperand1Method · 0.80
astOperand2Method · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected