aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2015-06-23 11:54:19 +0100
committerJon Skeet <jonskeet@google.com>2015-06-23 12:42:20 +0100
commit6c1fe6ea3e4e3915fc4164c43230210f9a0ac24f (patch)
tree3acd6ea7eebd05c6e12958ec3cf901d098ad9b14 /src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc
parent45b70328f218dc2b3e20191c2cfa92872ef10d04 (diff)
downloadprotobuf-6c1fe6ea3e4e3915fc4164c43230210f9a0ac24f.tar.gz
protobuf-6c1fe6ea3e4e3915fc4164c43230210f9a0ac24f.tar.bz2
protobuf-6c1fe6ea3e4e3915fc4164c43230210f9a0ac24f.zip
Implement Clone.
Fixes issue #527.
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc
index 3ab0b190..edfb98b4 100644
--- a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc
@@ -118,6 +118,11 @@ void RepeatedMessageFieldGenerator::WriteToString(io::Printer* printer) {
"PrintField(\"$field_name$\", $name$_, writer);\n");
}
+void RepeatedMessageFieldGenerator::GenerateCloningCode(io::Printer* printer) {
+ printer->Print(variables_,
+ "$name$_ = other.$name$_.Clone();\n");
+}
+
} // namespace csharp
} // namespace compiler
} // namespace protobuf