#include <TelepathyQt4/KeyFile>
Public Types | |
enum | Status { None = 0, NoError, NotFoundError, AccessError, FormatError } |
Public Member Functions | |
KeyFile () | |
KeyFile (const QString &fileName) | |
~KeyFile () | |
void | setFileName (const QString &fileName) |
QString | fileName () const |
Status | status () const |
void | setGroup (const QString &group) |
QString | group () const |
QStringList | allGroups () const |
QStringList | allKeys () const |
QStringList | keys () const |
bool | contains (const QString &key) const |
QString | rawValue (const QString &key) const |
QString | value (const QString &key) const |
QStringList | valueAsStringList (const QString &key) const |
Friends | |
struct | Private |
It follows the rules regarding string escaping as defined in http://standards.freedesktop.org/desktop-entry-spec/latest/index.html
Telepathy::KeyFile::KeyFile | ( | ) |
Create a KeyFile object used to read (key-pair) compliant files.
The status will be KeyFile::None
Telepathy::KeyFile::KeyFile | ( | const QString & | fileName | ) |
Create a KeyFile object used to read (key-pair) compliant files.
fileName | Name of the file to be read. |
Telepathy::KeyFile::~KeyFile | ( | ) |
Class destructor.
QStringList Telepathy::KeyFile::allGroups | ( | ) | const |
Return all groups in the desktop file.
Global keys will be added to a empty group.
QStringList Telepathy::KeyFile::allKeys | ( | ) | const |
Return all keys described in the desktop file.
bool Telepathy::KeyFile::contains | ( | const QString & | key | ) | const |
Check if the current group contains a key named key.
QString Telepathy::KeyFile::fileName | ( | ) | const |
Return the name of the file associated with this object.
QString Telepathy::KeyFile::group | ( | ) | const |
QStringList Telepathy::KeyFile::keys | ( | ) | const |
Return a list of keys in the current group.
QString Telepathy::KeyFile::rawValue | ( | const QString & | key | ) | const |
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.
void Telepathy::KeyFile::setFileName | ( | const QString & | fileName | ) |
Set the name of the file to be read.
fileName | Name of the file to be read. |
void Telepathy::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. |
KeyFile::Status Telepathy::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().
QString Telepathy::KeyFile::value | ( | const QString & | key | ) | const |
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 Telepathy::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/
friend struct Private [friend] |