Creating processes and executing programs.
More...
#include <libppbase/base/Process.h>
List of all members.
Detailed Description
Creating processes and executing programs.
- Author:
- Christoph Schwarz
- Version:
- $Id: Process.h 21 2010-09-05 04:18:17Z cschwarz1 $
Member Enumeration Documentation
execution flags
- Enumerator:
execCaptureStdIo |
flag: capture standard input and output
|
execMergeStdErrAndStdOut |
flag: merge stderr and stdout
|
execInheritHandles |
flag: inherit handles (Windows only)
|
Member Function Documentation
void base::Process::execute |
( |
int |
flags = 0 |
) |
|
Executes the program.
- Parameters:
-
| flags | execute flags: Process::exec* |
bool base::Process::exitedBySignal |
( |
|
) |
const |
Checks if the program exited because of a signal.
- Returns:
- true if the program exited because of a signal, false if not
static int base::Process::getCurrentProcessId |
( |
|
) |
[static] |
Gets the own process id.
- Returns:
- own process id
int base::Process::getExitCode |
( |
|
) |
const |
Gets the program exit code.
- Returns:
- the program exit code
int base::Process::getExitSignal |
( |
|
) |
const |
Gets the signal number that caused the program to exit.
- Returns:
- the signal number
File* base::Process::getStdErr |
( |
|
) |
|
Gets the standard error of the currently executing program.
- Returns:
- the standard error stream
File* base::Process::getStdIn |
( |
|
) |
|
Gets the standard input of the currently executing program.
- Returns:
- the standard input stream
File* base::Process::getStdOut |
( |
|
) |
|
Gets the standard output of the currently executing program.
- Returns:
- the standard output stream
void base::Process::setArguments |
( |
const std::vector< String > & |
arguments |
) |
|
Sets the command line arguments.
- Parameters:
-
| arguments | the command line arguments |
void base::Process::setArguments |
( |
const String & |
arguments |
) |
|
Sets the command line arguments.
- Parameters:
-
| arguments | the command line arguments |
void base::Process::setProgram |
( |
const String & |
program |
) |
|
Sets the program to execute.
- Parameters:
-
void base::Process::terminate |
( |
int |
exitcode |
) |
|
Terminates the running program by sending a terminate request.
Termination of a process is platform-dependent. On Windows, a terminate request is sent through the TerminateProcess system call. On UNIX the process is sent a KILL signal. Regardless of the plaform, the caller must call wait() after calling terminate() to wait for the process to terminate and to free all associated resources.
- Parameters:
-
| exitcode | the program exit code to set (required for Windows only, Linux ignores this parameter) |
bool base::Process::wait |
( |
unsigned |
timeout = 0 |
) |
|
Waits for the program to exit.
- Parameters:
-
| timeout | timeout in seconds, 0 means to wait infinite |
- Returns:
- true if the program exited, false if a timeout occurred
The documentation for this class was generated from the following file: