MCPcopy Create free account
hub / github.com/KDE/kdiff3 / wildcardMultiMatch

Method wildcardMultiMatch

src/Utils.cpp:101–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool Utils::wildcardMultiMatch(const QString& wildcard, const QString& testString, bool bCaseSensitive)
102{
103 static QHash<QString, QRegularExpression> s_patternMap;
104
105 const QStringList regExpList = wildcard.split(QChar(';'));
106
107 for(const QString& regExp : regExpList)
108 {
109 QHash<QString, QRegularExpression>::iterator patIt = s_patternMap.find(regExp);
110 if(patIt == s_patternMap.end())
111 {
112 QRegularExpression pattern(QRegularExpression::wildcardToRegularExpression(regExp), bCaseSensitive ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption);
113 patIt = s_patternMap.insert(regExp, pattern);
114 }
115
116 if(patIt.value().match(testString).hasMatch())
117 return true;
118 }
119
120 return false;
121}
122
123//TODO: Only used by calcTokenPos.
124bool Utils::isCTokenChar(QChar c)

Callers

nothing calls this directly

Calls 3

splitMethod · 0.80
endMethod · 0.80
valueMethod · 0.80

Tested by

no test coverage detected