|
|
|
@ -654,16 +654,20 @@ class PROTOBUF_EXPORT MessageLite { |
|
|
|
|
// missing required fields.
|
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParsePartialFromBoundedZeroCopyStream( |
|
|
|
|
io::ZeroCopyInputStream* input, int size); |
|
|
|
|
// Parses a protocol buffer contained in a string. Returns true on success.
|
|
|
|
|
// This function takes a string in the (non-human-readable) binary wire
|
|
|
|
|
// format, matching the encoding output by MessageLite::SerializeToString().
|
|
|
|
|
// If you'd like to convert a human-readable string into a protocol buffer
|
|
|
|
|
// object, see google::protobuf::TextFormat::ParseFromString().
|
|
|
|
|
// Parses a protocol buffer contained in a string or Cord. Returns true on
|
|
|
|
|
// success. This function takes a string in the (non-human-readable) binary
|
|
|
|
|
// wire format, matching the encoding output by
|
|
|
|
|
// MessageLite::SerializeToString(). If you'd like to convert a human-readable
|
|
|
|
|
// string into a protocol buffer object, see
|
|
|
|
|
// google::protobuf::TextFormat::ParseFromString().
|
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParseFromString(absl::string_view data); |
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParseFromString(const absl::Cord& data); |
|
|
|
|
// Like ParseFromString(), but accepts messages that are missing
|
|
|
|
|
// required fields.
|
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParsePartialFromString( |
|
|
|
|
absl::string_view data); |
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParsePartialFromString( |
|
|
|
|
const absl::Cord& data); |
|
|
|
|
// Parse a protocol buffer contained in an array of bytes.
|
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParseFromArray(const void* data, int size); |
|
|
|
|
// Like ParseFromArray(), but accepts messages that are missing
|
|
|
|
@ -694,6 +698,12 @@ class PROTOBUF_EXPORT MessageLite { |
|
|
|
|
|
|
|
|
|
// Merge a protocol buffer contained in a string.
|
|
|
|
|
bool MergeFromString(absl::string_view data); |
|
|
|
|
bool MergeFromString(const absl::Cord& data); |
|
|
|
|
|
|
|
|
|
// Like MergeFromString(), but accepts messages that are missing required
|
|
|
|
|
// fields.
|
|
|
|
|
bool MergePartialFromString(absl::string_view data); |
|
|
|
|
bool MergePartialFromString(const absl::Cord& data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Serialization ---------------------------------------------------
|
|
|
|
@ -714,8 +724,12 @@ class PROTOBUF_EXPORT MessageLite { |
|
|
|
|
// Serialize the message and store it in the given string. All required
|
|
|
|
|
// fields must be set.
|
|
|
|
|
bool SerializeToString(std::string* output) const; |
|
|
|
|
// Serialize the message and store it in the given Cord. All required
|
|
|
|
|
// fields must be set.
|
|
|
|
|
bool SerializeToString(absl::Cord* output) const; |
|
|
|
|
// Like SerializeToString(), but allows missing required fields.
|
|
|
|
|
bool SerializePartialToString(std::string* output) const; |
|
|
|
|
bool SerializePartialToString(absl::Cord* output) const; |
|
|
|
|
// Serialize the message and store it in the given byte array. All required
|
|
|
|
|
// fields must be set.
|
|
|
|
|
bool SerializeToArray(void* data, int size) const; |
|
|
|
@ -746,26 +760,45 @@ class PROTOBUF_EXPORT MessageLite { |
|
|
|
|
// Like SerializeToString(), but appends to the data to the string's
|
|
|
|
|
// existing contents. All required fields must be set.
|
|
|
|
|
bool AppendToString(std::string* output) const; |
|
|
|
|
bool AppendToString(absl::Cord* output) const; |
|
|
|
|
// Like AppendToString(), but allows missing required fields.
|
|
|
|
|
bool AppendPartialToString(std::string* output) const; |
|
|
|
|
bool AppendPartialToString(absl::Cord* output) const; |
|
|
|
|
|
|
|
|
|
// Reads a protocol buffer from a Cord and merges it into this message.
|
|
|
|
|
bool MergeFromCord(const absl::Cord& cord); |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() bool MergeFromCord(const absl::Cord& data) { |
|
|
|
|
return MergeFromString(data); |
|
|
|
|
} |
|
|
|
|
// Like MergeFromCord(), but accepts messages that are missing
|
|
|
|
|
// required fields.
|
|
|
|
|
bool MergePartialFromCord(const absl::Cord& cord); |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() |
|
|
|
|
bool MergePartialFromCord(const absl::Cord& data) { |
|
|
|
|
return MergePartialFromString(data); |
|
|
|
|
} |
|
|
|
|
// Parse a protocol buffer contained in a Cord.
|
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParseFromCord(const absl::Cord& cord); |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() |
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParseFromCord(const absl::Cord& data) { |
|
|
|
|
return ParseFromString(data); |
|
|
|
|
} |
|
|
|
|
// Like ParseFromCord(), but accepts messages that are missing
|
|
|
|
|
// required fields.
|
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES bool ParsePartialFromCord( |
|
|
|
|
const absl::Cord& cord); |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() |
|
|
|
|
ABSL_ATTRIBUTE_REINITIALIZES |
|
|
|
|
bool ParsePartialFromCord(const absl::Cord& data) { |
|
|
|
|
return ParsePartialFromString(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Serialize the message and store it in the given Cord. All required
|
|
|
|
|
// fields must be set.
|
|
|
|
|
bool SerializeToCord(absl::Cord* output) const; |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() |
|
|
|
|
bool SerializeToCord(absl::Cord* output) const { |
|
|
|
|
return SerializeToString(output); |
|
|
|
|
} |
|
|
|
|
// Like SerializeToCord(), but allows missing required fields.
|
|
|
|
|
bool SerializePartialToCord(absl::Cord* output) const; |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() |
|
|
|
|
bool SerializePartialToCord(absl::Cord* output) const { |
|
|
|
|
return SerializePartialToString(output); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Make a Cord encoding the message. Is equivalent to calling
|
|
|
|
|
// SerializeToCord() on a Cord and using that. Returns an empty
|
|
|
|
@ -776,9 +809,14 @@ class PROTOBUF_EXPORT MessageLite { |
|
|
|
|
|
|
|
|
|
// Like SerializeToCord(), but appends to the data to the Cord's existing
|
|
|
|
|
// contents. All required fields must be set.
|
|
|
|
|
bool AppendToCord(absl::Cord* output) const; |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() bool AppendToCord(absl::Cord* output) const { |
|
|
|
|
return AppendToString(output); |
|
|
|
|
} |
|
|
|
|
// Like AppendToCord(), but allows missing required fields.
|
|
|
|
|
bool AppendPartialToCord(absl::Cord* output) const; |
|
|
|
|
PROTOBUF_DEPRECATE_AND_INLINE() |
|
|
|
|
bool AppendPartialToCord(absl::Cord* output) const { |
|
|
|
|
return AppendPartialToString(output); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Computes the serialized size of the message. This recursively calls
|
|
|
|
|
// ByteSizeLong() on all embedded messages.
|
|
|
|
|