• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

util

KDevelop::CommandExecutor

KDevelop::CommandExecutor Class Reference

Simplifying the exeuction of a Command through (QK)Process. More...

#include <commandexecutor.h>

Inheritance diagram for KDevelop::CommandExecutor:
Inheritance graph
[legend]

List of all members.

Signals

void completed ()
void failed ()
void receivedStandardError (const QStringList &)
void receivedStandardOutput (const QStringList &)

Public Member Functions

 CommandExecutor (const QString &command, QObject *parent=0)
void kill ()
void setArguments (const QStringList &args)
void setCommand (const QString &command)
void setEnvironment (const QMap< QString, QString > &env)
void setUseShell (bool shell)
void setWorkingDirectory (const QString &dir)
void start ()
bool useShell () const

Detailed Description

Simplifying the exeuction of a Command through (QK)Process.

This class emits only very basic signals when the process writes something to stdout or stderr and for signaling completed and failed status.

If you need more fine-grained control use (QK)Process directly and also check whether you can use KDevelop::ProcessLineMaker to use properly terminated lines of output.

Also this class provides only asynchronous operation, it doesn't allow to wait for the program to finish.

Author:
Andreas Pakulat <apaku@gmx.de> TODO: Should this be a KJob??

Definition at line 46 of file commandexecutor.h.


Constructor & Destructor Documentation

KDevelop::CommandExecutor::CommandExecutor ( const QString &  command,
QObject *  parent = 0 
) [explicit]

Create a command using the given executable, arguments and environment.

The process is not started immediately, instead start() has to be called.

Definition at line 62 of file commandexecutor.cpp.


Member Function Documentation

void KDevelop::CommandExecutor::kill (  ) 

kill the process, failed() will likely be emitted

Definition at line 135 of file commandexecutor.cpp.

void KDevelop::CommandExecutor::setArguments ( const QStringList &  args  ) 

set additional arguments to be used when executing the command

Definition at line 92 of file commandexecutor.cpp.

void KDevelop::CommandExecutor::setCommand ( const QString &  command  ) 

set the Command that should be started, now a commandexecutor can be reused

Definition at line 130 of file commandexecutor.cpp.

void KDevelop::CommandExecutor::setEnvironment ( const QMap< QString, QString > &  env  ) 

set additional environment variables to be used when executing the command

Definition at line 87 of file commandexecutor.cpp.

void KDevelop::CommandExecutor::setUseShell ( bool  shell  ) 

if shell is true, the command is executed from a shell

Definition at line 107 of file commandexecutor.cpp.

void KDevelop::CommandExecutor::setWorkingDirectory ( const QString &  dir  ) 

Sets the working directory of the command.

Definition at line 97 of file commandexecutor.cpp.

void KDevelop::CommandExecutor::start (  ) 

start the command, after this has been called signals may be emitted

Definition at line 112 of file commandexecutor.cpp.

bool KDevelop::CommandExecutor::useShell (  )  const

whether the commands are executed from a shell

Definition at line 102 of file commandexecutor.cpp.


The documentation for this class was generated from the following files:
  • commandexecutor.h
  • commandexecutor.cpp

util

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

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   codegen
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal