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

Function parseAddressOrZero

codelab/network_functions.cc:321–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321cel::Value parseAddressOrZero(const cel::StringValue& str) {
322 std::string buf;
323 absl::string_view addr = str.ToStringView(&buf);
324 absl::optional<NetworkAddressRep> rep = NetworkAddressRep::Parse(addr);
325 static const NetworkAddressRep kZero;
326 if (!rep.has_value()) {
327 return NetworkAddressRep::MakeValue(kZero);
328 }
329 return NetworkAddressRep::MakeValue(*rep);
330}
331
332cel::Value parseAddressMatcher(
333 const cel::StringValue& str,

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected