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

Method GetFieldByName

common/legacy_value.cc:919–937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

917}
918
919absl::Status LegacyStructValue::GetFieldByName(
920 absl::string_view name, ProtoWrapperTypeOptions unboxing_options,
921 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
922 google::protobuf::MessageFactory* absl_nonnull message_factory,
923 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const {
924 auto message_wrapper = AsMessageWrapper(message_ptr_, legacy_type_info_);
925 const auto* access_apis =
926 message_wrapper.legacy_type_info()->GetAccessApis(message_wrapper);
927 if (ABSL_PREDICT_FALSE(access_apis == nullptr)) {
928 *result = NoSuchFieldError(name);
929 return absl::OkStatus();
930 }
931 CEL_ASSIGN_OR_RETURN(
932 auto cel_value,
933 access_apis->GetField(name, message_wrapper, unboxing_options,
934 MemoryManagerRef::Pooling(arena)));
935 CEL_RETURN_IF_ERROR(ModernValue(arena, cel_value, *result));
936 return absl::OkStatus();
937}
938
939absl::Status LegacyStructValue::GetFieldByNumber(
940 int64_t number, ProtoWrapperTypeOptions unboxing_options,

Callers

nothing calls this directly

Calls 5

AsMessageWrapperFunction · 0.85
NoSuchFieldErrorFunction · 0.85
legacy_type_infoMethod · 0.80
ModernValueFunction · 0.70
GetAccessApisMethod · 0.45

Tested by

no test coverage detected