|
Public Types |
enum | OutputStream { IDX_STDOUT,
IDX_STDERR
} |
Public Member Functions |
| SystemCmd (const char *Command_Cv) |
| SystemCmd (const string &Command_Cv) |
| SystemCmd () |
virtual | ~SystemCmd () |
int | execute (const string &Command_Cv) |
int | executeBackground (const string &Command_Cv) |
int | executeRestricted (const string &Command_Cv, unsigned long MaxTimeSec, unsigned long MaxLineOut, bool &ExceedTime, bool &ExceedLines) |
void | setOutputHandler (void(*Handle_f)(void *, string, bool), void *Par_p) |
void | logOutput () |
void | setOutputProcessor (OutputProcessor *proc) |
int | select (string Reg_Cv, bool Invert_bv=false, unsigned Idx_ii=IDX_STDOUT) |
const string & | stderr () const |
const string & | stdout () const |
const string & | cmd () const |
const string * | getString (unsigned Idx_ii=IDX_STDOUT) const |
const string * | getLine (unsigned Num_iv, bool Selected_bv=false, unsigned Idx_ii=IDX_STDOUT) const |
unsigned | numLines (bool Selected_bv=false, unsigned Idx_ii=IDX_STDOUT) const |
void | setCombine (const bool Combine_b=true) |
int | retcode () const |
int | getStdout (std::vector< string > &Ret_Cr, const bool Append_bv=false) const |
int | getStderr (std::vector< string > &Ret_Cr, const bool Append_bv=false) const |
int | getStdout (std::list< string > &Ret_Cr, const bool Append_bv=false) const |
int | getStderr (std::list< string > &Ret_Cr, const bool Append_bv=false) const |
Protected Member Functions |
int | placeOutput (unsigned Which_iv, std::vector< string > &Ret_Cr, const bool Append_bv) const |
int | placeOutput (unsigned Which_iv, std::list< string > &Ret_Cr, const bool Append_bv) const |
void | invalidate () |
void | closeOpenFds () |
int | doExecute (string Cmd_Cv) |
bool | doWait (bool Hang_bv, int &Ret_ir) |
void | checkOutput () |
void | getUntilEOF (FILE *File_Cr, std::vector< string > &Lines_Cr, bool &NewLineSeen_br, bool Stderr_bv) |
void | extractNewline (const char *Buf_ti, int Cnt_ii, bool &NewLineSeen_br, string &Text_Cr, std::vector< string > &Lines_Cr) |
void | addLine (string Text_Cv, std::vector< string > &Lines_Cr) |
void | init () |
Protected Attributes |
string | Text_aC [2] |
bool | Valid_ab [2] |
FILE * | File_aC [2] |
std::vector< string > | Lines_aC [2] |
std::vector< string * > | SelLines_aC [2] |
bool | NewLineSeen_ab [2] |
bool | Combine_b |
bool | Background_b |
string | lastCmd |
int | Ret_i |
int | Pid_i |
void(* | OutputHandler_f )(void *, string, bool) |
void * | HandlerPar_p |
OutputProcessor * | output_proc |
pollfd | pfds [2] |
Static Protected Attributes |
static int | Nr_i = 0 |