| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qdataurl.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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")
| 0-32 | ||||||||||||
| 13 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 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
| 1-31 | ||||||||||||
| 26 | payload = data.mid(pos + 1); | - | ||||||||||||
| 27 | data.truncate(pos); | - | ||||||||||||
| 28 | data = data.trimmed(); | - | ||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | if (data.endsWith(";base64")
| 11-20 | ||||||||||||
| 32 | payload = QByteArray::fromBase64(payload); | - | ||||||||||||
| 33 | data.chop(7); | - | ||||||||||||
| 34 | } executed 11 times by 1 test: end of blockExecuted by:
| 11 | ||||||||||||
| 35 | - | |||||||||||||
| 36 | if (data.toLower().startsWith("charset")
| 4-27 | ||||||||||||
| 37 | int i = 7; | - | ||||||||||||
| 38 | while (data.at(i) == ' '
| 1-4 | ||||||||||||
| 39 | ++ executed 1 time by 1 test: i;++i;Executed by:
executed 1 time by 1 test: ++i;Executed by:
| 1 | ||||||||||||
| 40 | if (data.at(i) == '='
| 0-4 | ||||||||||||
| 41 | data.prepend("text/plain;"); executed 4 times by 1 test: data.prepend("text/plain;");Executed by:
| 4 | ||||||||||||
| 42 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||
| 43 | - | |||||||||||||
| 44 | if (!data.isEmpty()
| 15-16 | ||||||||||||
| 45 | mimeType = QLatin1String(data.trimmed()); executed 16 times by 2 tests: mimeType = QLatin1String(data.trimmed());Executed by:
| 16 | ||||||||||||
| 46 | - | |||||||||||||
| 47 | } executed 31 times by 2 tests: end of blockExecuted by:
| 31 | ||||||||||||
| 48 | - | |||||||||||||
| 49 | return executed 32 times by 2 tests: true;return true;Executed by:
executed 32 times by 2 tests: return true;Executed by:
| 32 | ||||||||||||
| 50 | } | - | ||||||||||||
| 51 | - | |||||||||||||
| 52 | - | |||||||||||||
| Switch to Source code | Preprocessed file |