From cc8ca5b6a5478b40546d4206392eb1471454460d Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Mon, 19 Sep 2016 13:45:07 -0700 Subject: Integrate internal changes --- src/google/protobuf/descriptor.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/google/protobuf/descriptor.h') diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h index b040b62c..0151e1d9 100644 --- a/src/google/protobuf/descriptor.h +++ b/src/google/protobuf/descriptor.h @@ -143,7 +143,7 @@ struct SourceLocation { // See the comments in SourceCodeInfo.Location (descriptor.proto) for details. string leading_comments; string trailing_comments; - vector leading_detached_comments; + std::vector leading_detached_comments; }; // Options when generating machine-parsable output from a descriptor with @@ -558,6 +558,10 @@ class LIBPROTOBUF_EXPORT FieldDescriptor { // Does this field have an explicitly-declared default value? bool has_default_value() const; + // Whether the user has specified the json_name field option in the .proto + // file. + bool has_json_name() const; + // Get the field default value if cpp_type() == CPPTYPE_INT32. If no // explicit default was defined, the default is 0. int32 default_value_int32() const; @@ -683,7 +687,7 @@ class LIBPROTOBUF_EXPORT FieldDescriptor { // file. bool has_json_name_; // If has_json_name_ is true, it's the value specified by the user. - // Otherwise, it has the same value as lowercase_name_. + // Otherwise, it has the same value as camelcase_name_. const string* json_name_; const FileDescriptor* file_; int number_; @@ -1699,6 +1703,7 @@ PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, message_type, const Descriptor*) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, enum_type, const EnumDescriptor*) PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FieldDescriptor, FieldOptions) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_default_value, bool) +PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_json_name, bool) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int32 , int32 ) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int64 , int64 ) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint32, uint32) -- cgit v1.2.3