aboutsummaryrefslogtreecommitdiffstats
path: root/src/google/protobuf/wire_format.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/wire_format.h')
-rw-r--r--src/google/protobuf/wire_format.h44
1 files changed, 6 insertions, 38 deletions
diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h
index 9f26eb2..c753925 100644
--- a/src/google/protobuf/wire_format.h
+++ b/src/google/protobuf/wire_format.h
@@ -1,6 +1,6 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -40,7 +40,6 @@
#define GOOGLE_PROTOBUF_WIRE_FORMAT_H__
#include <string>
-#include <google/protobuf/stubs/common.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
@@ -79,7 +78,7 @@ class LIBPROTOBUF_EXPORT WireFormat {
static inline WireFormatLite::WireType WireTypeForField(
const FieldDescriptor* field);
- // Given a FieldDescriptor::Type return its WireType
+ // Given a FieldSescriptor::Type return its WireType
static inline WireFormatLite::WireType WireTypeForFieldType(
FieldDescriptor::Type type);
@@ -180,7 +179,7 @@ class LIBPROTOBUF_EXPORT WireFormat {
// of packed repeated fields.
static uint32 MakeTag(const FieldDescriptor* field);
- // Parse a single field. The input should start out positioned immediately
+ // Parse a single field. The input should start out positioned immidately
// after the tag.
static bool ParseAndMergeField(
uint32 tag,
@@ -228,34 +227,14 @@ class LIBPROTOBUF_EXPORT WireFormat {
};
// Verifies that a string field is valid UTF8, logging an error if not.
- // This function will not be called by newly generated protobuf code
- // but remains present to support existing code.
static void VerifyUTF8String(const char* data, int size, Operation op);
- // The NamedField variant takes a field name in order to produce an
- // informative error message if verification fails.
- static void VerifyUTF8StringNamedField(const char* data,
- int size,
- Operation op,
- 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,
- UnknownFieldSet* unknown_fields);
-
- // Parse a MessageSet field.
- static bool ParseAndMergeMessageSetField(uint32 field_number,
- const FieldDescriptor* field,
- Message* message,
- io::CodedInputStream* input);
+ Operation op);
@@ -274,7 +253,7 @@ class LIBPROTOBUF_EXPORT UnknownFieldSetFieldSkipper : public FieldSkipper {
virtual bool SkipMessage(io::CodedInputStream* input);
virtual void SkipUnknownEnum(int field_number, int value);
- protected:
+ private:
UnknownFieldSet* unknown_fields_;
};
@@ -313,18 +292,7 @@ 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);
-#else
- // Avoid the compiler warning about unsued variables.
- (void)data; (void)size; (void)op;
-#endif
-}
-
-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);
+ WireFormat::VerifyUTF8StringFallback(data, size, op);
#endif
}