#include <tjprocess.h>
Public Member Functions | |
| Process () | |
| bool | start (const STD_string &cmdline, bool block_till_finished=false, bool log_std_streams=true) |
| bool | finished (int &proc_return_value, STD_string &stdout_result, STD_string &stderr_result, bool block_till_finished=false) |
| bool | finished (int &proc_return_value, bool block_till_finished=false) |
| bool | kill (const svector &extra_kill=svector()) |
| bool | operator== (const Process &op) const |
| bool | operator< (const Process &op) const |
| bool | operator!= (const Process &op) const |
Static Public Member Functions | |
| static int | system (const STD_string &cmdline, STD_string &stdout_result, STD_string &stderr_result) |
Definition at line 43 of file tjprocess.h.
| Process::Process | ( | ) | [inline] |
Create non-running process.
Definition at line 50 of file tjprocess.h.
| bool Process::start | ( | const STD_string & | cmdline, | |
| bool | block_till_finished = false, |
|||
| bool | log_std_streams = true | |||
| ) |
Start new process with by executing 'cmdline'. If 'block_till_finished' is true, return only after process has terminated. If 'log_std_streams' is true, the output of stdout/stderr is catched and can be queried later by finished(). Returns 'true' if no error occured.
| bool Process::finished | ( | int & | proc_return_value, | |
| STD_string & | stdout_result, | |||
| STD_string & | stderr_result, | |||
| bool | block_till_finished = false | |||
| ) |
Return whether process has terminated, returns return value and stdout/stderr output in 'proc_return_value' and 'stdout_result/stderr_result', respectively. If 'block_till_finished' is true return only after process has terminated.
| bool Process::finished | ( | int & | proc_return_value, | |
| bool | block_till_finished = false | |||
| ) |
Return whether process has terminated, returns return value in 'proc_return_value'. Writes stdout/stderr of child process to the log. If 'block_till_finished' is true return only after process has terminated.
Kill process. Additionlly, kill child processes whose program name is in 'extra_kill'.
| static int Process::system | ( | const STD_string & | cmdline, | |
| STD_string & | stdout_result, | |||
| STD_string & | stderr_result | |||
| ) | [static] |
Start process by executing 'cmdline'. Return after process has terminated with stdout/stderr output in 'stdout_result/stderr_result'. Returns return code of the process.
1.5.1