MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / Match

Method Match

CppCoverage/WildcardCoverageFilter.cpp:124–147  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

122
123 //---------------------------------------------------------------------
124 bool WildcardCoverageFilter::Match(
125 const std::wstring& str,
126 const Filter& filter,
127 std::wostream& ostr) const
128 {
129 const auto* selectedRegEx = MatchAny(str, filter.selectedWildcards);
130
131 if (!selectedRegEx)
132 {
133 ostr << L": " << str << L" is skipped because it matches no selected patterns";
134 return false;
135 }
136
137 const auto* excludedRegEx = MatchAny(str, filter.excludedWildcards);
138
139 if (excludedRegEx)
140 {
141 ostr << L": " << str << L" is not selected because it matches excluded pattern: " << *excludedRegEx;
142 return false;
143 }
144
145 ostr << L": " << str << L" is selected because it matches selected pattern: " << *selectedRegEx;;
146 return true;
147 }
148}

Callers 1

MatchAnyFunction · 0.45

Calls 1

MatchAnyFunction · 0.85

Tested by

no test coverage detected