Index: third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc |
index 3cb874828e991295b26b8d2e16e34eb8079d647b..44bafd7f3c2ffe9abca0b5f12bbe36aadde10767 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc |
+++ b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc |
@@ -104,6 +104,7 @@ void OneofGenerator::GeneratePublicCasePropertyDeclaration( |
void OneofGenerator::GenerateClearFunctionDeclaration(io::Printer* printer) { |
printer->Print( |
variables_, |
+ "/// Clears whatever value was set for the oneof '$name$'.\n" |
"void $owning_message_class$_Clear$capitalized_name$OneOfCase($owning_message_class$ *message);\n"); |
} |
@@ -119,17 +120,16 @@ void OneofGenerator::GenerateClearFunctionImplementation(io::Printer* printer) { |
"void $owning_message_class$_Clear$capitalized_name$OneOfCase($owning_message_class$ *message) {\n" |
" GPBDescriptor *descriptor = [message descriptor];\n" |
" GPBOneofDescriptor *oneof = descriptor->oneofs_[$raw_index$];\n" |
- " GPBMaybeClearOneof(message, oneof, 0);\n" |
+ " GPBMaybeClearOneof(message, oneof, $index$, 0);\n" |
"}\n"); |
} |
-void OneofGenerator::GenerateDescription(io::Printer* printer) { |
- printer->Print( |
- variables_, |
- "{\n" |
- " .name = \"$name$\",\n" |
- " .index = $index$,\n" |
- "},\n"); |
+string OneofGenerator::DescriptorName(void) const { |
+ return variables_.find("name")->second; |
+} |
+ |
+string OneofGenerator::HasIndexAsString(void) const { |
+ return variables_.find("index")->second; |
} |
} // namespace objectivec |