cmlabs::OSCommand Class Reference

#include <OSCommand.h>

Inheritance diagram for cmlabs::OSCommand:

Inheritance graph
[legend]
Collaboration diagram for cmlabs::OSCommand:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 OSCommand ()
 OSCommand (const JString &cmdline, const JString &startupdir="")
 ~OSCommand ()
Objectclone () const
bool unitTest ()
bool setBinary ()
bool setASCII ()
JString getCommand ()
bool start ()
bool terminate ()
bool restart ()
bool hasBeenStarted ()
bool isRunning ()
bool hasTerminated ()
bool waitForProcessToFinish (int timeout)
int getProcID ()
 Get the OS process ID.
bool writeToStandardInput (const JString &text)
bool writeToStandardInput (char *bytes, int len)
bool hasOutput ()
int getOutputCharCount ()
bool hasErrors ()
int getErrorCharCount ()
int getReturnCode ()
JString getStartupDir ()
JString getCurrentOutput ()
JString getCurrentError ()
JString getNewOutput ()
JString getNewError ()
JString readOutputLine (int timeout)
Collection readCurrentLines ()
char * readOutputBytes (int length, int *readcount, int timeout=0)
JString waitForProcessToFinishAndGetOutput (int timeout)
JString waitForProcessToFinishAndGetError (int timeout)
JTime getStartedTime ()
JTime getEndedTime ()

Public Attributes

JString alias
bool consoleOutput
bool autoRestart
JString status
JString startupDir

Private Member Functions

bool init ()
int readIntoBuffers ()
bool resizeOutputBuffer (int max)
bool resizeErrorBuffer (int max)
bool cleanUp ()

Private Attributes

JString command
int procID
int returncode
bool binary
char * outbuffer
int outbuffercount
int outbuffermax
char * errbuffer
int errbuffercount
int errbuffermax
JString outputHistory
JString errorHistory
JTime startedTime
JTime endedTime
FILE * proc_stdin
FILE * proc_stdout
FILE * proc_stderr
int stdin_pipe [2]
int stdout_pipe [2]
int stderr_pipe [2]


Detailed Description

Definition at line 55 of file OSCommand.h.


Constructor & Destructor Documentation

cmlabs::OSCommand::OSCommand (  ) 

Definition at line 33 of file OSCommand.cpp.

cmlabs::OSCommand::OSCommand ( const JString cmdline,
const JString startupdir = "" 
)

Definition at line 37 of file OSCommand.cpp.

cmlabs::OSCommand::~OSCommand (  ) 

Definition at line 43 of file OSCommand.cpp.


Member Function Documentation

Object* cmlabs::OSCommand::clone (  )  const [virtual]

Implements cmlabs::Object.

Definition at line 62 of file OSCommand.h.

bool cmlabs::OSCommand::unitTest (  )  [virtual]

Reimplemented from cmlabs::Object.

Definition at line 976 of file OSCommand.cpp.

bool cmlabs::OSCommand::setBinary (  ) 

Definition at line 121 of file OSCommand.cpp.

bool cmlabs::OSCommand::setASCII (  ) 

Definition at line 126 of file OSCommand.cpp.

JString cmlabs::OSCommand::getCommand (  ) 

Definition at line 131 of file OSCommand.cpp.

bool cmlabs::OSCommand::start (  ) 

Definition at line 693 of file OSCommand.cpp.

bool cmlabs::OSCommand::terminate (  ) 

Definition at line 821 of file OSCommand.cpp.

bool cmlabs::OSCommand::restart (  ) 

Definition at line 85 of file OSCommand.cpp.

bool cmlabs::OSCommand::hasBeenStarted (  ) 

Definition at line 867 of file OSCommand.cpp.

bool cmlabs::OSCommand::isRunning (  ) 

Definition at line 871 of file OSCommand.cpp.

bool cmlabs::OSCommand::hasTerminated (  ) 

Definition at line 141 of file OSCommand.cpp.

bool cmlabs::OSCommand::waitForProcessToFinish ( int  timeout  ) 

Definition at line 853 of file OSCommand.cpp.

int cmlabs::OSCommand::getProcID (  ) 

Get the OS process ID.

Reimplemented from cmlabs::Object.

Definition at line 160 of file OSCommand.cpp.

bool cmlabs::OSCommand::writeToStandardInput ( const JString text  ) 

Definition at line 182 of file OSCommand.cpp.

