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 <QCommandLineParser>
11 #include <QCommandLineOption>
12 #include <QString>
13 
14 class QCommandLineParser;
15 
16 class DesktopToJson
17 {
18 public:
19  DesktopToJson(QCommandLineParser *parser, const QCommandLineOption &i,
20  const QCommandLineOption &o, const QCommandLineOption &v,
21  const QCommandLineOption &c, const QCommandLineOption &s);
22  int runMain();
23 
24 private:
25  bool convert(const QString &src, const QString &dest, const QStringList& serviceTypes);
26  void convertToJson(const QString& key, const QString &value, QJsonObject &json, QJsonObject &kplugin, int lineNr);
27  void convertToCompatibilityJson(const QString &key, const QString &value, QJsonObject &json, int lineNr);
28  bool resolveFiles();
29 
30  QCommandLineParser *m_parser;
31  QCommandLineOption input;
32  QCommandLineOption output;
33  QCommandLineOption verbose;
34  QCommandLineOption compat;
35  QCommandLineOption serviceTypesOption;
36  QString m_inFile;
37  QString m_outFile;
38 };
39 
40 #endif
T convert(const QVariant &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed May 27 2020 23:06:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.