• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • Konsole
  • ShellCommand
Public Member Functions | Static Public Member Functions | List of all members
Konsole::ShellCommand Class Reference

#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

ShellCommand::ShellCommand ( const QString &  aCommand)
explicit

Constructs a ShellCommand from a command line.

Parameters
aCommandThe 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.

QString ShellCommand::expand ( const QString &  text)
static

Expands environment variables in text .

Definition at line 74 of file ShellCommand.cpp.

QStringList ShellCommand::expand ( const QStringList &  items)
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.

bool ShellCommand::isValidEnvCharacter ( const QChar &  ch)
static

Definition at line 81 of file ShellCommand.cpp.

bool ShellCommand::isValidLeadingEnvCharacter ( const QChar &  ch)
static

Definition at line 87 of file ShellCommand.cpp.


The documentation for this class was generated from the following files:
  • ShellCommand.h
  • ShellCommand.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal