Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/xml/sax/qxml.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | namespace { | - | ||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | template <typename Container> | - | ||||||||||||||||||||||||
7 | void clear(Container &c) { c = Container(); } executed 2261 times by 6 tests: end of block Executed by:
| 2261 | ||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||
9 | } | - | ||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||
12 | static const signed char cltWS = 0; | - | ||||||||||||||||||||||||
13 | static const signed char cltPer = 1; | - | ||||||||||||||||||||||||
14 | static const signed char cltAmp = 2; | - | ||||||||||||||||||||||||
15 | static const signed char cltGt = 3; | - | ||||||||||||||||||||||||
16 | static const signed char cltLt = 4; | - | ||||||||||||||||||||||||
17 | static const signed char cltSlash = 5; | - | ||||||||||||||||||||||||
18 | static const signed char cltQm = 6; | - | ||||||||||||||||||||||||
19 | static const signed char cltEm = 7; | - | ||||||||||||||||||||||||
20 | static const signed char cltDash = 8; | - | ||||||||||||||||||||||||
21 | static const signed char cltCB = 9; | - | ||||||||||||||||||||||||
22 | static const signed char cltOB = 10; | - | ||||||||||||||||||||||||
23 | static const signed char cltEq = 11; | - | ||||||||||||||||||||||||
24 | static const signed char cltDq = 12; | - | ||||||||||||||||||||||||
25 | static const signed char cltSq = 13; | - | ||||||||||||||||||||||||
26 | static const signed char cltUnknown = 14; | - | ||||||||||||||||||||||||
27 | - | |||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||
29 | static const signed char charLookupTable[256]={ | - | ||||||||||||||||||||||||
30 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
31 | cltUnknown, | - | ||||||||||||||||||||||||
32 | cltWS, | - | ||||||||||||||||||||||||
33 | cltWS, | - | ||||||||||||||||||||||||
34 | cltUnknown, | - | ||||||||||||||||||||||||
35 | cltUnknown, | - | ||||||||||||||||||||||||
36 | cltWS, | - | ||||||||||||||||||||||||
37 | cltUnknown, | - | ||||||||||||||||||||||||
38 | cltUnknown, | - | ||||||||||||||||||||||||
39 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
40 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
41 | cltWS, | - | ||||||||||||||||||||||||
42 | cltEm, | - | ||||||||||||||||||||||||
43 | cltDq, | - | ||||||||||||||||||||||||
44 | cltUnknown, | - | ||||||||||||||||||||||||
45 | cltUnknown, | - | ||||||||||||||||||||||||
46 | cltPer, | - | ||||||||||||||||||||||||
47 | cltAmp, | - | ||||||||||||||||||||||||
48 | cltSq, | - | ||||||||||||||||||||||||
49 | cltUnknown, | - | ||||||||||||||||||||||||
50 | cltUnknown, | - | ||||||||||||||||||||||||
51 | cltUnknown, | - | ||||||||||||||||||||||||
52 | cltUnknown, | - | ||||||||||||||||||||||||
53 | cltUnknown, | - | ||||||||||||||||||||||||
54 | cltDash, | - | ||||||||||||||||||||||||
55 | cltUnknown, | - | ||||||||||||||||||||||||
56 | cltSlash, | - | ||||||||||||||||||||||||
57 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
58 | cltUnknown, | - | ||||||||||||||||||||||||
59 | cltUnknown, | - | ||||||||||||||||||||||||
60 | cltUnknown, | - | ||||||||||||||||||||||||
61 | cltUnknown, | - | ||||||||||||||||||||||||
62 | cltLt, | - | ||||||||||||||||||||||||
63 | cltEq, | - | ||||||||||||||||||||||||
64 | cltGt, | - | ||||||||||||||||||||||||
65 | cltQm, | - | ||||||||||||||||||||||||
66 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
67 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
68 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
69 | cltUnknown, | - | ||||||||||||||||||||||||
70 | cltUnknown, | - | ||||||||||||||||||||||||
71 | cltUnknown, | - | ||||||||||||||||||||||||
72 | cltOB, | - | ||||||||||||||||||||||||
73 | cltUnknown, | - | ||||||||||||||||||||||||
74 | cltCB, | - | ||||||||||||||||||||||||
75 | cltUnknown, | - | ||||||||||||||||||||||||
76 | cltUnknown, | - | ||||||||||||||||||||||||
77 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
78 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
79 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
80 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
81 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
82 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
83 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
84 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
85 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
86 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
87 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
88 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
89 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
90 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
91 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
92 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
93 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
94 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
95 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
96 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown | - | ||||||||||||||||||||||||
97 | }; | - | ||||||||||||||||||||||||
98 | static bool stripTextDecl(QString& str) | - | ||||||||||||||||||||||||
99 | { | - | ||||||||||||||||||||||||
100 | QString textDeclStart(QLatin1String("<?xml")); | - | ||||||||||||||||||||||||
101 | if (str.startsWith(textDeclStart)
| 0 | ||||||||||||||||||||||||
102 | QRegExp textDecl(QString::fromLatin1( | - | ||||||||||||||||||||||||
103 | "^<\\?xml\\s+" | - | ||||||||||||||||||||||||
104 | "(version\\s*=\\s*((['\"])[-a-zA-Z0-9_.:]+\\3))?" | - | ||||||||||||||||||||||||
105 | "\\s*" | - | ||||||||||||||||||||||||
106 | "(encoding\\s*=\\s*((['\"])[A-Za-z][-a-zA-Z0-9_.]*\\6))?" | - | ||||||||||||||||||||||||
107 | "\\s*\\?>" | - | ||||||||||||||||||||||||
108 | )); | - | ||||||||||||||||||||||||
109 | QString strTmp = str.replace(textDecl, QLatin1String("")); | - | ||||||||||||||||||||||||
110 | if (strTmp.length() != str.length()
| 0 | ||||||||||||||||||||||||
111 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
112 | str = strTmp; | - | ||||||||||||||||||||||||
113 | } never executed: end of block | 0 | ||||||||||||||||||||||||
114 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
115 | } | - | ||||||||||||||||||||||||
116 | - | |||||||||||||||||||||||||
117 | - | |||||||||||||||||||||||||
118 | class QXmlAttributesPrivate | - | ||||||||||||||||||||||||
119 | { | - | ||||||||||||||||||||||||
120 | }; | - | ||||||||||||||||||||||||
121 | class QXmlInputSourcePrivate | - | ||||||||||||||||||||||||
122 | { | - | ||||||||||||||||||||||||
123 | public: | - | ||||||||||||||||||||||||
124 | QIODevice *inputDevice; | - | ||||||||||||||||||||||||
125 | QTextStream *inputStream; | - | ||||||||||||||||||||||||
126 | - | |||||||||||||||||||||||||
127 | QString str; | - | ||||||||||||||||||||||||
128 | const QChar *unicode; | - | ||||||||||||||||||||||||
129 | int pos; | - | ||||||||||||||||||||||||
130 | int length; | - | ||||||||||||||||||||||||
131 | bool nextReturnedEndOfData; | - | ||||||||||||||||||||||||
132 | - | |||||||||||||||||||||||||
133 | QTextDecoder *encMapper; | - | ||||||||||||||||||||||||
134 | - | |||||||||||||||||||||||||
135 | - | |||||||||||||||||||||||||
136 | QByteArray encodingDeclBytes; | - | ||||||||||||||||||||||||
137 | QString encodingDeclChars; | - | ||||||||||||||||||||||||
138 | bool lookingForEncodingDecl; | - | ||||||||||||||||||||||||
139 | }; | - | ||||||||||||||||||||||||
140 | class QXmlParseExceptionPrivate | - | ||||||||||||||||||||||||
141 | { | - | ||||||||||||||||||||||||
142 | public: | - | ||||||||||||||||||||||||
143 | QXmlParseExceptionPrivate() | - | ||||||||||||||||||||||||
144 | : column(-1), line(-1) | - | ||||||||||||||||||||||||
145 | { | - | ||||||||||||||||||||||||
146 | } executed 155 times by 1 test: end of block Executed by:
| 155 | ||||||||||||||||||||||||
147 | QXmlParseExceptionPrivate(const QXmlParseExceptionPrivate &other) | - | ||||||||||||||||||||||||
148 | : msg(other.msg), column(other.column), line(other.line), | - | ||||||||||||||||||||||||
149 | pub(other.pub), sys(other.sys) | - | ||||||||||||||||||||||||
150 | { | - | ||||||||||||||||||||||||
151 | } never executed: end of block | 0 | ||||||||||||||||||||||||
152 | - | |||||||||||||||||||||||||
153 | QString msg; | - | ||||||||||||||||||||||||
154 | int column; | - | ||||||||||||||||||||||||
155 | int line; | - | ||||||||||||||||||||||||
156 | QString pub; | - | ||||||||||||||||||||||||
157 | QString sys; | - | ||||||||||||||||||||||||
158 | - | |||||||||||||||||||||||||
159 | }; | - | ||||||||||||||||||||||||
160 | - | |||||||||||||||||||||||||
161 | class QXmlLocatorPrivate | - | ||||||||||||||||||||||||
162 | { | - | ||||||||||||||||||||||||
163 | }; | - | ||||||||||||||||||||||||
164 | - | |||||||||||||||||||||||||
165 | class QXmlDefaultHandlerPrivate | - | ||||||||||||||||||||||||
166 | { | - | ||||||||||||||||||||||||
167 | }; | - | ||||||||||||||||||||||||
168 | QXmlParseException::QXmlParseException(const QString& name, int c, int l, | - | ||||||||||||||||||||||||
169 | const QString& p, const QString& s) | - | ||||||||||||||||||||||||
170 | : d(new QXmlParseExceptionPrivate) | - | ||||||||||||||||||||||||
171 | { | - | ||||||||||||||||||||||||
172 | d->msg = name; | - | ||||||||||||||||||||||||
173 | d->column = c; | - | ||||||||||||||||||||||||
174 | d->line = l; | - | ||||||||||||||||||||||||
175 | d->pub = p; | - | ||||||||||||||||||||||||
176 | d->sys = s; | - | ||||||||||||||||||||||||
177 | } executed 155 times by 1 test: end of block Executed by:
| 155 | ||||||||||||||||||||||||
178 | - | |||||||||||||||||||||||||
179 | - | |||||||||||||||||||||||||
180 | - | |||||||||||||||||||||||||
181 | - | |||||||||||||||||||||||||
182 | QXmlParseException::QXmlParseException(const QXmlParseException& other) : | - | ||||||||||||||||||||||||
183 | d(new QXmlParseExceptionPrivate(*other.d)) | - | ||||||||||||||||||||||||
184 | { | - | ||||||||||||||||||||||||
185 | - | |||||||||||||||||||||||||
186 | } never executed: end of block | 0 | ||||||||||||||||||||||||
187 | - | |||||||||||||||||||||||||
188 | - | |||||||||||||||||||||||||
189 | - | |||||||||||||||||||||||||
190 | - | |||||||||||||||||||||||||
191 | QXmlParseException::~QXmlParseException() | - | ||||||||||||||||||||||||
192 | { | - | ||||||||||||||||||||||||
193 | } | - | ||||||||||||||||||||||||
194 | - | |||||||||||||||||||||||||
195 | - | |||||||||||||||||||||||||
196 | - | |||||||||||||||||||||||||
197 | - | |||||||||||||||||||||||||
198 | QString QXmlParseException::message() const | - | ||||||||||||||||||||||||
199 | { | - | ||||||||||||||||||||||||
200 | return executed 300 times by 1 test: d->msg;return d->msg; Executed by:
executed 300 times by 1 test: return d->msg; Executed by:
| 300 | ||||||||||||||||||||||||
201 | } | - | ||||||||||||||||||||||||
202 | - | |||||||||||||||||||||||||
203 | - | |||||||||||||||||||||||||
204 | - | |||||||||||||||||||||||||
205 | int QXmlParseException::columnNumber() const | - | ||||||||||||||||||||||||
206 | { | - | ||||||||||||||||||||||||
207 | return executed 300 times by 1 test: d->column;return d->column; Executed by:
executed 300 times by 1 test: return d->column; Executed by:
| 300 | ||||||||||||||||||||||||
208 | } | - | ||||||||||||||||||||||||
209 | - | |||||||||||||||||||||||||
210 | - | |||||||||||||||||||||||||
211 | - | |||||||||||||||||||||||||
212 | int QXmlParseException::lineNumber() const | - | ||||||||||||||||||||||||
213 | { | - | ||||||||||||||||||||||||
214 | return executed 300 times by 1 test: d->line;return d->line; Executed by:
executed 300 times by 1 test: return d->line; Executed by:
| 300 | ||||||||||||||||||||||||
215 | } | - | ||||||||||||||||||||||||
216 | - | |||||||||||||||||||||||||
217 | - | |||||||||||||||||||||||||
218 | - | |||||||||||||||||||||||||
219 | QString QXmlParseException::publicId() const | - | ||||||||||||||||||||||||
220 | { | - | ||||||||||||||||||||||||
221 | return executed 152 times by 1 test: d->pub;return d->pub; Executed by:
executed 152 times by 1 test: return d->pub; Executed by:
| 152 | ||||||||||||||||||||||||
222 | } | - | ||||||||||||||||||||||||
223 | - | |||||||||||||||||||||||||
224 | - | |||||||||||||||||||||||||
225 | - | |||||||||||||||||||||||||
226 | QString QXmlParseException::systemId() const | - | ||||||||||||||||||||||||
227 | { | - | ||||||||||||||||||||||||
228 | return executed 152 times by 1 test: d->sys;return d->sys; Executed by:
executed 152 times by 1 test: return d->sys; Executed by:
| 152 | ||||||||||||||||||||||||
229 | } | - | ||||||||||||||||||||||||
230 | QXmlLocator::QXmlLocator() | - | ||||||||||||||||||||||||
231 | { | - | ||||||||||||||||||||||||
232 | } | - | ||||||||||||||||||||||||
233 | - | |||||||||||||||||||||||||
234 | - | |||||||||||||||||||||||||
235 | - | |||||||||||||||||||||||||
236 | - | |||||||||||||||||||||||||
237 | QXmlLocator::~QXmlLocator() | - | ||||||||||||||||||||||||
238 | { | - | ||||||||||||||||||||||||
239 | } | - | ||||||||||||||||||||||||
240 | class QXmlSimpleReaderLocator : public QXmlLocator | - | ||||||||||||||||||||||||
241 | { | - | ||||||||||||||||||||||||
242 | public: | - | ||||||||||||||||||||||||
243 | QXmlSimpleReaderLocator(QXmlSimpleReader* parent) | - | ||||||||||||||||||||||||
244 | { | - | ||||||||||||||||||||||||
245 | reader = parent; | - | ||||||||||||||||||||||||
246 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
247 | ~QXmlSimpleReaderLocator() | - | ||||||||||||||||||||||||
248 | { | - | ||||||||||||||||||||||||
249 | } | - | ||||||||||||||||||||||||
250 | - | |||||||||||||||||||||||||
251 | int columnNumber() const override | - | ||||||||||||||||||||||||
252 | { | - | ||||||||||||||||||||||||
253 | return executed 2993 times by 5 tests: (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1); Executed by:
executed 2993 times by 5 tests: return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1); Executed by:
| 2993 | ||||||||||||||||||||||||
254 | } | - | ||||||||||||||||||||||||
255 | int lineNumber() const override | - | ||||||||||||||||||||||||
256 | { | - | ||||||||||||||||||||||||
257 | return executed 2993 times by 5 tests: (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1); Executed by:
executed 2993 times by 5 tests: return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1); Executed by:
| 2993 | ||||||||||||||||||||||||
258 | } | - | ||||||||||||||||||||||||
259 | - | |||||||||||||||||||||||||
260 | - | |||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||
262 | private: | - | ||||||||||||||||||||||||
263 | QXmlSimpleReader *reader; | - | ||||||||||||||||||||||||
264 | }; | - | ||||||||||||||||||||||||
265 | - | |||||||||||||||||||||||||
266 | - | |||||||||||||||||||||||||
267 | - | |||||||||||||||||||||||||
268 | - | |||||||||||||||||||||||||
269 | - | |||||||||||||||||||||||||
270 | - | |||||||||||||||||||||||||
271 | - | |||||||||||||||||||||||||
272 | typedef QMap<QString, QString> NamespaceMap; | - | ||||||||||||||||||||||||
273 | - | |||||||||||||||||||||||||
274 | class QXmlNamespaceSupportPrivate | - | ||||||||||||||||||||||||
275 | { | - | ||||||||||||||||||||||||
276 | public: | - | ||||||||||||||||||||||||
277 | QXmlNamespaceSupportPrivate() | - | ||||||||||||||||||||||||
278 | { | - | ||||||||||||||||||||||||
279 | ns.insert(QLatin1String("xml"), QLatin1String("http://www.w3.org/XML/1998/namespace")); | - | ||||||||||||||||||||||||
280 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
281 | - | |||||||||||||||||||||||||
282 | ~QXmlNamespaceSupportPrivate() | - | ||||||||||||||||||||||||
283 | { | - | ||||||||||||||||||||||||
284 | } | - | ||||||||||||||||||||||||
285 | - | |||||||||||||||||||||||||
286 | QStack<NamespaceMap> nsStack; | - | ||||||||||||||||||||||||
287 | NamespaceMap ns; | - | ||||||||||||||||||||||||
288 | }; | - | ||||||||||||||||||||||||
289 | QXmlNamespaceSupport::QXmlNamespaceSupport() | - | ||||||||||||||||||||||||
290 | { | - | ||||||||||||||||||||||||
291 | d = new QXmlNamespaceSupportPrivate; | - | ||||||||||||||||||||||||
292 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
293 | - | |||||||||||||||||||||||||
294 | - | |||||||||||||||||||||||||
295 | - | |||||||||||||||||||||||||
296 | - | |||||||||||||||||||||||||
297 | QXmlNamespaceSupport::~QXmlNamespaceSupport() | - | ||||||||||||||||||||||||
298 | { | - | ||||||||||||||||||||||||
299 | delete d; | - | ||||||||||||||||||||||||
300 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
301 | void QXmlNamespaceSupport::setPrefix(const QString& pre, const QString& uri) | - | ||||||||||||||||||||||||
302 | { | - | ||||||||||||||||||||||||
303 | if(pre.isNull()
| 3-4 | ||||||||||||||||||||||||
304 | d->ns.insert(QLatin1String(""), uri); | - | ||||||||||||||||||||||||
305 | } executed 3 times by 1 test: else {end of block Executed by:
| 3 | ||||||||||||||||||||||||
306 | d->ns.insert(pre, uri); | - | ||||||||||||||||||||||||
307 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||
308 | } | - | ||||||||||||||||||||||||
309 | QString QXmlNamespaceSupport::prefix(const QString& uri) const | - | ||||||||||||||||||||||||
310 | { | - | ||||||||||||||||||||||||
311 | NamespaceMap::const_iterator itc, it = d->ns.constBegin(); | - | ||||||||||||||||||||||||
312 | while ((
| 0 | ||||||||||||||||||||||||
313 | ++it; | - | ||||||||||||||||||||||||
314 | if (*
| 0 | ||||||||||||||||||||||||
315 | return never executed: itc.key();return itc.key(); never executed: return itc.key(); | 0 | ||||||||||||||||||||||||
316 | } never executed: end of block | 0 | ||||||||||||||||||||||||
317 | return never executed: QLatin1String("");return QLatin1String(""); never executed: return QLatin1String(""); | 0 | ||||||||||||||||||||||||
318 | } | - | ||||||||||||||||||||||||
319 | - | |||||||||||||||||||||||||
320 | - | |||||||||||||||||||||||||
321 | - | |||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||
323 | - | |||||||||||||||||||||||||
324 | - | |||||||||||||||||||||||||
325 | QString QXmlNamespaceSupport::uri(const QString& prefix) const | - | ||||||||||||||||||||||||
326 | { | - | ||||||||||||||||||||||||
327 | return executed 27 times by 2 tests: d->ns[prefix];return d->ns[prefix]; Executed by:
executed 27 times by 2 tests: return d->ns[prefix]; Executed by:
| 27 | ||||||||||||||||||||||||
328 | } | - | ||||||||||||||||||||||||
329 | - | |||||||||||||||||||||||||
330 | - | |||||||||||||||||||||||||
331 | - | |||||||||||||||||||||||||
332 | - | |||||||||||||||||||||||||
333 | - | |||||||||||||||||||||||||
334 | - | |||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||
336 | void QXmlNamespaceSupport::splitName(const QString& qname, QString& prefix, | - | ||||||||||||||||||||||||
337 | QString& localname) const | - | ||||||||||||||||||||||||
338 | { | - | ||||||||||||||||||||||||
339 | int pos = qname.indexOf(QLatin1Char(':')); | - | ||||||||||||||||||||||||
340 | if (pos == -1
| 30-11998 | ||||||||||||||||||||||||
341 | pos = qname.size(); executed 11998 times by 3 tests: pos = qname.size(); Executed by:
| 11998 | ||||||||||||||||||||||||
342 | - | |||||||||||||||||||||||||
343 | prefix = qname.left(pos); | - | ||||||||||||||||||||||||
344 | localname = qname.mid(pos+1); | - | ||||||||||||||||||||||||
345 | } executed 12028 times by 3 tests: end of block Executed by:
| 12028 | ||||||||||||||||||||||||
346 | void QXmlNamespaceSupport::processName(const QString& qname, | - | ||||||||||||||||||||||||
347 | bool isAttribute, | - | ||||||||||||||||||||||||
348 | QString& nsuri, QString& localname) const | - | ||||||||||||||||||||||||
349 | { | - | ||||||||||||||||||||||||
350 | int len = qname.size(); | - | ||||||||||||||||||||||||
351 | const QChar *data = qname.constData(); | - | ||||||||||||||||||||||||
352 | for (int pos = 0; pos < len
| 21219-96470 | ||||||||||||||||||||||||
353 | if (data[pos] == QLatin1Char(':')
| 27-96443 | ||||||||||||||||||||||||
354 | nsuri = uri(qname.left(pos)); | - | ||||||||||||||||||||||||
355 | localname = qname.mid(pos + 1); | - | ||||||||||||||||||||||||
356 | return; executed 27 times by 2 tests: return; Executed by:
| 27 | ||||||||||||||||||||||||
357 | } | - | ||||||||||||||||||||||||
358 | } executed 96443 times by 3 tests: end of block Executed by:
| 96443 | ||||||||||||||||||||||||
359 | - | |||||||||||||||||||||||||
360 | - | |||||||||||||||||||||||||
361 | nsuri.clear(); | - | ||||||||||||||||||||||||
362 | - | |||||||||||||||||||||||||
363 | if (!isAttribute
| 0-11995 | ||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||
365 | - | |||||||||||||||||||||||||
366 | - | |||||||||||||||||||||||||
367 | - | |||||||||||||||||||||||||
368 | - | |||||||||||||||||||||||||
369 | NamespaceMap::const_iterator first = d->ns.constBegin(); | - | ||||||||||||||||||||||||
370 | if (first.key().isEmpty()
| 21-9203 | ||||||||||||||||||||||||
371 | nsuri = first.value(); executed 21 times by 1 test: nsuri = first.value(); Executed by:
| 21 | ||||||||||||||||||||||||
372 | } executed 9224 times by 3 tests: end of block Executed by:
| 9224 | ||||||||||||||||||||||||
373 | localname = qname; | - | ||||||||||||||||||||||||
374 | } executed 21219 times by 3 tests: end of block Executed by:
| 21219 | ||||||||||||||||||||||||
375 | QStringList QXmlNamespaceSupport::prefixes() const | - | ||||||||||||||||||||||||
376 | { | - | ||||||||||||||||||||||||
377 | QStringList list; | - | ||||||||||||||||||||||||
378 | - | |||||||||||||||||||||||||
379 | NamespaceMap::const_iterator itc, it = d->ns.constBegin(); | - | ||||||||||||||||||||||||
380 | while ((
| 434-439 | ||||||||||||||||||||||||
381 | ++it; | - | ||||||||||||||||||||||||
382 | if (!itc.key().isEmpty()
| 1-438 | ||||||||||||||||||||||||
383 | list.append(itc.key()); executed 438 times by 2 tests: list.append(itc.key()); Executed by:
| 438 | ||||||||||||||||||||||||
384 | } executed 439 times by 2 tests: end of block Executed by:
| 439 | ||||||||||||||||||||||||
385 | return executed 434 times by 2 tests: list;return list; Executed by:
executed 434 times by 2 tests: return list; Executed by:
| 434 | ||||||||||||||||||||||||
386 | } | - | ||||||||||||||||||||||||
387 | QStringList QXmlNamespaceSupport::prefixes(const QString& uri) const | - | ||||||||||||||||||||||||
388 | { | - | ||||||||||||||||||||||||
389 | QStringList list; | - | ||||||||||||||||||||||||
390 | - | |||||||||||||||||||||||||
391 | NamespaceMap::const_iterator itc, it = d->ns.constBegin(); | - | ||||||||||||||||||||||||
392 | while ((
| 0 | ||||||||||||||||||||||||
393 | ++it; | - | ||||||||||||||||||||||||
394 | if (*
| 0 | ||||||||||||||||||||||||
395 | list.append(itc.key()); never executed: list.append(itc.key()); | 0 | ||||||||||||||||||||||||
396 | } never executed: end of block | 0 | ||||||||||||||||||||||||
397 | return never executed: list;return list; never executed: return list; | 0 | ||||||||||||||||||||||||
398 | } | - | ||||||||||||||||||||||||
399 | void QXmlNamespaceSupport::pushContext() | - | ||||||||||||||||||||||||
400 | { | - | ||||||||||||||||||||||||
401 | d->nsStack.push(d->ns); | - | ||||||||||||||||||||||||
402 | } executed 4781 times by 3 tests: end of block Executed by:
| 4781 | ||||||||||||||||||||||||
403 | void QXmlNamespaceSupport::popContext() | - | ||||||||||||||||||||||||
404 | { | - | ||||||||||||||||||||||||
405 | d->ns.clear(); | - | ||||||||||||||||||||||||
406 | if(!d->nsStack.isEmpty()
| 0-4705 | ||||||||||||||||||||||||
407 | d->ns = d->nsStack.pop(); executed 4705 times by 3 tests: d->ns = d->nsStack.pop(); Executed by:
| 4705 | ||||||||||||||||||||||||
408 | } executed 4705 times by 3 tests: end of block Executed by:
| 4705 | ||||||||||||||||||||||||
409 | - | |||||||||||||||||||||||||
410 | - | |||||||||||||||||||||||||
411 | - | |||||||||||||||||||||||||
412 | - | |||||||||||||||||||||||||
413 | void QXmlNamespaceSupport::reset() | - | ||||||||||||||||||||||||
414 | { | - | ||||||||||||||||||||||||
415 | QXmlNamespaceSupportPrivate *newD = new QXmlNamespaceSupportPrivate; | - | ||||||||||||||||||||||||
416 | delete d; | - | ||||||||||||||||||||||||
417 | d = newD; | - | ||||||||||||||||||||||||
418 | } never executed: end of block | 0 | ||||||||||||||||||||||||
419 | QXmlAttributes::QXmlAttributes() | - | ||||||||||||||||||||||||
420 | { | - | ||||||||||||||||||||||||
421 | - | |||||||||||||||||||||||||
422 | - | |||||||||||||||||||||||||
423 | (void)d;; | - | ||||||||||||||||||||||||
424 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
425 | - | |||||||||||||||||||||||||
426 | - | |||||||||||||||||||||||||
427 | - | |||||||||||||||||||||||||
428 | - | |||||||||||||||||||||||||
429 | - | |||||||||||||||||||||||||
430 | - | |||||||||||||||||||||||||
431 | QXmlAttributes::~QXmlAttributes() | - | ||||||||||||||||||||||||
432 | { | - | ||||||||||||||||||||||||
433 | } | - | ||||||||||||||||||||||||
434 | int QXmlAttributes::index(const QString& qName) const | - | ||||||||||||||||||||||||
435 | { | - | ||||||||||||||||||||||||
436 | for (int i = 0; i < attList.size()
| 0 | ||||||||||||||||||||||||
437 | if (attList.at(i).qname == qName
| 0 | ||||||||||||||||||||||||
438 | return never executed: i;return i; never executed: return i; | 0 | ||||||||||||||||||||||||
439 | } never executed: end of block | 0 | ||||||||||||||||||||||||
440 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
441 | } | - | ||||||||||||||||||||||||
442 | - | |||||||||||||||||||||||||
443 | - | |||||||||||||||||||||||||
444 | - | |||||||||||||||||||||||||
445 | int QXmlAttributes::index(QLatin1String qName) const | - | ||||||||||||||||||||||||
446 | { | - | ||||||||||||||||||||||||
447 | for (int i = 0; i < attList.size()
| 2589-11810 | ||||||||||||||||||||||||
448 | if (attList.at(i).qname == qName
| 24-11786 | ||||||||||||||||||||||||
449 | return executed 24 times by 1 test: i;return i; Executed by:
executed 24 times by 1 test: return i; Executed by:
| 24 | ||||||||||||||||||||||||
450 | } executed 11786 times by 1 test: end of block Executed by:
| 11786 | ||||||||||||||||||||||||
451 | return executed 2589 times by 1 test: -1;return -1; Executed by:
executed 2589 times by 1 test: return -1; Executed by:
| 2589 | ||||||||||||||||||||||||
452 | } | - | ||||||||||||||||||||||||
453 | int QXmlAttributes::index(const QString& uri, const QString& localPart) const | - | ||||||||||||||||||||||||
454 | { | - | ||||||||||||||||||||||||
455 | for (int i = 0; i < attList.size()
| 5843-51512 | ||||||||||||||||||||||||
456 | const Attribute &att = attList.at(i); | - | ||||||||||||||||||||||||
457 | if (att.uri == uri
| 0-51512 | ||||||||||||||||||||||||
458 | return executed 8130 times by 1 test: i;return i; Executed by:
executed 8130 times by 1 test: return i; Executed by:
| 8130 | ||||||||||||||||||||||||
459 | } executed 43382 times by 1 test: end of block Executed by:
| 43382 | ||||||||||||||||||||||||
460 | return executed 5843 times by 1 test: -1;return -1; Executed by:
executed 5843 times by 1 test: return -1; Executed by:
| 5843 | ||||||||||||||||||||||||
461 | } | - | ||||||||||||||||||||||||
462 | - | |||||||||||||||||||||||||
463 | - | |||||||||||||||||||||||||
464 | - | |||||||||||||||||||||||||
465 | - | |||||||||||||||||||||||||
466 | - | |||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||
468 | int QXmlAttributes::length() const | - | ||||||||||||||||||||||||
469 | { | - | ||||||||||||||||||||||||
470 | return executed 4017 times by 5 tests: attList.count();return attList.count(); Executed by:
executed 4017 times by 5 tests: return attList.count(); Executed by:
| 4017 | ||||||||||||||||||||||||
471 | } | - | ||||||||||||||||||||||||
472 | QString QXmlAttributes::localName(int index) const | - | ||||||||||||||||||||||||
473 | { | - | ||||||||||||||||||||||||
474 | return executed 407 times by 1 test: attList.at(index).localname;return attList.at(index).localname; Executed by:
executed 407 times by 1 test: return attList.at(index).localname; Executed by:
| 407 | ||||||||||||||||||||||||
475 | } | - | ||||||||||||||||||||||||
476 | - | |||||||||||||||||||||||||
477 | - | |||||||||||||||||||||||||
478 | - | |||||||||||||||||||||||||
479 | - | |||||||||||||||||||||||||
480 | - | |||||||||||||||||||||||||
481 | - | |||||||||||||||||||||||||
482 | - | |||||||||||||||||||||||||
483 | QString QXmlAttributes::qName(int index) const | - | ||||||||||||||||||||||||
484 | { | - | ||||||||||||||||||||||||
485 | return executed 1275 times by 4 tests: attList.at(index).qname;return attList.at(index).qname; Executed by:
executed 1275 times by 4 tests: return attList.at(index).qname; Executed by:
| 1275 | ||||||||||||||||||||||||
486 | } | - | ||||||||||||||||||||||||
487 | QString QXmlAttributes::uri(int index) const | - | ||||||||||||||||||||||||
488 | { | - | ||||||||||||||||||||||||
489 | return executed 409 times by 1 test: attList.at(index).uri;return attList.at(index).uri; Executed by:
executed 409 times by 1 test: return attList.at(index).uri; Executed by:
| 409 | ||||||||||||||||||||||||
490 | } | - | ||||||||||||||||||||||||
491 | - | |||||||||||||||||||||||||
492 | - | |||||||||||||||||||||||||
493 | - | |||||||||||||||||||||||||
494 | - | |||||||||||||||||||||||||
495 | - | |||||||||||||||||||||||||
496 | - | |||||||||||||||||||||||||
497 | - | |||||||||||||||||||||||||
498 | QString QXmlAttributes::type(int) const | - | ||||||||||||||||||||||||
499 | { | - | ||||||||||||||||||||||||
500 | return executed 407 times by 1 test: QLatin1String("CDATA");return QLatin1String("CDATA"); Executed by:
executed 407 times by 1 test: return QLatin1String("CDATA"); Executed by:
| 407 | ||||||||||||||||||||||||
501 | } | - | ||||||||||||||||||||||||
502 | QString QXmlAttributes::type(const QString&) const | - | ||||||||||||||||||||||||
503 | { | - | ||||||||||||||||||||||||
504 | return never executed: QLatin1String("CDATA");return QLatin1String("CDATA"); never executed: return QLatin1String("CDATA"); | 0 | ||||||||||||||||||||||||
505 | } | - | ||||||||||||||||||||||||
506 | QString QXmlAttributes::type(const QString&, const QString&) const | - | ||||||||||||||||||||||||
507 | { | - | ||||||||||||||||||||||||
508 | return never executed: QLatin1String("CDATA");return QLatin1String("CDATA"); never executed: return QLatin1String("CDATA"); | 0 | ||||||||||||||||||||||||
509 | } | - | ||||||||||||||||||||||||
510 | - | |||||||||||||||||||||||||
511 | - | |||||||||||||||||||||||||
512 | - | |||||||||||||||||||||||||
513 | - | |||||||||||||||||||||||||
514 | - | |||||||||||||||||||||||||
515 | - | |||||||||||||||||||||||||
516 | QString QXmlAttributes::value(int index) const | - | ||||||||||||||||||||||||
517 | { | - | ||||||||||||||||||||||||
518 | return executed 1287 times by 5 tests: attList.at(index).value;return attList.at(index).value; Executed by:
executed 1287 times by 5 tests: return attList.at(index).value; Executed by:
| 1287 | ||||||||||||||||||||||||
519 | } | - | ||||||||||||||||||||||||
520 | QString QXmlAttributes::value(const QString& qName) const | - | ||||||||||||||||||||||||
521 | { | - | ||||||||||||||||||||||||
522 | int i = index(qName); | - | ||||||||||||||||||||||||
523 | if (i == -1
| 0 | ||||||||||||||||||||||||
524 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||||||||||||||||||||
525 | return never executed: attList.at(i).value;return attList.at(i).value; never executed: return attList.at(i).value; | 0 | ||||||||||||||||||||||||
526 | } | - | ||||||||||||||||||||||||
527 | QString QXmlAttributes::value(QLatin1String qName) const | - | ||||||||||||||||||||||||
528 | { | - | ||||||||||||||||||||||||
529 | int i = index(qName); | - | ||||||||||||||||||||||||
530 | if (i == -1
| 0 | ||||||||||||||||||||||||
531 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||||||||||||||||||||
532 | return never executed: attList.at(i).value;return attList.at(i).value; never executed: return attList.at(i).value; | 0 | ||||||||||||||||||||||||
533 | } | - | ||||||||||||||||||||||||
534 | QString QXmlAttributes::value(const QString& uri, const QString& localName) const | - | ||||||||||||||||||||||||
535 | { | - | ||||||||||||||||||||||||
536 | int i = index(uri, localName); | - | ||||||||||||||||||||||||
537 | if (i == -1
| 4320-7751 | ||||||||||||||||||||||||
538 | return executed 4320 times by 1 test: QString();return QString(); Executed by:
executed 4320 times by 1 test: return QString(); Executed by:
| 4320 | ||||||||||||||||||||||||
539 | return executed 7751 times by 1 test: attList.at(i).value;return attList.at(i).value; Executed by:
executed 7751 times by 1 test: return attList.at(i).value; Executed by:
| 7751 | ||||||||||||||||||||||||
540 | } | - | ||||||||||||||||||||||||
541 | - | |||||||||||||||||||||||||
542 | - | |||||||||||||||||||||||||
543 | - | |||||||||||||||||||||||||
544 | - | |||||||||||||||||||||||||
545 | - | |||||||||||||||||||||||||
546 | - | |||||||||||||||||||||||||
547 | void QXmlAttributes::clear() | - | ||||||||||||||||||||||||
548 | { | - | ||||||||||||||||||||||||
549 | attList.clear(); | - | ||||||||||||||||||||||||
550 | } executed 5802 times by 6 tests: end of block Executed by:
| 5802 | ||||||||||||||||||||||||
551 | void QXmlAttributes::append(const QString &qName, const QString &uri, const QString &localPart, const QString &value) | - | ||||||||||||||||||||||||
552 | { | - | ||||||||||||||||||||||||
553 | Attribute att; | - | ||||||||||||||||||||||||
554 | att.qname = qName; | - | ||||||||||||||||||||||||
555 | att.uri = uri; | - | ||||||||||||||||||||||||
556 | att.localname = localPart; | - | ||||||||||||||||||||||||
557 | att.value = value; | - | ||||||||||||||||||||||||
558 | - | |||||||||||||||||||||||||
559 | attList.append(att); | - | ||||||||||||||||||||||||
560 | } executed 12887 times by 6 tests: end of block Executed by:
| 12887 | ||||||||||||||||||||||||
561 | const ushort QXmlInputSource::EndOfData = 0xfffe; | - | ||||||||||||||||||||||||
562 | const ushort QXmlInputSource::EndOfDocument = 0xffff; | - | ||||||||||||||||||||||||
563 | - | |||||||||||||||||||||||||
564 | - | |||||||||||||||||||||||||
565 | - | |||||||||||||||||||||||||
566 | - | |||||||||||||||||||||||||
567 | void QXmlInputSource::init() | - | ||||||||||||||||||||||||
568 | { | - | ||||||||||||||||||||||||
569 | d = new QXmlInputSourcePrivate; | - | ||||||||||||||||||||||||
570 | - | |||||||||||||||||||||||||
571 | if (true) { | - | ||||||||||||||||||||||||
572 | d->inputDevice = 0; | - | ||||||||||||||||||||||||
573 | d->inputStream = 0; | - | ||||||||||||||||||||||||
574 | - | |||||||||||||||||||||||||
575 | setData(QString()); | - | ||||||||||||||||||||||||
576 | - | |||||||||||||||||||||||||
577 | d->encMapper = 0; | - | ||||||||||||||||||||||||
578 | - | |||||||||||||||||||||||||
579 | d->nextReturnedEndOfData = true; | - | ||||||||||||||||||||||||
580 | - | |||||||||||||||||||||||||
581 | d->encodingDeclBytes.clear(); | - | ||||||||||||||||||||||||
582 | d->encodingDeclChars.clear(); | - | ||||||||||||||||||||||||
583 | d->lookingForEncodingDecl = true; | - | ||||||||||||||||||||||||
584 | } executed 2106 times by 6 tests: else {end of block Executed by:
dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
585 | delete(d); dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
586 | qt_noop(); dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
587 | } dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
588 | } | - | ||||||||||||||||||||||||
589 | - | |||||||||||||||||||||||||
590 | - | |||||||||||||||||||||||||
591 | - | |||||||||||||||||||||||||
592 | - | |||||||||||||||||||||||||
593 | - | |||||||||||||||||||||||||
594 | - | |||||||||||||||||||||||||
595 | QXmlInputSource::QXmlInputSource() | - | ||||||||||||||||||||||||
596 | { | - | ||||||||||||||||||||||||
597 | init(); | - | ||||||||||||||||||||||||
598 | } executed 1734 times by 5 tests: end of block Executed by:
| 1734 | ||||||||||||||||||||||||
599 | QXmlInputSource::QXmlInputSource(QIODevice *dev) | - | ||||||||||||||||||||||||
600 | { | - | ||||||||||||||||||||||||
601 | init(); | - | ||||||||||||||||||||||||
602 | d->inputDevice = dev; | - | ||||||||||||||||||||||||
603 | if (dev->isOpen()
| 9-363 | ||||||||||||||||||||||||
604 | d->inputDevice->setTextModeEnabled(false); executed 363 times by 2 tests: d->inputDevice->setTextModeEnabled(false); Executed by:
| 363 | ||||||||||||||||||||||||
605 | } executed 372 times by 3 tests: end of block Executed by:
| 372 | ||||||||||||||||||||||||
606 | - | |||||||||||||||||||||||||
607 | - | |||||||||||||||||||||||||
608 | - | |||||||||||||||||||||||||
609 | - | |||||||||||||||||||||||||
610 | QXmlInputSource::~QXmlInputSource() | - | ||||||||||||||||||||||||
611 | { | - | ||||||||||||||||||||||||
612 | - | |||||||||||||||||||||||||
613 | - | |||||||||||||||||||||||||
614 | delete d->encMapper; | - | ||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||
616 | delete d; | - | ||||||||||||||||||||||||
617 | } executed 2106 times by 6 tests: end of block Executed by:
| 2106 | ||||||||||||||||||||||||
618 | QChar QXmlInputSource::next() | - | ||||||||||||||||||||||||
619 | { | - | ||||||||||||||||||||||||
620 | if (d->pos >= d->length
| 48748-744723 | ||||||||||||||||||||||||
621 | if (d->nextReturnedEndOfData
| 2851-45897 | ||||||||||||||||||||||||
622 | d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
623 | fetchData(); | - | ||||||||||||||||||||||||
624 | if (d->pos >= d->length
| 890-1961 | ||||||||||||||||||||||||
625 | return executed 1961 times by 6 tests: EndOfDocument;return EndOfDocument; Executed by:
executed 1961 times by 6 tests: return EndOfDocument; Executed by:
| 1961 | ||||||||||||||||||||||||
626 | } | - | ||||||||||||||||||||||||
627 | return executed 890 times by 3 tests: next();return next(); Executed by:
executed 890 times by 3 tests: return next(); Executed by:
| 890 | ||||||||||||||||||||||||
628 | } | - | ||||||||||||||||||||||||
629 | d->nextReturnedEndOfData = true; | - | ||||||||||||||||||||||||
630 | return executed 45897 times by 6 tests: EndOfData;return EndOfData; Executed by:
executed 45897 times by 6 tests: return EndOfData; Executed by:
| 45897 | ||||||||||||||||||||||||
631 | } | - | ||||||||||||||||||||||||
632 | - | |||||||||||||||||||||||||
633 | - | |||||||||||||||||||||||||
634 | - | |||||||||||||||||||||||||
635 | - | |||||||||||||||||||||||||
636 | QChar c = d->unicode[d->pos++]; | - | ||||||||||||||||||||||||
637 | if (c.unicode() == EndOfData
| 1-744722 | ||||||||||||||||||||||||
638 | c = EndOfDocument; executed 1 time by 1 test: c = EndOfDocument; Executed by:
| 1 | ||||||||||||||||||||||||
639 | return executed 744723 times by 6 tests: c;return c; Executed by:
executed 744723 times by 6 tests: return c; Executed by:
| 744723 | ||||||||||||||||||||||||
640 | } | - | ||||||||||||||||||||||||
641 | void QXmlInputSource::reset() | - | ||||||||||||||||||||||||
642 | { | - | ||||||||||||||||||||||||
643 | d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
644 | d->pos = 0; | - | ||||||||||||||||||||||||
645 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||
646 | - | |||||||||||||||||||||||||
647 | - | |||||||||||||||||||||||||
648 | - | |||||||||||||||||||||||||
649 | - | |||||||||||||||||||||||||
650 | - | |||||||||||||||||||||||||
651 | - | |||||||||||||||||||||||||
652 | - | |||||||||||||||||||||||||
653 | QString QXmlInputSource::data() const | - | ||||||||||||||||||||||||
654 | { | - | ||||||||||||||||||||||||
655 | if (d->nextReturnedEndOfData
| 0-4 | ||||||||||||||||||||||||
656 | QXmlInputSource *that = const_cast<QXmlInputSource*>(this); | - | ||||||||||||||||||||||||
657 | that->d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
658 | that->fetchData(); | - | ||||||||||||||||||||||||
659 | } never executed: end of block | 0 | ||||||||||||||||||||||||
660 | return executed 4 times by 1 test: d->str;return d->str; Executed by:
executed 4 times by 1 test: return d->str; Executed by:
| 4 | ||||||||||||||||||||||||
661 | } | - | ||||||||||||||||||||||||
662 | void QXmlInputSource::setData(const QString& dat) | - | ||||||||||||||||||||||||
663 | { | - | ||||||||||||||||||||||||
664 | d->str = dat; | - | ||||||||||||||||||||||||
665 | d->unicode = dat.unicode(); | - | ||||||||||||||||||||||||
666 | d->pos = 0; | - | ||||||||||||||||||||||||
667 | d->length = d->str.length(); | - | ||||||||||||||||||||||||
668 | d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
669 | } executed 48375 times by 6 tests: end of block Executed by:
| 48375 | ||||||||||||||||||||||||
670 | - | |||||||||||||||||||||||||
671 | - | |||||||||||||||||||||||||
672 | - | |||||||||||||||||||||||||
673 | - | |||||||||||||||||||||||||
674 | - | |||||||||||||||||||||||||
675 | - | |||||||||||||||||||||||||
676 | - | |||||||||||||||||||||||||
677 | void QXmlInputSource::setData(const QByteArray& dat) | - | ||||||||||||||||||||||||
678 | { | - | ||||||||||||||||||||||||
679 | setData(fromRawData(dat)); | - | ||||||||||||||||||||||||
680 | } executed 44908 times by 1 test: end of block Executed by:
| 44908 | ||||||||||||||||||||||||
681 | void QXmlInputSource::fetchData() | - | ||||||||||||||||||||||||
682 | { | - | ||||||||||||||||||||||||
683 | enum | - | ||||||||||||||||||||||||
684 | { | - | ||||||||||||||||||||||||
685 | BufferSize = 1024 | - | ||||||||||||||||||||||||
686 | }; | - | ||||||||||||||||||||||||
687 | - | |||||||||||||||||||||||||
688 | QByteArray rawData; | - | ||||||||||||||||||||||||
689 | - | |||||||||||||||||||||||||
690 | if (d->inputDevice
| 0-1734 | ||||||||||||||||||||||||
691 | QIODevice *device = d->inputDevice
| 0-1117 | ||||||||||||||||||||||||
692 | - | |||||||||||||||||||||||||
693 | if (!device
| 0-1117 | ||||||||||||||||||||||||
694 | if (d->inputStream
| 0 | ||||||||||||||||||||||||
695 | QString *s = d->inputStream->string(); | - | ||||||||||||||||||||||||
696 | rawData = QByteArray((const char *) s->constData(), s->size() * sizeof(QChar)); | - | ||||||||||||||||||||||||
697 | } never executed: end of block | 0 | ||||||||||||||||||||||||
698 | } never executed: else if (device->isOpen()end of block
| 0-1108 | ||||||||||||||||||||||||
699 | rawData.resize(BufferSize); | - | ||||||||||||||||||||||||
700 | qint64 size = device->read(rawData.data(), BufferSize); | - | ||||||||||||||||||||||||
701 | - | |||||||||||||||||||||||||
702 | if (size != -1
| 0-1117 | ||||||||||||||||||||||||
703 | - | |||||||||||||||||||||||||
704 | while (size < 4
| 235-890 | ||||||||||||||||||||||||
705 | if (!device->waitForReadyRead(-1)
| 8-227 | ||||||||||||||||||||||||
706 | break; executed 227 times by 3 tests: break; Executed by:
| 227 | ||||||||||||||||||||||||
707 | int ret = device->read(rawData.data() + size, BufferSize - size); | - | ||||||||||||||||||||||||
708 | if (ret <= 0
| 0-8 | ||||||||||||||||||||||||
709 | break; never executed: break; | 0 | ||||||||||||||||||||||||
710 | size += ret; | - | ||||||||||||||||||||||||
711 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
712 | } executed 1117 times by 3 tests: end of block Executed by:
| 1117 | ||||||||||||||||||||||||
713 | - | |||||||||||||||||||||||||
714 | rawData.resize(qMax(qint64(0), size)); | - | ||||||||||||||||||||||||
715 | } executed 1117 times by 3 tests: end of block Executed by:
| 1117 | ||||||||||||||||||||||||
716 | - | |||||||||||||||||||||||||
717 | - | |||||||||||||||||||||||||
718 | - | |||||||||||||||||||||||||
719 | - | |||||||||||||||||||||||||
720 | - | |||||||||||||||||||||||||
721 | setData(fromRawData(rawData)); | - | ||||||||||||||||||||||||
722 | } executed 1117 times by 3 tests: end of block Executed by:
| 1117 | ||||||||||||||||||||||||
723 | } executed 2851 times by 6 tests: end of block Executed by:
| 2851 | ||||||||||||||||||||||||
724 | - | |||||||||||||||||||||||||
725 | - | |||||||||||||||||||||||||
726 | static QString extractEncodingDecl(const QString &text, bool *needMoreText) | - | ||||||||||||||||||||||||
727 | { | - | ||||||||||||||||||||||||
728 | *needMoreText = false; | - | ||||||||||||||||||||||||
729 | - | |||||||||||||||||||||||||
730 | int l = text.length(); | - | ||||||||||||||||||||||||
731 | const QLatin1String snip("<?xml", std::min(l, 5)); | - | ||||||||||||||||||||||||
732 | if (l > 0
| 6-3097 | ||||||||||||||||||||||||
733 | return executed 1742 times by 2 tests: QString();return QString(); Executed by:
executed 1742 times by 2 tests: return QString(); Executed by:
| 1742 | ||||||||||||||||||||||||
734 | - | |||||||||||||||||||||||||
735 | int endPos = text.indexOf(QLatin1Char('>')); | - | ||||||||||||||||||||||||
736 | if (endPos == -1
| 119-1242 | ||||||||||||||||||||||||
737 | *needMoreText = l < 255; | - | ||||||||||||||||||||||||
738 | return executed 1242 times by 1 test: QString();return QString(); Executed by:
executed 1242 times by 1 test: return QString(); Executed by:
| 1242 | ||||||||||||||||||||||||
739 | } | - | ||||||||||||||||||||||||
740 | - | |||||||||||||||||||||||||
741 | int pos = text.indexOf(QLatin1String("encoding")); | - | ||||||||||||||||||||||||
742 | if (pos == -1
| 0-67 | ||||||||||||||||||||||||
743 | return executed 52 times by 1 test: QString();return QString(); Executed by:
executed 52 times by 1 test: return QString(); Executed by:
| 52 | ||||||||||||||||||||||||
744 | - | |||||||||||||||||||||||||
745 | while (pos < endPos
| 0-670 | ||||||||||||||||||||||||
746 | ushort uc = text.at(pos).unicode(); | - | ||||||||||||||||||||||||
747 | if (uc == '\''
| 0-670 | ||||||||||||||||||||||||
748 | break; executed 67 times by 2 tests: break; Executed by:
| 67 | ||||||||||||||||||||||||
749 | ++pos; | - | ||||||||||||||||||||||||
750 | } executed 603 times by 2 tests: end of block Executed by:
| 603 | ||||||||||||||||||||||||
751 | - | |||||||||||||||||||||||||
752 | if (pos == endPos
| 0-67 | ||||||||||||||||||||||||
753 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||||||||||||||||||||
754 | - | |||||||||||||||||||||||||
755 | QString encoding; | - | ||||||||||||||||||||||||
756 | ++pos; | - | ||||||||||||||||||||||||
757 | while (pos < endPos
| 0-404 | ||||||||||||||||||||||||
758 | ushort uc = text.at(pos).unicode(); | - | ||||||||||||||||||||||||
759 | if (uc == '\''
| 0-404 | ||||||||||||||||||||||||
760 | break; executed 67 times by 2 tests: break; Executed by:
| 67 | ||||||||||||||||||||||||
761 | encoding.append(uc); | - | ||||||||||||||||||||||||
762 | ++pos; | - | ||||||||||||||||||||||||
763 | } executed 337 times by 2 tests: end of block Executed by:
| 337 | ||||||||||||||||||||||||
764 | - | |||||||||||||||||||||||||
765 | return executed 67 times by 2 tests: encoding;return encoding; Executed by:
executed 67 times by 2 tests: return encoding; Executed by:
| 67 | ||||||||||||||||||||||||
766 | } | - | ||||||||||||||||||||||||
767 | QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning) | - | ||||||||||||||||||||||||
768 | { | - | ||||||||||||||||||||||||
769 | - | |||||||||||||||||||||||||
770 | - | |||||||||||||||||||||||||
771 | - | |||||||||||||||||||||||||
772 | - | |||||||||||||||||||||||||
773 | if (data.size() == 0
| 227-45798 | ||||||||||||||||||||||||
774 | return executed 227 times by 3 tests: QString();return QString(); Executed by:
executed 227 times by 3 tests: return QString(); Executed by:
| 227 | ||||||||||||||||||||||||
775 | if (beginning
| 0-45798 | ||||||||||||||||||||||||
776 | delete d->encMapper; | - | ||||||||||||||||||||||||
777 | d->encMapper = 0; | - | ||||||||||||||||||||||||
778 | } never executed: end of block | 0 | ||||||||||||||||||||||||
779 | - | |||||||||||||||||||||||||
780 | int mib = 106; | - | ||||||||||||||||||||||||
781 | - | |||||||||||||||||||||||||
782 | - | |||||||||||||||||||||||||
783 | if (d->encMapper == 0
| 1861-43937 | ||||||||||||||||||||||||
784 | d->encodingDeclBytes.clear(); | - | ||||||||||||||||||||||||
785 | d->encodingDeclChars.clear(); | - | ||||||||||||||||||||||||
786 | d->lookingForEncodingDecl = true; | - | ||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||
788 | - | |||||||||||||||||||||||||
789 | if (data.size() >= 4
| 494-1367 | ||||||||||||||||||||||||
790 | uchar ch1 = data.at(0); | - | ||||||||||||||||||||||||
791 | uchar ch2 = data.at(1); | - | ||||||||||||||||||||||||
792 | uchar ch3 = data.at(2); | - | ||||||||||||||||||||||||
793 | uchar ch4 = data.at(3); | - | ||||||||||||||||||||||||
794 | - | |||||||||||||||||||||||||
795 | if ((ch1 == 0
| 0-1367 | ||||||||||||||||||||||||
796 | (ch1 == 0xff
| 0-1345 | ||||||||||||||||||||||||
797 | mib = 1017; never executed: mib = 1017; | 0 | ||||||||||||||||||||||||
798 | else if (ch1 == 0x3c
| 0-1343 | ||||||||||||||||||||||||
799 | mib = 1019; never executed: mib = 1019; | 0 | ||||||||||||||||||||||||
800 | else if (ch1 == 0x00
| 0-1367 | ||||||||||||||||||||||||
801 | mib = 1018; never executed: mib = 1018; | 0 | ||||||||||||||||||||||||
802 | } executed 1367 times by 3 tests: end of block Executed by:
| 1367 | ||||||||||||||||||||||||
803 | if (mib == 106
| 0-1861 | ||||||||||||||||||||||||
804 | uchar ch1 = data.at(0); | - | ||||||||||||||||||||||||
805 | uchar ch2 = data.at(1); | - | ||||||||||||||||||||||||
806 | - | |||||||||||||||||||||||||
807 | if ((ch1 == 0xfe
| 0-1698 | ||||||||||||||||||||||||
808 | mib = 1015; executed 29 times by 1 test: mib = 1015; Executed by:
| 29 | ||||||||||||||||||||||||
809 | else if (ch1 == 0x3c
| 1-1669 | ||||||||||||||||||||||||
810 | mib = 1014; executed 1 time by 1 test: mib = 1014; Executed by:
| 1 | ||||||||||||||||||||||||
811 | else if (ch1 == 0x00
| 0-1669 | ||||||||||||||||||||||||
812 | mib = 1013; never executed: mib = 1013; | 0 | ||||||||||||||||||||||||
813 | } executed 1699 times by 3 tests: end of block Executed by:
| 1699 | ||||||||||||||||||||||||
814 | - | |||||||||||||||||||||||||
815 | QTextCodec *codec = QTextCodec::codecForMib(mib); | - | ||||||||||||||||||||||||
816 | ((!(codec)) ? qt_assert("codec",__FILE__,1396) : qt_noop()); | - | ||||||||||||||||||||||||
817 | - | |||||||||||||||||||||||||
818 | d->encMapper = codec->makeDecoder(); | - | ||||||||||||||||||||||||
819 | } executed 1861 times by 3 tests: end of block Executed by:
| 1861 | ||||||||||||||||||||||||
820 | - | |||||||||||||||||||||||||
821 | QString input = d->encMapper->toUnicode(data.constData(), data.size()); | - | ||||||||||||||||||||||||
822 | - | |||||||||||||||||||||||||
823 | if (d->lookingForEncodingDecl
| 3103-42695 | ||||||||||||||||||||||||
824 | d->encodingDeclChars += input; | - | ||||||||||||||||||||||||
825 | - | |||||||||||||||||||||||||
826 | bool needMoreText; | - | ||||||||||||||||||||||||
827 | QString encoding = extractEncodingDecl(d->encodingDeclChars, &needMoreText); | - | ||||||||||||||||||||||||
828 | - | |||||||||||||||||||||||||
829 | if (!encoding.isEmpty()
| 67-3036 | ||||||||||||||||||||||||
830 | if (QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1())
| 0-67 | ||||||||||||||||||||||||
831 | - | |||||||||||||||||||||||||
832 | if(codec->mibEnum() != mib
| 1-66 | ||||||||||||||||||||||||
833 | delete d->encMapper; | - | ||||||||||||||||||||||||
834 | d->encMapper = codec->makeDecoder(); | - | ||||||||||||||||||||||||
835 | - | |||||||||||||||||||||||||
836 | - | |||||||||||||||||||||||||
837 | - | |||||||||||||||||||||||||
838 | - | |||||||||||||||||||||||||
839 | input.clear(); | - | ||||||||||||||||||||||||
840 | - | |||||||||||||||||||||||||
841 | - | |||||||||||||||||||||||||
842 | d->encMapper->toUnicode(d->encodingDeclBytes.constData(), d->encodingDeclBytes.size()); | - | ||||||||||||||||||||||||
843 | - | |||||||||||||||||||||||||
844 | input = d->encMapper->toUnicode(data.constData(), data.size()); | - | ||||||||||||||||||||||||
845 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||
846 | } executed 67 times by 2 tests: end of block Executed by:
| 67 | ||||||||||||||||||||||||
847 | } executed 67 times by 2 tests: end of block Executed by:
| 67 | ||||||||||||||||||||||||
848 | - | |||||||||||||||||||||||||
849 | d->encodingDeclBytes += data; | - | ||||||||||||||||||||||||
850 | d->lookingForEncodingDecl = needMoreText; | - | ||||||||||||||||||||||||
851 | } executed 3103 times by 3 tests: end of block Executed by:
| 3103 | ||||||||||||||||||||||||
852 | - | |||||||||||||||||||||||||
853 | return executed 45798 times by 3 tests: input;return input; Executed by:
executed 45798 times by 3 tests: return input; Executed by:
| 45798 | ||||||||||||||||||||||||
854 | - | |||||||||||||||||||||||||
855 | } | - | ||||||||||||||||||||||||
856 | QXmlDefaultHandler::QXmlDefaultHandler() | - | ||||||||||||||||||||||||
857 | { | - | ||||||||||||||||||||||||
858 | - | |||||||||||||||||||||||||
859 | - | |||||||||||||||||||||||||
860 | (void)d;; | - | ||||||||||||||||||||||||
861 | } executed 2103 times by 6 tests: end of block Executed by:
| 2103 | ||||||||||||||||||||||||
862 | - | |||||||||||||||||||||||||
863 | - | |||||||||||||||||||||||||
864 | - | |||||||||||||||||||||||||
865 | - | |||||||||||||||||||||||||
866 | - | |||||||||||||||||||||||||
867 | - | |||||||||||||||||||||||||
868 | QXmlDefaultHandler::~QXmlDefaultHandler() | - | ||||||||||||||||||||||||
869 | { | - | ||||||||||||||||||||||||
870 | } | - | ||||||||||||||||||||||||
871 | - | |||||||||||||||||||||||||
872 | - | |||||||||||||||||||||||||
873 | - | |||||||||||||||||||||||||
874 | - | |||||||||||||||||||||||||
875 | - | |||||||||||||||||||||||||
876 | - | |||||||||||||||||||||||||
877 | void QXmlDefaultHandler::setDocumentLocator(QXmlLocator*) | - | ||||||||||||||||||||||||
878 | { | - | ||||||||||||||||||||||||
879 | } | - | ||||||||||||||||||||||||
880 | - | |||||||||||||||||||||||||
881 | - | |||||||||||||||||||||||||
882 | - | |||||||||||||||||||||||||
883 | - | |||||||||||||||||||||||||
884 | - | |||||||||||||||||||||||||
885 | - | |||||||||||||||||||||||||
886 | bool QXmlDefaultHandler::startDocument() | - | ||||||||||||||||||||||||
887 | { | - | ||||||||||||||||||||||||
888 | return executed 255 times by 6 tests: true;return true; Executed by:
executed 255 times by 6 tests: return true; Executed by:
| 255 | ||||||||||||||||||||||||
889 | } | - | ||||||||||||||||||||||||
890 | - | |||||||||||||||||||||||||
891 | - | |||||||||||||||||||||||||
892 | - | |||||||||||||||||||||||||
893 | - | |||||||||||||||||||||||||
894 | - | |||||||||||||||||||||||||
895 | - | |||||||||||||||||||||||||
896 | bool QXmlDefaultHandler::endDocument() | - | ||||||||||||||||||||||||
897 | { | - | ||||||||||||||||||||||||
898 | return executed 11 times by 3 tests: true;return true; Executed by:
executed 11 times by 3 tests: return true; Executed by:
| 11 | ||||||||||||||||||||||||
899 | } | - | ||||||||||||||||||||||||
900 | - | |||||||||||||||||||||||||
901 | - | |||||||||||||||||||||||||
902 | - | |||||||||||||||||||||||||
903 | - | |||||||||||||||||||||||||
904 | - | |||||||||||||||||||||||||
905 | - | |||||||||||||||||||||||||
906 | bool QXmlDefaultHandler::startPrefixMapping(const QString&, const QString&) | - | ||||||||||||||||||||||||
907 | { | - | ||||||||||||||||||||||||
908 | return executed 5 times by 1 test: true;return true; Executed by:
executed 5 times by 1 test: return true; Executed by:
| 5 | ||||||||||||||||||||||||
909 | } | - | ||||||||||||||||||||||||
910 | - | |||||||||||||||||||||||||
911 | - | |||||||||||||||||||||||||
912 | - | |||||||||||||||||||||||||
913 | - | |||||||||||||||||||||||||
914 | - | |||||||||||||||||||||||||
915 | - | |||||||||||||||||||||||||
916 | bool QXmlDefaultHandler::endPrefixMapping(const QString&) | - | ||||||||||||||||||||||||
917 | { | - | ||||||||||||||||||||||||
918 | return executed 4 times by 1 test: true;return true; Executed by:
executed 4 times by 1 test: return true; Executed by:
| 4 | ||||||||||||||||||||||||
919 | } | - | ||||||||||||||||||||||||
920 | - | |||||||||||||||||||||||||
921 | - | |||||||||||||||||||||||||
922 | - | |||||||||||||||||||||||||
923 | - | |||||||||||||||||||||||||
924 | - | |||||||||||||||||||||||||
925 | - | |||||||||||||||||||||||||
926 | bool QXmlDefaultHandler::startElement(const QString&, const QString&, | - | ||||||||||||||||||||||||
927 | const QString&, const QXmlAttributes&) | - | ||||||||||||||||||||||||
928 | { | - | ||||||||||||||||||||||||
929 | return executed 206 times by 2 tests: true;return true; Executed by:
executed 206 times by 2 tests: return true; Executed by:
| 206 | ||||||||||||||||||||||||
930 | } | - | ||||||||||||||||||||||||
931 | - | |||||||||||||||||||||||||
932 | - | |||||||||||||||||||||||||
933 | - | |||||||||||||||||||||||||
934 | - | |||||||||||||||||||||||||
935 | - | |||||||||||||||||||||||||
936 | - | |||||||||||||||||||||||||
937 | bool QXmlDefaultHandler::endElement(const QString&, const QString&, | - | ||||||||||||||||||||||||
938 | const QString&) | - | ||||||||||||||||||||||||
939 | { | - | ||||||||||||||||||||||||
940 | return executed 206 times by 2 tests: true;return true; Executed by:
executed 206 times by 2 tests: return true; Executed by:
| 206 | ||||||||||||||||||||||||
941 | } | - | ||||||||||||||||||||||||
942 | - | |||||||||||||||||||||||||
943 | - | |||||||||||||||||||||||||
944 | - | |||||||||||||||||||||||||
945 | - | |||||||||||||||||||||||||
946 | - | |||||||||||||||||||||||||
947 | - | |||||||||||||||||||||||||
948 | bool QXmlDefaultHandler::characters(const QString&) | - | ||||||||||||||||||||||||
949 | { | - | ||||||||||||||||||||||||
950 | return executed 394 times by 1 test: true;return true; Executed by:
executed 394 times by 1 test: return true; Executed by:
| 394 | ||||||||||||||||||||||||
951 | } | - | ||||||||||||||||||||||||
952 | - | |||||||||||||||||||||||||
953 | - | |||||||||||||||||||||||||
954 | - | |||||||||||||||||||||||||
955 | - | |||||||||||||||||||||||||
956 | - | |||||||||||||||||||||||||
957 | - | |||||||||||||||||||||||||
958 | bool QXmlDefaultHandler::ignorableWhitespace(const QString&) | - | ||||||||||||||||||||||||
959 | { | - | ||||||||||||||||||||||||
960 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
961 | } | - | ||||||||||||||||||||||||
962 | - | |||||||||||||||||||||||||
963 | - | |||||||||||||||||||||||||
964 | - | |||||||||||||||||||||||||
965 | - | |||||||||||||||||||||||||
966 | - | |||||||||||||||||||||||||
967 | - | |||||||||||||||||||||||||
968 | bool QXmlDefaultHandler::processingInstruction(const QString&, | - | ||||||||||||||||||||||||
969 | const QString&) | - | ||||||||||||||||||||||||
970 | { | - | ||||||||||||||||||||||||
971 | return executed 6 times by 2 tests: true;return true; Executed by:
executed 6 times by 2 tests: return true; Executed by:
| 6 | ||||||||||||||||||||||||
972 | } | - | ||||||||||||||||||||||||
973 | - | |||||||||||||||||||||||||
974 | - | |||||||||||||||||||||||||
975 | - | |||||||||||||||||||||||||
976 | - | |||||||||||||||||||||||||
977 | - | |||||||||||||||||||||||||
978 | - | |||||||||||||||||||||||||
979 | bool QXmlDefaultHandler::skippedEntity(const QString&) | - | ||||||||||||||||||||||||
980 | { | - | ||||||||||||||||||||||||
981 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
982 | } | - | ||||||||||||||||||||||||
983 | - | |||||||||||||||||||||||||
984 | - | |||||||||||||||||||||||||
985 | - | |||||||||||||||||||||||||
986 | - | |||||||||||||||||||||||||
987 | - | |||||||||||||||||||||||||
988 | - | |||||||||||||||||||||||||
989 | bool QXmlDefaultHandler::warning(const QXmlParseException&) | - | ||||||||||||||||||||||||
990 | { | - | ||||||||||||||||||||||||
991 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
992 | } | - | ||||||||||||||||||||||||
993 | - | |||||||||||||||||||||||||
994 | - | |||||||||||||||||||||||||
995 | - | |||||||||||||||||||||||||
996 | - | |||||||||||||||||||||||||
997 | - | |||||||||||||||||||||||||
998 | - | |||||||||||||||||||||||||
999 | bool QXmlDefaultHandler::error(const QXmlParseException&) | - | ||||||||||||||||||||||||
1000 | { | - | ||||||||||||||||||||||||
1001 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1002 | } | - | ||||||||||||||||||||||||
1003 | - | |||||||||||||||||||||||||
1004 | - | |||||||||||||||||||||||||
1005 | - | |||||||||||||||||||||||||
1006 | - | |||||||||||||||||||||||||
1007 | - | |||||||||||||||||||||||||
1008 | - | |||||||||||||||||||||||||
1009 | bool QXmlDefaultHandler::fatalError(const QXmlParseException&) | - | ||||||||||||||||||||||||
1010 | { | - | ||||||||||||||||||||||||
1011 | return executed 3 times by 1 test: true;return true; Executed by:
executed 3 times by 1 test: return true; Executed by:
| 3 | ||||||||||||||||||||||||
1012 | } | - | ||||||||||||||||||||||||
1013 | - | |||||||||||||||||||||||||
1014 | - | |||||||||||||||||||||||||
1015 | - | |||||||||||||||||||||||||
1016 | - | |||||||||||||||||||||||||
1017 | - | |||||||||||||||||||||||||
1018 | - | |||||||||||||||||||||||||
1019 | bool QXmlDefaultHandler::notationDecl(const QString&, const QString&, | - | ||||||||||||||||||||||||
1020 | const QString&) | - | ||||||||||||||||||||||||
1021 | { | - | ||||||||||||||||||||||||
1022 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1023 | } | - | ||||||||||||||||||||||||
1024 | - | |||||||||||||||||||||||||
1025 | - | |||||||||||||||||||||||||
1026 | - | |||||||||||||||||||||||||
1027 | - | |||||||||||||||||||||||||
1028 | - | |||||||||||||||||||||||||
1029 | - | |||||||||||||||||||||||||
1030 | bool QXmlDefaultHandler::unparsedEntityDecl(const QString&, const QString&, | - | ||||||||||||||||||||||||
1031 | const QString&, const QString&) | - | ||||||||||||||||||||||||
1032 | { | - | ||||||||||||||||||||||||
1033 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1034 | } | - | ||||||||||||||||||||||||
1035 | - | |||||||||||||||||||||||||
1036 | - | |||||||||||||||||||||||||
1037 | - | |||||||||||||||||||||||||
1038 | - | |||||||||||||||||||||||||
1039 | - | |||||||||||||||||||||||||
1040 | - | |||||||||||||||||||||||||
1041 | - | |||||||||||||||||||||||||
1042 | bool QXmlDefaultHandler::resolveEntity(const QString&, const QString&, | - | ||||||||||||||||||||||||
1043 | QXmlInputSource*& ret) | - | ||||||||||||||||||||||||
1044 | { | - | ||||||||||||||||||||||||
1045 | ret = 0; | - | ||||||||||||||||||||||||
1046 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1047 | } | - | ||||||||||||||||||||||||
1048 | - | |||||||||||||||||||||||||
1049 | - | |||||||||||||||||||||||||
1050 | - | |||||||||||||||||||||||||
1051 | - | |||||||||||||||||||||||||
1052 | - | |||||||||||||||||||||||||
1053 | - | |||||||||||||||||||||||||
1054 | QString QXmlDefaultHandler::errorString() const | - | ||||||||||||||||||||||||
1055 | { | - | ||||||||||||||||||||||||
1056 | return never executed: QString::fromLatin1("error triggered by consumer");return QString::fromLatin1("error triggered by consumer"); never executed: return QString::fromLatin1("error triggered by consumer"); | 0 | ||||||||||||||||||||||||
1057 | } | - | ||||||||||||||||||||||||
1058 | - | |||||||||||||||||||||||||
1059 | - | |||||||||||||||||||||||||
1060 | - | |||||||||||||||||||||||||
1061 | - | |||||||||||||||||||||||||
1062 | - | |||||||||||||||||||||||||
1063 | - | |||||||||||||||||||||||||
1064 | bool QXmlDefaultHandler::startDTD(const QString&, const QString&, const QString&) | - | ||||||||||||||||||||||||
1065 | { | - | ||||||||||||||||||||||||
1066 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1067 | } | - | ||||||||||||||||||||||||
1068 | - | |||||||||||||||||||||||||
1069 | - | |||||||||||||||||||||||||
1070 | - | |||||||||||||||||||||||||
1071 | - | |||||||||||||||||||||||||
1072 | - | |||||||||||||||||||||||||
1073 | - | |||||||||||||||||||||||||
1074 | bool QXmlDefaultHandler::endDTD() | - | ||||||||||||||||||||||||
1075 | { | - | ||||||||||||||||||||||||
1076 | return executed 157 times by 2 tests: true;return true; Executed by:
executed 157 times by 2 tests: return true; Executed by:
| 157 | ||||||||||||||||||||||||
1077 | } | - | ||||||||||||||||||||||||
1078 | - | |||||||||||||||||||||||||
1079 | - | |||||||||||||||||||||||||
1080 | - | |||||||||||||||||||||||||
1081 | - | |||||||||||||||||||||||||
1082 | - | |||||||||||||||||||||||||
1083 | - | |||||||||||||||||||||||||
1084 | bool QXmlDefaultHandler::startEntity(const QString&) | - | ||||||||||||||||||||||||
1085 | { | - | ||||||||||||||||||||||||
1086 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1087 | } | - | ||||||||||||||||||||||||
1088 | - | |||||||||||||||||||||||||
1089 | - | |||||||||||||||||||||||||
1090 | - | |||||||||||||||||||||||||
1091 | - | |||||||||||||||||||||||||
1092 | - | |||||||||||||||||||||||||
1093 | - | |||||||||||||||||||||||||
1094 | bool QXmlDefaultHandler::endEntity(const QString&) | - | ||||||||||||||||||||||||
1095 | { | - | ||||||||||||||||||||||||
1096 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1097 | } | - | ||||||||||||||||||||||||
1098 | - | |||||||||||||||||||||||||
1099 | - | |||||||||||||||||||||||||
1100 | - | |||||||||||||||||||||||||
1101 | - | |||||||||||||||||||||||||
1102 | - | |||||||||||||||||||||||||
1103 | - | |||||||||||||||||||||||||
1104 | bool QXmlDefaultHandler::startCDATA() | - | ||||||||||||||||||||||||
1105 | { | - | ||||||||||||||||||||||||
1106 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1107 | } | - | ||||||||||||||||||||||||
1108 | - | |||||||||||||||||||||||||
1109 | - | |||||||||||||||||||||||||
1110 | - | |||||||||||||||||||||||||
1111 | - | |||||||||||||||||||||||||
1112 | - | |||||||||||||||||||||||||
1113 | - | |||||||||||||||||||||||||
1114 | bool QXmlDefaultHandler::endCDATA() | - | ||||||||||||||||||||||||
1115 | { | - | ||||||||||||||||||||||||
1116 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1117 | } | - | ||||||||||||||||||||||||
1118 | - | |||||||||||||||||||||||||
1119 | - | |||||||||||||||||||||||||
1120 | - | |||||||||||||||||||||||||
1121 | - | |||||||||||||||||||||||||
1122 | - | |||||||||||||||||||||||||
1123 | - | |||||||||||||||||||||||||
1124 | bool QXmlDefaultHandler::comment(const QString&) | - | ||||||||||||||||||||||||
1125 | { | - | ||||||||||||||||||||||||
1126 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1127 | } | - | ||||||||||||||||||||||||
1128 | - | |||||||||||||||||||||||||
1129 | - | |||||||||||||||||||||||||
1130 | - | |||||||||||||||||||||||||
1131 | - | |||||||||||||||||||||||||
1132 | - | |||||||||||||||||||||||||
1133 | - | |||||||||||||||||||||||||
1134 | bool QXmlDefaultHandler::attributeDecl(const QString&, const QString&, const QString&, const QString&, const QString&) | - | ||||||||||||||||||||||||
1135 | { | - | ||||||||||||||||||||||||
1136 | return executed 1 time by 1 test: true;return true; Executed by:
executed 1 time by 1 test: return true; Executed by:
| 1 | ||||||||||||||||||||||||
1137 | } | - | ||||||||||||||||||||||||
1138 | - | |||||||||||||||||||||||||
1139 | - | |||||||||||||||||||||||||
1140 | - | |||||||||||||||||||||||||
1141 | - | |||||||||||||||||||||||||
1142 | - | |||||||||||||||||||||||||
1143 | - | |||||||||||||||||||||||||
1144 | bool QXmlDefaultHandler::internalEntityDecl(const QString&, const QString&) | - | ||||||||||||||||||||||||
1145 | { | - | ||||||||||||||||||||||||
1146 | return executed 5 times by 1 test: true;return true; Executed by:
executed 5 times by 1 test: return true; Executed by:
| 5 | ||||||||||||||||||||||||
1147 | } | - | ||||||||||||||||||||||||
1148 | - | |||||||||||||||||||||||||
1149 | - | |||||||||||||||||||||||||
1150 | - | |||||||||||||||||||||||||
1151 | - | |||||||||||||||||||||||||
1152 | - | |||||||||||||||||||||||||
1153 | - | |||||||||||||||||||||||||
1154 | bool QXmlDefaultHandler::externalEntityDecl(const QString&, const QString&, const QString&) | - | ||||||||||||||||||||||||
1155 | { | - | ||||||||||||||||||||||||
1156 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1157 | } | - | ||||||||||||||||||||||||
1158 | inline bool QXmlSimpleReaderPrivate::atEnd() | - | ||||||||||||||||||||||||
1159 | { | - | ||||||||||||||||||||||||
1160 | return executed 1050513 times by 6 tests: (c.unicode()|0x0001) == 0xffff;return (c.unicode()|0x0001) == 0xffff; Executed by:
executed 1050513 times by 6 tests: return (c.unicode()|0x0001) == 0xffff; Executed by:
| 1050513 | ||||||||||||||||||||||||
1161 | } | - | ||||||||||||||||||||||||
1162 | - | |||||||||||||||||||||||||
1163 | inline void QXmlSimpleReaderPrivate::stringClear() | - | ||||||||||||||||||||||||
1164 | { | - | ||||||||||||||||||||||||
1165 | stringValueLen = 0; stringArrayPos = 0; | - | ||||||||||||||||||||||||
1166 | } executed 21975 times by 6 tests: end of block Executed by:
| 21975 | ||||||||||||||||||||||||
1167 | inline void QXmlSimpleReaderPrivate::nameClear() | - | ||||||||||||||||||||||||
1168 | { | - | ||||||||||||||||||||||||
1169 | nameValueLen = 0; nameArrayPos = 0; | - | ||||||||||||||||||||||||
1170 | } executed 30021 times by 6 tests: end of block Executed by:
| 30021 | ||||||||||||||||||||||||
1171 | - | |||||||||||||||||||||||||
1172 | inline void QXmlSimpleReaderPrivate::refClear() | - | ||||||||||||||||||||||||
1173 | { | - | ||||||||||||||||||||||||
1174 | refValueLen = 0; refArrayPos = 0; | - | ||||||||||||||||||||||||
1175 | } executed 2957 times by 3 tests: end of block Executed by:
| 2957 | ||||||||||||||||||||||||
1176 | - | |||||||||||||||||||||||||
1177 | QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader) | - | ||||||||||||||||||||||||
1178 | { | - | ||||||||||||||||||||||||
1179 | q_ptr = reader; | - | ||||||||||||||||||||||||
1180 | parseStack = 0; | - | ||||||||||||||||||||||||
1181 | - | |||||||||||||||||||||||||
1182 | locator.reset(new QXmlSimpleReaderLocator(reader)); | - | ||||||||||||||||||||||||
1183 | entityRes = 0; | - | ||||||||||||||||||||||||
1184 | dtdHnd = 0; | - | ||||||||||||||||||||||||
1185 | contentHnd = 0; | - | ||||||||||||||||||||||||
1186 | errorHnd = 0; | - | ||||||||||||||||||||||||
1187 | lexicalHnd = 0; | - | ||||||||||||||||||||||||
1188 | declHnd = 0; | - | ||||||||||||||||||||||||
1189 | - | |||||||||||||||||||||||||
1190 | - | |||||||||||||||||||||||||
1191 | useNamespaces = true; | - | ||||||||||||||||||||||||
1192 | useNamespacePrefixes = false; | - | ||||||||||||||||||||||||
1193 | reportWhitespaceCharData = true; | - | ||||||||||||||||||||||||
1194 | reportEntities = false; | - | ||||||||||||||||||||||||
1195 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
1196 | - | |||||||||||||||||||||||||
1197 | QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate() | - | ||||||||||||||||||||||||
1198 | { | - | ||||||||||||||||||||||||
1199 | delete parseStack; | - | ||||||||||||||||||||||||
1200 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
1201 | - | |||||||||||||||||||||||||
1202 | void QXmlSimpleReaderPrivate::initIncrementalParsing() | - | ||||||||||||||||||||||||
1203 | { | - | ||||||||||||||||||||||||
1204 | if(parseStack
| 0-1490 | ||||||||||||||||||||||||
1205 | parseStack->clear(); never executed: parseStack->clear(); | 0 | ||||||||||||||||||||||||
1206 | else | - | ||||||||||||||||||||||||
1207 | parseStack = new QStack<ParseState>; executed 1490 times by 1 test: parseStack = new QStack<ParseState>; Executed by:
| 1490 | ||||||||||||||||||||||||
1208 | } | - | ||||||||||||||||||||||||
1209 | static inline bool is_S(QChar ch) | - | ||||||||||||||||||||||||
1210 | { | - | ||||||||||||||||||||||||
1211 | ushort uc = ch.unicode(); | - | ||||||||||||||||||||||||
1212 | return executed 187992 times by 6 tests: (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r');return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r'); Executed by:
executed 187992 times by 6 tests: return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r'); Executed by:
| 187992 | ||||||||||||||||||||||||
1213 | } | - | ||||||||||||||||||||||||
1214 | - | |||||||||||||||||||||||||
1215 | enum NameChar { NameBeginning, NameNotBeginning, NotName }; | - | ||||||||||||||||||||||||
1216 | - | |||||||||||||||||||||||||
1217 | static const char Begi = (char)NameBeginning; | - | ||||||||||||||||||||||||
1218 | static const char NtBg = (char)NameNotBeginning; | - | ||||||||||||||||||||||||
1219 | static const char NotN = (char)NotName; | - | ||||||||||||||||||||||||
1220 | - | |||||||||||||||||||||||||
1221 | static const char nameCharTable[128] = | - | ||||||||||||||||||||||||
1222 | { | - | ||||||||||||||||||||||||
1223 | - | |||||||||||||||||||||||||
1224 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
1225 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
1226 | - | |||||||||||||||||||||||||
1227 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
1228 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
1229 | - | |||||||||||||||||||||||||
1230 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
1231 | NotN, NotN, NotN, NotN, NotN, NtBg, NtBg, NotN, | - | ||||||||||||||||||||||||
1232 | - | |||||||||||||||||||||||||
1233 | NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, | - | ||||||||||||||||||||||||
1234 | NtBg, NtBg, Begi, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
1235 | - | |||||||||||||||||||||||||
1236 | NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
1237 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
1238 | - | |||||||||||||||||||||||||
1239 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
1240 | Begi, Begi, Begi, NotN, NotN, NotN, NotN, Begi, | - | ||||||||||||||||||||||||
1241 | - | |||||||||||||||||||||||||
1242 | NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
1243 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
1244 | - | |||||||||||||||||||||||||
1245 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
1246 | Begi, Begi, Begi, NotN, NotN, NotN, NotN, NotN | - | ||||||||||||||||||||||||
1247 | }; | - | ||||||||||||||||||||||||
1248 | - | |||||||||||||||||||||||||
1249 | static inline NameChar fastDetermineNameChar(QChar ch) | - | ||||||||||||||||||||||||
1250 | { | - | ||||||||||||||||||||||||
1251 | ushort uc = ch.unicode(); | - | ||||||||||||||||||||||||
1252 | if (!(uc & ~0x7f)
| 2385-258018 | ||||||||||||||||||||||||
1253 | return executed 258018 times by 6 tests: (NameChar)nameCharTable[uc];return (NameChar)nameCharTable[uc]; Executed by:
executed 258018 times by 6 tests: return (NameChar)nameCharTable[uc]; Executed by:
| 258018 | ||||||||||||||||||||||||
1254 | - | |||||||||||||||||||||||||
1255 | QChar::Category cat = ch.category(); | - | ||||||||||||||||||||||||
1256 | - | |||||||||||||||||||||||||
1257 | if ((cat >= QChar::Letter_Uppercase
| 12-2297 | ||||||||||||||||||||||||
1258 | || cat == QChar::Number_Letter
| 0-100 | ||||||||||||||||||||||||
1259 | return executed 2285 times by 1 test: NameBeginning;return NameBeginning; Executed by:
executed 2285 times by 1 test: return NameBeginning; Executed by:
| 2285 | ||||||||||||||||||||||||
1260 | if ((cat >= QChar::Number_DecimalDigit
| 0-77 | ||||||||||||||||||||||||
1261 | || (cat >= QChar::Mark_NonSpacing
| 0-100 | ||||||||||||||||||||||||
1262 | return executed 77 times by 1 test: NameNotBeginning;return NameNotBeginning; Executed by:
executed 77 times by 1 test: return NameNotBeginning; Executed by:
| 77 | ||||||||||||||||||||||||
1263 | return executed 23 times by 1 test: NotName;return NotName; Executed by:
executed 23 times by 1 test: return NotName; Executed by:
| 23 | ||||||||||||||||||||||||
1264 | } | - | ||||||||||||||||||||||||
1265 | - | |||||||||||||||||||||||||
1266 | static NameChar determineNameChar(QChar ch) | - | ||||||||||||||||||||||||
1267 | { | - | ||||||||||||||||||||||||
1268 | return executed 40888 times by 6 tests: fastDetermineNameChar(ch);return fastDetermineNameChar(ch); Executed by:
executed 40888 times by 6 tests: return fastDetermineNameChar(ch); Executed by:
| 40888 | ||||||||||||||||||||||||
1269 | } | - | ||||||||||||||||||||||||
1270 | - | |||||||||||||||||||||||||
1271 | - | |||||||||||||||||||||||||
1272 | - | |||||||||||||||||||||||||
1273 | - | |||||||||||||||||||||||||
1274 | - | |||||||||||||||||||||||||
1275 | QXmlSimpleReader::QXmlSimpleReader() | - | ||||||||||||||||||||||||
1276 | : d_ptr(new QXmlSimpleReaderPrivate(this)) | - | ||||||||||||||||||||||||
1277 | { | - | ||||||||||||||||||||||||
1278 | } executed 2104 times by 6 tests: end of block Executed by:
| 2104 | ||||||||||||||||||||||||
1279 | - | |||||||||||||||||||||||||
1280 | - | |||||||||||||||||||||||||
1281 | - | |||||||||||||||||||||||||
1282 | - | |||||||||||||||||||||||||
1283 | QXmlSimpleReader::~QXmlSimpleReader() | - | ||||||||||||||||||||||||
1284 | { | - | ||||||||||||||||||||||||
1285 | } | - | ||||||||||||||||||||||||
1286 | - | |||||||||||||||||||||||||
1287 | - | |||||||||||||||||||||||||
1288 | - | |||||||||||||||||||||||||
1289 | - | |||||||||||||||||||||||||
1290 | bool QXmlSimpleReader::feature(const QString& name, bool *ok) const | - | ||||||||||||||||||||||||
1291 | { | - | ||||||||||||||||||||||||
1292 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
1293 | - | |||||||||||||||||||||||||
1294 | if (ok != 0
| 0-246 | ||||||||||||||||||||||||
1295 | * never executed: ok = true;*ok = true; never executed: *ok = true; | 0 | ||||||||||||||||||||||||
1296 | if (name == QLatin1String("http://xml.org/sax/features/namespaces")
| 2-244 | ||||||||||||||||||||||||
1297 | return executed 244 times by 5 tests: d->useNamespaces;return d->useNamespaces; Executed by:
executed 244 times by 5 tests: return d->useNamespaces; Executed by:
| 244 | ||||||||||||||||||||||||
1298 | } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
| 0-2 | ||||||||||||||||||||||||
1299 | return executed 2 times by 1 test: d->useNamespacePrefixes;return d->useNamespacePrefixes; Executed by:
executed 2 times by 1 test: return d->useNamespacePrefixes; Executed by:
| 2 | ||||||||||||||||||||||||
1300 | } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
1301 | || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
1302 | return never executed: d->reportWhitespaceCharData;return d->reportWhitespaceCharData; never executed: return d->reportWhitespaceCharData; | 0 | ||||||||||||||||||||||||
1303 | } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
1304 | || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
1305 | return never executed: d->reportEntities;return d->reportEntities; never executed: return d->reportEntities; | 0 | ||||||||||||||||||||||||
1306 | } else { | - | ||||||||||||||||||||||||
1307 | QMessageLogger(__FILE__, 2944, __PRETTY_FUNCTION__).warning("Unknown feature %s", name.toLatin1().data()); | - | ||||||||||||||||||||||||
1308 | if (ok != 0
| 0 | ||||||||||||||||||||||||
1309 | * never executed: ok = false;*ok = false; never executed: *ok = false; | 0 | ||||||||||||||||||||||||
1310 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1311 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1312 | } | - | ||||||||||||||||||||||||
1313 | void QXmlSimpleReader::setFeature(const QString& name, bool enable) | - | ||||||||||||||||||||||||
1314 | { | - | ||||||||||||||||||||||||
1315 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1316 | if (name == QLatin1String("http://xml.org/sax/features/namespaces")
| 244-488 | ||||||||||||||||||||||||
1317 | d->useNamespaces = enable; | - | ||||||||||||||||||||||||
1318 | } executed 244 times by 5 tests: else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")end of block Executed by:
| 244 | ||||||||||||||||||||||||
1319 | d->useNamespacePrefixes = enable; | - | ||||||||||||||||||||||||
1320 | } executed 244 times by 5 tests: else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")end of block Executed by:
| 0-244 | ||||||||||||||||||||||||
1321 | || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
1322 | d->reportWhitespaceCharData = enable; | - | ||||||||||||||||||||||||
1323 | } executed 244 times by 5 tests: else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")end of block Executed by:
| 0-244 | ||||||||||||||||||||||||
1324 | || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
1325 | d->reportEntities = enable; | - | ||||||||||||||||||||||||
1326 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1327 | QMessageLogger(__FILE__, 2998, __PRETTY_FUNCTION__).warning("Unknown feature %s", name.toLatin1().data()); | - | ||||||||||||||||||||||||
1328 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1329 | } | - | ||||||||||||||||||||||||
1330 | - | |||||||||||||||||||||||||
1331 | - | |||||||||||||||||||||||||
1332 | - | |||||||||||||||||||||||||
1333 | bool QXmlSimpleReader::hasFeature(const QString& name) const | - | ||||||||||||||||||||||||
1334 | { | - | ||||||||||||||||||||||||
1335 | if (name == QLatin1String("http://xml.org/sax/features/namespaces")
| 0 | ||||||||||||||||||||||||
1336 | || name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
| 0 | ||||||||||||||||||||||||
1337 | || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
1338 | || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
1339 | || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
1340 | || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
1341 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1342 | } else { | - | ||||||||||||||||||||||||
1343 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1344 | } | - | ||||||||||||||||||||||||
1345 | } | - | ||||||||||||||||||||||||
1346 | - | |||||||||||||||||||||||||
1347 | - | |||||||||||||||||||||||||
1348 | - | |||||||||||||||||||||||||
1349 | void* QXmlSimpleReader::property(const QString&, bool *ok) const | - | ||||||||||||||||||||||||
1350 | { | - | ||||||||||||||||||||||||
1351 | if (ok != 0
| 0 | ||||||||||||||||||||||||
1352 | * never executed: ok = false;*ok = false; never executed: *ok = false; | 0 | ||||||||||||||||||||||||
1353 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
1354 | } | - | ||||||||||||||||||||||||
1355 | - | |||||||||||||||||||||||||
1356 | - | |||||||||||||||||||||||||
1357 | - | |||||||||||||||||||||||||
1358 | void QXmlSimpleReader::setProperty(const QString&, void*) | - | ||||||||||||||||||||||||
1359 | { | - | ||||||||||||||||||||||||
1360 | } | - | ||||||||||||||||||||||||
1361 | - | |||||||||||||||||||||||||
1362 | - | |||||||||||||||||||||||||
1363 | - | |||||||||||||||||||||||||
1364 | - | |||||||||||||||||||||||||
1365 | bool QXmlSimpleReader::hasProperty(const QString&) const | - | ||||||||||||||||||||||||
1366 | { | - | ||||||||||||||||||||||||
1367 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1368 | } | - | ||||||||||||||||||||||||
1369 | - | |||||||||||||||||||||||||
1370 | - | |||||||||||||||||||||||||
1371 | - | |||||||||||||||||||||||||
1372 | - | |||||||||||||||||||||||||
1373 | void QXmlSimpleReader::setEntityResolver(QXmlEntityResolver* handler) | - | ||||||||||||||||||||||||
1374 | { | - | ||||||||||||||||||||||||
1375 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1376 | d->entityRes = handler; | - | ||||||||||||||||||||||||
1377 | } executed 1845 times by 1 test: end of block Executed by:
| 1845 | ||||||||||||||||||||||||
1378 | - | |||||||||||||||||||||||||
1379 | - | |||||||||||||||||||||||||
1380 | - | |||||||||||||||||||||||||
1381 | - | |||||||||||||||||||||||||
1382 | QXmlEntityResolver* QXmlSimpleReader::entityResolver() const | - | ||||||||||||||||||||||||
1383 | { | - | ||||||||||||||||||||||||
1384 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
1385 | return never executed: d->entityRes;return d->entityRes; never executed: return d->entityRes; | 0 | ||||||||||||||||||||||||
1386 | } | - | ||||||||||||||||||||||||
1387 | - | |||||||||||||||||||||||||
1388 | - | |||||||||||||||||||||||||
1389 | - | |||||||||||||||||||||||||
1390 | - | |||||||||||||||||||||||||
1391 | void QXmlSimpleReader::setDTDHandler(QXmlDTDHandler* handler) | - | ||||||||||||||||||||||||
1392 | { | - | ||||||||||||||||||||||||
1393 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1394 | d->dtdHnd = handler; | - | ||||||||||||||||||||||||
1395 | } executed 2089 times by 5 tests: end of block Executed by:
| 2089 | ||||||||||||||||||||||||
1396 | - | |||||||||||||||||||||||||
1397 | - | |||||||||||||||||||||||||
1398 | - | |||||||||||||||||||||||||
1399 | - | |||||||||||||||||||||||||
1400 | QXmlDTDHandler* QXmlSimpleReader::DTDHandler() const | - | ||||||||||||||||||||||||
1401 | { | - | ||||||||||||||||||||||||
1402 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
1403 | return never executed: d->dtdHnd;return d->dtdHnd; never executed: return d->dtdHnd; | 0 | ||||||||||||||||||||||||
1404 | } | - | ||||||||||||||||||||||||
1405 | - | |||||||||||||||||||||||||
1406 | - | |||||||||||||||||||||||||
1407 | - | |||||||||||||||||||||||||
1408 | - | |||||||||||||||||||||||||
1409 | void QXmlSimpleReader::setContentHandler(QXmlContentHandler* handler) | - | ||||||||||||||||||||||||
1410 | { | - | ||||||||||||||||||||||||
1411 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1412 | d->contentHnd = handler; | - | ||||||||||||||||||||||||
1413 | } executed 2100 times by 6 tests: end of block Executed by:
| 2100 | ||||||||||||||||||||||||
1414 | - | |||||||||||||||||||||||||
1415 | - | |||||||||||||||||||||||||
1416 | - | |||||||||||||||||||||||||
1417 | - | |||||||||||||||||||||||||
1418 | QXmlContentHandler* QXmlSimpleReader::contentHandler() const | - | ||||||||||||||||||||||||
1419 | { | - | ||||||||||||||||||||||||
1420 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
1421 | return never executed: d->contentHnd;return d->contentHnd; never executed: return d->contentHnd; | 0 | ||||||||||||||||||||||||
1422 | } | - | ||||||||||||||||||||||||
1423 | - | |||||||||||||||||||||||||
1424 | - | |||||||||||||||||||||||||
1425 | - | |||||||||||||||||||||||||
1426 | - | |||||||||||||||||||||||||
1427 | void QXmlSimpleReader::setErrorHandler(QXmlErrorHandler* handler) | - | ||||||||||||||||||||||||
1428 | { | - | ||||||||||||||||||||||||
1429 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1430 | d->errorHnd = handler; | - | ||||||||||||||||||||||||
1431 | } executed 2094 times by 5 tests: end of block Executed by:
| 2094 | ||||||||||||||||||||||||
1432 | - | |||||||||||||||||||||||||
1433 | - | |||||||||||||||||||||||||
1434 | - | |||||||||||||||||||||||||
1435 | - | |||||||||||||||||||||||||
1436 | QXmlErrorHandler* QXmlSimpleReader::errorHandler() const | - | ||||||||||||||||||||||||
1437 | { | - | ||||||||||||||||||||||||
1438 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
1439 | return never executed: d->errorHnd;return d->errorHnd; never executed: return d->errorHnd; | 0 | ||||||||||||||||||||||||
1440 | } | - | ||||||||||||||||||||||||
1441 | - | |||||||||||||||||||||||||
1442 | - | |||||||||||||||||||||||||
1443 | - | |||||||||||||||||||||||||
1444 | - | |||||||||||||||||||||||||
1445 | void QXmlSimpleReader::setLexicalHandler(QXmlLexicalHandler* handler) | - | ||||||||||||||||||||||||
1446 | { | - | ||||||||||||||||||||||||
1447 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1448 | d->lexicalHnd = handler; | - | ||||||||||||||||||||||||
1449 | } executed 2089 times by 5 tests: end of block Executed by:
| 2089 | ||||||||||||||||||||||||
1450 | - | |||||||||||||||||||||||||
1451 | - | |||||||||||||||||||||||||
1452 | - | |||||||||||||||||||||||||
1453 | - | |||||||||||||||||||||||||
1454 | QXmlLexicalHandler* QXmlSimpleReader::lexicalHandler() const | - | ||||||||||||||||||||||||
1455 | { | - | ||||||||||||||||||||||||
1456 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
1457 | return never executed: d->lexicalHnd;return d->lexicalHnd; never executed: return d->lexicalHnd; | 0 | ||||||||||||||||||||||||
1458 | } | - | ||||||||||||||||||||||||
1459 | - | |||||||||||||||||||||||||
1460 | - | |||||||||||||||||||||||||
1461 | - | |||||||||||||||||||||||||
1462 | - | |||||||||||||||||||||||||
1463 | void QXmlSimpleReader::setDeclHandler(QXmlDeclHandler* handler) | - | ||||||||||||||||||||||||
1464 | { | - | ||||||||||||||||||||||||
1465 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1466 | d->declHnd = handler; | - | ||||||||||||||||||||||||
1467 | } executed 2092 times by 5 tests: end of block Executed by:
| 2092 | ||||||||||||||||||||||||
1468 | - | |||||||||||||||||||||||||
1469 | - | |||||||||||||||||||||||||
1470 | - | |||||||||||||||||||||||||
1471 | - | |||||||||||||||||||||||||
1472 | QXmlDeclHandler* QXmlSimpleReader::declHandler() const | - | ||||||||||||||||||||||||
1473 | { | - | ||||||||||||||||||||||||
1474 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
1475 | return never executed: d->declHnd;return d->declHnd; never executed: return d->declHnd; | 0 | ||||||||||||||||||||||||
1476 | } | - | ||||||||||||||||||||||||
1477 | - | |||||||||||||||||||||||||
1478 | - | |||||||||||||||||||||||||
1479 | - | |||||||||||||||||||||||||
1480 | - | |||||||||||||||||||||||||
1481 | - | |||||||||||||||||||||||||
1482 | - | |||||||||||||||||||||||||
1483 | bool QXmlSimpleReader::parse(const QXmlInputSource& input) | - | ||||||||||||||||||||||||
1484 | { | - | ||||||||||||||||||||||||
1485 | return executed 359 times by 2 tests: parse(&input, false);return parse(&input, false); Executed by:
executed 359 times by 2 tests: return parse(&input, false); Executed by:
| 359 | ||||||||||||||||||||||||
1486 | } | - | ||||||||||||||||||||||||
1487 | - | |||||||||||||||||||||||||
1488 | - | |||||||||||||||||||||||||
1489 | - | |||||||||||||||||||||||||
1490 | - | |||||||||||||||||||||||||
1491 | - | |||||||||||||||||||||||||
1492 | bool QXmlSimpleReader::parse(const QXmlInputSource* input) | - | ||||||||||||||||||||||||
1493 | { | - | ||||||||||||||||||||||||
1494 | return executed 252 times by 5 tests: parse(input, false);return parse(input, false); Executed by:
executed 252 times by 5 tests: return parse(input, false); Executed by:
| 252 | ||||||||||||||||||||||||
1495 | } | - | ||||||||||||||||||||||||
1496 | bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental) | - | ||||||||||||||||||||||||
1497 | { | - | ||||||||||||||||||||||||
1498 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1499 | - | |||||||||||||||||||||||||
1500 | d->literalEntitySizes.clear(); | - | ||||||||||||||||||||||||
1501 | d->referencesToOtherEntities.clear(); | - | ||||||||||||||||||||||||
1502 | d->expandedSizes.clear(); | - | ||||||||||||||||||||||||
1503 | - | |||||||||||||||||||||||||
1504 | if (incremental
| 616-1490 | ||||||||||||||||||||||||
1505 | d->initIncrementalParsing(); | - | ||||||||||||||||||||||||
1506 | } executed 1490 times by 1 test: else {end of block Executed by:
| 1490 | ||||||||||||||||||||||||
1507 | delete d->parseStack; | - | ||||||||||||||||||||||||
1508 | d->parseStack = 0; | - | ||||||||||||||||||||||||
1509 | } executed 616 times by 6 tests: end of block Executed by:
| 616 | ||||||||||||||||||||||||
1510 | d->init(input); | - | ||||||||||||||||||||||||
1511 | - | |||||||||||||||||||||||||
1512 | - | |||||||||||||||||||||||||
1513 | if (d->contentHnd
| 6-2100 | ||||||||||||||||||||||||
1514 | d->contentHnd->setDocumentLocator(d->locator.data()); | - | ||||||||||||||||||||||||
1515 | if (!d->contentHnd->startDocument()
| 0-2100 | ||||||||||||||||||||||||
1516 | d->reportParseError(d->contentHnd->errorString()); | - | ||||||||||||||||||||||||
1517 | clear(d->tags); | - | ||||||||||||||||||||||||
1518 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1519 | } | - | ||||||||||||||||||||||||
1520 | } executed 2100 times by 6 tests: end of block Executed by:
| 2100 | ||||||||||||||||||||||||
1521 | d->skipped_entity_in_content = false; | - | ||||||||||||||||||||||||
1522 | return executed 2106 times by 6 tests: d->parseBeginOrContinue(0, incremental);return d->parseBeginOrContinue(0, incremental); Executed by:
executed 2106 times by 6 tests: return d->parseBeginOrContinue(0, incremental); Executed by:
| 2106 | ||||||||||||||||||||||||
1523 | } | - | ||||||||||||||||||||||||
1524 | bool QXmlSimpleReader::parseContinue() | - | ||||||||||||||||||||||||
1525 | { | - | ||||||||||||||||||||||||
1526 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1527 | if (d->parseStack == 0
| 0-44908 | ||||||||||||||||||||||||
1528 | return executed 1490 times by 1 test: false;return false; Executed by:
executed 1490 times by 1 test: return false; Executed by:
| 1490 | ||||||||||||||||||||||||
1529 | d->initData(); | - | ||||||||||||||||||||||||
1530 | int state = d->parseStack->pop().state; | - | ||||||||||||||||||||||||
1531 | return executed 44908 times by 1 test: d->parseBeginOrContinue(state, true);return d->parseBeginOrContinue(state, true); Executed by:
executed 44908 times by 1 test: return d->parseBeginOrContinue(state, true); Executed by:
| 44908 | ||||||||||||||||||||||||
1532 | } | - | ||||||||||||||||||||||||
1533 | - | |||||||||||||||||||||||||
1534 | - | |||||||||||||||||||||||||
1535 | - | |||||||||||||||||||||||||
1536 | - | |||||||||||||||||||||||||
1537 | bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental) | - | ||||||||||||||||||||||||
1538 | { | - | ||||||||||||||||||||||||
1539 | bool atEndOrig = atEnd(); | - | ||||||||||||||||||||||||
1540 | - | |||||||||||||||||||||||||
1541 | if (state==0
| 10967-36047 | ||||||||||||||||||||||||
1542 | if (!parseProlog()
| 2029-34018 | ||||||||||||||||||||||||
1543 | if (incremental
| 0-33941 | ||||||||||||||||||||||||
1544 | pushParseState(0, 0); | - | ||||||||||||||||||||||||
1545 | return executed 33941 times by 1 test: true;return true; Executed by:
executed 33941 times by 1 test: return true; Executed by:
| 33941 | ||||||||||||||||||||||||
1546 | } else { | - | ||||||||||||||||||||||||
1547 | clear(tags); | - | ||||||||||||||||||||||||
1548 | return executed 77 times by 1 test: false;return false; Executed by:
executed 77 times by 1 test: return false; Executed by:
| 77 | ||||||||||||||||||||||||
1549 | } | - | ||||||||||||||||||||||||
1550 | } | - | ||||||||||||||||||||||||
1551 | state = 1; | - | ||||||||||||||||||||||||
1552 | } executed 2029 times by 6 tests: end of block Executed by:
| 2029 | ||||||||||||||||||||||||
1553 | if (state==1
| 2514-10482 | ||||||||||||||||||||||||
1554 | if (!parseElement()
| 1961-8521 | ||||||||||||||||||||||||
1555 | if (incremental
| 0-8453 | ||||||||||||||||||||||||
1556 | pushParseState(0, 1); | - | ||||||||||||||||||||||||
1557 | return executed 8453 times by 1 test: true;return true; Executed by:
executed 8453 times by 1 test: return true; Executed by:
| 8453 | ||||||||||||||||||||||||
1558 | } else { | - | ||||||||||||||||||||||||
1559 | clear(tags); | - | ||||||||||||||||||||||||
1560 | return executed 68 times by 1 test: false;return false; Executed by:
executed 68 times by 1 test: return false; Executed by:
| 68 | ||||||||||||||||||||||||
1561 | } | - | ||||||||||||||||||||||||
1562 | } | - | ||||||||||||||||||||||||
1563 | state = 2; | - | ||||||||||||||||||||||||
1564 | } executed 1961 times by 6 tests: end of block Executed by:
| 1961 | ||||||||||||||||||||||||
1565 | - | |||||||||||||||||||||||||
1566 | while (!atEnd()
| 2340-2392 | ||||||||||||||||||||||||
1567 | if (!parseMisc()
| 257-2083 | ||||||||||||||||||||||||
1568 | if (incremental
| 0-2073 | ||||||||||||||||||||||||
1569 | pushParseState(0, 2); | - | ||||||||||||||||||||||||
1570 | return executed 2073 times by 1 test: true;return true; Executed by:
executed 2073 times by 1 test: return true; Executed by:
| 2073 | ||||||||||||||||||||||||
1571 | } else { | - | ||||||||||||||||||||||||
1572 | clear(tags); | - | ||||||||||||||||||||||||
1573 | return executed 10 times by 1 test: false;return false; Executed by:
executed 10 times by 1 test: return false; Executed by:
| 10 | ||||||||||||||||||||||||
1574 | } | - | ||||||||||||||||||||||||
1575 | } | - | ||||||||||||||||||||||||
1576 | } executed 257 times by 2 tests: end of block Executed by:
| 257 | ||||||||||||||||||||||||
1577 | if (!atEndOrig
| 441-1490 | ||||||||||||||||||||||||
1578 | - | |||||||||||||||||||||||||
1579 | pushParseState(0, 2); | - | ||||||||||||||||||||||||
1580 | return executed 441 times by 1 test: true;return true; Executed by:
executed 441 times by 1 test: return true; Executed by:
| 441 | ||||||||||||||||||||||||
1581 | } | - | ||||||||||||||||||||||||
1582 | - | |||||||||||||||||||||||||
1583 | if (!tags.empty()
| 0-1951 | ||||||||||||||||||||||||
1584 | reportParseError(QLatin1String("unexpected end of file")); | - | ||||||||||||||||||||||||
1585 | clear(tags); | - | ||||||||||||||||||||||||
1586 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1587 | } | - | ||||||||||||||||||||||||
1588 | - | |||||||||||||||||||||||||
1589 | if (contentHnd
| 1-1950 | ||||||||||||||||||||||||
1590 | delete parseStack; | - | ||||||||||||||||||||||||
1591 | parseStack = 0; | - | ||||||||||||||||||||||||
1592 | if (!contentHnd->endDocument()
| 0-1950 | ||||||||||||||||||||||||
1593 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
1594 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1595 | } | - | ||||||||||||||||||||||||
1596 | } executed 1950 times by 6 tests: end of block Executed by:
| 1950 | ||||||||||||||||||||||||
1597 | return executed 1951 times by 6 tests: true;return true; Executed by:
executed 1951 times by 6 tests: return true; Executed by:
| 1951 | ||||||||||||||||||||||||
1598 | } | - | ||||||||||||||||||||||||
1599 | bool QXmlSimpleReaderPrivate::parseProlog() | - | ||||||||||||||||||||||||
1600 | { | - | ||||||||||||||||||||||||
1601 | const signed char Init = 0; | - | ||||||||||||||||||||||||
1602 | const signed char EatWS = 1; | - | ||||||||||||||||||||||||
1603 | const signed char Lt = 2; | - | ||||||||||||||||||||||||
1604 | const signed char Em = 3; | - | ||||||||||||||||||||||||
1605 | const signed char DocType = 4; | - | ||||||||||||||||||||||||
1606 | const signed char Comment = 5; | - | ||||||||||||||||||||||||
1607 | const signed char CommentR = 6; | - | ||||||||||||||||||||||||
1608 | const signed char PInstr = 7; | - | ||||||||||||||||||||||||
1609 | const signed char PInstrR = 8; | - | ||||||||||||||||||||||||
1610 | const signed char Done = 9; | - | ||||||||||||||||||||||||
1611 | - | |||||||||||||||||||||||||
1612 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
1613 | const signed char InpLt = 1; | - | ||||||||||||||||||||||||
1614 | const signed char InpQm = 2; | - | ||||||||||||||||||||||||
1615 | const signed char InpEm = 3; | - | ||||||||||||||||||||||||
1616 | const signed char InpD = 4; | - | ||||||||||||||||||||||||
1617 | const signed char InpDash = 5; | - | ||||||||||||||||||||||||
1618 | const signed char InpUnknown = 6; | - | ||||||||||||||||||||||||
1619 | - | |||||||||||||||||||||||||
1620 | static const signed char table[9][7] = { | - | ||||||||||||||||||||||||
1621 | - | |||||||||||||||||||||||||
1622 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1623 | { -1, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1624 | { -1, -1, PInstr,Em, Done, -1, Done }, | - | ||||||||||||||||||||||||
1625 | { -1, -1, -1, -1, DocType, Comment, -1 }, | - | ||||||||||||||||||||||||
1626 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1627 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1628 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1629 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1630 | { EatWS, Lt, -1, -1, -1, -1, -1 } | - | ||||||||||||||||||||||||
1631 | }; | - | ||||||||||||||||||||||||
1632 | signed char state; | - | ||||||||||||||||||||||||
1633 | signed char input; | - | ||||||||||||||||||||||||
1634 | - | |||||||||||||||||||||||||
1635 | if (parseStack == 0
| 616-35431 | ||||||||||||||||||||||||
1636 | xmldecl_possible = true; | - | ||||||||||||||||||||||||
1637 | doctype_read = false; | - | ||||||||||||||||||||||||
1638 | state = Init; | - | ||||||||||||||||||||||||
1639 | } executed 2106 times by 6 tests: else {end of block Executed by:
| 2106 | ||||||||||||||||||||||||
1640 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
1641 | - | |||||||||||||||||||||||||
1642 | - | |||||||||||||||||||||||||
1643 | - | |||||||||||||||||||||||||
1644 | if (!parseStack->isEmpty()
| 1663-32278 | ||||||||||||||||||||||||
1645 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
1646 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 923-31355 | ||||||||||||||||||||||||
1647 | parseStack->pop(); | - | ||||||||||||||||||||||||
1648 | - | |||||||||||||||||||||||||
1649 | - | |||||||||||||||||||||||||
1650 | - | |||||||||||||||||||||||||
1651 | } executed 923 times by 1 test: end of block Executed by:
| 923 | ||||||||||||||||||||||||
1652 | if (!(this->*function)()
| 2353-29925 | ||||||||||||||||||||||||
1653 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
1654 | return executed 29925 times by 1 test: false;return false; Executed by:
executed 29925 times by 1 test: return false; Executed by:
| 29925 | ||||||||||||||||||||||||
1655 | } | - | ||||||||||||||||||||||||
1656 | } executed 2353 times by 1 test: end of block Executed by:
| 2353 | ||||||||||||||||||||||||
1657 | } executed 4016 times by 1 test: end of block Executed by:
| 4016 | ||||||||||||||||||||||||
1658 | - | |||||||||||||||||||||||||
1659 | for (;;) { | - | ||||||||||||||||||||||||
1660 | switch (state) { | - | ||||||||||||||||||||||||
1661 | case executed 2370 times by 4 tests: DocType:case DocType: Executed by:
executed 2370 times by 4 tests: case DocType: Executed by:
| 2370 | ||||||||||||||||||||||||
1662 | if (doctype_read
| 0-2370 | ||||||||||||||||||||||||
1663 | reportParseError(QLatin1String("more than one document type definition")); | - | ||||||||||||||||||||||||
1664 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1665 | } else { | - | ||||||||||||||||||||||||
1666 | doctype_read = false; | - | ||||||||||||||||||||||||
1667 | } executed 2370 times by 4 tests: end of block Executed by:
| 2370 | ||||||||||||||||||||||||
1668 | break; executed 2370 times by 4 tests: break; Executed by:
| 2370 | ||||||||||||||||||||||||
1669 | case executed 21 times by 2 tests: Comment:case Comment: Executed by:
executed 21 times by 2 tests: case Comment: Executed by:
| 21 | ||||||||||||||||||||||||
1670 | if (lexicalHnd
| 8-13 | ||||||||||||||||||||||||
1671 | if (!lexicalHnd->comment(string())
| 0-13 | ||||||||||||||||||||||||
1672 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
1673 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1674 | } | - | ||||||||||||||||||||||||
1675 | } executed 13 times by 1 test: end of block Executed by:
| 13 | ||||||||||||||||||||||||
1676 | state = CommentR; | - | ||||||||||||||||||||||||
1677 | break; executed 21 times by 2 tests: break; Executed by:
| 21 | ||||||||||||||||||||||||
1678 | case executed 134 times by 2 tests: PInstr:case PInstr: Executed by:
executed 134 times by 2 tests: case PInstr: Executed by:
| 134 | ||||||||||||||||||||||||
1679 | - | |||||||||||||||||||||||||
1680 | if (contentHnd
| 3-131 | ||||||||||||||||||||||||
1681 | if (xmldecl_possible
| 11-120 | ||||||||||||||||||||||||
1682 | QString value(QLatin1String("version='")); | - | ||||||||||||||||||||||||
1683 | value += xmlVersion; | - | ||||||||||||||||||||||||
1684 | value += QLatin1Char('\''); | - | ||||||||||||||||||||||||
1685 | if (!encoding.isEmpty()
| 45-63 | ||||||||||||||||||||||||
1686 | value += QLatin1String(" encoding='"); | - | ||||||||||||||||||||||||
1687 | value += encoding; | - | ||||||||||||||||||||||||
1688 | value += QLatin1Char('\''); | - | ||||||||||||||||||||||||
1689 | } executed 63 times by 2 tests: end of block Executed by:
| 63 | ||||||||||||||||||||||||
1690 | if (standalone == QXmlSimpleReaderPrivate::Yes
| 21-87 | ||||||||||||||||||||||||
1691 | value += QLatin1String(" standalone='yes'"); | - | ||||||||||||||||||||||||
1692 | } executed 21 times by 1 test: else if (standalone == QXmlSimpleReaderPrivate::Noend of block Executed by:
| 21-57 | ||||||||||||||||||||||||
1693 | value += QLatin1String(" standalone='no'"); | - | ||||||||||||||||||||||||
1694 | } executed 30 times by 1 test: end of block Executed by:
| 30 | ||||||||||||||||||||||||
1695 | if (!contentHnd->processingInstruction(QLatin1String("xml"), value)
| 0-108 | ||||||||||||||||||||||||
1696 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
1697 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1698 | } | - | ||||||||||||||||||||||||
1699 | } executed 108 times by 2 tests: else {end of block Executed by:
| 108 | ||||||||||||||||||||||||
1700 | if (!contentHnd->processingInstruction(name(), string())
| 0-23 | ||||||||||||||||||||||||
1701 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
1702 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1703 | } | - | ||||||||||||||||||||||||
1704 | } executed 23 times by 2 tests: end of block Executed by:
| 23 | ||||||||||||||||||||||||
1705 | } | - | ||||||||||||||||||||||||
1706 | - | |||||||||||||||||||||||||
1707 | xmldecl_possible = false; | - | ||||||||||||||||||||||||
1708 | state = PInstrR; | - | ||||||||||||||||||||||||
1709 | break; executed 134 times by 2 tests: break; Executed by:
| 134 | ||||||||||||||||||||||||
1710 | case executed 2029 times by 6 tests: Done:case Done: Executed by:
executed 2029 times by 6 tests: case Done: Executed by:
| 2029 | ||||||||||||||||||||||||
1711 | return executed 2029 times by 6 tests: true;return true; Executed by:
executed 2029 times by 6 tests: return true; Executed by:
| 2029 | ||||||||||||||||||||||||
1712 | case executed 6 times by 1 test: -1:case -1: Executed by:
executed 6 times by 1 test: case -1: Executed by:
| 6 | ||||||||||||||||||||||||
1713 | reportParseError(QLatin1String("error occurred while parsing element")); | - | ||||||||||||||||||||||||
1714 | return executed 6 times by 1 test: false;return false; Executed by:
executed 6 times by 1 test: return false; Executed by:
| 6 | ||||||||||||||||||||||||
1715 | } | - | ||||||||||||||||||||||||
1716 | - | |||||||||||||||||||||||||
1717 | if (atEnd()
| 1664-12160 | ||||||||||||||||||||||||
1718 | unexpectedEof(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
1719 | return executed 1664 times by 1 test: false;return false; Executed by:
executed 1664 times by 1 test: return false; Executed by:
| 1664 | ||||||||||||||||||||||||
1720 | } | - | ||||||||||||||||||||||||
1721 | if (is_S(c)
| 1960-10200 | ||||||||||||||||||||||||
1722 | input = InpWs; | - | ||||||||||||||||||||||||
1723 | } executed 1960 times by 4 tests: else if (c == QLatin1Char('<')end of block Executed by:
| 1960-6076 | ||||||||||||||||||||||||
1724 | input = InpLt; | - | ||||||||||||||||||||||||
1725 | } executed 4124 times by 6 tests: else if (c == QLatin1Char('?')end of block Executed by:
| 147-5929 | ||||||||||||||||||||||||
1726 | input = InpQm; | - | ||||||||||||||||||||||||
1727 | } executed 147 times by 2 tests: else if (c == QLatin1Char('!')end of block Executed by:
| 147-3981 | ||||||||||||||||||||||||
1728 | input = InpEm; | - | ||||||||||||||||||||||||
1729 | } executed 1948 times by 4 tests: else if (c == QLatin1Char('D')end of block Executed by:
| 1923-2058 | ||||||||||||||||||||||||
1730 | input = InpD; | - | ||||||||||||||||||||||||
1731 | } executed 1923 times by 4 tests: else if (c == QLatin1Char('-')end of block Executed by:
| 23-2035 | ||||||||||||||||||||||||
1732 | input = InpDash; | - | ||||||||||||||||||||||||
1733 | } executed 23 times by 2 tests: else {end of block Executed by:
| 23 | ||||||||||||||||||||||||
1734 | input = InpUnknown; | - | ||||||||||||||||||||||||
1735 | } executed 2035 times by 6 tests: end of block Executed by:
| 2035 | ||||||||||||||||||||||||
1736 | state = table[state][input]; | - | ||||||||||||||||||||||||
1737 | - | |||||||||||||||||||||||||
1738 | switch (state) { | - | ||||||||||||||||||||||||
1739 | case executed 1960 times by 4 tests: EatWS:case EatWS: Executed by:
executed 1960 times by 4 tests: case EatWS: Executed by:
| 1960 | ||||||||||||||||||||||||
1740 | - | |||||||||||||||||||||||||
1741 | xmldecl_possible = false; | - | ||||||||||||||||||||||||
1742 | if (!eat_ws()
| 746-1214 | ||||||||||||||||||||||||
1743 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
1744 | return executed 746 times by 1 test: false;return false; Executed by:
executed 746 times by 1 test: return false; Executed by:
| 746 | ||||||||||||||||||||||||
1745 | } | - | ||||||||||||||||||||||||
1746 | break; executed 1214 times by 4 tests: break; Executed by:
| 1214 | ||||||||||||||||||||||||
1747 | case executed 4124 times by 6 tests: Lt:case Lt: Executed by:
executed 4124 times by 6 tests: case Lt: Executed by:
| 4124 | ||||||||||||||||||||||||
1748 | next(); | - | ||||||||||||||||||||||||
1749 | break; executed 4124 times by 6 tests: break; Executed by:
| 4124 | ||||||||||||||||||||||||
1750 | case executed 1948 times by 4 tests: Em:case Em: Executed by:
executed 1948 times by 4 tests: case Em: Executed by:
| 1948 | ||||||||||||||||||||||||
1751 | - | |||||||||||||||||||||||||
1752 | xmldecl_possible = false; | - | ||||||||||||||||||||||||
1753 | next(); | - | ||||||||||||||||||||||||
1754 | break; executed 1948 times by 4 tests: break; Executed by:
| 1948 | ||||||||||||||||||||||||
1755 | case executed 1923 times by 4 tests: DocType:case DocType: Executed by:
executed 1923 times by 4 tests: case DocType: Executed by:
| 1923 | ||||||||||||||||||||||||
1756 | if (!parseDoctype()
| 378-1545 | ||||||||||||||||||||||||
1757 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
1758 | return executed 1545 times by 1 test: false;return false; Executed by:
executed 1545 times by 1 test: return false; Executed by:
| 1545 | ||||||||||||||||||||||||
1759 | } | - | ||||||||||||||||||||||||
1760 | break; executed 378 times by 4 tests: break; Executed by:
| 378 | ||||||||||||||||||||||||
1761 | case executed 23 times by 2 tests: Comment:case Comment: Executed by:
executed 23 times by 2 tests: case Comment: Executed by:
| 23 | ||||||||||||||||||||||||
1762 | case never executed: CommentR:case CommentR: never executed: case CommentR: | 0 | ||||||||||||||||||||||||
1763 | if (!parseComment()
| 11-12 | ||||||||||||||||||||||||
1764 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
1765 | return executed 11 times by 1 test: false;return false; Executed by:
executed 11 times by 1 test: return false; Executed by:
| 11 | ||||||||||||||||||||||||
1766 | } | - | ||||||||||||||||||||||||
1767 | break; executed 12 times by 2 tests: break; Executed by:
| 12 | ||||||||||||||||||||||||
1768 | case executed 147 times by 2 tests: PInstr:case PInstr: Executed by:
executed 147 times by 2 tests: case PInstr: Executed by:
| 147 | ||||||||||||||||||||||||
1769 | case never executed: PInstrR:case PInstrR: never executed: case PInstrR: | 0 | ||||||||||||||||||||||||
1770 | parsePI_xmldecl = xmldecl_possible; | - | ||||||||||||||||||||||||
1771 | if (!parsePI()
| 26-121 | ||||||||||||||||||||||||
1772 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
1773 | return executed 121 times by 1 test: false;return false; Executed by:
executed 121 times by 1 test: return false; Executed by:
| 121 | ||||||||||||||||||||||||
1774 | } | - | ||||||||||||||||||||||||
1775 | break; executed 26 times by 2 tests: break; Executed by:
| 26 | ||||||||||||||||||||||||
1776 | } | - | ||||||||||||||||||||||||
1777 | } executed 9737 times by 6 tests: end of block Executed by:
| 9737 | ||||||||||||||||||||||||
1778 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1779 | } | - | ||||||||||||||||||||||||
1780 | - | |||||||||||||||||||||||||
1781 | - | |||||||||||||||||||||||||
1782 | - | |||||||||||||||||||||||||
1783 | - | |||||||||||||||||||||||||
1784 | - | |||||||||||||||||||||||||
1785 | - | |||||||||||||||||||||||||
1786 | bool QXmlSimpleReaderPrivate::parseElement() | - | ||||||||||||||||||||||||
1787 | { | - | ||||||||||||||||||||||||
1788 | const int Init = 0; | - | ||||||||||||||||||||||||
1789 | const int ReadName = 1; | - | ||||||||||||||||||||||||
1790 | const int Ws1 = 2; | - | ||||||||||||||||||||||||
1791 | const int STagEnd = 3; | - | ||||||||||||||||||||||||
1792 | const int STagEnd2 = 4; | - | ||||||||||||||||||||||||
1793 | const int ETagBegin = 5; | - | ||||||||||||||||||||||||
1794 | const int ETagBegin2 = 6; | - | ||||||||||||||||||||||||
1795 | const int Ws2 = 7; | - | ||||||||||||||||||||||||
1796 | const int EmptyTag = 8; | - | ||||||||||||||||||||||||
1797 | const int Attrib = 9; | - | ||||||||||||||||||||||||
1798 | const int AttribPro = 10; | - | ||||||||||||||||||||||||
1799 | const int Ws3 = 11; | - | ||||||||||||||||||||||||
1800 | const int Done = 12; | - | ||||||||||||||||||||||||
1801 | - | |||||||||||||||||||||||||
1802 | const int InpWs = 0; | - | ||||||||||||||||||||||||
1803 | const int InpNameBe = 1; | - | ||||||||||||||||||||||||
1804 | const int InpGt = 2; | - | ||||||||||||||||||||||||
1805 | const int InpSlash = 3; | - | ||||||||||||||||||||||||
1806 | const int InpUnknown = 4; | - | ||||||||||||||||||||||||
1807 | - | |||||||||||||||||||||||||
1808 | static const int table[12][5] = { | - | ||||||||||||||||||||||||
1809 | - | |||||||||||||||||||||||||
1810 | { -1, ReadName, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1811 | { Ws1, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
1812 | { -1, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
1813 | { STagEnd2, STagEnd2, STagEnd2, STagEnd2, STagEnd2 }, | - | ||||||||||||||||||||||||
1814 | { -1, -1, -1, ETagBegin, -1 }, | - | ||||||||||||||||||||||||
1815 | { -1, ETagBegin2, -1, -1, -1 }, | - | ||||||||||||||||||||||||
1816 | { Ws2, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
1817 | { -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
1818 | { -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
1819 | { Ws3, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
1820 | { Ws3, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
1821 | { -1, Attrib, STagEnd, EmptyTag, -1 } | - | ||||||||||||||||||||||||
1822 | }; | - | ||||||||||||||||||||||||
1823 | int state; | - | ||||||||||||||||||||||||
1824 | int input; | - | ||||||||||||||||||||||||
1825 | - | |||||||||||||||||||||||||
1826 | if (parseStack == 0
| 1814-11462 | ||||||||||||||||||||||||
1827 | state = Init; | - | ||||||||||||||||||||||||
1828 | } executed 5806 times by 6 tests: else {end of block Executed by:
| 5806 | ||||||||||||||||||||||||
1829 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
1830 | - | |||||||||||||||||||||||||
1831 | - | |||||||||||||||||||||||||
1832 | - | |||||||||||||||||||||||||
1833 | if (!parseStack->isEmpty()
| 1223-8425 | ||||||||||||||||||||||||
1834 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
1835 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 136-8289 | ||||||||||||||||||||||||
1836 | parseStack->pop(); | - | ||||||||||||||||||||||||
1837 | - | |||||||||||||||||||||||||
1838 | - | |||||||||||||||||||||||||
1839 | - | |||||||||||||||||||||||||
1840 | } executed 136 times by 1 test: end of block Executed by:
| 136 | ||||||||||||||||||||||||
1841 | if (!(this->*function)()
| 3566-4859 | ||||||||||||||||||||||||
1842 | parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
1843 | return executed 4859 times by 1 test: false;return false; Executed by:
executed 4859 times by 1 test: return false; Executed by:
| 4859 | ||||||||||||||||||||||||
1844 | } | - | ||||||||||||||||||||||||
1845 | } executed 3566 times by 1 test: end of block Executed by:
| 3566 | ||||||||||||||||||||||||
1846 | } executed 4789 times by 1 test: end of block Executed by:
| 4789 | ||||||||||||||||||||||||
1847 | - | |||||||||||||||||||||||||
1848 | for (;;) { | - | ||||||||||||||||||||||||
1849 | switch (state) { | - | ||||||||||||||||||||||||
1850 | case executed 5802 times by 6 tests: ReadName:case ReadName: Executed by:
executed 5802 times by 6 tests: case ReadName: Executed by:
| 5802 | ||||||||||||||||||||||||
1851 | - | |||||||||||||||||||||||||
1852 | tags.push(name()); | - | ||||||||||||||||||||||||
1853 | - | |||||||||||||||||||||||||
1854 | attList.clear(); | - | ||||||||||||||||||||||||
1855 | if (useNamespaces
| 1021-4781 | ||||||||||||||||||||||||
1856 | namespaceSupport.pushContext(); executed 4781 times by 3 tests: namespaceSupport.pushContext(); Executed by:
| 4781 | ||||||||||||||||||||||||
1857 | break; executed 5802 times by 6 tests: break; Executed by:
| 5802 | ||||||||||||||||||||||||
1858 | case executed 5180 times by 6 tests: ETagBegin2:case ETagBegin2: Executed by:
executed 5180 times by 6 tests: case ETagBegin2: Executed by:
| 5180 | ||||||||||||||||||||||||
1859 | if (!processElementETagBegin2()
| 4-5176 | ||||||||||||||||||||||||
1860 | return executed 4 times by 1 test: false;return false; Executed by:
executed 4 times by 1 test: return false; Executed by:
| 4 | ||||||||||||||||||||||||
1861 | break; executed 5176 times by 6 tests: break; Executed by:
| 5176 | ||||||||||||||||||||||||
1862 | case executed 12894 times by 6 tests: Attrib:case Attrib: Executed by:
executed 12894 times by 6 tests: case Attrib: Executed by:
| 12894 | ||||||||||||||||||||||||
1863 | if (!processElementAttribute()
| 0-12894 | ||||||||||||||||||||||||
1864 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1865 | state = AttribPro; | - | ||||||||||||||||||||||||
1866 | break; executed 12894 times by 6 tests: break; Executed by:
| 12894 | ||||||||||||||||||||||||
1867 | case executed 5723 times by 6 tests: Done:case Done: Executed by:
executed 5723 times by 6 tests: case Done: Executed by:
| 5723 | ||||||||||||||||||||||||
1868 | return executed 5723 times by 6 tests: true;return true; Executed by:
executed 5723 times by 6 tests: return true; Executed by:
| 5723 | ||||||||||||||||||||||||
1869 | case executed 14 times by 1 test: -1:case -1: Executed by:
executed 14 times by 1 test: case -1: Executed by:
| 14 | ||||||||||||||||||||||||
1870 | reportParseError(QLatin1String("error occurred while parsing element")); | - | ||||||||||||||||||||||||
1871 | return executed 14 times by 1 test: false;return false; Executed by:
executed 14 times by 1 test: return false; Executed by:
| 14 | ||||||||||||||||||||||||
1872 | } | - | ||||||||||||||||||||||||
1873 | - | |||||||||||||||||||||||||
1874 | if (atEnd()
| 1225-58942 | ||||||||||||||||||||||||
1875 | unexpectedEof(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
1876 | return executed 1225 times by 1 test: false;return false; Executed by:
executed 1225 times by 1 test: return false; Executed by:
| 1225 | ||||||||||||||||||||||||
1877 | } | - | ||||||||||||||||||||||||
1878 | if (fastDetermineNameChar(c) == NameBeginning
|