Home · All Classes · All Namespaces · Modules · Functions · Files |
The KeyFile class provides an easy way to read key-pair files such as INI style files and .desktop files. More...
#include <TelepathyQt4/KeyFile>
The KeyFile class provides an easy way to read key-pair files such as INI style files and .desktop files.
It follows the rules regarding string escaping as defined in http://standards.freedesktop.org/desktop-entry-spec/latest/index.html
enum Tp::KeyFile::Status |
Tp::KeyFile::KeyFile | ( | ) |
Create a KeyFile object used to read (key-pair) compliant files.
The status will be KeyFile::None
Tp::KeyFile::KeyFile | ( | const KeyFile & | other | ) |
Create a KeyFile object used to read (key-pair) compliant files.
Tp::KeyFile::KeyFile | ( | const QString & | fileName | ) |
Create a KeyFile object used to read (key-pair) compliant files.
fileName | Name of the file to be read. |
Tp::KeyFile::~KeyFile | ( | ) |
Class destructor.
void Tp::KeyFile::setFileName | ( | const QString & | fileName | ) |
Set the name of the file to be read.
fileName | Name of the file to be read. |
QString Tp::KeyFile::fileName | ( | ) | const |
Return the name of the file associated with this object.
KeyFile::Status Tp::KeyFile::status | ( | ) | const |
Return a status code indicating the first error that was met by KeyFile, or KeyFile::NoError if no error occurred.
Make sure to use this method if you set the filename to be read using setFileName().
void Tp::KeyFile::setGroup | ( | const QString & | group | ) |
Set the current group to be used while reading keys.
Query functions such as keys(), contains() and value() are based on this group.
By default a empty group is used as the group for global keys and is used as the default group if none is set.
group | Name of the group to be used. |
QString Tp::KeyFile::group | ( | ) | const |
QStringList Tp::KeyFile::allGroups | ( | ) | const |
Return all groups in the desktop file.
Global keys will be added to a empty group.
QStringList Tp::KeyFile::allKeys | ( | ) | const |
Return all keys described in the desktop file.
QStringList Tp::KeyFile::keys | ( | ) | const |
Return a list of keys in the current group.
bool Tp::KeyFile::contains | ( | const QString & | key | ) | const |
Check if the current group contains a key named key.
Get the raw value for the key in the current group named key.
The raw value is the value as is in the key file.
Get the value for the key in the current group named key.
Escape sequences in the value are interpreted as defined in: http://standards.freedesktop.org/desktop-entry-spec/latest/
QStringList Tp::KeyFile::valueAsStringList | ( | const QString & | key | ) | const |
Get the value for the key in the current group named key as a list.
Return a list containing all strings on this key separated by ';'. Escape sequences in the value are interpreted as defined in: http://standards.freedesktop.org/desktop-entry-spec/latest/
bool Tp::KeyFile::unescapeString | ( | const QByteArray & | data, |
int | from, | ||
int | to, | ||
QString & | result | ||
) | [static] |
bool Tp::KeyFile::unescapeStringList | ( | const QByteArray & | data, |
int | from, | ||
int | to, | ||
QStringList & | result | ||
) | [static] |
Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation | Telepathy-Qt4 0.8.0 |