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

Method getStrArraySize

lib/token.cpp:767–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765}
766
767nonneg int Token::getStrArraySize(const Token *tok)
768{
769 assert(tok != nullptr);
770 assert(tok->tokType() == eString);
771 const std::string str(getStringLiteral(tok->str()));
772 int sizeofstring = 1;
773 for (int i = 0; i < static_cast<int>(str.size()); i++) {
774 if (str[i] == '\\')
775 ++i;
776 ++sizeofstring;
777 }
778 return sizeofstring;
779}
780
781nonneg int Token::getStrSize(const Token *tok, const Settings &settings)
782{

Callers

nothing calls this directly

Calls 3

getStringLiteralFunction · 0.85
strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected