blob: bd121483a8d61868ad6e37e441470a6f4e5a6be3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright (C) 2020 Alexis Jeandet.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <projectexplorer/ioutputparser.h>
#include <QRegularExpression>
#include <optional>
namespace MesonProjectManager::Internal {
class NinjaParser final : public ProjectExplorer::OutputTaskParser
{
Q_OBJECT
QRegularExpression m_progressRegex{R"(^\[(\d+)/(\d+)\])"};
std::optional<int> extractProgress(const QString &line);
public:
NinjaParser();
Result handleLine(const QString &line, Utils::OutputFormat type) override;
void setSourceDirectory(const Utils::FilePath &sourceDir);
bool hasDetectedRedirection() const override { return true; }
bool hasFatalErrors() const override;
Q_SIGNAL void reportProgress(int progress);
};
} // namespace MesonProjectManager::Internal
|