aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/csharp
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2016-07-27 09:12:48 +0100
committerJisi Liu <jisi.liu@gmail.com>2016-07-27 10:50:34 -0700
commit86535a1ce7609bb5549d2b4f7e7aded0948e8d45 (patch)
tree34a71707431d4a1bea9c1a07330d6305afebfe53 /src/google/protobuf/compiler/csharp
parent7c9c314ca7641672587d28426a05113e952d4e10 (diff)
downloadprotobuf-86535a1ce7609bb5549d2b4f7e7aded0948e8d45.tar.gz
protobuf-86535a1ce7609bb5549d2b4f7e7aded0948e8d45.tar.bz2
protobuf-86535a1ce7609bb5549d2b4f7e7aded0948e8d45.zip
Remove legacy_enum_values flag for GA.
Diffstat (limited to 'src/google/protobuf/compiler/csharp')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_enum.cc4
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_generator.cc3
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_options.h9
3 files changed, 2 insertions, 14 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_enum.cc b/src/google/protobuf/compiler/csharp/csharp_enum.cc
index 64381d0f..9e4da1ed 100644
--- a/src/google/protobuf/compiler/csharp/csharp_enum.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_enum.cc
@@ -68,9 +68,7 @@ void EnumGenerator::Generate(io::Printer* printer) {
for (int i = 0; i < descriptor_->value_count(); i++) {
WriteEnumValueDocComment(printer, descriptor_->value(i));
string original_name = descriptor_->value(i)->name();
- string name = options()->legacy_enum_values
- ? descriptor_->value(i)->name()
- : GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name());
+ string name = GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name());
// Make sure we don't get any duplicate names due to prefix removal.
while (!used_names.insert(name).second) {
// It's possible we'll end up giving this warning multiple times, but that's better than not at all.
diff --git a/src/google/protobuf/compiler/csharp/csharp_generator.cc b/src/google/protobuf/compiler/csharp/csharp_generator.cc
index d74e8c88..c13ed65b 100644
--- a/src/google/protobuf/compiler/csharp/csharp_generator.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_generator.cc
@@ -83,9 +83,6 @@ bool Generator::Generate(
cli_options.base_namespace_specified = true;
} else if (options[i].first == "internal_access") {
cli_options.internal_access = true;
- } else if (options[i].first == "legacy_enum_values") {
- // TODO: Remove this before final release
- cli_options.legacy_enum_values = true;
} else {
*error = "Unknown generator option: " + options[i].first;
return false;
diff --git a/src/google/protobuf/compiler/csharp/csharp_options.h b/src/google/protobuf/compiler/csharp/csharp_options.h
index 4079bf7f..426fb3b5 100644
--- a/src/google/protobuf/compiler/csharp/csharp_options.h
+++ b/src/google/protobuf/compiler/csharp/csharp_options.h
@@ -45,8 +45,7 @@ struct Options {
file_extension(".cs"),
base_namespace(""),
base_namespace_specified(false),
- internal_access(false),
- legacy_enum_values(false) {
+ internal_access(false) {
}
// Extension of the generated file. Defaults to ".cs"
string file_extension;
@@ -69,12 +68,6 @@ struct Options {
// Whether the generated classes should have accessibility level of "internal".
// Defaults to false that generates "public" classes.
bool internal_access;
- // By default, C# codegen now uses PascalCased enum values names, after
- // removing the enum type name as a prefix (if it *is* a prefix of the value).
- // Setting this option reverts to the previous behavior of just copying the
- // value name specified in the .proto file, allowing gradual migration.
- // This option will be removed before final release.
- bool legacy_enum_values;
};
} // namespace csharp