The QtlSynchronousProcess class implements the execution of a synchronous process.
More...
|
| QtlSynchronousProcess (const QString &program, const QStringList &arguments=QStringList(), int msRunTestTimeout=0, int maxProcessOutputSize=0, QObject *parent=0, const QProcessEnvironment &env=QProcessEnvironment()) |
| Constructor. More...
|
|
QString | errorMessage () const |
| Get an error message after process termination if the process did not execute properly. More...
|
|
int | exitCode () const |
| Get the process exit code after process termination. More...
|
|
bool | hasError () const |
| Check if the process terminated with an error. More...
|
|
QString | standardError () const |
| Get the content of the standard error after process termination. More...
|
|
QStringList | standardErrorLines () const |
| Get the content of the standard error after process termination as list of lines. More...
|
|
int | standardErrorSize () const |
| Get the size of the standard error after process termination. More...
|
|
QString | standardOutput () const |
| Get the content of the standard output after process termination. More...
|
|
QStringList | standardOutputLines () const |
| Get the content of the standard output after process termination as list of lines. More...
|
|
int | standardOutputSize () const |
| Get the size of the standard output after process termination. More...
|
|
The QtlSynchronousProcess class implements the execution of a synchronous process.
The process is entirely executed during the constructor. Then, the standard output and error can be read.
◆ QtlSynchronousProcess() [1/2]
QtlSynchronousProcess::QtlSynchronousProcess |
( |
const QString & |
program, |
|
|
const QStringList & |
arguments = QStringList() , |
|
|
int |
msRunTestTimeout = 0 , |
|
|
int |
maxProcessOutputSize = 0 , |
|
|
QObject * |
parent = 0 , |
|
|
const QProcessEnvironment & |
env = QProcessEnvironment() |
|
) |
| |
Constructor.
The process executes synchronously. The constructor returns only upon process completion.
- Parameters
-
[in] | program | Executable file path. |
[in] | arguments | Command line arguments. |
[in] | msRunTestTimeout | Timeout of process execution in milliseconds. Ignored if negative or zero. |
[in] | maxProcessOutputSize | Maximum size in bytes of process output. Ignored if negative or zero. |
[in] | parent | Optional parent object. |
[in] | env | Environment for the process. Current environment by default. |
◆ QtlSynchronousProcess() [2/2]
QtlSynchronousProcess::QtlSynchronousProcess |
( |
| ) |
|
|
private |
◆ standardOutput()
QString QtlSynchronousProcess::standardOutput |
( |
| ) |
const |
|
inline |
Get the content of the standard output after process termination.
- Returns
- Content of standard output.
◆ standardOutputLines()
QStringList QtlSynchronousProcess::standardOutputLines |
( |
| ) |
const |
|
inline |
Get the content of the standard output after process termination as list of lines.
- Returns
- Text of lines of standard output.
◆ standardOutputSize()
int QtlSynchronousProcess::standardOutputSize |
( |
| ) |
const |
|
inline |
Get the size of the standard output after process termination.
- Returns
- Content of standard output.
◆ standardError()
QString QtlSynchronousProcess::standardError |
( |
| ) |
const |
|
inline |
Get the content of the standard error after process termination.
- Returns
- Content of standard error.
◆ standardErrorLines()
QStringList QtlSynchronousProcess::standardErrorLines |
( |
| ) |
const |
|
inline |
Get the content of the standard error after process termination as list of lines.
- Returns
- Text of lines of standard error.
◆ standardErrorSize()
int QtlSynchronousProcess::standardErrorSize |
( |
| ) |
const |
|
inline |
Get the size of the standard error after process termination.
- Returns
- Content of standard error.
◆ hasError()
bool QtlSynchronousProcess::hasError |
( |
| ) |
const |
|
inline |
Check if the process terminated with an error.
- Returns
- True on error, false otherwise.
◆ errorMessage()
QString QtlSynchronousProcess::errorMessage |
( |
| ) |
const |
|
inline |
Get an error message after process termination if the process did not execute properly.
- Returns
- Error message. If empty, the process executed correctly.
◆ exitCode()
int QtlSynchronousProcess::exitCode |
( |
| ) |
const |
|
inline |
Get the process exit code after process termination.
- Returns
- Process exit code.
◆ processTerminated
Invoked when the process is terminated or failed to start.
- Parameters
-
[in] | result | Process execution results. |
◆ _eventLoop
QEventLoop QtlSynchronousProcess::_eventLoop |
|
private |
Event loop which executes in the constructor.
◆ _result
Process execution result.
◆ _terminated
bool QtlSynchronousProcess::_terminated |
|
private |
Process execution is completed.
The documentation for this class was generated from the following files: