aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/ioutputparser.h
blob: 83229eb5607d5ff1a709549d41e49762454754d8 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "projectexplorer_export.h"
#include "buildstep.h"

#include <utils/outputformatter.h>

namespace ProjectExplorer {
class Task;

class PROJECTEXPLORER_EXPORT OutputTaskParser : public Utils::OutputLineParser
{
public:
    OutputTaskParser();
    ~OutputTaskParser() override;

    class TaskInfo
    {
    public:
        TaskInfo(const Task &t, int l, int s) : task(t), linkedLines(l), skippedLines(s) {}
        Task task;
        int linkedLines = 0;
        int skippedLines = 0;
    };
    const QList<TaskInfo> taskInfo() const;

protected:
    void flush() override;

    void setOrigin(const QString &source);
    void scheduleTask(const Task &task, int outputLines, int skippedLines = 0);
    void setDetailsFormat(Task &task, const LinkSpecs &linkSpecs = {});
    void addDetailsFormat(Task &task, const LinkSpecs &linkSpecs = {});
    void fixTargetLink();
    void createOrAmendTask(
        Task::TaskType type,
        const QString &description,
        const QString &originalLine,
        bool forceAmend = false,
        const Utils::FilePath &file = {},
        int line = -1,
        int column = 0,
        const LinkSpecs &linkSpecs = {});
    void setCurrentTask(const Task &task);

    Task &currentTask();
    const Task &currentTask() const;

private:
    virtual bool isContinuation(const QString &line) const;

    void runPostPrintActions(QPlainTextEdit *edit) override;

    class Private;
    Private * const d;
};

} // namespace ProjectExplorer