aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@google.com>2015-04-13 13:03:23 -0700
committerJan Tattermusch <jtattermusch@google.com>2015-04-13 13:03:23 -0700
commit16a3e2b91423c32680b3dc904c839853c9dc8cc8 (patch)
tree8d196008f4fba5ee04320a274535319944b8fbc1 /src
parent44664bb705fc704ac3cc5a745d200145a4897ed2 (diff)
downloadprotobuf-16a3e2b91423c32680b3dc904c839853c9dc8cc8.tar.gz
protobuf-16a3e2b91423c32680b3dc904c839853c9dc8cc8.tar.bz2
protobuf-16a3e2b91423c32680b3dc904c839853c9dc8cc8.zip
enable overriding of property name using csharp_property_name
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_helpers.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.cc b/src/google/protobuf/compiler/csharp/csharp_helpers.cc
index ac258f04..55ce3285 100644
--- a/src/google/protobuf/compiler/csharp/csharp_helpers.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_helpers.cc
@@ -253,7 +253,9 @@ std::string GetFieldConstantName(const FieldDescriptor* field) {
}
std::string GetPropertyName(const FieldDescriptor* descriptor) {
- // TODO: fix this.
+ if (descriptor->options().has_csharp_property_name()) {
+ return descriptor->options().csharp_property_name();
+ }
std::string property_name = UnderscoresToPascalCase(GetFieldName(descriptor));
if (property_name == descriptor->containing_type()->name()) {
property_name += "_";