bool cmlabs::OSCommand::writeToStandardInput ( char *  bytes,
int  len 
)

Definition at line 906 of file OSCommand.cpp.

bool cmlabs::OSCommand::hasOutput (  ) 

Definition at line 164 of file OSCommand.cpp.

int cmlabs::OSCommand::getOutputCharCount (  ) 

Definition at line 172 of file OSCommand.cpp.

bool cmlabs::OSCommand::hasErrors (  ) 

Definition at line 168 of file OSCommand.cpp.

int cmlabs::OSCommand::getErrorCharCount (  ) 

Definition at line 177 of file OSCommand.cpp.

int cmlabs::OSCommand::getReturnCode (  ) 

Definition at line 135 of file OSCommand.cpp.

JString cmlabs::OSCommand::getStartupDir (  ) 

Definition at line 156 of file OSCommand.cpp.

JString cmlabs::OSCommand::getCurrentOutput (  ) 

Definition at line 186 of file OSCommand.cpp.

JString cmlabs::OSCommand::getCurrentError (  ) 

Definition at line 191 of file OSCommand.cpp.

JString cmlabs::OSCommand::getNewOutput (  ) 

Definition at line 196 of file OSCommand.cpp.

JString cmlabs::OSCommand::getNewError (  ) 

Definition at line 208 of file OSCommand.cpp.

JString cmlabs::OSCommand::readOutputLine ( int  timeout  ) 

Definition at line 220 of file OSCommand.cpp.

Collection cmlabs::OSCommand::readCurrentLines (  ) 

Definition at line 250 of file OSCommand.cpp.

char * cmlabs::OSCommand::readOutputBytes ( int  length,
int *  readcount,
int  timeout = 0 
)

Definition at line 282 of file OSCommand.cpp.

JString cmlabs::OSCommand::waitForProcessToFinishAndGetOutput ( int  timeout  ) 

Definition at line 261 of file OSCommand.cpp.

JString cmlabs::OSCommand::waitForProcessToFinishAndGetError ( int  timeout  ) 

Definition at line 271 of file OSCommand.cpp.

JTime cmlabs::OSCommand::getStartedTime (  ) 

Definition at line 147 of file OSCommand.cpp.

JTime cmlabs::OSCommand::getEndedTime (  ) 

Definition at line 151 of file OSCommand.cpp.

bool cmlabs::OSCommand::init (  )  [private]

Definition at line 49 of file OSCommand.cpp.

int cmlabs::OSCommand::readIntoBuffers (  )  [private]

Definition at line 919 of file OSCommand.cpp.

bool cmlabs::OSCommand::resizeOutputBuffer ( int  max  )  [private]

Definition at line 321 of file OSCommand.cpp.

bool cmlabs::OSCommand::resizeErrorBuffer ( int  max  )  [private]

Definition at line 338 of file OSCommand.cpp.

bool cmlabs::OSCommand::cleanUp (  )  [private]

Definition at line 835 of file OSCommand.cpp.


Member Data Documentation

Definition at line 108 of file OSCommand.h.

Definition at line 109 of file OSCommand.h.

Definition at line 110 of file OSCommand.h.

Definition at line 111 of file OSCommand.h.

Definition at line 112 of file OSCommand.h.

Definition at line 115 of file OSCommand.h.

Definition at line 116 of file OSCommand.h.

Definition at line 117 of file OSCommand.h.

bool cmlabs::OSCommand::binary [private]

Definition at line 118 of file OSCommand.h.

Definition at line 126 of file OSCommand.h.

Definition at line 127 of file OSCommand.h.

Definition at line 128 of file OSCommand.h.

Definition at line 129 of file OSCommand.h.

Definition at line 130 of file OSCommand.h.

Definition at line 131 of file OSCommand.h.

Definition at line 133 of file OSCommand.h.

Definition at line 134 of file OSCommand.h.

Definition at line 135 of file OSCommand.h.

Definition at line 136 of file OSCommand.h.

Definition at line 145 of file OSCommand.h.

Definition at line 146 of file OSCommand.h.

Definition at line 147 of file OSCommand.h.

Definition at line 149 of file OSCommand.h.

Definition at line 150 of file OSCommand.h.

Definition at line 151 of file OSCommand.h.


The documentation for this class was generated from the following files:

Generated on Tue Jul 7 16:23:42 2009 for CoreLibrary by  doxygen 1.5.6