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

Function parseAddressMatcher

codelab/network_functions.cc:332–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332cel::Value parseAddressMatcher(
333 const cel::StringValue& str,
334 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
335 google::protobuf::MessageFactory* absl_nonnull message_factory,
336 google::protobuf::Arena* absl_nonnull arena) {
337 std::string buf;
338 absl::string_view addr = str.ToStringView(&buf);
339 absl::optional<NetworkAddressMatcher> rep =
340 NetworkAddressMatcher::Parse(addr);
341 if (!rep.has_value()) {
342 return cel::ErrorValue(
343 absl::InvalidArgumentError("invalid address matcher"));
344 }
345
346 return NetworkAddressMatcher::MakeValue(arena, std::move(rep).value());
347}
348
349cel::Value containsAddress(const cel::OpaqueValue& matcher,
350 const cel::OpaqueValue& addr) {

Callers

nothing calls this directly

Calls 6

ErrorValueFunction · 0.85
MakeValueFunction · 0.85
ToStringViewMethod · 0.80
ParseFunction · 0.50
has_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected