class UnknownFieldSet
Defined at line 141 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
An UnknownFieldSet contains fields that were encountered while parsing a
message but were not defined by its type. Keeping track of these can be
useful, especially in that they may be written if the message is serialized
again without being cleared in between. This means that software which
simply receives messages and forwards them to other servers does not need
to be updated every time a new field is added to the message definition.
To get the UnknownFieldSet attached to any message, call
Reflection::GetUnknownFields().
This class is necessarily tied to the protocol buffer wire format, unlike
the Reflection interface which is independent of any serialization scheme.
Public Methods
void UnknownFieldSet (const UnknownFieldSet & )
Defined at line 144 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
UnknownFieldSet & operator= (const UnknownFieldSet & )
Defined at line 145 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
int SpaceUsedExcludingSelf ()
Defined at line 177 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
int SpaceUsed ()
Defined at line 184 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
bool ParseFromString (const absl::string_view data)
Defined at line 231 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
void UnknownFieldSet (internal::InternalVisibility , Arena * arena)
Defined at line 247 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
void UnknownFieldSet ()
===================================================================
inline implementations
Defined at line 316 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
void ~UnknownFieldSet ()
Defined at line 318 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
void Clear ()
Remove all fields.
Defined at line 328 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
void ClearAndFreeMemory ()
Remove all fields and deallocate internal data objects
Defined at line 326 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
bool empty ()
Is this set empty?
Defined at line 334 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
void MergeFrom (const UnknownFieldSet & other)
Merge the contents of some other UnknownFieldSet with this one.
void MergeFromAndDestroy (UnknownFieldSet * other)
Similar to above, but this function will destroy the contents of other.
void MergeToInternalMetadata (const UnknownFieldSet & other, internal::InternalMetadata * metadata)
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.
void Swap (UnknownFieldSet * x)
Swaps the contents of some other UnknownFieldSet with this one.
Defined at line 336 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
size_t SpaceUsedExcludingSelfLong ()
Computes (an estimate of) the total number of bytes currently used for
storing the unknown fields in memory. Does NOT include
sizeof(*this) in the calculation.
size_t SpaceUsedLong ()
Version of SpaceUsed() including sizeof(*this).
int field_count ()
Returns the number of fields present in the UnknownFieldSet.
Defined at line 345 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
const UnknownField & field (int index)
Get a field in the set, where 0
<
= index
<
field_count(). The fields
appear in the order in which they were added.
Defined at line 348 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
UnknownField * mutable_field (int index)
Get a mutable pointer to a field in the set, where
0
<
= index
<
field_count(). The fields appear in the order in which
they were added.
Defined at line 351 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
void AddVarint (int number, uint64_t value)
Adding fields ---------------------------------------------------
void AddFixed32 (int number, uint32_t value)
void AddFixed64 (int number, uint64_t value)
void AddLengthDelimited (int number, absl::string_view value)
Defined at line 355 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
template <int&>
void AddLengthDelimited (int number, std::string && value)
template to avoid ambiguous overload resolution.
void AddLengthDelimited (int number, const absl::Cord & value)
std::string * AddLengthDelimited (int number)
UnknownFieldSet * AddGroup (int number)
void AddField (const UnknownField & field)
Adds an unknown field from another set.
void DeleteSubrange (int start, int num)
Delete fields with indices in the range [start .. start+num-1].
Caution: implementation moves all fields with indices [start+num .. ].
void DeleteByNumber (int number)
Delete all fields with a specific field number. The order of left fields
is preserved.
Caution: implementation moves all fields after the first deleted field.
bool MergeFromCodedStream (io::CodedInputStream * input)
Parsing helpers -------------------------------------------------
These work exactly like the similarly-named methods of Message.
bool ParseFromCodedStream (io::CodedInputStream * input)
bool ParseFromZeroCopyStream (io::ZeroCopyInputStream * input)
bool ParseFromArray (const void * data, int size)
template <typename MessageType>
bool MergeFromMessage (const MessageType & message)
Merges this message's unknown field data (if any). This works whether
the message is a lite or full proto (for legacy reasons, lite and full
return different types for MessageType::unknown_fields()).
Defined at line 422 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
bool SerializeToString (std::string * output)
Serialization.
bool SerializeToCord (absl::Cord * output)
bool SerializeToCodedStream (io::CodedOutputStream * output)
const UnknownFieldSet & default_instance ()
Defined at line 320 of file ../../third_party/protobuf/src/google/protobuf/unknown_field_set.h
Friends
class Arena
class UnknownFieldSetTestPeer
class UnknownFieldParserHelper
class WireFormat