| 310 | } |
| 311 | |
| 312 | absl::Status ParsedJsonMapValue::ForEach( |
| 313 | ForEachCallback callback, |
| 314 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 315 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 316 | google::protobuf::Arena* absl_nonnull arena) const { |
| 317 | if (value_ == nullptr) { |
| 318 | return absl::OkStatus(); |
| 319 | } |
| 320 | const auto reflection = |
| 321 | well_known_types::GetStructReflectionOrDie(value_->GetDescriptor()); |
| 322 | Value key_scratch; |
| 323 | Value value_scratch; |
| 324 | auto map_begin = reflection.BeginFields(*value_); |
| 325 | const auto map_end = reflection.EndFields(*value_); |
| 326 | for (; map_begin != map_end; ++map_begin) { |
| 327 | // We have to copy until `google::protobuf::MapKey` is just a view. |
| 328 | key_scratch = StringValue(arena, map_begin.GetKey().GetStringValue()); |
| 329 | value_scratch = common_internal::ParsedJsonValue( |
| 330 | &map_begin.GetValueRef().GetMessageValue(), arena); |
| 331 | CEL_ASSIGN_OR_RETURN(auto ok, callback(key_scratch, value_scratch)); |
| 332 | if (!ok) { |
| 333 | break; |
| 334 | } |
| 335 | } |
| 336 | return absl::OkStatus(); |
| 337 | } |
| 338 | |
| 339 | namespace { |
| 340 |
nothing calls this directly
no test coverage detected