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

Method ConvertToJson

common/values/parsed_map_field_value.cc:77–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77absl::Status ParsedMapFieldValue::ConvertToJson(
78 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
79 google::protobuf::MessageFactory* absl_nonnull message_factory,
80 google::protobuf::Message* absl_nonnull json) const {
81 ABSL_DCHECK(descriptor_pool != nullptr);
82 ABSL_DCHECK(message_factory != nullptr);
83 ABSL_DCHECK(json != nullptr);
84 ABSL_DCHECK_EQ(json->GetDescriptor()->well_known_type(),
85 google::protobuf::Descriptor::WELLKNOWNTYPE_VALUE);
86 ABSL_DCHECK(*this);
87
88 if (ABSL_PREDICT_FALSE(field_ == nullptr)) {
89 ValueReflection value_reflection;
90 CEL_RETURN_IF_ERROR(value_reflection.Initialize(json->GetDescriptor()));
91 value_reflection.MutableStructValue(json)->Clear();
92 return absl::OkStatus();
93 }
94 return internal::MessageFieldToJson(*message_, field_, descriptor_pool,
95 message_factory, json);
96}
97
98absl::Status ParsedMapFieldValue::ConvertToJsonObject(
99 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,

Callers

nothing calls this directly

Calls 5

MessageFieldToJsonFunction · 0.85
GetDescriptorMethod · 0.45
InitializeMethod · 0.45
ClearMethod · 0.45
MutableStructValueMethod · 0.45

Tested by

no test coverage detected