summaryrefslogtreecommitdiff
path: root/qmake/property.h
blob: 95c9f43bd4a50f37d1f7495894417d13f0fa087e (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef PROPERTY_H
#define PROPERTY_H

#include "library/proitems.h"
#include "propertyprinter.h"

#include <qglobal.h>
#include <qstring.h>
#include <qhash.h>

QT_BEGIN_NAMESPACE

class QSettings;

class QMakeProperty final
{
    QSettings *settings;
    void initSettings();

    QHash<ProKey, ProString> m_values;

public:
    QMakeProperty();
    ~QMakeProperty();

    void reload();

    bool hasValue(const ProKey &);
    ProString value(const ProKey &);

    void setValue(QString, const QString &);
    void remove(const QString &);

    int queryProperty(const QStringList &optionProperties = QStringList(),
                      const PropertyPrinter &printer = qmakePropertyPrinter);
    int setProperty(const QStringList &optionProperties);
    void unsetProperty(const QStringList &optionProperties);
};

QT_END_NAMESPACE

#endif // PROPERTY_H