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

Method SerializeTo

common/values/parsed_repeated_field_value.cc:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48absl::Status ParsedRepeatedFieldValue::SerializeTo(
49 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
50 google::protobuf::MessageFactory* absl_nonnull message_factory,
51 google::protobuf::io::ZeroCopyOutputStream* absl_nonnull output) const {
52 ABSL_DCHECK(descriptor_pool != nullptr);
53 ABSL_DCHECK(message_factory != nullptr);
54 ABSL_DCHECK(output != nullptr);
55 ABSL_DCHECK(*this);
56
57 if (ABSL_PREDICT_FALSE(field_ == nullptr)) {
58 return absl::OkStatus();
59 }
60 // We have to convert to google.protobuf.Struct first.
61 google::protobuf::Value message;
62 CEL_RETURN_IF_ERROR(internal::MessageFieldToJson(
63 *message_, field_, descriptor_pool, message_factory, &message));
64 if (!message.list_value().SerializePartialToZeroCopyStream(output)) {
65 return absl::UnknownError("failed to serialize google.protobuf.Struct");
66 }
67 return absl::OkStatus();
68}
69
70absl::Status ParsedRepeatedFieldValue::ConvertToJson(
71 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,

Callers

nothing calls this directly

Calls 1

MessageFieldToJsonFunction · 0.85

Tested by

no test coverage detected