| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4stringobject_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||
| 2 | ** | - | ||||||
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||
| 4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||
| 5 | ** | - | ||||||
| 6 | ** This file is part of the QtQml module of the Qt Toolkit. | - | ||||||
| 7 | ** | - | ||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||
| 9 | ** Commercial License Usage | - | ||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||
| 16 | ** | - | ||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
| 19 | ** General Public License version 3 as published by the Free Software | - | ||||||
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||
| 21 | ** packaging of this file. Please review the following information to | - | ||||||
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||
| 24 | ** | - | ||||||
| 25 | ** GNU General Public License Usage | - | ||||||
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||
| 31 | ** included in the packaging of this file. Please review the following | - | ||||||
| 32 | ** information to ensure the GNU General Public License requirements will | - | ||||||
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||
| 35 | ** | - | ||||||
| 36 | ** $QT_END_LICENSE$ | - | ||||||
| 37 | ** | - | ||||||
| 38 | ****************************************************************************/ | - | ||||||
| 39 | #ifndef QV4STRINGOBJECT_P_H | - | ||||||
| 40 | #define QV4STRINGOBJECT_P_H | - | ||||||
| 41 | - | |||||||
| 42 | // | - | ||||||
| 43 | // W A R N I N G | - | ||||||
| 44 | // ------------- | - | ||||||
| 45 | // | - | ||||||
| 46 | // This file is not part of the Qt API. It exists purely as an | - | ||||||
| 47 | // implementation detail. This header file may change from version to | - | ||||||
| 48 | // version without notice, or even be removed. | - | ||||||
| 49 | // | - | ||||||
| 50 | // We mean it. | - | ||||||
| 51 | // | - | ||||||
| 52 | - | |||||||
| 53 | #include "qv4object_p.h" | - | ||||||
| 54 | #include "qv4functionobject_p.h" | - | ||||||
| 55 | #include <QtCore/qnumeric.h> | - | ||||||
| 56 | - | |||||||
| 57 | QT_BEGIN_NAMESPACE | - | ||||||
| 58 | - | |||||||
| 59 | namespace QV4 { | - | ||||||
| 60 | - | |||||||
| 61 | namespace Heap { | - | ||||||
| 62 | - | |||||||
| 63 | #define StringObjectMembers(class, Member) \ | - | ||||||
| 64 | Member(class, Pointer, String *, string) | - | ||||||
| 65 | - | |||||||
| 66 | DECLARE_HEAP_OBJECT(StringObject, Object) { | - | ||||||
| 67 | DECLARE_MARKOBJECTS(StringObject); executed 8854 times by 26 tests: end of blockExecuted by:
executed 8854 times by 26 tests: o->string.heapObject()->mark(stack);Executed by:
| 0-8854 | ||||||
| 68 | - | |||||||
| 69 | enum { | - | ||||||
| 70 | LengthPropertyIndex = 0 | - | ||||||
| 71 | }; | - | ||||||
| 72 | - | |||||||
| 73 | void init(bool /*don't init*/) | - | ||||||
| 74 | { Object::init(); } executed 98976 times by 153 tests: end of blockExecuted by:
| 98976 | ||||||
| 75 | void init(); | - | ||||||
| 76 | void init(const QV4::String *string); | - | ||||||
| 77 | - | |||||||
| 78 | Heap::String *getIndex(uint index) const; | - | ||||||
| 79 | uint length() const; | - | ||||||
| 80 | }; | - | ||||||
| 81 | - | |||||||
| 82 | struct StringCtor : FunctionObject { | - | ||||||
| 83 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 84 | }; | - | ||||||
| 85 | - | |||||||
| 86 | } | - | ||||||
| 87 | - | |||||||
| 88 | struct StringObject: Object { | - | ||||||
| 89 | V4_OBJECT2(StringObject, Object) executed 8099 times by 4 tests: end of blockExecuted by:
never executed: end of blockexecuted 549091 times by 153 tests: return &static_vtbl;Executed by:
executed 301361 times by 153 tests: return static_cast<QV4::Heap::StringObject *>(m());Executed by:
executed 253627 times by 153 tests: return dptr;Executed by:
| 0-549091 | ||||||
| 90 | Q_MANAGED_TYPE(StringObject) | - | ||||||
| 91 | V4_INTERNALCLASS(StringObject) executed 48300 times by 14 tests: return e->internalClasses(QV4::EngineBase::Class_StringObject);Executed by:
| 48300 | ||||||
| 92 | V4_PROTOTYPE(stringPrototype) executed 48310 times by 14 tests: return e->stringPrototype();Executed by:
| 48310 | ||||||
| 93 | - | |||||||
| 94 | Heap::String *getIndex(uint index) const { | - | ||||||
| 95 | return d()->getIndex(index); executed 1104 times by 4 tests: return d()->getIndex(index);Executed by:
| 1104 | ||||||
| 96 | } | - | ||||||
| 97 | uint length() const { | - | ||||||
| 98 | return d()->length(); executed 612 times by 4 tests: return d()->length();Executed by:
| 612 | ||||||
| 99 | } | - | ||||||
| 100 | - | |||||||
| 101 | using Object::getOwnProperty; | - | ||||||
| 102 | protected: | - | ||||||
| 103 | static bool virtualDeleteProperty(Managed *m, PropertyKey id); | - | ||||||
| 104 | static void virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attrs); | - | ||||||
| 105 | static PropertyAttributes virtualGetOwnProperty(Managed *m, PropertyKey id, Property *p); | - | ||||||
| 106 | }; | - | ||||||
| 107 | - | |||||||
| 108 | struct StringCtor: FunctionObject | - | ||||||
| 109 | { | - | ||||||
| 110 | V4_OBJECT2(StringCtor, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 296980 times by 153 tests: return &static_vtbl;Executed by:
executed 198127 times by 153 tests: return static_cast<QV4::Heap::StringCtor *>(m());Executed by:
executed 99138 times by 153 tests: return dptr;Executed by:
| 0-296980 | ||||||
| 111 | - | |||||||
| 112 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 113 | static ReturnedValue virtualCall(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 114 | - | |||||||
| 115 | static ReturnedValue method_fromCharCode(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 116 | static ReturnedValue method_fromCodePoint(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 117 | }; | - | ||||||
| 118 | - | |||||||
| 119 | struct StringPrototype: StringObject | - | ||||||
| 120 | { | - | ||||||
| 121 | V4_PROTOTYPE(objectPrototype) never executed: return e->objectPrototype(); | 0 | ||||||
| 122 | void init(ExecutionEngine *engine, Object *ctor); | - | ||||||
| 123 | - | |||||||
| 124 | static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 125 | static ReturnedValue method_charAt(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 126 | static ReturnedValue method_charCodeAt(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 127 | static ReturnedValue method_codePointAt(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 128 | static ReturnedValue method_concat(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 129 | static ReturnedValue method_endsWith(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 130 | static ReturnedValue method_indexOf(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 131 | static ReturnedValue method_includes(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 132 | static ReturnedValue method_lastIndexOf(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 133 | static ReturnedValue method_localeCompare(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 134 | static ReturnedValue method_match(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 135 | static ReturnedValue method_normalize(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 136 | static ReturnedValue method_padEnd(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 137 | static ReturnedValue method_padStart(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 138 | static ReturnedValue method_repeat(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 139 | static ReturnedValue method_replace(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 140 | static ReturnedValue method_search(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 141 | static ReturnedValue method_slice(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 142 | static ReturnedValue method_split(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 143 | static ReturnedValue method_startsWith(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 144 | static ReturnedValue method_substr(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 145 | static ReturnedValue method_substring(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 146 | static ReturnedValue method_toLowerCase(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 147 | static ReturnedValue method_toLocaleLowerCase(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 148 | static ReturnedValue method_toUpperCase(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 149 | static ReturnedValue method_toLocaleUpperCase(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 150 | static ReturnedValue method_trim(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 151 | static ReturnedValue method_iterator(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 152 | }; | - | ||||||
| 153 | - | |||||||
| 154 | } | - | ||||||
| 155 | - | |||||||
| 156 | QT_END_NAMESPACE | - | ||||||
| 157 | - | |||||||
| 158 | #endif // QV4ECMAOBJECTS_P_H | - | ||||||
| Source code | Switch to Preprocessed file |