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

Method getStrLength

lib/token.cpp:756–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754}
755
756nonneg int Token::getStrLength(const Token *tok)
757{
758 assert(tok != nullptr);
759 assert(tok->mTokType == eString);
760
761 const std::string s(replaceEscapeSequences(getStringLiteral(tok->str())));
762
763 const auto pos = s.find('\0');
764 return pos < s.size() ? pos : s.size();
765}
766
767nonneg int Token::getStrArraySize(const Token *tok)
768{

Callers

nothing calls this directly

Calls 5

replaceEscapeSequencesFunction · 0.85
getStringLiteralFunction · 0.85
strMethod · 0.45
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected