#include <stapplication.h>
Inheritance diagram for StApplication:
Public Member Functions | |
StApplication () | |
StApplication (const StFile &file, const StDir &dir=StDir(ST_DEFAULT_TEMP)) | |
StApplication (const StFile &file, const StStringList &args, const StDir &dir=StDir(ST_DEFAULT_TEMP)) | |
bool | setExecutable (const StFile &file) |
void | setWorkDirectory (const StDir &dir) |
void | setTempDirectory (const StDir &dir) |
void | setArguments (const StStringList &args) |
void | setArguments (const StString &arg) |
bool | execute (bool wait=true, bool outputToFile=true) |
StStringList | getNormalOutput () |
StStringList | getErrorOutput () |
int | getReturnCode () |
Protected Member Functions | |
virtual void | run () |
Protected Attributes | |
StDir | tempDir |
StDir | workDir |
Private Member Functions | |
void | init () |
void | clear () |
StFile | genFileName () const |
Private Attributes | |
StFile | executable |
StStringList | args |
volatile int | returnCode |
volatile bool | outputToFile |
StStringList | normalOutput |
StStringList | errorOutput |
Let's think of StApplication like single line in bash shell. This can be for example "ls" and for this task we use setExecutable(). We can attach to it some arguments like "ls -alh" by setArguments(). When we execute() application like that, it will generate output and error output accessable by getNormalOutput() and getErrorOutput() and it will also return exit code in getReturnCode();
StApplication::StApplication | ( | ) | [inline] |
StApplication::StApplication | ( | const StFile & | file, | |
const StDir & | dir = StDir(ST_DEFAULT_TEMP) | |||
) | [inline] |
StApplication::StApplication | ( | const StFile & | file, | |
const StStringList & | args, | |||
const StDir & | dir = StDir(ST_DEFAULT_TEMP) | |||
) | [inline] |
void StApplication::clear | ( | ) | [inline, private] |
Reimplemented in StScript.
bool StApplication::execute | ( | bool | wait = true , |
|
bool | outputToFile = true | |||
) |
Executes application
wait | wait for application to close |
Reimplemented in StScript, and StScriptFile.
StFile StApplication::genFileName | ( | ) | const [private] |
StStringList StApplication::getErrorOutput | ( | ) | [inline] |
StStringList StApplication::getNormalOutput | ( | ) | [inline] |
int StApplication::getReturnCode | ( | ) | [inline] |
void StApplication::init | ( | ) | [inline, private] |
Reimplemented from StThread.
void StApplication::run | ( | ) | [protected, virtual] |
void StApplication::setArguments | ( | const StString & | arg | ) | [inline] |
Overloaded version of function above.
Reimplemented in StScript, and StScriptFile.
void StApplication::setArguments | ( | const StStringList & | args | ) | [inline] |
With what arguments execute binary.
Reimplemented in StScript, and StScriptFile.
bool StApplication::setExecutable | ( | const StFile & | file | ) |
Set where is binary to execute.
Reimplemented in StScript, and StScriptFile.
void StApplication::setTempDirectory | ( | const StDir & | dir | ) |
Where output files will be stored while executing.
void StApplication::setWorkDirectory | ( | const StDir & | dir | ) | [inline] |
Where program will be execute.
StStringList StApplication::args [private] |
Reimplemented in StScript, and StScriptFile.
StStringList StApplication::errorOutput [private] |
StFile StApplication::executable [private] |
StStringList StApplication::normalOutput [private] |
volatile bool StApplication::outputToFile [private] |
volatile int StApplication::returnCode [private] |
StDir StApplication::tempDir [protected] |
StDir StApplication::workDir [protected] |