summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.h
blob: de7376c2866294ab7650679dde8ccf794d274dd0 (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
// 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 "jsonwizardgeneratorfactory.h"

#include <QDir>
#include <QRegularExpression>
#include <QVariant>

namespace ProjectExplorer {
namespace Internal {

// Documentation inside.
class JsonWizardScannerGenerator : public JsonWizardGenerator
{
public:
    bool setup(const QVariant &data, QString *errorMessage);

    Core::GeneratedFiles fileList(Utils::MacroExpander *expander,
                                  const Utils::FilePath &wizardDir, const Utils::FilePath &projectDir,
                                  QString *errorMessage) override;
private:
    Core::GeneratedFiles scan(const Utils::FilePath &dir, const Utils::FilePath &base);
    bool matchesSubdirectoryPattern(const Utils::FilePath &path);

    QString m_binaryPattern;
    QList<QRegularExpression> m_subDirectoryExpressions;
};

} // namespace Internal
} // namespace ProjectExplorer