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

Function BoolFromValue

eval/public/structs/cel_proto_wrap_util.cc:744–757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742}
743
744google::protobuf::Message* BoolFromValue(const google::protobuf::Message* prototype,
745 const CelValue& value, google::protobuf::Arena* arena) {
746 bool val;
747 if (!value.GetValue(&val)) {
748 return nullptr;
749 }
750 auto* message = prototype->New(arena);
751 CEL_ASSIGN_OR_RETURN(
752 auto reflection,
753 cel::well_known_types::GetBoolValueReflection(message->GetDescriptor()),
754 _.With(IgnoreErrorAndReturnNullptr()));
755 reflection.SetValue(message, val);
756 return message;
757}
758
759google::protobuf::Message* BytesFromValue(const google::protobuf::Message* prototype,
760 const CelValue& value, google::protobuf::Arena* arena) {

Callers 1

MaybeWrapMessageMethod · 0.85

Calls 3

GetValueMethod · 0.45
NewMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected