aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/descriptor.h
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2016-09-19 13:45:07 -0700
committerGravatar Bo Yang <teboring@google.com>2016-10-10 11:23:36 -0700
commitcc8ca5b6a5478b40546d4206392eb1471454460d (patch)
treec0b45abfa16d7d373a6ea8f7fe50f1de00ab938e /src/google/protobuf/descriptor.h
parent337a028bb65ccca4dda768695950b5aba53ae2c9 (diff)
Integrate internal changes
Diffstat (limited to 'src/google/protobuf/descriptor.h')
-rw-r--r--src/google/protobuf/descriptor.h9
1 files changed, 7 insertions, 2 deletions
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<string> leading_detached_comments;
+ std::vector<string> 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)