| 236 | } |
| 237 | |
| 238 | absl::Status ParsedJsonListValue::ForEach( |
| 239 | ForEachWithIndexCallback callback, |
| 240 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 241 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 242 | google::protobuf::Arena* absl_nonnull arena) const { |
| 243 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 244 | ABSL_DCHECK(message_factory != nullptr); |
| 245 | ABSL_DCHECK(arena != nullptr); |
| 246 | |
| 247 | if (value_ == nullptr) { |
| 248 | return absl::OkStatus(); |
| 249 | } |
| 250 | Value scratch; |
| 251 | const auto reflection = |
| 252 | well_known_types::GetListValueReflectionOrDie(value_->GetDescriptor()); |
| 253 | const int size = reflection.ValuesSize(*value_); |
| 254 | for (int i = 0; i < size; ++i) { |
| 255 | scratch = |
| 256 | common_internal::ParsedJsonValue(&reflection.Values(*value_, i), arena); |
| 257 | CEL_ASSIGN_OR_RETURN(auto ok, callback(static_cast<size_t>(i), scratch)); |
| 258 | if (!ok) { |
| 259 | break; |
| 260 | } |
| 261 | } |
| 262 | return absl::OkStatus(); |
| 263 | } |
| 264 | |
| 265 | namespace { |
| 266 |
nothing calls this directly
no test coverage detected