summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/qscriptengine.h')
-rw-r--r--src/script/api/qscriptengine.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/script/api/qscriptengine.h b/src/script/api/qscriptengine.h
index 701f9c6..cd86aca 100644
--- a/src/script/api/qscriptengine.h
+++ b/src/script/api/qscriptengine.h
@@ -120,6 +120,29 @@ private:
friend class QScriptEnginePrivate;
};
+class QScriptProgramPrivate;
+class Q_SCRIPT_EXPORT QScriptProgram
+{
+public:
+ QScriptProgram();
+ QScriptProgram(const QScriptProgram &);
+ ~QScriptProgram();
+
+ QScriptProgram &operator=(const QScriptProgram &);
+
+ bool isNull() const;
+
+ bool hasSyntaxError() const;
+ QScriptValue syntaxError() const;
+
+ QString programSource() const;
+
+private:
+ friend class QScriptEngine;
+ QScriptProgramPrivate *d;
+};
+
+class QScriptCode;
class Q_SCRIPT_EXPORT QScriptEngine
#ifndef QT_NO_QOBJECT
: public QObject
@@ -159,11 +182,15 @@ public:
QScriptContext *currentContext() const;
QScriptContext *pushContext();
+ QScriptContext *pushCleanContext();
void popContext();
bool canEvaluate(const QString &program) const;
static QScriptSyntaxCheckResult checkSyntax(const QString &program);
+ QScriptProgram compile(const QString &program, const QString &fileName = QString(), int lineNumber = 1);
+ QScriptValue evaluate(const QScriptProgram &);
+
QScriptValue evaluate(const QString &program, const QString &fileName = QString(), int lineNumber = 1);
bool isEvaluating() const;