MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / GetFieldByName

Method GetFieldByName

common/values/parsed_message_value.cc:177–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177absl::Status ParsedMessageValue::GetFieldByName(
178 absl::string_view name, ProtoWrapperTypeOptions unboxing_options,
179 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
180 google::protobuf::MessageFactory* absl_nonnull message_factory,
181 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const {
182 ABSL_DCHECK(descriptor_pool != nullptr);
183 ABSL_DCHECK(message_factory != nullptr);
184 ABSL_DCHECK(arena != nullptr);
185 ABSL_DCHECK(result != nullptr);
186
187 const auto* descriptor = GetDescriptor();
188 const auto* field = descriptor->FindFieldByName(name);
189 if (field == nullptr) {
190 field = descriptor->file()->pool()->FindExtensionByPrintableName(descriptor,
191 name);
192 if (field == nullptr) {
193 *result = NoSuchFieldError(name);
194 return absl::OkStatus();
195 }
196 }
197 return GetField(field, unboxing_options, descriptor_pool, message_factory,
198 arena, result);
199}
200
201absl::Status ParsedMessageValue::GetFieldByNumber(
202 int64_t number, ProtoWrapperTypeOptions unboxing_options,

Callers

nothing calls this directly

Calls 3

GetDescriptorFunction · 0.85
NoSuchFieldErrorFunction · 0.85
FindFieldByNameMethod · 0.45

Tested by

no test coverage detected