KCoreAddons

kshell.h
1 /*
2  This file is part of the KDE libraries
3 
4  SPDX-FileCopyrightText: 2003, 2007 Oswald Buddenhagen <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 #ifndef KSHELL_H
9 #define KSHELL_H
10 
11 #include <kcoreaddons_export.h>
12 #include <qglobal.h>
13 
14 class QStringList;
15 class QString;
16 
22 namespace KShell
23 {
24 
29 enum Option {
30  NoOptions = 0,
31 
38 
69 };
73 Q_DECLARE_FLAGS(Options, Option)
74 
75 
78 enum Errors {
82  NoError = 0,
83 
88 
94 };
95 
138 KCOREADDONS_EXPORT QStringList splitArgs(const QString &cmd, Options flags = NoOptions, Errors *err = nullptr);
139 
151 KCOREADDONS_EXPORT QString joinArgs(const QStringList &args);
152 
171 KCOREADDONS_EXPORT QString quoteArg(const QString &arg);
172 
185 KCOREADDONS_EXPORT QString tildeExpand(const QString &path);
186 
195 KCOREADDONS_EXPORT QString tildeCollapse(const QString &path);
196 }
197 
198 Q_DECLARE_OPERATORS_FOR_FLAGS(KShell::Options)
199 
200 #endif /* KSHELL_H */
KCOREADDONS_EXPORT QString tildeCollapse(const QString &path)
Performs tilde collapse on path.
Definition: kshell.cpp:59
The AbortOnMeta flag was set and an unhandled shell meta character was encountered.
Definition: kshell.h:93
Errors
Status codes from splitArgs()
Definition: kshell.h:78
KCOREADDONS_EXPORT QStringList splitArgs(const QString &cmd, Options flags=NoOptions, Errors *err=nullptr)
Splits cmd according to system shell word splitting and quoting rules.
Definition: kshell_unix.cpp:58
KCOREADDONS_EXPORT QString quoteArg(const QString &arg)
Quotes arg according to system shell rules.
Indicates a parsing error, like an unterminated quoted string.
Definition: kshell.h:87
Success.
Definition: kshell.h:82
KCOREADDONS_EXPORT QString tildeExpand(const QString &path)
Performs tilde expansion on path.
Definition: kshell.cpp:41
KCOREADDONS_EXPORT QString joinArgs(const QStringList &args)
Quotes and joins args together according to system shell rules.
Definition: kshell.cpp:23
Emulates some basic system shell functionality.
Definition: kshell.h:15
Option
Flags for splitArgs().
Definition: kshell.h:29
Put the parser into full shell mode and bail out if a too complex construct is encountered.
Definition: kshell.h:68
Perform tilde expansion.
Definition: kshell.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed May 27 2020 23:06:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.