| 3824 | } |
| 3825 | |
| 3826 | std::string Type::name() const |
| 3827 | { |
| 3828 | const Token* start = classDef->next(); |
| 3829 | if (classScope && classScope->enumClass && isEnumType()) |
| 3830 | start = start->tokAt(1); |
| 3831 | else if (start->str() == "class") |
| 3832 | start = start->tokAt(1); |
| 3833 | else if (!start->isName()) |
| 3834 | return ""; |
| 3835 | const Token* next = start; |
| 3836 | while (Token::Match(next, "::|<|>|(|)|[|]|*|&|&&|%name%")) { |
| 3837 | if (Token::Match(next, "<|(|[") && next->link()) |
| 3838 | next = next->link(); |
| 3839 | next = next->next(); |
| 3840 | } |
| 3841 | std::string result; |
| 3842 | for (const Token* tok = start; tok != next; tok = tok->next()) { |
| 3843 | if (!result.empty()) |
| 3844 | result += ' '; |
| 3845 | result += tok->str(); |
| 3846 | } |
| 3847 | return result; |
| 3848 | } |
| 3849 | |
| 3850 | void SymbolDatabase::debugMessage(const Token *tok, const std::string &type, const std::string &msg) const |
| 3851 | { |