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

Function MapValueToJson

common/values/value_builder.cc:834–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

832
833template <typename Map>
834absl::Status MapValueToJson(
835 const Map& map, const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
836 google::protobuf::MessageFactory* absl_nonnull message_factory,
837 google::protobuf::Message* absl_nonnull json) {
838 ABSL_DCHECK(descriptor_pool != nullptr);
839 ABSL_DCHECK(message_factory != nullptr);
840 ABSL_DCHECK(json != nullptr);
841 ABSL_DCHECK_EQ(json->GetDescriptor()->well_known_type(),
842 google::protobuf::Descriptor::WELLKNOWNTYPE_VALUE);
843
844 ValueReflection reflection;
845 CEL_RETURN_IF_ERROR(reflection.Initialize(json->GetDescriptor()));
846 return MapValueToJsonObject(map, descriptor_pool, message_factory,
847 reflection.MutableStructValue(json));
848}
849
850struct ValueHasher {
851 using is_transparent = void;

Callers

nothing calls this directly

Calls 4

MapValueToJsonObjectFunction · 0.85
GetDescriptorMethod · 0.45
InitializeMethod · 0.45
MutableStructValueMethod · 0.45

Tested by

no test coverage detected