C++ common classes
General purpose classes for use across projects (Apache license)
|
#include <executeshell.h>
Public Member Functions | |
ExecuteShell () | |
virtual | ~ExecuteShell () |
Static Public Member Functions | |
static int | Execute (const char *szCommand, string &sStdout, string *sStderr=NULL, const char *strForkExit=NULL) |
static const char * | FindBinary (const char *pName) |
Find a command on the machine. | |
static void | WriteStdout (bool bNewline=true) |
Write to standard out. | |
Static Public Attributes | |
static char | szStdOut [ESHELL_FORMAT_SIZE] |
Definition at line 26 of file executeshell.h.
Definition at line 27 of file executeshell.cpp.
ExecuteShell::~ExecuteShell | ( | ) | [virtual] |
Definition at line 32 of file executeshell.cpp.
int ExecuteShell::Execute | ( | const char * | szCommand, |
string & | sStdout, | ||
string * | sStderr = NULL , |
||
const char * | strForkExit = NULL |
||
) | [static] |
Execute command,return stdout in a string buffer strForkExit is set if the command will fork. When Execute sees the string it will return. Otherwise, stdout doesn't close until all forked processes close.
Definition at line 39 of file executeshell.cpp.
const char * ExecuteShell::FindBinary | ( | const char * | pName | ) | [static] |
Find a command on the machine.
Definition at line 133 of file executeshell.cpp.
void ExecuteShell::WriteStdout | ( | bool | bNewline = true | ) | [static] |
Write to standard out.
Definition at line 170 of file executeshell.cpp.
char ExecuteShell::szStdOut [static] |
Definition at line 43 of file executeshell.h.