aboutsummaryrefslogtreecommitdiffstats
path: root/QtVsTools.Core/QMakeQuery.cs
blob: 0cff666bdf67b79372f6aa0d24531906b9dc327b (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
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

using System.Diagnostics;
using System.Text;

namespace QtVsTools.Core
{
    public class QMakeQuery : QtBuildToolQuery
    {
        private class QMakeProcess : QMake, IQueryProcess
        {
            public QMakeProcess(string qtDir)
                : base(qtDir)
            {
                Query = " ";
            }

            protected override void OutMsg(Process process, string msg)
            {
                StdOutput.AppendLine(msg);
            }

            protected override void InfoStart(Process process)
            {
                InfoMsg(process, "Querying persistent properties");
                base.InfoStart(process);
            }

            private StringBuilder stdOutput;
            public StringBuilder StdOutput => stdOutput ??= new StringBuilder();
        }

        protected override IQueryProcess CreateQueryProcess(string qtDir) => new QMakeProcess(qtDir);
    }
}