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

Function SetValueToSingleField

eval/public/structs/field_access_impl.cc:720–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718}
719
720absl::Status SetValueToSingleField(const CelValue& value,
721 const FieldDescriptor* desc, Message* msg,
722 Arena* arena) {
723 ScalarFieldSetter setter(msg, desc, arena);
724 return (setter.SetFieldFromCelValue(value))
725 ? absl::OkStatus()
726 : absl::InvalidArgumentError(absl::Substitute(
727 "Could not assign supplied argument to message \"$0\" field "
728 "\"$1\" of type $2: value type \"$3\"",
729 msg->GetDescriptor()->name(), desc->name(),
730 desc->type_name(), CelValue::TypeName(value.type())));
731}
732
733absl::Status AddValueToRepeatedField(const CelValue& value,
734 const FieldDescriptor* desc, Message* msg,

Callers 3

CEL_ASSIGN_OR_RETURNFunction · 0.70
TESTFunction · 0.70
TEST_PFunction · 0.70

Calls 4

SetFieldFromCelValueMethod · 0.80
typeMethod · 0.80
nameMethod · 0.45
GetDescriptorMethod · 0.45

Tested by 2

TESTFunction · 0.56
TEST_PFunction · 0.56