aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/modifications_p.h
blob: e21df906156705fad12ae9c6fdcf654a4fcf8613 (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
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef MODIFICATIONS_P_H
#define MODIFICATIONS_P_H

#include <QtCore/QList>
#include <QtCore/QString>
#include <QtCore/QStringView>

QT_BEGIN_NAMESPACE
class QDebug;
QT_END_NAMESPACE

// Helpers to split a parameter list of <add-function>, <declare-function>
// in a separate header for testing purposes

namespace AddedFunctionParser {

struct Argument
{
    bool equals(const Argument &rhs) const;

    QString type;
    QString name;
    QString defaultValue;
};

using Arguments = QList<Argument>;

inline bool operator==(const Argument &a1, const Argument &a2) { return a1.equals(a2); }
inline bool operator!=(const Argument &a1, const Argument &a2) { return !a1.equals(a2); }

#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const Argument &a);
#endif

Arguments splitParameters(QStringView paramString, QString *errorMessage = nullptr);

} // namespace AddedFunctionParser

#endif // MODIFICATIONS_P_H