Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4jsonobject_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | - | |
3 | - | |
4 | namespace QV4 { | - |
5 | - | |
6 | namespace Heap { | - |
7 | - | |
8 | struct JsonObject : Object { | - |
9 | void init(); | - |
10 | }; | - |
11 | - | |
12 | } | - |
13 | - | |
14 | struct ObjectItem { | - |
15 | const QV4::Object *o; | - |
16 | ObjectItem(const QV4::Object *o) : o(o) {} never executed: end of block | 0 |
17 | }; | - |
18 | - | |
19 | inline bool operator ==(const ObjectItem &a, const ObjectItem &b) | - |
20 | { return never executed: a.o->d() == b.o->d();return a.o->d() == b.o->d(); never executed: }return a.o->d() == b.o->d(); | 0 |
21 | - | |
22 | inline int qHash(const ObjectItem &i, uint seed = 0) | - |
23 | { return never executed: ::qHash((void *)i.o->d(), seed);return ::qHash((void *)i.o->d(), seed); never executed: }return ::qHash((void *)i.o->d(), seed); | 0 |
24 | - | |
25 | struct 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: typedef QV4::Heap::JsonObject Data; typedef Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of block executed 296482 times by 153 tests: &static_vtbl;return &static_vtbl; Executed by:
executed 296482 times by 153 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl; Executed by:
never executed: QV4::Heap::JsonObject *d_unchecked() const { returnend of block executed 197829 times by 153 tests: static_cast<QV4::Heap::JsonObject *>(m());return static_cast<QV4::Heap::JsonObject *>(m()); Executed by:
executed 197829 times by 153 tests: } QV4::Heap::JsonObject *d() const { QV4::Heap::JsonObject *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::JsonObject *>(m()); Executed by:
executed 99021 times by 153 tests: dptr;return dptr; Executed by:
executed 99021 times by 153 tests: } static_assert(bool(std::is_trivial< QV4::Heap::JsonObject >::value), "std::is_trivial< QV4::Heap::JsonObject >::value");return dptr; Executed by:
| 0-296482 |
28 | private: | - |
29 | - | |
30 | typedef QSet<ObjectItem> V4ObjectSet; | - |
31 | public: | - |
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: toJsonValue(value, visitedObjects);return toJsonValue(value, visitedObjects); Executed by:
executed 112 times by 2 tests: }return toJsonValue(value, visitedObjects); Executed by:
| 112 |
42 | static inline QJsonObject toJsonObject(const QV4::Object *o) | - |
43 | { V4ObjectSet visitedObjects; return executed 40 times by 2 tests: toJsonObject(o, visitedObjects);return toJsonObject(o, visitedObjects); Executed by:
executed 40 times by 2 tests: }return toJsonObject(o, visitedObjects); Executed by:
| 40 |
44 | static inline QJsonArray toJsonArray(const QV4::ArrayObject *a) | - |
45 | { V4ObjectSet visitedObjects; return executed 38 times by 2 tests: toJsonArray(a, visitedObjects);return toJsonArray(a, visitedObjects); Executed by:
executed 38 times by 2 tests: }return toJsonArray(a, visitedObjects); Executed by:
| 38 |
46 | - | |
47 | private: | - |
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 | - | |
54 | class JsonParser | - |
55 | { | - |
56 | public: | - |
57 | JsonParser(ExecutionEngine *engine, const QChar *json, int length); | - |
58 | - | |
59 | ReturnedValue parse(QJsonParseError *error); | - |
60 | - | |
61 | private: | - |
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 code | Preprocessed file |