KDECore
Go to the documentation of this file.
27#include <QtCore/QChar>
28#include <QtCore/QStringList>
34 if (
c >=
'0' &&
c <=
'9')
36 else if (
c >=
'A' &&
c <=
'F')
38 else if (
c >=
'a' &&
c <=
'f')
47 0x00, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00,
48 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00
51 return (
c <
sizeof(
iqm) * 8) && (
iqm[
c / 8] & (1 << (
c & 7)));
54 return c ==
'\\' ||
c ==
'\'' ||
c ==
'"' ||
c ==
'$';
61 0x00, 0x00, 0x00, 0x00, 0xdc, 0x07, 0x00, 0xd8,
62 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x38
67 return (
c <
sizeof(
iqm) * 8) && (
iqm[
c / 8] & (1 << (
c & 7)));
75 for (
int pos = 0; ; ) {
78 if (pos >= args.length())
80 c = args.unicode()[pos++];
81 }
while (
c.isSpace());
86 if (pos >= args.length())
88 c = args.unicode()[pos];
100 if (
ccret.isEmpty()) {
105 if (pos >= args.length()) {
126 if (
pos2 >= args.length()) {
128 ret += args.mid(pos - 1);
131 cc = args.unicode()[
pos2++];
145 if (pos >= args.length())
147 c = args.unicode()[pos++];
152 if (pos >= args.length())
154 c = args.unicode()[pos++];
158 if (pos >= args.length())
160 c = args.unicode()[pos++];
173 }
else if (
c ==
QLatin1Char(
'$') && pos < args.length() &&
177 if (pos >= args.length())
179 c = args.unicode()[pos++];
183 if (pos >= args.length())
185 c = args.unicode()[pos++];
186 switch (
c.toLatin1()) {
197 if (pos >= args.length())
199 cret += args.unicode()[pos++].toLatin1() & 31;
203 if (pos >= args.length())
205 int hv =
fromHex( args.unicode()[pos++] );
208 if (pos < args.length()) {
219 if (
c.toLatin1() >=
'0' &&
c.toAscii() <=
'7') {
222 for (
int i = 0; i < 2; i++) {
223 if (pos >= args.length())
225 c = args.unicode()[pos];
226 if (
c.toLatin1() <
'0' ||
c.toAscii() >
'7')
228 hv =
hv * 8 + (
c.toLatin1() -
'0');
243 if (pos >= args.length())
245 c = args.unicode()[pos++];
250 if (pos >= args.length())
252 c = args.unicode()[pos++];
253 }
while (!
c.isSpace());
277 0xff, 0xff, 0xff, 0xff, 0xdf, 0x07, 0x00, 0xd8,
278 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78
282 return ((
c <
sizeof(
iqm) * 8) && (
iqm[
c / 8] & (1 << (
c & 7)))) ||
cUnicode.isSpace();
288 return QString::fromLatin1(
"''");
289 for (
int i = 0; i < arg.length(); i++)
static bool isMeta(QChar cUnicode)
static int fromHex(QChar cUnicode)
static bool isSpecial(QChar cUnicode)
static bool isQuoteMeta(QChar cUnicode)
QString quoteArg(const QString &arg)
Quotes arg according to system shell rules.
QString homeDir(const QString &user)
QStringList splitArgs(const QString &cmd, Options flags=NoOptions, Errors *err=0)
Splits cmd according to system shell word splitting and quoting rules.
@ TildeExpand
Perform tilde expansion.
@ AbortOnMeta
Put the parser into full shell mode and bail out if a too complex construct is encoutered.
Errors
Status codes from splitArgs()
@ BadQuoting
Indicates a parsing error, like an unterminated quoted string.
@ FoundMeta
The AbortOnMeta flag was set and an unhandled shell meta character was encoutered.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Jul 20 2023 00:00:00 by
doxygen 1.9.8 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.