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

Function ListFromValue

eval/public/structs/cel_proto_wrap_util.cc:921–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

919}
920
921google::protobuf::Message* ListFromValue(google::protobuf::Message* message, const CelValue& value,
922 google::protobuf::Arena* arena) {
923 if (!value.IsList()) {
924 return nullptr;
925 }
926 const CelList& list = *value.ListOrDie();
927 CEL_ASSIGN_OR_RETURN(
928 auto reflection,
929 cel::well_known_types::GetListValueReflection(message->GetDescriptor()),
930 _.With(IgnoreErrorAndReturnNullptr()));
931 for (int i = 0; i < list.size(); i++) {
932 auto e = list.Get(arena, i);
933 auto* elem = reflection.AddValues(message);
934 if (ValueFromValue(elem, e, arena) == nullptr) {
935 return nullptr;
936 }
937 }
938 return message;
939}
940
941google::protobuf::Message* ListFromValue(const google::protobuf::Message* prototype,
942 const CelValue& value, google::protobuf::Arena* arena) {

Callers 3

ValueFromValueFunction · 0.85
AnyFromValueFunction · 0.85
MaybeWrapMessageMethod · 0.85

Calls 7

ValueFromValueFunction · 0.85
ListOrDieMethod · 0.80
IsListMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45
AddValuesMethod · 0.45
NewMethod · 0.45

Tested by

no test coverage detected