File indexing completed on 2024-04-28 05:38:32

0001 /*
0002     SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB a KDAB Group company info@kdab.com
0003     SPDX-FileContributor: Nicolas Fella <nicolas.fella@kdab.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef JNISIGNATURES_H
0009 #define JNISIGNATURES_H
0010 
0011 #include "checkbase.h"
0012 
0013 #include <regex>
0014 #include <string>
0015 
0016 class ClazyContext;
0017 namespace clang
0018 {
0019 class Stmt;
0020 class CXXMemberCallExpr;
0021 class FunctionDecl;
0022 } // namespace clang
0023 
0024 class JniSignatures : public CheckBase
0025 {
0026 public:
0027     JniSignatures(const std::string &name, ClazyContext *context);
0028     void VisitStmt(clang::Stmt *) override;
0029 
0030 private:
0031     template<typename T>
0032     void checkArgAt(T *call, unsigned int index, const std::regex &expr, const std::string &errorMessage);
0033     void checkConstructorCall(clang::Stmt *stm);
0034     void checkFunctionCall(clang::Stmt *stm);
0035 };
0036 
0037 #endif