kconf_update
Go to the documentation of this file.
25 #include <kconfiggroup.h>
27 namespace KConfigUtils
30 bool hasGroup(KConfig *config,
const QStringList &lst)
32 KConfigGroup group =
openGroup(config, lst);
33 return group.exists();
36 KConfigGroup
openGroup(KConfig *config,
const QStringList &_lst)
39 return KConfigGroup(config, QString());
42 QStringList lst = _lst;
45 for (cg = KConfigGroup(config, lst.takeFirst()); !lst.isEmpty(); cg = KConfigGroup(&cg, lst.takeFirst())) {}
59 return QStringList() << str;
62 if (!str.endsWith(
']')) {
64 *error = QString(
"Missing closing ']' in %1").arg(_str);
71 return str.split(
"][");
77 int length = src.length();
78 for (
int pos = 0; pos < length; ++pos) {
79 QChar ch = src.at(pos);
86 *error = QString(
"Unfinished escape sequence in %1").arg(src);
92 }
else if (ch ==
't') {
94 }
else if (ch ==
'n') {
96 }
else if (ch ==
'r') {
98 }
else if (ch ==
'\\') {
100 }
else if (ch ==
'x') {
101 if (pos + 2 < length) {
102 char value = src.mid(pos + 1, 2).toInt(ok, 16);
104 dst += QChar::fromLatin1(value);
107 *error = QString(
"Invalid hex escape sequence at column %1 in %2").arg(pos).arg(src);
112 *error = QString(
"Unfinished hex escape sequence at column %1 in %2").arg(pos).arg(src);
117 *error = QString(
"Invalid escape sequence at column %1 in %2").arg(pos).arg(src);
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 11:43:19 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.