aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_def_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4value_def_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_def_p.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h
index 76f694c0e9..7d97d4531e 100644
--- a/src/qml/jsruntime/qv4value_def_p.h
+++ b/src/qml/jsruntime/qv4value_def_p.h
@@ -341,6 +341,37 @@ struct Q_QML_EXPORT Value
inline void mark() const;
};
+struct SafeValue : public Value
+{
+ SafeValue &operator =(const ScopedValue &v);
+ template<typename T>
+ SafeValue &operator=(Returned<T> *t);
+ SafeValue &operator=(ReturnedValue v) {
+ val = v;
+ return *this;
+ }
+ template<typename T>
+ SafeValue &operator=(const Scoped<T> &t);
+ SafeValue &operator=(const Value &v) {
+ val = v.val;
+ return *this;
+ }
+
+ template<typename T>
+ Returned<T> *as();
+};
+
+template<typename T>
+T *value_cast(const Value &v)
+{
+ return v.as<T>();
+}
+
+template<typename T>
+ReturnedValue value_convert(ExecutionContext *ctx, const Value &v);
+
+
+
}
QT_END_NAMESPACE