diff options
author | Jon Skeet <jonskeet@google.com> | 2016-04-08 12:19:10 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2016-04-20 03:45:59 +0100 |
commit | 75626ed79c726ed9fd96d9d143ce6b6c88413bf8 (patch) | |
tree | a64be68c42ea3abdd589df459fbf685724bfd82c /src/google/protobuf/compiler/csharp/csharp_generator.cc | |
parent | 2a197b3eb0d74ac1f1d461ac958ebccaf968031c (diff) | |
download | protobuf-75626ed79c726ed9fd96d9d143ce6b6c88413bf8.tar.gz protobuf-75626ed79c726ed9fd96d9d143ce6b6c88413bf8.tar.bz2 protobuf-75626ed79c726ed9fd96d9d143ce6b6c88413bf8.zip |
Add C# codegen changes to enum value names (mostly C++)
Overview of changes:
- A new C#-specific command-line option, legacy_enum_values to revert to the old behavior
- When legacy_enum_values isn't specified, we strip the enum name as a prefix, and PascalCase the value name
- A new attribute within the C# code so that we can always tell the original in-proto name
Regenerating the C# code with legacy_enum_values leads to code which still compiles and works - but
there's more still to do.
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_generator.cc')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_generator.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_generator.cc b/src/google/protobuf/compiler/csharp/csharp_generator.cc index c13ed65b..d74e8c88 100644 --- a/src/google/protobuf/compiler/csharp/csharp_generator.cc +++ b/src/google/protobuf/compiler/csharp/csharp_generator.cc @@ -83,6 +83,9 @@ 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; |