aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util/internal/proto_writer.cc
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/util/internal/proto_writer.cc
parent337a028bb65ccca4dda768695950b5aba53ae2c9 (diff)
Integrate internal changes
Diffstat (limited to 'src/google/protobuf/util/internal/proto_writer.cc')
-rw-r--r--src/google/protobuf/util/internal/proto_writer.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/google/protobuf/util/internal/proto_writer.cc b/src/google/protobuf/util/internal/proto_writer.cc
index 0c38aeb9..4dcf4c3b 100644
--- a/src/google/protobuf/util/internal/proto_writer.cc
+++ b/src/google/protobuf/util/internal/proto_writer.cc
@@ -65,6 +65,7 @@ ProtoWriter::ProtoWriter(TypeResolver* type_resolver,
own_typeinfo_(true),
done_(false),
ignore_unknown_fields_(false),
+ use_lower_camel_for_enums_(false),
element_(NULL),
size_insert_(),
output_(output),
@@ -83,6 +84,7 @@ ProtoWriter::ProtoWriter(const TypeInfo* typeinfo,
own_typeinfo_(false),
done_(false),
ignore_unknown_fields_(false),
+ use_lower_camel_for_enums_(false),
element_(NULL),
size_insert_(),
output_(output),
@@ -264,8 +266,9 @@ inline Status WriteString(int field_number, const DataPiece& data,
// Writes an ENUM field, including tag, to the stream.
inline Status WriteEnum(int field_number, const DataPiece& data,
const google::protobuf::Enum* enum_type,
- CodedOutputStream* stream) {
- StatusOr<int> e = data.ToEnum(enum_type);
+ CodedOutputStream* stream,
+ bool use_lower_camel_for_enums) {
+ StatusOr<int> e = data.ToEnum(enum_type, use_lower_camel_for_enums);
if (e.ok()) {
WireFormatLite::WriteEnum(field_number, e.ValueOrDie(), stream);
}
@@ -662,7 +665,7 @@ ProtoWriter* ProtoWriter::RenderPrimitiveField(
case google::protobuf::Field_Kind_TYPE_ENUM: {
status = WriteEnum(field.number(), data,
typeinfo_->GetEnumByTypeUrl(field.type_url()),
- stream_.get());
+ stream_.get(), use_lower_camel_for_enums_);
break;
}
default: // TYPE_GROUP or TYPE_MESSAGE