storage::SystemCmd Class Reference

#include <SystemCmd.h>

List of all members.

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
OutputProcessoroutput_proc
pollfd pfds [2]

Static Protected Attributes

static int Nr_i = 0


Member Enumeration Documentation

enum storage::SystemCmd::OutputStream
 

Enumerator:
IDX_STDOUT 
IDX_STDERR 


Constructor & Destructor Documentation

SystemCmd::SystemCmd const char *  Command_Cv  ) 
 

SystemCmd::SystemCmd const string &  Command_Cv  ) 
 

SystemCmd::SystemCmd  ) 
 

SystemCmd::~SystemCmd  )  [virtual]
 


Member Function Documentation

void storage::SystemCmd::addLine string  Text_Cv,
std::vector< string > &  Lines_Cr
[protected]
 

void SystemCmd::checkOutput  )  [protected]
 

void SystemCmd::closeOpenFds  )  [protected]
 

const string& storage::SystemCmd::cmd  )  const [inline]
 

int SystemCmd::doExecute string  Cmd_Cv  )  [protected]
 

bool SystemCmd::doWait bool  Hang_bv,
int &  Ret_ir
[protected]
 

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 storage::SystemCmd::extractNewline const char *  Buf_ti,
int  Cnt_ii,
bool &  NewLineSeen_br,
string &  Text_Cr,
std::vector< string > &  Lines_Cr
[protected]
 

const string * SystemCmd::getLine unsigned  Num_iv,
bool  Selected_bv = false,
unsigned  Idx_ii = IDX_STDOUT
const
 

int storage::SystemCmd::getStderr std::list< 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::getStdout std::vector< string > &  Ret_Cr,
const bool  Append_bv = false
const [inline]
 

const string * SystemCmd::getString unsigned  Idx_ii = IDX_STDOUT  )  const
 

void storage::SystemCmd::getUntilEOF FILE *  File_Cr,
std::vector< string > &  Lines_Cr,
bool &  NewLineSeen_br,
bool  Stderr_bv
[protected]
 

void SystemCmd::init  )  [protected]
 

void SystemCmd::invalidate  )  [protected]
 

void SystemCmd::logOutput  ) 
 

unsigned SystemCmd::numLines bool  Selected_bv = false,
unsigned  Idx_ii = IDX_STDOUT
const
 

int storage::SystemCmd::placeOutput unsigned  Which_iv,
std::list< string > &  Ret_Cr,
const bool  Append_bv
const [protected]
 

int storage::SystemCmd::placeOutput unsigned  Which_iv,
std::vector< string > &  Ret_Cr,
const bool  Append_bv
const [protected]
 

int storage::SystemCmd::retcode  )  const [inline]
 

int SystemCmd::select string  Reg_Cv,
bool  Invert_bv = false,
unsigned  Idx_ii = IDX_STDOUT
 

void SystemCmd::setCombine const bool  Combine_b = true  ) 
 

void SystemCmd::setOutputHandler void(*)(void *, string, bool)  Handle_f,
void *  Par_p
 

void storage::SystemCmd::setOutputProcessor OutputProcessor proc  )  [inline]
 

const string& storage::SystemCmd::stderr  )  const [inline]
 

const string& storage::SystemCmd::stdout  )  const [inline]
 


Member Data Documentation

bool storage::SystemCmd::Background_b [protected]
 

bool storage::SystemCmd::Combine_b [protected]
 

FILE* storage::SystemCmd::File_aC[2] [protected]
 

void* storage::SystemCmd::HandlerPar_p [protected]
 

string storage::SystemCmd::lastCmd [protected]
 

std::vector<string> storage::SystemCmd::Lines_aC[2] [protected]
 

bool storage::SystemCmd::NewLineSeen_ab[2] [protected]
 

int SystemCmd::Nr_i = 0 [static, protected]
 

OutputProcessor* storage::SystemCmd::output_proc [protected]
 

void(* storage::SystemCmd::OutputHandler_f)(void *, string, bool) [protected]
 

struct pollfd storage::SystemCmd::pfds[2] [protected]
 

int storage::SystemCmd::Pid_i [protected]
 

int storage::SystemCmd::Ret_i [protected]
 

std::vector<string*> storage::SystemCmd::SelLines_aC[2] [protected]
 

string storage::SystemCmd::Text_aC[2] [mutable, protected]
 

bool storage::SystemCmd::Valid_ab[2] [mutable, protected]
 


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:40:25 2006 for yast2-storage by  doxygen 1.4.6