| Home · All Classes · All Namespaces · Modules · Functions · Files

key-file.h
1
23 #ifndef _TelepathyQt_key_file_h_HEADER_GUARD_
24 #define _TelepathyQt_key_file_h_HEADER_GUARD_
25
26 #include <TelepathyQt/Global>
27
28 #include <QMetaType>
29 #include <QtGlobal>
30
31 class QString;
32 class QStringList;
33
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35
36 namespace Tp
37 {
38
39 class TP_QT_NO_EXPORT KeyFile
40 {
41 public:
42 enum Status {
43 None = 0,
44 NoError,
45 NotFoundError,
46 AccessError,
47 FormatError,
48 };
49
50 KeyFile();
51 KeyFile(const KeyFile &other);
52 KeyFile(const QString &fileName);
53 ~KeyFile();
54
55 KeyFile &operator=(const KeyFile &other);
56
57 void setFileName(const QString &fileName);
58 QString fileName() const;
59
60 Status status() const;
61
62 void setGroup(const QString &group);
63 QString group() const;
64
65 QStringList allGroups() const;
66 QStringList allKeys() const;
67 QStringList keys() const;
68 bool contains(const QString &key) const;
69
70 QString rawValue(const QString &key) const;
71 QString value(const QString &key) const;
72 QStringList valueAsStringList(const QString &key) const;
73
74 static bool unescapeString(const QByteArray &data, int from, int to,
75 QString &result);
76 static bool unescapeStringList(const QByteArray &data, int from, int to,
77 QStringList &result);
78
79 private:
80 struct Private;
81 friend struct Private;
82 Private *mPriv;
83 };
84
85 }
86
87 Q_DECLARE_METATYPE(Tp::KeyFile);
88
89 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
90
91 #endif