1 | /* |
2 | * BluezQt - Asynchronous BlueZ wrapper library |
3 | * |
4 | * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <mincequi@web.de> |
5 | * |
6 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #ifndef XMLGENERATOR_H |
10 | #define XMLGENERATOR_H |
11 | |
12 | class BluezApiParser; |
13 | class Method; |
14 | class Parameter; |
15 | class QString; |
16 | class QTextStream; |
17 | |
18 | class XmlGenerator |
19 | { |
20 | public: |
21 | struct Config { |
22 | bool useOptional = false; |
23 | bool useDeprecated = false; |
24 | bool useExperimental = false; |
25 | }; |
26 | XmlGenerator(const Config &config); |
27 | |
28 | bool generate(const BluezApiParser &parser); |
29 | |
30 | private: |
31 | static void (QTextStream &stream); |
32 | static void (QTextStream &stream); |
33 | static void writeInterface(QTextStream &stream, const QString &name); |
34 | static void closeInterface(QTextStream &stream); |
35 | static bool writeMethod(QTextStream &stream, const Method &method); |
36 | static bool writeArg(QTextStream &stream, const Parameter ¶m, const QString &dir); |
37 | static void writeAnnotation(QTextStream &stream, const Parameter ¶m, const QString &dir, int i); |
38 | |
39 | Config m_config; |
40 | }; |
41 | |
42 | #endif // XMLGENERATOR_H |
43 | |