| 397 | } |
| 398 | |
| 399 | absl::Status ParsedMapFieldValue::ListKeys( |
| 400 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 401 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 402 | google::protobuf::Arena* absl_nonnull arena, ListValue* absl_nonnull result) const { |
| 403 | ABSL_DCHECK(*this); |
| 404 | if (field_ == nullptr) { |
| 405 | *result = ListValue(); |
| 406 | return absl::OkStatus(); |
| 407 | } |
| 408 | const auto* reflection = message_->GetReflection(); |
| 409 | if (reflection->FieldSize(*message_, field_) == 0) { |
| 410 | *result = ListValue(); |
| 411 | return absl::OkStatus(); |
| 412 | } |
| 413 | CEL_ASSIGN_OR_RETURN(auto key_accessor, |
| 414 | common_internal::MapFieldKeyAccessorFor( |
| 415 | field_->message_type()->map_key())); |
| 416 | auto builder = NewListValueBuilder(arena); |
| 417 | builder->Reserve(Size()); |
| 418 | auto begin = extensions::protobuf_internal::ConstMapBegin(*reflection, |
| 419 | *message_, *field_); |
| 420 | const auto end = extensions::protobuf_internal::ConstMapEnd( |
| 421 | *reflection, *message_, *field_); |
| 422 | for (; begin != end; ++begin) { |
| 423 | Value scratch; |
| 424 | (*key_accessor)(begin.GetKey(), message_, arena, &scratch); |
| 425 | CEL_RETURN_IF_ERROR(builder->Add(std::move(scratch))); |
| 426 | } |
| 427 | *result = std::move(*builder).Build(); |
| 428 | return absl::OkStatus(); |
| 429 | } |
| 430 | |
| 431 | absl::Status ParsedMapFieldValue::ForEach( |
| 432 | ForEachCallback callback, |
nothing calls this directly
no test coverage detected