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

Function FromExprValue

common/internal/value_conversion.cc:211–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209} // namespace
210
211absl::StatusOr<Value> FromExprValue(
212 const cel::expr::Value& value,
213 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
214 google::protobuf::MessageFactory* absl_nonnull message_factory,
215 google::protobuf::Arena* absl_nonnull arena) {
216 google::protobuf::LinkMessageReflection<cel::expr::Value>();
217 switch (value.kind_case()) {
218 case ExprValueKind::kBoolValue:
219 return cel::BoolValue(value.bool_value());
220 case ExprValueKind::kInt64Value:
221 return cel::IntValue(value.int64_value());
222 case ExprValueKind::kUint64Value:
223 return cel::UintValue(value.uint64_value());
224 case ExprValueKind::kDoubleValue:
225 return cel::DoubleValue(value.double_value());
226 case ExprValueKind::kStringValue:
227 return cel::StringValue(value.string_value());
228 case ExprValueKind::kBytesValue:
229 return cel::BytesValue(value.bytes_value());
230 case ExprValueKind::kNullValue:
231 return cel::NullValue();
232 case ExprValueKind::kObjectValue:
233 return FromObject(value.object_value(), descriptor_pool, message_factory,
234 arena);
235 case ExprValueKind::kMapValue:
236 return MapValueFromExpr(value.map_value(), descriptor_pool,
237 message_factory, arena);
238 case ExprValueKind::kListValue:
239 return ListValueFromExpr(value.list_value(), descriptor_pool,
240 message_factory, arena);
241
242 default:
243 return absl::UnimplementedError(absl::StrCat(
244 "FromExprValue not supported ", ToString(value.kind_case())));
245 }
246}
247
248absl::StatusOr<cel::expr::Value> ToExprValue(
249 const Value& value,

Callers 3

EvalMethod · 0.85
EvalWithLegacyBindingsFunction · 0.85
ResolveValueFunction · 0.85

Calls 12

FromObjectFunction · 0.85
MapValueFromExprFunction · 0.85
ListValueFromExprFunction · 0.85
kind_caseMethod · 0.80
StringValueClass · 0.70
ToStringFunction · 0.70
BoolValueClass · 0.50
IntValueClass · 0.50
UintValueClass · 0.50
DoubleValueClass · 0.50
BytesValueClass · 0.50
NullValueClass · 0.50

Tested by

no test coverage detected