mimetypes/qmimemagicrulematcher.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4QMimeMagicRuleMatcher::QMimeMagicRuleMatcher(const QString &mime, unsigned thePriority) : -
5 m_list(), -
6 m_priority(thePriority), -
7 m_mimetype(mime) -
8{ -
9}
never executed: }
0
10 -
11bool QMimeMagicRuleMatcher::operator==(const QMimeMagicRuleMatcher &other) const -
12{ -
13 return m_list == other.m_list && 0
14 m_priority == other.m_priority;
never executed: return m_list == other.m_list && m_priority == other.m_priority;
0
15} -
16 -
17void QMimeMagicRuleMatcher::addRule(const QMimeMagicRule &rule) -
18{ -
19 m_list.append(rule); -
20}
never executed: }
0
21 -
22void QMimeMagicRuleMatcher::addRules(const QList<QMimeMagicRule> &rules) -
23{ -
24 m_list.append(rules); -
25}
never executed: }
0
26 -
27QList<QMimeMagicRule> QMimeMagicRuleMatcher::magicRules() const -
28{ -
29 return m_list;
never executed: return m_list;
0
30} -
31 -
32 -
33bool QMimeMagicRuleMatcher::matches(const QByteArray &data) const -
34{ -
35 for (QForeachContainer<__typeof__(m_list)> _container_(m_list); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QMimeMagicRule &magicRule = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
36 if (magicRule.matches(data))
never evaluated: magicRule.matches(data)
0
37 return true;
never executed: return true;
0
38 }
never executed: }
0
39 -
40 return false;
never executed: return false;
0
41} -
42 -
43 -
44unsigned QMimeMagicRuleMatcher::priority() const -
45{ -
46 return m_priority;
never executed: return m_priority;
0
47} -
48 -
49 -
50 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial