dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
xmlconfig.h
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  */
25 #ifndef XMLCONFIG_H
26 #define XMLCONFIG_H
27 
28 #if defined(QTCREATOR_UTILS_LIB)
29 # define XMLCONFIG_EXPORT Q_DECL_EXPORT
30 #else
31 # define XMLCONFIG_EXPORT Q_DECL_IMPORT
32 #endif
33 
34 #include <QtCore/qglobal.h>
35 #include <QSettings>
36 #include <QDomElement>
37 #include <QObject>
38 
39 class XMLCONFIG_EXPORT XmlConfig : QObject
40 {
41 
42 public:
43  static const QSettings::Format XmlSettingsFormat;
44 
45  static bool readXmlFile(QIODevice &device, QSettings::SettingsMap &map);
46  static bool writeXmlFile(QIODevice &device, const QSettings::SettingsMap &map);
47 
48 private:
49  static QString rootName;
50 
51  static void handleNode(QDomElement* node, QSettings::SettingsMap &map, QString path = "");
52  static QSettings::SettingsMap settingsToMap(QSettings& qs);
53  static QString variantToString(const QVariant &v);
54  static QVariant stringToVariant(const QString &s);
55  static QStringList splitArgs(const QString &s, int idx);
56 };
57 
58 #endif // XMLCONFIG_H
59 
static const QSettings::Format XmlSettingsFormat
Definition: xmlconfig.h:43