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

Method getValueTokenMinStrSize

lib/token.cpp:1981–1999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1979}
1980
1981const Token *Token::getValueTokenMinStrSize(const Settings &settings, MathLib::bigint* path) const
1982{
1983 if (!mImpl->mValues)
1984 return nullptr;
1985 const Token *ret = nullptr;
1986 int minsize = INT_MAX;
1987 for (auto it = mImpl->mValues->begin(); it != mImpl->mValues->end(); ++it) {
1988 if (it->isTokValue() && it->tokvalue && it->tokvalue->tokType() == Token::eString) {
1989 const int size = getStrSize(it->tokvalue, settings);
1990 if (!ret || size < minsize) {
1991 minsize = size;
1992 ret = it->tokvalue;
1993 if (path)
1994 *path = it->path;
1995 }
1996 }
1997 }
1998 return ret;
1999}
2000
2001const Token *Token::getValueTokenMaxStrLength() const
2002{

Callers 3

getDimensionsEtcFunction · 0.80
invalidFunctionUsageMethod · 0.80
stringLiteralWriteMethod · 0.80

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected