#include <Pt/System/Process.h>
Starts another program as a child process.
More...
Inherits NonCopyable.
|
|
| Process (const ProcessInfo &procInfo) |
| | Constructs with a process parameters.
|
|
| ~Process () |
| | Destructor.
|
|
const ProcessInfo & | procInfo () const |
| | Returns the process parameters.
|
|
State | state () const |
| | Returns the current state.
|
| void | start () |
| | Start/Create the Process.
|
| void | kill () |
| | Kills the Process.
|
| int | wait () |
| | Waits until the Process ends.
|
| bool | tryWait (int &status) |
| | Returns true if the process has finished.
|
|
IODevice * | stdInput () |
| | Returns an I/O device to stdin.
|
|
IODevice * | stdOutput () |
| | Returns an I/O device to stdout.
|
|
IODevice * | stdError () |
| | Returns an I/O device to stderr.
|
Construct with a ProcessInfo that names the command, arguments, and how stdin, stdout, and stderr are handled. start() runs the program. wait() joins it and returns the exit status. tryWait() reports whether it has finished. kill() terminates it. stdInput(), stdOutput(), and stdError() return the redirected IODevice endpoints when redirection was requested.
- Exceptions
-
◆ State
| Enumerator |
|---|
| Ready | Ready to run.
|
| Running | Currently running.
|
| Finished | Finished to run.
|
| Failed | Execution has failed.
|
◆ start()
◆ kill()
◆ wait()
◆ tryWait()
| bool tryWait |
( |
int & | status | ) |
|
Sets status to the exit status when the process has finished.