summaryrefslogtreecommitdiff
path: root/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.h
blob: 6a39287205b01c929ea0def6bf2f4d795b754303 (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
// 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 <QObject>
#include <QString>
#include <QList>
#include <QMap>

QT_BEGIN_NAMESPACE
QT_END_NAMESPACE

namespace Core { class GeneratedFile; }

namespace QmakeProjectManager {
namespace Internal {

struct PluginOptions;

struct GenerationParameters {
    QString path;
    QString fileName;
    QString templatePath;
};

class PluginGenerator : public QObject
{
    Q_OBJECT

public:
    static QList<Core::GeneratedFile> generatePlugin(const GenerationParameters& p,
                                                     const PluginOptions &options,
                                                     QString *errorMessage);

private:
    using SubstitutionMap = QMap<QString, QString>;
    static QString processTemplate(const QString &tmpl, const SubstitutionMap &substMap, QString *errorMessage);
    static QString cStringQuote(QString s);
};

}
}