diff options
Diffstat (limited to 'src/checks/detachingbase.cpp')
-rw-r--r-- | src/checks/detachingbase.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/checks/detachingbase.cpp b/src/checks/detachingbase.cpp index eff470d9..aaa172f4 100644 --- a/src/checks/detachingbase.cpp +++ b/src/checks/detachingbase.cpp @@ -22,7 +22,6 @@ Boston, MA 02110-1301, USA. */ -#include "checkmanager.h" #include "detachingbase.h" #include "Utils.h" #include "StringUtils.h" @@ -35,12 +34,12 @@ using namespace clang; using namespace std; -DetachingBase::DetachingBase(const std::string &name, ClazyContext *context) - : CheckBase(name, context) +DetachingBase::DetachingBase(const std::string &name, ClazyContext *context, Options options) + : CheckBase(name, context, options) { } -bool DetachingBase::isDetachingMethod(CXXMethodDecl *method) const +bool DetachingBase::isDetachingMethod(CXXMethodDecl *method, DetachingMethodType detachingMethodType) const { if (!method) return false; @@ -49,13 +48,14 @@ bool DetachingBase::isDetachingMethod(CXXMethodDecl *method) const if (!record) return false; - const string className = record->getNameAsString(); + StringRef className = clazy::name(record); - const std::unordered_map<string, std::vector<string> > &methodsByType = QtUtils::detachingMethods(); + const std::unordered_map<string, std::vector<StringRef> > &methodsByType = detachingMethodType == DetachingMethod ? clazy::detachingMethods() + : clazy::detachingMethodsWithConstCounterParts(); auto it = methodsByType.find(className); if (it != methodsByType.cend()) { const auto &methods = it->second; - if (clazy_std::contains(methods, method->getNameAsString())) + if (clazy::contains(methods, clazy::name(method))) return true; } |