1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef GCCPARSER_H |
6 | #define GCCPARSER_H |
7 | |
8 | #include "services/builder/ioutputparser.h" |
9 | #include "services/builder/task.h" |
10 | |
11 | #include <QRegularExpression> |
12 | |
13 | class GccParser : public IOutputParser |
14 | { |
15 | Q_OBJECT |
16 | |
17 | public: |
18 | GccParser(); |
19 | |
20 | void stdError(const QString &line) override; |
21 | void stdOutput(const QString &line, OutputPane::OutputFormat format) override; |
22 | |
23 | static QString id(); |
24 | |
25 | protected: |
26 | void newTask(const Task &task); |
27 | void doFlush() override; |
28 | |
29 | void amendDescription(const QString &desc, bool monospaced); |
30 | |
31 | private: |
32 | QRegularExpression regExp; |
33 | QRegularExpression regExpIncluded; |
34 | QRegularExpression regExpGccNames; |
35 | |
36 | Task currentTask; |
37 | int lines = 0; |
38 | }; |
39 | |
40 | #endif // GCCPARSER_H |
41 |