1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef CMAKEPARSER_H
6#define CMAKEPARSER_H
7
8#include "services/builder/ioutputparser.h"
9#include "services/builder/task.h"
10
11#include <QObject>
12#include <QRegularExpression>
13
14class CMakeParser : public IOutputParser
15{
16 Q_OBJECT
17public:
18 explicit CMakeParser();
19 virtual void stdOutput(const QString &line, OutputPane::OutputFormat format) override;
20 void stdError(const QString &line) override;
21
22protected:
23 void doFlush() override;
24
25private:
26 enum TripleLineError { NONE, LINE_LOCATION, LINE_DESCRIPTION, LINE_DESCRIPTION2 };
27
28 TripleLineError expectTripleLineErrorData = NONE;
29
30 Task lastTask;
31 QRegExp commonError;
32 QRegExp nextSubError;
33 QRegularExpression locationLine;
34 bool skippedFirstEmptyLine = false;
35 int lines = 0;
36};
37
38#endif // CMAKEPARSER_H
39