The BPS scripting engine.
More...
#include <bpsscriptengine.h>
|
void | writelnDebug (const QString &aLine) |
| This signal is emitted whenever a line shall be written to the debugger output. More...
|
|
void | writelnStderr (const QString &aLine) |
| This signal is emitted whenever a line shall be written to the standard error output (stderr). More...
|
|
void | writelnStdout (const QString &aLine) |
| This signal is emitted whenever a line shall be written to the standard output (stdout). More...
|
|
The BPS scripting engine.
It is derived from QScriptEnging and implements the BPS extensions.
◆ BpsScriptEngine()
BpsScriptEngine::BpsScriptEngine |
( |
QObject * |
aParent = nullptr | ) |
|
Standard constructor for the BpsScriptEngine objects.
- Parameters
-
aParent | Pointer to parent object. |
◆ adjustFileName()
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
-
aFilename | The file name to adjust. |
- Returns
- The adjusted absolute file name
◆ debug()
Prints a line to debug output.
- Parameters
-
- Returns
- Reference of current object.
◆ eval() [1/2]
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
-
aCode | The script code to evaluate. |
aFilename | The file name reported in case of exceptions. |
aLinenumber | The first line number to assume for the code fragment. |
- Returns
- The value returned from the script code.
◆ eval() [2/2]
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
-
aFilename | The name of the file with the script code. |
aLinenumber | The first line number to assume for the file. |
- Returns
- The value returned from the script code.
◆ perror()
Prints a line to stderr.
- Parameters
-
- Returns
- Reference of current object.
◆ print()
Prints a line to stdout.
- Parameters
-
- Returns
- Reference of current object.
◆ writelnDebug
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
-
aLine | The line that shall be written. |
◆ writelnStderr
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
-
aLine | The line that shall be written. |
◆ writelnStdout
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
-
aLine | The line that shall be written. |
The documentation for this class was generated from the following file: