Konsole
#include <ShellCommand.h>
Public Member Functions | |
ShellCommand (const QString &aCommand) | |
ShellCommand (const QString &aCommand, const QStringList &aArguments) | |
QStringList | arguments () const |
QString | command () const |
QString | fullCommand () const |
Static Public Member Functions | |
static QString | expand (const QString &text) |
static QStringList | expand (const QStringList &items) |
static bool | isValidEnvCharacter (const QChar &ch) |
static bool | isValidLeadingEnvCharacter (const QChar &ch) |
Detailed Description
A class to parse and extract information about shell commands.
ShellCommand can be used to:
- Take a command-line (eg "/bin/sh -c /path/to/my/script") and split it into its component parts (eg. the command "/bin/sh" and the arguments "-c","/path/to/my/script")
- Take a command and a list of arguments and combine them to form a complete command line.
- Determine whether the binary specified by a command exists in the user's PATH.
- Determine whether a command-line specifies the execution of another command as the root user using su/sudo etc.
Definition at line 52 of file ShellCommand.h.
Constructor & Destructor Documentation
|
explicit |
Constructs a ShellCommand from a command line.
- Parameters
-
aCommand The command line to parse.
Definition at line 28 of file ShellCommand.cpp.
ShellCommand::ShellCommand | ( | const QString & | aCommand, |
const QStringList & | aArguments | ||
) |
Constructs a ShellCommand with the specified aCommand
and aArguments
.
Definition at line 32 of file ShellCommand.cpp.
Member Function Documentation
QStringList ShellCommand::arguments | ( | ) | const |
Returns the arguments.
Definition at line 60 of file ShellCommand.cpp.
QString ShellCommand::command | ( | ) | const |
Returns the command.
Definition at line 53 of file ShellCommand.cpp.
|
static |
Expands environment variables in text
.
Definition at line 74 of file ShellCommand.cpp.
|
static |
Expands environment variables in each string in list
.
Definition at line 64 of file ShellCommand.cpp.
QString ShellCommand::fullCommand | ( | ) | const |
Returns the full command line.
Definition at line 39 of file ShellCommand.cpp.
|
static |
Definition at line 81 of file ShellCommand.cpp.
|
static |
Definition at line 87 of file ShellCommand.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.