diff options
author | temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d> | 2008-08-06 01:12:21 +0000 |
---|---|---|
committer | temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d> | 2008-08-06 01:12:21 +0000 |
commit | a0f27fcd96c5bf2509ca88cca54f00b78f7b8bc5 (patch) | |
tree | 6d44ab5739d6fc9b956e17eb13a6d34f71094109 /src/google/protobuf/unknown_field_set.h | |
parent | 8ccb79057ee477c36d155f2c507c859934f858dd (diff) | |
download | protobuf-a0f27fcd96c5bf2509ca88cca54f00b78f7b8bc5.tar.gz protobuf-a0f27fcd96c5bf2509ca88cca54f00b78f7b8bc5.tar.bz2 protobuf-a0f27fcd96c5bf2509ca88cca54f00b78f7b8bc5.zip |
Heuristically detect sub-messages when printing unknown fields.
Patch mostly written by Dilip Joseph <dilip.antony.joseph@gmail.com>.
Diffstat (limited to 'src/google/protobuf/unknown_field_set.h')
-rw-r--r-- | src/google/protobuf/unknown_field_set.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/google/protobuf/unknown_field_set.h b/src/google/protobuf/unknown_field_set.h index 42184621..2e908c33 100644 --- a/src/google/protobuf/unknown_field_set.h +++ b/src/google/protobuf/unknown_field_set.h @@ -77,6 +77,17 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet { // the existing UnknownField. UnknownField* AddField(int number); + // Parsing helpers ------------------------------------------------- + // These work exactly like the similarly-named methods of Message. + + bool MergeFromCodedStream(io::CodedInputStream* input); + bool ParseFromCodedStream(io::CodedInputStream* input); + bool ParseFromZeroCopyStream(io::ZeroCopyInputStream* input); + bool ParseFromArray(const void* data, int size); + inline bool ParseFromString(const string& data) { + return ParseFromArray(data.data(), data.size()); + } + private: // "Active" fields are ones which have been added since the last time Clear() // was called. Inactive fields are objects we are keeping around incase |