From b17ec3ca11ed13cc0d984f6d8be112c246b1994d Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Sun, 23 Aug 2015 17:50:38 -0700 Subject: Down-integrate from internal code base. --- src/google/protobuf/wire_format_lite.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/google/protobuf/wire_format_lite.h') diff --git a/src/google/protobuf/wire_format_lite.h b/src/google/protobuf/wire_format_lite.h index 19fbc2c5..55fc7ecd 100644 --- a/src/google/protobuf/wire_format_lite.h +++ b/src/google/protobuf/wire_format_lite.h @@ -316,6 +316,16 @@ class LIBPROTOBUF_EXPORT WireFormatLite { static bool ReadBytes(input, string** p); + enum Operation { + PARSE = 0, + SERIALIZE = 1, + }; + + // Returns true if the data is valid UTF-8. + static bool VerifyUtf8String(const char* data, int size, + Operation op, + const char* field_name); + static inline bool ReadGroup (field_number, input, MessageLite* value); static inline bool ReadMessage(input, MessageLite* value); -- cgit v1.2.3