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

Function ListValueToJson

common/values/value_builder.cc:109–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107
108template <typename Vector>
109absl::Status ListValueToJson(
110 const Vector& vector,
111 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
112 google::protobuf::MessageFactory* absl_nonnull message_factory,
113 google::protobuf::Message* absl_nonnull json) {
114 ABSL_DCHECK(descriptor_pool != nullptr);
115 ABSL_DCHECK(message_factory != nullptr);
116 ABSL_DCHECK(json != nullptr);
117 ABSL_DCHECK_EQ(json->GetDescriptor()->well_known_type(),
118 google::protobuf::Descriptor::WELLKNOWNTYPE_VALUE);
119
120 ValueReflection reflection;
121 CEL_RETURN_IF_ERROR(reflection.Initialize(json->GetDescriptor()));
122 return ListValueToJsonArray(vector, descriptor_pool, message_factory,
123 reflection.MutableListValue(json));
124}
125
126class CompatListValueImplIterator final : public ValueIterator {
127 public:

Callers

nothing calls this directly

Calls 4

ListValueToJsonArrayFunction · 0.85
GetDescriptorMethod · 0.45
InitializeMethod · 0.45
MutableListValueMethod · 0.45

Tested by

no test coverage detected