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

Function CelNumberFromValue

eval/eval/container_access_step.cc:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47inline constexpr int kNumContainerAccessArguments = 2;
48
49absl::optional<Number> CelNumberFromValue(const Value& value) {
50 switch (value->kind()) {
51 case ValueKind::kInt64:
52 return Number::FromInt64(value.GetInt().NativeValue());
53 case ValueKind::kUint64:
54 return Number::FromUint64(value.GetUint().NativeValue());
55 case ValueKind::kDouble:
56 return Number::FromDouble(value.GetDouble().NativeValue());
57 default:
58 return absl::nullopt;
59 }
60}
61
62absl::Status CheckMapKeyType(const Value& key) {
63 ValueKind kind = key->kind();

Callers 2

LookupInMapFunction · 0.85
LookupInListFunction · 0.85

Calls 5

kindMethod · 0.45
NativeValueMethod · 0.45
GetIntMethod · 0.45
GetUintMethod · 0.45
GetDoubleMethod · 0.45

Tested by

no test coverage detected