Documents > BPS V2 C++ API
BpsScriptEngine Class Reference

The BPS scripting engine. More...

#include <bpsscriptengine.h>

List of all members.

Signals

void writelnDebug (const QString &aLine)
 This signal is emitted whenever a line shall be written to the debugger output.
void writelnStderr (const QString &aLine)
 This signal is emitted whenever a line shall be written to the standard error output (stderr).
void writelnStdout (const QString &aLine)
 This signal is emitted whenever a line shall be written to the standard output (stdout).

Public Member Functions

QString adjustFileName (const QString &aFilename) const
 Adjusts filename and checks for existance.
 BpsScriptEngine (QObject *aParent=0)
 Standard constructor for the BpsScriptEngine objects.
BpsScriptEnginedebug (const QString &aLine)
 Prints a line to debug output.
QScriptValue eval (const QString &aCode, const QString &aFilename, quint32 aLinenumber=1)
 Evaluates script code, using aFilename as file name and aLinenumber as starting line number.
QScriptValue eval (const QString &aFilename, quint32 aLinenumber=1)
 Evaluates a script stored in a file.
BpsScriptEngineperror (const QString &aLine)
 Prints a line to stderr.
BpsScriptEngineprint (const QString &aLine)
 Prints a line to stdout.

Detailed Description

The BPS scripting engine.

It is derived from QScriptEnging and implements the BPS extensions.


Constructor & Destructor Documentation

BpsScriptEngine::BpsScriptEngine ( QObject *  aParent = 0)

Standard constructor for the BpsScriptEngine objects.

Parameters:
[in]aParentPointer to parent object.

Member Function Documentation

QString BpsScriptEngine::adjustFileName ( const QString &  aFilename) const

Adjusts filename and checks for existance.

If the filename is provided without extension, .js will be appended. The file will also be searched in the plugins directory defined in HKLM/IBK Software AG/BPS2/plugins in case it is not found in first place.

Parameters:
[in]aFilenameThe file name to adjust.
Returns:
The adjusted absolute file name
BpsScriptEngine& BpsScriptEngine::debug ( const QString &  aLine)

Prints a line to debug output.

Parameters:
[in]aLineThe line to print.
Returns:
Reference of current object.
QScriptValue BpsScriptEngine::eval ( const QString &  aCode,
const QString &  aFilename,
quint32  aLinenumber = 1 
)

Evaluates script code, using aFilename as file name and aLinenumber as starting line number.

The script code will be evaluated in the current context. The evaluation can cause an exception in the engine; in this case the script exception will be converted and thrown as a BpsException.

Parameters:
[in]aCodeThe script code to evaluate.
[in]aFilenameThe file name reported in case of exceptions.
[in]aLinenumberThe first line number to assume for the code fragment.
Returns:
The value returned from the script code.
QScriptValue BpsScriptEngine::eval ( const QString &  aFilename,
quint32  aLinenumber = 1 
)

Evaluates a script stored in a file.

If the filename is provided without extension, .js will be appended. The script code will be evaluated in the current context. The evaluation can cause an exception in the engine; in this case the script exception will be converted and thrown as a BpsException.

Parameters:
[in]aFilenameThe name of the file with the script code.
[in]aLinenumberThe first line number to assume for the file.
Returns:
The value returned from the script code.
BpsScriptEngine& BpsScriptEngine::perror ( const QString &  aLine)

Prints a line to stderr.

Parameters:
[in]aLineThe line to print.
Returns:
Reference of current object.
BpsScriptEngine& BpsScriptEngine::print ( const QString &  aLine)

Prints a line to stdout.

Parameters:
[in]aLineThe line to print.
Returns:
Reference of current object.
void BpsScriptEngine::writelnDebug ( const QString &  aLine) [signal]

This signal is emitted whenever a line shall be written to the debugger output.

Connect this signal to a slot implementing that output.

Parameters:
[in]aLineThe line that shall be written.
void BpsScriptEngine::writelnStderr ( const QString &  aLine) [signal]

This signal is emitted whenever a line shall be written to the standard error output (stderr).

Connect this signal to a slot implementing that output.

Parameters:
[in]aLineThe line that shall be written.
void BpsScriptEngine::writelnStdout ( const QString &  aLine) [signal]

This signal is emitted whenever a line shall be written to the standard output (stdout).

Connect this signal to a slot implementing that output.

Parameters:
[in]aLineThe line that shall be written.

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