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

Function StringFromValue

eval/public/structs/cel_proto_wrap_util.cc:845–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845google::protobuf::Message* StringFromValue(const google::protobuf::Message* prototype,
846 const CelValue& value, google::protobuf::Arena* arena) {
847 CelValue::StringHolder view_val;
848 if (!value.GetValue(&view_val)) {
849 return nullptr;
850 }
851 auto* message = prototype->New(arena);
852 CEL_ASSIGN_OR_RETURN(
853 auto reflection,
854 cel::well_known_types::GetStringValueReflection(message->GetDescriptor()),
855 _.With(IgnoreErrorAndReturnNullptr()));
856 reflection.SetValue(message, view_val.value());
857 return message;
858}
859
860google::protobuf::Message* TimestampFromValue(const google::protobuf::Message* prototype,
861 const CelValue& value,

Callers 1

MaybeWrapMessageMethod · 0.85

Calls 4

GetValueMethod · 0.45
NewMethod · 0.45
SetValueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected