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
12class BluezApiParser;
13class Method;
14class Parameter;
15class QString;
16class QTextStream;
17
18class XmlGenerator
19{
20public:
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
30private:
31 static void writeHeader(QTextStream &stream);
32 static void writeFooter(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 &param, const QString &dir);
37 static void writeAnnotation(QTextStream &stream, const Parameter &param, const QString &dir, int i);
38
39 Config m_config;
40};
41
42#endif // XMLGENERATOR_H
43

source code of bluez-qt/tools/bluezapi2qt/XmlGenerator.h