KCoreAddons

desktoptojson.h
1 /*
2  SPDX-FileCopyrightText: 2013 Sebastian K├╝gler <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #ifndef DESKTOPTOJSON_H
8 #define DESKTOPTOJSON_H
9 
10 #include <QCommandLineOption>
11 #include <QCommandLineParser>
12 #include <QString>
13 
14 class QCommandLineParser;
15 
16 class DesktopToJson
17 {
18 public:
19  DesktopToJson(QCommandLineParser *parser,
20  const QCommandLineOption &i,
21  const QCommandLineOption &o,
22  const QCommandLineOption &v,
23  const QCommandLineOption &c,
24  const QCommandLineOption &s);
25  int runMain();
26 
27 private:
28  bool convert(const QString &src, const QString &dest, const QStringList &serviceTypes);
29  void convertToJson(const QString &key, const QString &value, QJsonObject &json, QJsonObject &kplugin, int lineNr);
30  void convertToCompatibilityJson(const QString &key, const QString &value, QJsonObject &json, int lineNr);
31  bool resolveFiles();
32 
33  QCommandLineParser *const m_parser;
34  const QCommandLineOption input;
35  const QCommandLineOption output;
36  const QCommandLineOption verbose;
37  const QCommandLineOption compat;
38  const QCommandLineOption serviceTypesOption;
39  QString m_inFile;
40  QString m_outFile;
41 };
42 
43 #endif
T convert(const QVariant &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Apr 18 2021 23:02:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.