• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KShellProcess Class Reference

#include <kprocess.h>

Inheritance diagram for KShellProcess:
KProcess

Public Member Functions

 KShellProcess (const char *shellname=0)
 ~KShellProcess ()
virtual bool start (RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
- Public Member Functions inherited from KProcess
 KProcess (TQObject *parent, const char *name=0)
 KProcess ()
virtual ~KProcess ()
bool setExecutable (const TQString &proc) KDE_DEPRECATED
KProcess & operator<< (const TQString &arg)
KProcess & operator<< (const char *arg)
KProcess & operator<< (const TQCString &arg)
KProcess & operator<< (const TQStringList &args)
void clearArguments ()
virtual bool kill (int signo=SIGTERM)
bool isRunning () const
pid_t pid () const
KDE_DEPRECATED pid_t getPid () const
void suspend ()
void resume ()
bool wait (int timeout=-1)
bool normalExit () const
bool signalled () const
bool coreDumped () const
int exitStatus () const
int exitSignal () const
bool writeStdin (const char *buffer, int buflen)
bool closeStdin ()
bool closeStdout ()
bool closeStderr ()
bool closePty ()
void closeAll ()
const TQValueList< TQCString > & args ()
void setRunPrivileged (bool keepPrivileges)
bool runPrivileged () const
void setEnvironment (const TQString &name, const TQString &value)
void setWorkingDirectory (const TQString &dir)
void setUseShell (bool useShell, const char *shell=0)
void detach ()
void setUsePty (Communication comm, bool addUtmp)
KPty * pty () const
bool setPriority (int prio)

Static Public Member Functions

static TQString quote (const TQString &arg)

Protected Member Functions

virtual void virtual_hook (int id, void *data)
- Protected Member Functions inherited from KProcess
void setupEnvironment ()
virtual int setupCommunication (Communication comm)
virtual int commSetupDoneP ()
virtual int commSetupDoneC ()
virtual void processHasExited (int state)
virtual void commClose ()
void setBinaryExecutable (const char *filename)
int childOutput (int fdno)
int childError (int fdno)

Additional Inherited Members

- Public Types inherited from KProcess
enum  Communication {
  NoCommunication = 0, Stdin = 1, Stdout = 2, Stderr = 4,
  AllOutput = 6, All = 7, NoRead = 8, CTtyOnly = NoRead,
  MergedStderr = 16
}
enum  RunMode { DontCare, NotifyOnExit, Block, OwnGroup }
enum  {
  PrioLowest = 20, PrioLow = 10, PrioLower = 5, PrioNormal = 0,
  PrioHigher = -5, PrioHigh = -10, PrioHighest = -19
}
- Signals inherited from KProcess
void processExited (KProcess *proc)
void receivedStdout (KProcess *proc, char *buffer, int buflen)
void receivedStdout (int fd, int &len)
void receivedStderr (KProcess *proc, char *buffer, int buflen)
void wroteStdin (KProcess *proc)
- Protected Slots inherited from KProcess
void slotChildOutput (int fdno)
void slotChildError (int fdno)
void slotSendData (int dummy)
- Protected Attributes inherited from KProcess
TQValueList< TQCString > arguments
RunMode run_mode
bool runs
pid_t pid_
int status
bool keepPrivs
int out [2]
int in [2]
int err [2]
TQSocketNotifier * innot
TQSocketNotifier * outnot
TQSocketNotifier * errnot
Communication communication
const char * input_data
int input_sent
int input_total

Detailed Description

A class derived from KProcess to start child processes through a shell.

Deprecated:

Use KProcess and KProcess::setUseShell(true) instead.

Author
Christian Czezatke e9025.nosp@m.461@.nosp@m.stude.nosp@m.nt.t.nosp@m.uwien.nosp@m..ac..nosp@m.at

Definition at line 904 of file kprocess.h.

Constructor & Destructor Documentation

KShellProcess::KShellProcess ( const char *  shellname = 0)

Constructor.

If no shellname is specified, the user's default shell is used.

Definition at line 1115 of file kprocess.cpp.

KShellProcess::~KShellProcess ( )

Destructor.

Definition at line 1121 of file kprocess.cpp.

Member Function Documentation

TQString KShellProcess::quote ( const TQString &  arg)
static

This function can be used to quote an argument string such that the shell processes it properly.

This is e. g. necessary for user-provided file names which may contain spaces or quotes. It also prevents expansion of wild cards and environment variables.

Parameters
argthe argument to quote
Returns
the quoted argument
Since
3.1

Reimplemented from KProcess.

Definition at line 1124 of file kprocess.cpp.

bool KShellProcess::start ( RunMode  runmode = NotifyOnExit,
Communication  comm = NoCommunication 
)
virtual

Starts the process.

For a detailed description of the various run modes and communication semantics, have a look at the general description of the KProcess class. Note that if you use setUsePty( Stdout | Stderr, <bool> ), you cannot use Stdout | Stderr here - instead, use Stdout only to receive the mixed output.

The following problems could cause this function to return false:

  • The process is already running.
  • The command line argument list is empty.
  • The the comm parameter is incompatible with the selected pty usage.
  • The starting of the process failed (could not fork).
  • The executable was not found.
Parameters
runmodeThe Run-mode for the process.
commSpecifies which communication links should be established to the child process (stdin/stdout/stderr). By default, no communication takes place and the respective communication signals will never get emitted.
Returns
true on success, false on error (see above for error conditions)

Reimplemented from KProcess.

Definition at line 1129 of file kprocess.cpp.


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

kdecore

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

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |