#include <SystemCmd.h>
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 |
| SystemCmd::SystemCmd | ( | const char * | Command_Cv | ) |
| SystemCmd::SystemCmd | ( | const string & | Command_Cv | ) |
| SystemCmd::SystemCmd | ( | ) |
| SystemCmd::~SystemCmd | ( | ) | [virtual] |
| int SystemCmd::execute | ( | const string & | Command_Cv | ) |
| int SystemCmd::executeBackground | ( | const string & | Command_Cv | ) |
| int storage::SystemCmd::executeRestricted | ( | const string & | Command_Cv, | |
| unsigned long | MaxTimeSec, | |||
| unsigned long | MaxLineOut, | |||
| bool & | ExceedTime, | |||
| bool & | ExceedLines | |||
| ) |
| void SystemCmd::setOutputHandler | ( | void(*)(void *, string, bool) | Handle_f, | |
| void * | Par_p | |||
| ) |
| void SystemCmd::logOutput | ( | ) |
| void storage::SystemCmd::setOutputProcessor | ( | OutputProcessor * | proc | ) | [inline] |
| int SystemCmd::select | ( | string | Reg_Cv, | |
| bool | Invert_bv = false, |
|||
| unsigned | Idx_ii = IDX_STDOUT | |||
| ) |
| const string& storage::SystemCmd::stderr | ( | ) | const [inline] |
| const string& storage::SystemCmd::stdout | ( | ) | const [inline] |
| const string& storage::SystemCmd::cmd | ( | ) | const [inline] |
| const string * SystemCmd::getString | ( | unsigned | Idx_ii = IDX_STDOUT |
) | const |
| const string * SystemCmd::getLine | ( | unsigned | Num_iv, | |
| bool | Selected_bv = false, |
|||
| unsigned | Idx_ii = IDX_STDOUT | |||
| ) | const |
| unsigned SystemCmd::numLines | ( | bool | Selected_bv = false, |
|
| unsigned | Idx_ii = IDX_STDOUT | |||
| ) | const |
| void SystemCmd::setCombine | ( | const bool | Combine_b = true |
) |
| int storage::SystemCmd::retcode | ( | ) | const [inline] |
| int storage::SystemCmd::getStdout | ( | std::vector< string > & | Ret_Cr, | |
| const bool | Append_bv = false | |||
| ) | const [inline] |
| int storage::SystemCmd::getStderr | ( | std::vector< string > & | Ret_Cr, | |
| const bool | Append_bv = false | |||
| ) | const [inline] |
| int storage::SystemCmd::getStdout | ( | std::list< string > & | Ret_Cr, | |
| const bool | Append_bv = false | |||
| ) | const [inline] |
| int storage::SystemCmd::getStderr | ( | std::list< string > & | Ret_Cr, | |
| const bool | Append_bv = false | |||
| ) | const [inline] |
| int storage::SystemCmd::placeOutput | ( | unsigned | Which_iv, | |
| std::vector< string > & | Ret_Cr, | |||
| const bool | Append_bv | |||
| ) | const [protected] |
| int storage::SystemCmd::placeOutput | ( | unsigned | Which_iv, | |
| std::list< string > & | Ret_Cr, | |||
| const bool | Append_bv | |||
| ) | const [protected] |
| void SystemCmd::invalidate | ( | ) | [protected] |
| void SystemCmd::closeOpenFds | ( | ) | [protected] |
| int SystemCmd::doExecute | ( | string | Cmd_Cv | ) | [protected] |
| bool SystemCmd::doWait | ( | bool | Hang_bv, | |
| int & | Ret_ir | |||
| ) | [protected] |
| void SystemCmd::checkOutput | ( | ) | [protected] |
| void storage::SystemCmd::getUntilEOF | ( | FILE * | File_Cr, | |
| std::vector< string > & | Lines_Cr, | |||
| bool & | NewLineSeen_br, | |||
| bool | Stderr_bv | |||
| ) | [protected] |
| void storage::SystemCmd::extractNewline | ( | const char * | Buf_ti, | |
| int | Cnt_ii, | |||
| bool & | NewLineSeen_br, | |||
| string & | Text_Cr, | |||
| std::vector< string > & | Lines_Cr | |||
| ) | [protected] |
| void storage::SystemCmd::addLine | ( | string | Text_Cv, | |
| std::vector< string > & | Lines_Cr | |||
| ) | [protected] |
| void SystemCmd::init | ( | ) | [protected] |
string storage::SystemCmd::Text_aC[2] [mutable, protected] |
bool storage::SystemCmd::Valid_ab[2] [mutable, protected] |
FILE* storage::SystemCmd::File_aC[2] [protected] |
std::vector<string> storage::SystemCmd::Lines_aC[2] [protected] |
std::vector<string*> storage::SystemCmd::SelLines_aC[2] [protected] |
bool storage::SystemCmd::NewLineSeen_ab[2] [protected] |
bool storage::SystemCmd::Combine_b [protected] |
bool storage::SystemCmd::Background_b [protected] |
string storage::SystemCmd::lastCmd [protected] |
int storage::SystemCmd::Ret_i [protected] |
int storage::SystemCmd::Pid_i [protected] |
void(* storage::SystemCmd::OutputHandler_f)(void *, string, bool) [protected] |
void* storage::SystemCmd::HandlerPar_p [protected] |
OutputProcessor* storage::SystemCmd::output_proc [protected] |
struct pollfd storage::SystemCmd::pfds[2] [protected] |
int SystemCmd::Nr_i [static, protected] |
1.5.0