class LiteUnknownFieldSetter
Defined at line 232 of file ../../third_party/protobuf/src/google/protobuf/metadata_lite.h
This helper RAII class is needed to efficiently parse unknown fields. We
should only call mutable_unknown_fields if there are actual unknown fields.
The obvious thing to just use a stack string and swap it at the end of
the parse won't work, because the destructor of StringOutputStream needs to
be called before we can modify the string (it check-fails). Using
LiteUnknownFieldSetter setter(
&
_internal_metadata_);
StringOutputStream stream(setter.buffer());
guarantees that the string is only swapped after stream is destroyed.
Public Methods
void LiteUnknownFieldSetter (InternalMetadata * metadata)
Defined at line 234 of file ../../third_party/protobuf/src/google/protobuf/metadata_lite.h
void ~LiteUnknownFieldSetter ()
Defined at line 240 of file ../../third_party/protobuf/src/google/protobuf/metadata_lite.h
std::string * buffer ()
Defined at line 244 of file ../../third_party/protobuf/src/google/protobuf/metadata_lite.h