[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Member Functions | Protected Member Functions | List of all members
KLFFilterProcess Class Reference
Inheritance diagram for KLFFilterProcess:
Inheritance graph
[legend]

Public Member Functions

 KLFFilterProcess (const QString &pTitle=QString(), const KLFBackend::klfSettings *settings=NULL, const QString &rundir=QString())
 
QString progTitle () const
 
void setProgTitle (const QString &title)
 
QString programCwd () const
 
void setProgramCwd (const QString &cwd)
 
QStringList execEnviron () const
 
void setExecEnviron (const QStringList &env)
 
void addExecEnviron (const QStringList &env)
 
QStringList argv () const
 
void setArgv (const QStringList &argv)
 
void addArgv (const QStringList &argv)
 
void addArgv (const QString &argv)
 
bool outputStdout () const
 
void setOutputStdout (bool on)
 
bool outputStderr () const
 
void setOutputStderr (bool on)
 
void collectStdoutTo (QByteArray *stdoutstore)
 
void collectStderrTo (QByteArray *stderrstore)
 
bool processAppEvents ()
 
void setProcessAppEvents (bool processEvents)
 
virtual int exitStatus () const
 
virtual int exitCode () const
 
virtual int resultStatus () const
 
virtual QString resultErrorString () const
 
bool run (const QString &outFileName, QByteArray *outdata)
 
bool run (const QByteArray &indata, const QString &outFileName, QByteArray *outdata)
 
bool run (const QMap< QString, QByteArray *> outdata)
 
bool run (const QByteArray &indata=QByteArray())
 
bool run (const QByteArray &indata, const QMap< QString, QByteArray *> outdatalist)
 

Protected Member Functions

virtual QMap< QString, QStringinterpreters () const
 
virtual bool do_run (const QByteArray &indata, const QMap< QString, QByteArray *> outdatalist)
 Actually run the process. More...
 
QByteArray collectedStdout () const
 The collected stdout data of the process that just ran. More...
 
QByteArray collectedStderr () const
 The collected stderr data of the process that just ran. More...
 

Detailed Description

Definition at line 47 of file klffilterprocess.h.

Member Function Documentation

◆ collectedStderr()

QByteArray KLFFilterProcess::collectedStderr ( ) const
protected

The collected stderr data of the process that just ran.

Convenience method for subclasses. Stderr data collection must have been enabled (with setOutputStderr() and collectStderrTo()).

Definition at line 414 of file klffilterprocess.cpp.

Referenced by KLFUserScriptFilterProcess::do_run().

◆ collectedStdout()

QByteArray KLFFilterProcess::collectedStdout ( ) const
protected

The collected stdout data of the process that just ran.

Convenience method for subclasses. Stdout data collection must have been enabled (with setOutputStdout() and collectStdoutTo()).

Definition at line 407 of file klffilterprocess.cpp.

Referenced by KLFUserScriptFilterProcess::do_run().

◆ collectStderrTo()

void KLFFilterProcess::collectStderrTo ( QByteArray stderrstore)

Set a QByteArray where all stderr data will be stored

Definition at line 250 of file klffilterprocess.cpp.

Referenced by KLFUserScriptInfo::settingsFormUI().

◆ collectStdoutTo()

void KLFFilterProcess::collectStdoutTo ( QByteArray stdoutstore)

Set a QByteArray where all stdout data will be stored

Definition at line 245 of file klffilterprocess.cpp.

Referenced by KLFUserScriptInfo::settingsFormUI().

◆ do_run()

bool KLFFilterProcess::do_run ( const QByteArray indata,
const QMap< QString, QByteArray *>  outdatalist 
)
protectedvirtual

◆ exitCode()

int KLFFilterProcess::exitCode ( ) const
virtual

After run(), this is set to the exit code of the process. See QProcess::exitCode()

Definition at line 270 of file klffilterprocess.cpp.

◆ exitStatus()

int KLFFilterProcess::exitStatus ( ) const
virtual

After run(), this is set to the exit status of the process. See QProcess::exitStatus()

Definition at line 266 of file klffilterprocess.cpp.

◆ processAppEvents()

bool KLFFilterProcess::processAppEvents ( )

See setProcessAppEvents()

Definition at line 256 of file klffilterprocess.cpp.

◆ resultErrorString()

QString KLFFilterProcess::resultErrorString ( ) const
virtual

An explicit error string in case the resultStatus() indicated an error.

Definition at line 279 of file klffilterprocess.cpp.

Referenced by KLFUserScriptFilterProcess::do_run(), and KLFUserScriptInfo::settingsFormUI().

◆ resultStatus()

int KLFFilterProcess::resultStatus ( ) const
virtual

This is one of the KLFFP_* define's, such as KLFFP_NOSTART, or KLFFP_NOERR if all OK.

Definition at line 275 of file klffilterprocess.cpp.

◆ run()

bool KLFFilterProcess::run ( const QByteArray indata,
const QMap< QString, QByteArray *>  outdatalist 
)
inline
Note
multiple output files possible. Each data is retreived into a pointer given by outdata map.
Parameters
indataa QByteArray to write into the program's standard input
outdatalista QMap with keys being files that are created by the program. These files are read and their contents stored in the QByteArray's pointed by the corresponding pointer.
resErrorthe klfOutput object is initialized to the corresponding error if an error occurred.

An empty file name in the list means to collect the standard output.

Returns
TRUE/FALSE for success/failure, respectively.

Definition at line 137 of file klffilterprocess.h.

References KLF_DECLARE_PRIVATE.

◆ setOutputStderr()

void KLFFilterProcess::setOutputStderr ( bool  on)

Set this to true to also read stderr as part of the output. If false (the default), stderr output is only reported in the error message in case nothing came out on stdout.

Definition at line 240 of file klffilterprocess.cpp.

◆ setOutputStdout()

void KLFFilterProcess::setOutputStdout ( bool  on)

Set this to false to ignore output on stdout of the program.

Definition at line 231 of file klffilterprocess.cpp.

◆ setProcessAppEvents()

void KLFFilterProcess::setProcessAppEvents ( bool  processEvents)

specify whether or not to call regularly qApp->processEvents() while executing. This will prevent the GUI to freeze. Enabled is the default. However you can choose to disable this behavior by passing FALSE here, e.g. if you're not in the GUI thread.

Definition at line 261 of file klffilterprocess.cpp.

Referenced by KLFUserScriptInfo::settingsFormUI().


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

Generated by doxygen 1.8.13