aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/unknown_field_set.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/unknown_field_set.h')
-rw-r--r--src/google/protobuf/unknown_field_set.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/google/protobuf/unknown_field_set.h b/src/google/protobuf/unknown_field_set.h
index aa752916..c2ad8918 100644
--- a/src/google/protobuf/unknown_field_set.h
+++ b/src/google/protobuf/unknown_field_set.h
@@ -52,6 +52,7 @@ namespace protobuf {
class ZeroCopyInputStream; // zero_copy_stream.h
}
namespace internal {
+ class InternalMetadataWithArena; // metadata.h
class WireFormat; // wire_format.h
class MessageSetFieldSkipperUsingCord;
// extension_set_heavy.cc
@@ -92,6 +93,13 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet {
// Similar to above, but this function will destroy the contents of other.
void MergeFromAndDestroy(UnknownFieldSet* other);
+ // Merge the contents an UnknownFieldSet with the UnknownFieldSet in
+ // *metadata, if there is one. If *metadata doesn't have an UnknownFieldSet
+ // then add one to it and make it be a copy of the first arg.
+ static void MergeToInternalMetdata(
+ const UnknownFieldSet& other,
+ internal::InternalMetadataWithArena* metadata);
+
// Swaps the contents of some other UnknownFieldSet with this one.
inline void Swap(UnknownFieldSet* x);
@@ -175,7 +183,7 @@ class LIBPROTOBUF_EXPORT UnknownField {
TYPE_GROUP
};
- // The field's tag number, as seen on the wire.
+ // The field's field number, as seen on the wire.
inline int number() const;
// The field type.
@@ -204,7 +212,7 @@ class LIBPROTOBUF_EXPORT UnknownField {
void SerializeLengthDelimitedNoTag(io::CodedOutputStream* output) const;
uint8* SerializeLengthDelimitedNoTagToArray(uint8* target) const;
- inline int GetLengthDelimitedSize() const;
+ inline size_t GetLengthDelimitedSize() const;
private:
friend class UnknownFieldSet;
@@ -330,9 +338,9 @@ inline UnknownFieldSet* UnknownField::mutable_group() {
return group_;
}
-inline int UnknownField::GetLengthDelimitedSize() const {
+inline size_t UnknownField::GetLengthDelimitedSize() const {
GOOGLE_DCHECK_EQ(TYPE_LENGTH_DELIMITED, type());
- return static_cast<int>(length_delimited_.string_value_->size());
+ return length_delimited_.string_value_->size();
}
inline void UnknownField::SetType(Type type) {