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

Method strValue

lib/token.cpp:250–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250std::string Token::strValue() const
251{
252 assert(mTokType == eString);
253 std::string ret(getStringLiteral(mStr));
254 std::string::size_type pos = 0U;
255 while ((pos = ret.find('\\', pos)) != std::string::npos) {
256 ret.erase(pos,1U);
257 if (ret[pos] >= 'a') {
258 if (ret[pos] == 'n')
259 ret[pos] = '\n';
260 else if (ret[pos] == 'r')
261 ret[pos] = '\r';
262 else if (ret[pos] == 't')
263 ret[pos] = '\t';
264 }
265 if (ret[pos] == '0')
266 return ret.substr(0,pos);
267 pos++;
268 }
269 return ret;
270}
271
272void Token::deleteNext(nonneg int count)
273{

Callers 9

parseFunctionCallMethod · 0.45
checkUnknownPatternMethod · 0.45
checkExtraWhitespaceMethod · 0.45
checkFileUsageMethod · 0.45
valueFlowArrayElementFunction · 0.45
executeImplMethod · 0.45

Calls 3

getStringLiteralFunction · 0.85
findMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected