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

0001 /*
0002     SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company info@kdab.com
0003     SPDX-FileContributor: SĂ©rgio Martins <sergio.martins@kdab.com>
0004 
0005     SPDX-FileCopyrightText: 2015 Sergio Martins <smartins@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #ifndef REQUIRED_RESULTS_H
0011 #define REQUIRED_RESULTS_H
0012 
0013 #include "checkbase.h"
0014 
0015 #include <string>
0016 
0017 /**
0018  * Warns if a result of a const member function is ignored.
0019  * There are lots of false positives. QDir::mkdir() for example.
0020  */
0021 class RequiredResults : public CheckBase
0022 {
0023 public:
0024     RequiredResults(const std::string &name, ClazyContext *context);
0025     void VisitStmt(clang::Stmt *stm) override;
0026 
0027 private:
0028     bool shouldIgnoreMethod(const std::string &qualifiedName);
0029 };
0030 
0031 #endif