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

Method Parse

codelab/network_functions.cc:384–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384absl::optional<NetworkAddressRep> NetworkAddressRep::Parse(
385 absl::string_view str) {
386 uint32_t ipv4 = 0;
387 char ipv6[16];
388 auto version = ParseAddressImpl(str, &ipv4, ipv6);
389 if (!version.ok()) {
390 return absl::nullopt;
391 }
392 if (*version != IpVersion::kIPv4) {
393 return absl::nullopt;
394 }
395 NetworkAddressRep rep;
396 rep.version_ = *version;
397 rep.addr_.v4 = ipv4;
398 return rep;
399}
400
401bool NetworkAddressRep::IsEqualTo(const NetworkAddressRep& other) const {
402 if (version_ != other.version_) {

Callers 2

MakeTestParsedAstFunction · 0.45
ParseFunction · 0.45

Calls 2

ParseAddressImplFunction · 0.85
okMethod · 0.45

Tested by 2

MakeTestParsedAstFunction · 0.36
ParseFunction · 0.36