File indexing completed on 2024-05-12 04:39:22
0001 /* 0002 SPDX-FileCopyrightText: 2016 Carlos Nihelton <carlosnsoliveira@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef _CLANGTIDYPARSER_H_ 0008 #define _CLANGTIDYPARSER_H_ 0009 0010 // KDevPlatform 0011 #include <interfaces/iproblem.h> 0012 // Qt 0013 #include <QRegularExpression> 0014 #include <QObject> 0015 0016 namespace ClangTidy 0017 { 0018 0019 /** 0020 * \class 0021 * \brief Implements a parser for clang-tidy's standard output. 0022 */ 0023 class ClangTidyParser : public QObject 0024 { 0025 Q_OBJECT 0026 0027 public: 0028 explicit ClangTidyParser(QObject* parent = nullptr); 0029 ~ClangTidyParser() override = default; 0030 0031 public: 0032 /** 0033 * \brief meant to be used by Job class to pass the standard output to be parsed. 0034 */ 0035 void addData(const QStringList& stdoutList); 0036 0037 Q_SIGNALS: 0038 void problemsDetected(const QVector<KDevelop::IProblem::Ptr>& problems); 0039 0040 private: 0041 const QRegularExpression m_hitRegExp; 0042 }; 0043 0044 } // namespace ClangTidy 0045 0046 #endif