aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_enum_field.cc')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_enum_field.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_enum_field.cc b/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
index d38fb1ed..9ceffa8c 100644
--- a/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
@@ -38,6 +38,7 @@
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
+#include <google/protobuf/compiler/csharp/csharp_options.h>
#include <google/protobuf/compiler/csharp/csharp_enum_field.h>
namespace google {
@@ -46,8 +47,8 @@ namespace compiler {
namespace csharp {
EnumFieldGenerator::EnumFieldGenerator(const FieldDescriptor* descriptor,
- int fieldOrdinal)
- : PrimitiveFieldGenerator(descriptor, fieldOrdinal) {
+ int fieldOrdinal, const Options *options)
+ : PrimitiveFieldGenerator(descriptor, fieldOrdinal, options) {
}
EnumFieldGenerator::~EnumFieldGenerator() {
@@ -80,14 +81,18 @@ void EnumFieldGenerator::GenerateCodecCode(io::Printer* printer) {
"pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x)");
}
-EnumOneofFieldGenerator::EnumOneofFieldGenerator(const FieldDescriptor* descriptor,
- int fieldOrdinal)
- : PrimitiveOneofFieldGenerator(descriptor, fieldOrdinal) {
+EnumOneofFieldGenerator::EnumOneofFieldGenerator(
+ const FieldDescriptor* descriptor, int fieldOrdinal, const Options *options)
+ : PrimitiveOneofFieldGenerator(descriptor, fieldOrdinal, options) {
}
EnumOneofFieldGenerator::~EnumOneofFieldGenerator() {
}
+void EnumOneofFieldGenerator::GenerateMergingCode(io::Printer* printer) {
+ printer->Print(variables_, "$property_name$ = other.$property_name$;\n");
+}
+
void EnumOneofFieldGenerator::GenerateParsingCode(io::Printer* printer) {
// TODO(jonskeet): What about if we read the default value?
printer->Print(