See ListValueInterface::Get for documentation.
| 211 | |
| 212 | // See ListValueInterface::Get for documentation. |
| 213 | absl::Status ParsedJsonListValue::Get( |
| 214 | size_t index, const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 215 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 216 | google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const { |
| 217 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 218 | ABSL_DCHECK(message_factory != nullptr); |
| 219 | ABSL_DCHECK(arena != nullptr); |
| 220 | ABSL_DCHECK(result != nullptr); |
| 221 | |
| 222 | if (value_ == nullptr) { |
| 223 | *result = IndexOutOfBoundsError(index); |
| 224 | return absl::OkStatus(); |
| 225 | } |
| 226 | const auto reflection = |
| 227 | well_known_types::GetListValueReflectionOrDie(value_->GetDescriptor()); |
| 228 | if (ABSL_PREDICT_FALSE(index >= |
| 229 | static_cast<size_t>(reflection.ValuesSize(*value_)))) { |
| 230 | *result = IndexOutOfBoundsError(index); |
| 231 | return absl::OkStatus(); |
| 232 | } |
| 233 | *result = common_internal::ParsedJsonValue( |
| 234 | &reflection.Values(*value_, static_cast<int>(index)), arena); |
| 235 | return absl::OkStatus(); |
| 236 | } |
| 237 | |
| 238 | absl::Status ParsedJsonListValue::ForEach( |
| 239 | ForEachWithIndexCallback callback, |
nothing calls this directly
no test coverage detected