aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/wire_format.h
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2015-08-23 17:50:38 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2015-08-23 17:50:38 -0700
commitb17ec3ca11ed13cc0d984f6d8be112c246b1994d (patch)
treec7c05b5d36fdb3c0a601a4dba0763e1e08f7bc52 /src/google/protobuf/wire_format.h
parenteee38b0c018b3279f77d03dff796f440f40d3516 (diff)
Down-integrate from internal code base.
Diffstat (limited to 'src/google/protobuf/wire_format.h')
-rw-r--r--src/google/protobuf/wire_format.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h
index 84270fee..941be75b 100644
--- a/src/google/protobuf/wire_format.h
+++ b/src/google/protobuf/wire_format.h
@@ -231,8 +231,8 @@ class LIBPROTOBUF_EXPORT WireFormat {
const Message& message);
enum Operation {
- PARSE,
- SERIALIZE,
+ PARSE = 0,
+ SERIALIZE = 1,
};
// Verifies that a string field is valid UTF8, logging an error if not.
@@ -247,13 +247,6 @@ class LIBPROTOBUF_EXPORT WireFormat {
const char* field_name);
private:
- // Verifies that a string field is valid UTF8, logging an error if not.
- static void VerifyUTF8StringFallback(
- const char* data,
- int size,
- Operation op,
- const char* field_name);
-
// Skip a MessageSet field.
static bool SkipMessageSetField(io::CodedInputStream* input,
uint32 field_number,
@@ -265,8 +258,6 @@ class LIBPROTOBUF_EXPORT WireFormat {
Message* message,
io::CodedInputStream* input);
-
-
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormat);
};
@@ -321,7 +312,8 @@ inline int WireFormat::TagSize(int field_number, FieldDescriptor::Type type) {
inline void WireFormat::VerifyUTF8String(const char* data, int size,
WireFormat::Operation op) {
#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
- WireFormat::VerifyUTF8StringFallback(data, size, op, NULL);
+ WireFormatLite::VerifyUtf8String(
+ data, size, static_cast<WireFormatLite::Operation>(op), NULL);
#else
// Avoid the compiler warning about unsued variables.
(void)data; (void)size; (void)op;
@@ -332,7 +324,8 @@ inline void WireFormat::VerifyUTF8StringNamedField(
const char* data, int size, WireFormat::Operation op,
const char* field_name) {
#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
- WireFormat::VerifyUTF8StringFallback(data, size, op, field_name);
+ WireFormatLite::VerifyUtf8String(
+ data, size, static_cast<WireFormatLite::Operation>(op), field_name);
#endif
}