io/qdataurl.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10__attribute__((visibility("default"))) bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray &payload) -
11{ -
12 if (uri.scheme() != QLatin1String("data") || !uri.host().isEmpty())
evaluated: uri.scheme() != QLatin1String("data")
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:32
partially evaluated: !uri.host().isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
0-32
13 return false;
executed: return false;
Execution Count:1
1
14 -
15 mimeType = QLatin1String("text/plain;charset=US-ASCII"); -
16 -
17 -
18 -
19 -
20 -
21 QByteArray data = QByteArray::fromPercentEncoding(uri.url(QUrl::FullyEncoded | QUrl::RemoveScheme).toLatin1()); -
22 -
23 -
24 int pos = data.indexOf(','); -
25 if (pos != -1) {
evaluated: pos != -1
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:1
1-31
26 payload = data.mid(pos + 1); -
27 data.truncate(pos); -
28 data = data.trimmed(); -
29 -
30 -
31 if (data.endsWith(";base64")) {
evaluated: data.endsWith(";base64")
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:20
11-20
32 payload = QByteArray::fromBase64(payload); -
33 data.chop(7); -
34 }
executed: }
Execution Count:11
11
35 -
36 if (data.toLower().startsWith("charset")) {
evaluated: data.toLower().startsWith("charset")
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:27
4-27
37 int i = 7; -
38 while (data.at(i) == ' ')
evaluated: data.at(i) == ' '
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
1-4
39 ++i;
executed: ++i;
Execution Count:1
1
40 if (data.at(i) == '=')
partially evaluated: data.at(i) == '='
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
41 data.prepend("text/plain;");
executed: data.prepend("text/plain;");
Execution Count:4
4
42 }
executed: }
Execution Count:4
4
43 -
44 if (!data.isEmpty())
evaluated: !data.isEmpty()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:15
15-16
45 mimeType = QLatin1String(data.trimmed());
executed: mimeType = QLatin1String(data.trimmed());
Execution Count:16
16
46 -
47 }
executed: }
Execution Count:31
31
48 -
49 return true;
executed: return true;
Execution Count:32
32
50} -
51 -
52 -
53 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial