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

Method ConvertToJson

common/values/double_value.cc:90–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90absl::Status DoubleValue::ConvertToJson(
91 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
92 google::protobuf::MessageFactory* absl_nonnull message_factory,
93 google::protobuf::Message* absl_nonnull json) const {
94 ABSL_DCHECK(descriptor_pool != nullptr);
95 ABSL_DCHECK(message_factory != nullptr);
96 ABSL_DCHECK(json != nullptr);
97 ABSL_DCHECK_EQ(json->GetDescriptor()->well_known_type(),
98 google::protobuf::Descriptor::WELLKNOWNTYPE_VALUE);
99
100 ValueReflection value_reflection;
101 CEL_RETURN_IF_ERROR(value_reflection.Initialize(json->GetDescriptor()));
102 value_reflection.SetNumberValue(json, NativeValue());
103
104 return absl::OkStatus();
105}
106
107absl::Status DoubleValue::Equal(
108 const Value& other,

Callers

nothing calls this directly

Calls 4

NativeValueFunction · 0.70
GetDescriptorMethod · 0.45
InitializeMethod · 0.45
SetNumberValueMethod · 0.45

Tested by

no test coverage detected