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

Method printOut

lib/templatesimplifier.cpp:3615–3685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3613}
3614
3615void TemplateSimplifier::printOut(const TokenAndName &tokenAndName, const std::string &indent) const
3616{
3617 std::cout << indent << "token: ";
3618 if (tokenAndName.token())
3619 std::cout << "\"" << tokenAndName.token()->str() << "\" " << mTokenList.fileLine(tokenAndName.token());
3620 else
3621 std::cout << "nullptr";
3622 std::cout << std::endl;
3623 std::cout << indent << "scope: \"" << tokenAndName.scope() << "\"" << std::endl;
3624 std::cout << indent << "name: \"" << tokenAndName.name() << "\"" << std::endl;
3625 std::cout << indent << "fullName: \"" << tokenAndName.fullName() << "\"" << std::endl;
3626 std::cout << indent << "nameToken: ";
3627 if (tokenAndName.nameToken())
3628 std::cout << "\"" << tokenAndName.nameToken()->str() << "\" " << mTokenList.fileLine(tokenAndName.nameToken());
3629 else
3630 std::cout << "nullptr";
3631 std::cout << std::endl;
3632 std::cout << indent << "paramEnd: ";
3633 if (tokenAndName.paramEnd())
3634 std::cout << "\"" << tokenAndName.paramEnd()->str() << "\" " << mTokenList.fileLine(tokenAndName.paramEnd());
3635 else
3636 std::cout << "nullptr";
3637 std::cout << std::endl;
3638 std::cout << indent << "flags: ";
3639 if (tokenAndName.isClass())
3640 std::cout << " isClass";
3641 if (tokenAndName.isFunction())
3642 std::cout << " isFunction";
3643 if (tokenAndName.isVariable())
3644 std::cout << " isVariable";
3645 if (tokenAndName.isAlias())
3646 std::cout << " isAlias";
3647 if (tokenAndName.isSpecialization())
3648 std::cout << " isSpecialization";
3649 if (tokenAndName.isPartialSpecialization())
3650 std::cout << " isPartialSpecialization";
3651 if (tokenAndName.isForwardDeclaration())
3652 std::cout << " isForwardDeclaration";
3653 if (tokenAndName.isVariadic())
3654 std::cout << " isVariadic";
3655 if (tokenAndName.isFriend())
3656 std::cout << " isFriend";
3657 std::cout << std::endl;
3658 if (tokenAndName.token() && !tokenAndName.paramEnd() && tokenAndName.token()->strAt(1) == "<") {
3659 const Token *end = tokenAndName.token()->next()->findClosingBracket();
3660 if (end) {
3661 const Token *start = tokenAndName.token()->next();
3662 std::cout << indent << "type: ";
3663 while (start && start != end) {
3664 if (start->isUnsigned())
3665 std::cout << "unsigned";
3666 else if (start->isSigned())
3667 std::cout << "signed";
3668 if (start->isLong())
3669 std::cout << "long";
3670 std::cout << start->str();
3671 start = start->next();
3672 }

Callers 1

simplifyTemplatesMethod · 0.45

Calls 15

tokenMethod · 0.80
fileLineMethod · 0.80
scopeMethod · 0.80
fullNameMethod · 0.80
paramEndMethod · 0.80
isClassMethod · 0.80
isVariableMethod · 0.80
isSpecializationMethod · 0.80
isForwardDeclarationMethod · 0.80
isVariadicMethod · 0.80
isFriendMethod · 0.80

Tested by

no test coverage detected