BPS C++ API  2.24.4
bpsscriptengine.h
Go to the documentation of this file.
1 
4 #ifndef BPSSCRIPTENGINE_H
5 #define BPSSCRIPTENGINE_H
6 
7 #include "bpscore_global.h"
8 #include <QScriptEngine>
9 
10 class QTranslator;
11 
16 class BPSCORE_EXPORT BpsScriptEngine : public QScriptEngine
17 {
18  Q_OBJECT
20 
21 public:
22 
27  BpsScriptEngine(QObject* aParent = nullptr);
28 
29  virtual ~BpsScriptEngine();
30 
41  QScriptValue eval(const QString& aCode, const QString& aFilename, quint32 aLinenumber = 1);
42 
52  QScriptValue eval(const QString& aFilename, quint32 aLinenumber = 1);
53 
59  BpsScriptEngine& debug(const QString& aLine);
60 
66  BpsScriptEngine& print(const QString& aLine);
67 
73  BpsScriptEngine& perror(const QString& aLine);
74 
83  QString adjustFileName(const QString& aFilename) const;
84 
85 signals:
86 
92  void writelnDebug(const QString& aLine);
93 
99  void writelnStdout(const QString& aLine);
100 
106  void writelnStderr(const QString& aLine);
107 
108 };
109 
110 #endif // BPSSCRIPTENGINE_H
Public include file for BPS CORE library macros.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
The BPS scripting engine.
Definition: bpsscriptengine.h:17
void writelnDebug(const QString &aLine)
This signal is emitted whenever a line shall be written to the debugger output.
BpsScriptEngine & debug(const QString &aLine)
Prints a line to debug output.
BpsScriptEngine(QObject *aParent=nullptr)
Standard constructor for the BpsScriptEngine objects.
BpsScriptEngine & print(const QString &aLine)
Prints a line to stdout.
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.
void writelnStderr(const QString &aLine)
This signal is emitted whenever a line shall be written to the standard error output (stderr).
QString adjustFileName(const QString &aFilename) const
Adjusts filename and checks for existance.
QScriptValue eval(const QString &aFilename, quint32 aLinenumber=1)
Evaluates a script stored in a file.
void writelnStdout(const QString &aLine)
This signal is emitted whenever a line shall be written to the standard output (stdout).
BpsScriptEngine & perror(const QString &aLine)
Prints a line to stderr.