| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2018 Sergio Martins <[email protected]> |
| 3 |
|
| 4 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef CLAZY_FULLY_QUALIFIED_MOC_TYPES_H |
| 8 |
#define CLAZY_FULLY_QUALIFIED_MOC_TYPES_H |
| 9 |
|
| 10 |
#include "checkbase.h" |
| 11 |
|
| 12 |
#include <string> |
| 13 |
#include <vector> |
| 14 |
|
| 15 |
namespace clang |
| 16 |
{ |
| 17 |
class CXXMethodDecl; |
| 18 |
class CXXRecordDecl; |
| 19 |
} // namespace clang |
| 20 |
|
| 21 |
/** |
| 22 |
* See README-fully-qualified-moc-types.md for more info. |
| 23 |
*/ |
| 24 |
class FullyQualifiedMocTypes : public CheckBase |
| 25 |
{ |
| 26 |
public: |
| 27 |
using CheckBase::CheckBase; |
| 28 |
void VisitDecl(clang::Decl *) override; |
| 29 |
|
| 30 |
private: |
| 31 |
bool isGadget(clang::CXXRecordDecl *record) const; |
| 32 |
bool handleQ_PROPERTY(clang::CXXMethodDecl *); |
| 33 |
void VisitMacroExpands(const clang::Token &MacroNameTok, const clang::SourceRange &range, const clang::MacroInfo *minfo = nullptr) override; |
| 34 |
void registerQ_GADGET(clang::SourceLocation); |
| 35 |
bool typeIsFullyQualified(clang::QualType t, std::string &qualifiedTypeName, const std::string &typeName) const; |
| 36 |
std::string getQualifiedNameOfType(const clang::Type *ptr, bool resolveTemplateArgs) const; |
| 37 |
std::string resolveTemplateType(const clang::TemplateSpecializationType *ptr, bool resolveTemplateArgs) const; |
| 38 |
|
| 39 |
std::string writtenType(const clang::ParmVarDecl *param) const; |
| 40 |
|
| 41 |
std::vector<clang::SourceLocation> m_qgadgetMacroLocations; |
| 42 |
}; |
| 43 |
#endif |