OpenCoverage

qv4jsonobject_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4jsonobject_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4namespace QV4 {-
5-
6namespace Heap {-
7-
8struct JsonObject : Object {-
9 void init();-
10};-
11-
12}-
13-
14struct ObjectItem {-
15 const QV4::Object *o;-
16 ObjectItem(const QV4::Object *o) : o(o) {}
never executed: end of block
0
17};-
18-
19inline bool operator ==(const ObjectItem &a, const ObjectItem &b)-
20{ return
never executed: return a.o->d() == b.o->d();
a.o->d() == b.o->d();
never executed: return a.o->d() == b.o->d();
}
0
21-
22inline int qHash(const ObjectItem &i, uint seed = 0)-
23{ return
never executed: return ::qHash((void *)i.o->d(), seed);
::qHash((void *)i.o->d(), seed);
never executed: return ::qHash((void *)i.o->d(), seed);
}
0
24-
25struct JsonObject : Object {-
26 public: enum { MyType = Type_JsonObject };-
27 private: JsonObject() = delete; JsonObject(const JsonObject &) = delete; JsonObject &operator=(const JsonObject &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; }
never executed: end of block
typedef QV4::Heap::JsonObject Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { return
executed 296482 times by 153 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
&static_vtbl;
executed 296482 times by 153 tests: return &static_vtbl;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
} void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }
never executed: end of block
QV4::Heap::JsonObject *d_unchecked() const { return
executed 197829 times by 153 tests: return static_cast<QV4::Heap::JsonObject *>(m());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
static_cast<QV4::Heap::JsonObject *>(m());
executed 197829 times by 153 tests: return static_cast<QV4::Heap::JsonObject *>(m());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
} QV4::Heap::JsonObject *d() const { QV4::Heap::JsonObject *dptr = d_unchecked(); dptr->_checkIsInitialized(); return
executed 99021 times by 153 tests: return dptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
dptr;
executed 99021 times by 153 tests: return dptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
} static_assert(bool(std::is_trivial< QV4::Heap::JsonObject >::value), "std::is_trivial< QV4::Heap::JsonObject >::value");
0-296482
28private:-
29-
30 typedef QSet<ObjectItem> V4ObjectSet;-
31public:-
32-
33 static ReturnedValue method_parse(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);-
34 static ReturnedValue method_stringify(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);-
35-
36 static ReturnedValue fromJsonValue(ExecutionEngine *engine, const QJsonValue &value);-
37 static ReturnedValue fromJsonObject(ExecutionEngine *engine, const QJsonObject &object);-
38 static ReturnedValue fromJsonArray(ExecutionEngine *engine, const QJsonArray &array);-
39-
40 static inline QJsonValue toJsonValue(const QV4::Value &value)-
41 { V4ObjectSet visitedObjects; return
executed 112 times by 2 tests: return toJsonValue(value, visitedObjects);
Executed by:
  • tst_qjsonbinding
  • tst_qqmlecmascript
toJsonValue(value, visitedObjects);
executed 112 times by 2 tests: return toJsonValue(value, visitedObjects);
Executed by:
  • tst_qjsonbinding
  • tst_qqmlecmascript
}
112
42 static inline QJsonObject toJsonObject(const QV4::Object *o)-
43 { V4ObjectSet visitedObjects; return
executed 40 times by 2 tests: return toJsonObject(o, visitedObjects);
Executed by:
  • tst_qjsonbinding
  • tst_qqmlecmascript
toJsonObject(o, visitedObjects);
executed 40 times by 2 tests: return toJsonObject(o, visitedObjects);
Executed by:
  • tst_qjsonbinding
  • tst_qqmlecmascript
}
40
44 static inline QJsonArray toJsonArray(const QV4::ArrayObject *a)-
45 { V4ObjectSet visitedObjects; return
executed 38 times by 2 tests: return toJsonArray(a, visitedObjects);
Executed by:
  • tst_qjsonbinding
  • tst_qqmlecmascript
toJsonArray(a, visitedObjects);
executed 38 times by 2 tests: return toJsonArray(a, visitedObjects);
Executed by:
  • tst_qjsonbinding
  • tst_qqmlecmascript
}
38
46-
47private:-
48 static QJsonValue toJsonValue(const QV4::Value &value, V4ObjectSet &visitedObjects);-
49 static QJsonObject toJsonObject(const Object *o, V4ObjectSet &visitedObjects);-
50 static QJsonArray toJsonArray(const ArrayObject *a, V4ObjectSet &visitedObjects);-
51-
52};-
53-
54class JsonParser-
55{-
56public:-
57 JsonParser(ExecutionEngine *engine, const QChar *json, int length);-
58-
59 ReturnedValue parse(QJsonParseError *error);-
60-
61private:-
62 inline bool eatSpace();-
63 inline QChar nextToken();-
64-
65 ReturnedValue parseObject();-
66 ReturnedValue parseArray();-
67 bool parseMember(Object *o);-
68 bool parseString(QString *string);-
69 bool parseValue(Value *val);-
70 bool parseNumber(Value *val);-
71-
72 ExecutionEngine *engine;-
73 const QChar *head;-
74 const QChar *json;-
75 const QChar *end;-
76-
77 int nestingLevel;-
78 QJsonParseError::ParseError lastError;-
79};-
80-
81}-
82-
83-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0