============================================================================= Extension function implementations. =============================================================================
| 305 | // Extension function implementations. |
| 306 | // ============================================================================= |
| 307 | cel::Value parseAddress( |
| 308 | const cel::StringValue& str, |
| 309 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 310 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 311 | google::protobuf::Arena* absl_nonnull arena) { |
| 312 | std::string buf; |
| 313 | absl::string_view addr = str.ToStringView(&buf); |
| 314 | absl::optional<NetworkAddressRep> rep = NetworkAddressRep::Parse(addr); |
| 315 | if (!rep.has_value()) { |
| 316 | return cel::ErrorValue(absl::InvalidArgumentError("invalid address")); |
| 317 | } |
| 318 | return NetworkAddressRep::MakeValue(*rep); |
| 319 | } |
| 320 | |
| 321 | cel::Value parseAddressOrZero(const cel::StringValue& str) { |
| 322 | std::string buf; |
nothing calls this directly
no test coverage detected