#include <stscriptfile.h>
Inheritance diagram for StScriptFile:
Public Member Functions | |
StScriptFile () | |
StScriptFile (const StFile &script, const StFile &shell=ST_DEFAULT_SHELL) | |
bool | setShell (const StFile &shell) |
void | setScript (const StFile &script) |
void | setArguments (const StStringList &args) |
void | setArguments (const StString &arg) |
bool | execute (bool wait=true, bool outputToFile=true) |
StFile | getScript () const |
Protected Attributes | |
StStringList | args |
Private Member Functions | |
bool | setExecutable (const StFile &file) |
Disallow of use this function couse of possible missunderstand. | |
Private Attributes | |
StFile | scriptFile |
StScriptFile allows you to execute a script like you would in a shell. It does not load file and you cannot edit it in memory and then execute. This possibly gives you StScript class.
StScriptFile::StScriptFile | ( | ) | [inline] |
StScriptFile::StScriptFile | ( | const StFile & | script, | |
const StFile & | shell = ST_DEFAULT_SHELL | |||
) | [inline] |
bool StScriptFile::execute | ( | bool | wait = true , |
|
bool | outputToFile = true | |||
) | [inline] |
Execute the script.
wait | - stop execution while executing the script? If no, you can always check hasFinished() |
Reimplemented from StApplication.
void StScriptFile::setArguments | ( | const StString & | arg | ) | [inline] |
Overloaded version of function above. But add argument as one, not multiple.
Reimplemented from StApplication.
void StScriptFile::setArguments | ( | const StStringList & | args | ) | [inline] |
Set arguments to execute with script.
Reimplemented from StApplication.
bool StScriptFile::setExecutable | ( | const StFile & | file | ) | [inline, private] |
void StScriptFile::setScript | ( | const StFile & | script | ) | [inline] |
Point to script file to execute. When set, file can not exist.
bool StScriptFile::setShell | ( | const StFile & | shell | ) | [inline] |
This can be for example /bin/bash for bash scripts or /usr/bin/php for php scripts. When set, file can not exist.
StStringList StScriptFile::args [protected] |
Reimplemented from StApplication.
StFile StScriptFile::scriptFile [private] |