21 #include <tjutils/tjstring.h>
22 #include <tjutils/tjarray.h>
32 class ProcessComponent {
34 static const char* get_compName();
59 bool start(
const STD_string& cmdline,
bool block_till_finished=
false,
bool log_std_streams=
true);
66 bool finished(
int& proc_return_value, STD_string& stdout_result, STD_string& stderr_result,
bool block_till_finished=
false);
73 bool finished(
int& proc_return_value,
bool block_till_finished=
false);
84 static int system(
const STD_string& cmdline, STD_string& stdout_result, STD_string& stderr_result);
88 bool operator == (
const Process& op)
const {
return pid==op.pid;}
89 bool operator < (
const Process& op)
const {
return pid!=op.pid;}
90 bool operator != (
const Process& op)
const {
return !(*
this==op);}
94 static bool read_pipe(
int fd, STD_string& result);
95 void reset() {pid=0; stdout_child=-1; stderr_child=-1;}
bool kill(const svector &extra_kill=svector())
static int system(const STD_string &cmdline, STD_string &stdout_result, STD_string &stderr_result)
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)