Scripting Interface |
The Process JavaScript class. Used to launch an external process. More...
Public Slots | |
int | launch () |
Launch process. More... | |
int | launchAndDetach () |
Launch process and detach it from application. More... | |
String | commandLine () |
Fetch command line to be executed in this process. More... | |
int | errorCode () |
Fetch error code. More... | |
String & | errorMessage () |
Fetch error message. More... | |
void | terminate () |
Terminates the process. More... | |
bool | isAlive () |
Verify if process is still alive. More... | |
int | pid () |
Fetch process PID. More... | |
void | start (StringList *env=0) |
Starts the process. More... | |
void | launch (String &buf, StringList *env=0) |
Launches the Process. More... | |
String | readStdout () |
Returns the contents of the Standard output file. More... | |
String | readStderr () |
Returns the contents of the Standard error file. More... | |
bool | canReadLineStdout () |
Returns true if you can read the Standard output file line by line. More... | |
bool | canReadLineStderr () |
Retruns true if you can read the Standard error file line by line. More... | |
String | readLineStdout () |
Returns the next line of the Standard output file. More... | |
String | readLineStderr () |
Returns the next line of the Standard error file. More... | |
void | tryTerminate () |
Tries to terminate the process. More... | |
void | kill () |
Kills the process. More... | |
void | writeToStdin (String &buffer) |
Writes to the Standard input file. More... | |
void | closeStdin () |
Closes the Standard input file. More... | |
Signals | |
void | readyReadStdout () |
void | readyReadStderr () |
void | processExited () |
void | wroteToStdin () |
void | launchFinished () |
Public Member Functions | |
Process (int pid) | |
Create a new Process. A process created with a pid cannot be launched as it already should have been. terminate() and isAlive() functions can still be called with such a process. More... | |
Process (String name,...) | |
Create a new Process. More... | |
Process (String name, StringList list) | |
Create a new Process. More... | |
Process (String commandLine) | |
Create a new Process. More... | |
Process (StringList &args=StringList()) | |
Create a new Process. More... | |
StringList | arguments () |
Returns the arguments for the process. More... | |
void | setArguments (StringList &arguments) |
Sets the arguments for running the process. More... | |
String | workingDirectory () |
Returns the current working directory. More... | |
void | setWorkingDirectory (String &workingDirectory) |
Sets the current working directory. More... | |
bool | running () |
Returns true if the process is running. More... | |
int | exitStatus () |
Whether or not running the process was a failure. A non-zero exit status indicates failure. More... | |
Properties | |
String | objectName |
StringList | arguments |
String | workingDirectory |
bool | running |
int | exitStatus |
The Process JavaScript class. Used to launch an external process.
Processes can be instantiated in the scripting environment.
Process::Process | ( | int | pid | ) |
Create a new Process. A process created with a pid cannot be launched as it already should have been. terminate() and isAlive() functions can still be called with such a process.
pid | : PID of already existing process. |
Process::Process | ( | String | name, |
... | |||
) |
Create a new Process.
name | : Path or name of process to execute. |
... | : List of arguments. |
Process::Process | ( | String | name, |
StringList | list | ||
) |
Create a new Process.
name | : Path or name of process to execute. |
list | : List of arguments. |
Process::Process | ( | String | commandLine | ) |
Create a new Process.
commandLine | : Entire command line to launch. |
Process::Process | ( | StringList & | args = StringList() | ) |
Create a new Process.
args | : A StringList of arguments. |
StringList Process::arguments | ( | ) |
Returns the arguments for the process.
|
slot |
Retruns true if you can read the Standard error file line by line.
|
slot |
Returns true if you can read the Standard output file line by line.
|
slot |
Closes the Standard input file.
|
slot |
Fetch command line to be executed in this process.
|
slot |
Fetch error code.
|
slot |
Fetch error message.
int Process::exitStatus | ( | ) |
Whether or not running the process was a failure. A non-zero exit status indicates failure.
|
slot |
Verify if process is still alive.
|
slot |
Kills the process.
|
slot |
Launch process.
|
slot |
Launches the Process.
buf | : The data to write. |
env | : The process environment. |
|
slot |
Launch process and detach it from application.
|
signal |
|
slot |
Fetch process PID.
|
signal |
|
slot |
Returns the next line of the Standard error file.
|
slot |
Returns the next line of the Standard output file.
|
slot |
Returns the contents of the Standard error file.
|
slot |
Returns the contents of the Standard output file.
|
signal |
|
signal |
bool Process::running | ( | ) |
Returns true if the process is running.
void Process::setArguments | ( | StringList & | arguments | ) |
Sets the arguments for running the process.
arguments | : A StringList of arguments. |
void Process::setWorkingDirectory | ( | String & | workingDirectory | ) |
Sets the current working directory.
workingDirectory | : The path to the desired working directory. |
|
slot |
Starts the process.
env | : The process environment. |
|
slot |
Terminates the process.
|
slot |
Tries to terminate the process.
String Process::workingDirectory | ( | ) |
Returns the current working directory.
|
slot |
Writes to the Standard input file.
buffer | : The data to write. |
|
signal |
|
readwrite |
|
read |
String Process::objectName |
|
read |
|
readwrite |