MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / MatchAgainstPatterns

Function MatchAgainstPatterns

eval/eval/attribute_utility.cc:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48DefaultAttributeMatcher::DefaultAttributeMatcher() = default;
49
50AttributeMatcher::MatchResult MatchAgainstPatterns(
51 absl::Span<const AttributePattern> patterns, const Attribute& attr) {
52 MatchResult result = MatchResult::NONE;
53 for (const auto& pattern : patterns) {
54 auto current_match = pattern.IsMatch(attr);
55 if (current_match == cel::AttributePattern::MatchType::FULL) {
56 return MatchResult::FULL;
57 }
58 if (current_match == cel::AttributePattern::MatchType::PARTIAL) {
59 result = MatchResult::PARTIAL;
60 }
61 }
62 return result;
63}
64
65DefaultAttributeMatcher::MatchResult DefaultAttributeMatcher::CheckForUnknown(
66 const Attribute& attr) const {

Callers 2

CheckForUnknownMethod · 0.85
CheckForMissingMethod · 0.85

Calls 1

IsMatchMethod · 0.45

Tested by

no test coverage detected