QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlSynchronousProcess Class Reference

The QtlSynchronousProcess class implements the execution of a synchronous process. More...

Inheritance diagram for QtlSynchronousProcess:

Public Member Functions

 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...
 

Private Slots

void processTerminated (const QtlBoundProcessResult &result)
 Invoked when the process is terminated or failed to start. More...
 

Private Member Functions

 QtlSynchronousProcess () Q_DECL_EQ_DELETE
 

Private Attributes

QEventLoop _eventLoop
 Event loop which executes in the constructor. More...
 
QtlBoundProcessResult _result
 Process execution result. More...
 
bool _terminated
 Process execution is completed. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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]programExecutable file path.
[in]argumentsCommand line arguments.
[in]msRunTestTimeoutTimeout of process execution in milliseconds. Ignored if negative or zero.
[in]maxProcessOutputSizeMaximum size in bytes of process output. Ignored if negative or zero.
[in]parentOptional parent object.
[in]envEnvironment for the process. Current environment by default.

◆ QtlSynchronousProcess() [2/2]

QtlSynchronousProcess::QtlSynchronousProcess ( )
private

Member Function Documentation

◆ 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

void QtlSynchronousProcess::processTerminated ( const QtlBoundProcessResult result)
privateslot

Invoked when the process is terminated or failed to start.

Parameters
[in]resultProcess execution results.

Member Data Documentation

◆ _eventLoop

QEventLoop QtlSynchronousProcess::_eventLoop
private

Event loop which executes in the constructor.

◆ _result

QtlBoundProcessResult QtlSynchronousProcess::_result
private

Process execution result.

◆ _terminated

bool QtlSynchronousProcess::_terminated
private

Process execution is completed.


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