| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/mimetypes/qmimemagicrulematcher.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | QMimeMagicRuleMatcher::QMimeMagicRuleMatcher(const QString &mime, unsigned thePriority) : | - | ||||||
| 7 | m_list(), | - | ||||||
| 8 | m_priority(thePriority), | - | ||||||
| 9 | m_mimetype(mime) | - | ||||||
| 10 | { | - | ||||||
| 11 | } executed 1733 times by 1 test: end of blockExecuted by:
| 1733 | ||||||
| 12 | - | |||||||
| 13 | bool QMimeMagicRuleMatcher::operator==(const QMimeMagicRuleMatcher &other) const | - | ||||||
| 14 | { | - | ||||||
| 15 | return never executed: m_list == other.m_list &&return m_list == other.m_list && m_priority == other.m_priority;never executed: return m_list == other.m_list && m_priority == other.m_priority; | 0 | ||||||
| 16 | m_priority == other.m_priority; never executed: return m_list == other.m_list && m_priority == other.m_priority; | 0 | ||||||
| 17 | } | - | ||||||
| 18 | - | |||||||
| 19 | void QMimeMagicRuleMatcher::addRule(const QMimeMagicRule &rule) | - | ||||||
| 20 | { | - | ||||||
| 21 | m_list.append(rule); | - | ||||||
| 22 | } never executed: end of block | 0 | ||||||
| 23 | - | |||||||
| 24 | void QMimeMagicRuleMatcher::addRules(const QList<QMimeMagicRule> &rules) | - | ||||||
| 25 | { | - | ||||||
| 26 | m_list.append(rules); | - | ||||||
| 27 | } executed 1733 times by 1 test: end of blockExecuted by:
| 1733 | ||||||
| 28 | - | |||||||
| 29 | QList<QMimeMagicRule> QMimeMagicRuleMatcher::magicRules() const | - | ||||||
| 30 | { | - | ||||||
| 31 | return never executed: m_list;return m_list;never executed: return m_list; | 0 | ||||||
| 32 | } | - | ||||||
| 33 | - | |||||||
| 34 | - | |||||||
| 35 | bool QMimeMagicRuleMatcher::matches(const QByteArray &data) const | - | ||||||
| 36 | { | - | ||||||
| 37 | for (const QMimeMagicRule &magicRule : m_list) { | - | ||||||
| 38 | if (magicRule.matches(data)
| 37-19185 | ||||||
| 39 | return executed 37 times by 1 test: true;return true;Executed by:
executed 37 times by 1 test: return true;Executed by:
| 37 | ||||||
| 40 | } executed 19185 times by 1 test: end of blockExecuted by:
| 19185 | ||||||
| 41 | - | |||||||
| 42 | return executed 11003 times by 1 test: false;return false;Executed by:
executed 11003 times by 1 test: return false;Executed by:
| 11003 | ||||||
| 43 | } | - | ||||||
| 44 | - | |||||||
| 45 | - | |||||||
| 46 | unsigned QMimeMagicRuleMatcher::priority() const | - | ||||||
| 47 | { | - | ||||||
| 48 | return executed 37 times by 1 test: m_priority;return m_priority;Executed by:
executed 37 times by 1 test: return m_priority;Executed by:
| 37 | ||||||
| 49 | } | - | ||||||
| 50 | - | |||||||
| 51 | - | |||||||
| Switch to Source code | Preprocessed file |