Home · All Classes · All Namespaces · Modules · Functions · Files
key-file.h
00001 
00023 #ifndef _TelepathyQt_key_file_h_HEADER_GUARD_
00024 #define _TelepathyQt_key_file_h_HEADER_GUARD_
00025 
00026 #include <TelepathyQt/Global>
00027 
00028 #include <QMetaType>
00029 #include <QtGlobal>
00030 
00031 class QString;
00032 class QStringList;
00033 
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035 
00036 namespace Tp
00037 {
00038 
00039 class TP_QT_NO_EXPORT KeyFile
00040 {
00041 public:
00042     enum Status {
00043         None = 0,
00044         NoError,
00045         NotFoundError,
00046         AccessError,
00047         FormatError,
00048     };
00049 
00050     KeyFile();
00051     KeyFile(const KeyFile &other);
00052     KeyFile(const QString &fileName);
00053     ~KeyFile();
00054 
00055     KeyFile &operator=(const KeyFile &other);
00056 
00057     void setFileName(const QString &fileName);
00058     QString fileName() const;
00059 
00060     Status status() const;
00061 
00062     void setGroup(const QString &group);
00063     QString group() const;
00064 
00065     QStringList allGroups() const;
00066     QStringList allKeys() const;
00067     QStringList keys() const;
00068     bool contains(const QString &key) const;
00069 
00070     QString rawValue(const QString &key) const;
00071     QString value(const QString &key) const;
00072     QStringList valueAsStringList(const QString &key) const;
00073 
00074     static bool unescapeString(const QByteArray &data, int from, int to,
00075         QString &result);
00076     static bool unescapeStringList(const QByteArray &data, int from, int to,
00077         QStringList &result);
00078 
00079 private:
00080     struct Private;
00081     friend struct Private;
00082     Private *mPriv;
00083 };
00084 
00085 }
00086 
00087 Q_DECLARE_METATYPE(Tp::KeyFile);
00088 
00089 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00090 
00091 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.3