summaryrefslogtreecommitdiffstats
path: root/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc
diff options
context:
space:
mode:
authormikhnenko <[email protected]>2024-06-30 20:16:52 +0300
committermikhnenko <[email protected]>2024-06-30 20:28:14 +0300
commitb91a38fe11269c505fec071351a68e568768e6e8 (patch)
tree07d43bf92eee00e2fce98bdbf698f135386995c1 /contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc
parentb21e05a2e32e36ae9cc9826acf98084ca4b52d7d (diff)
Update protobuf to 3.21.2
a628f0376085fcf46dc6d24629f2a7dacb91ae79
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc')
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc
index b80131b024d..8b5d09e5311 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc
@@ -393,6 +393,13 @@ TProtoStringType GetPropertyName(const FieldDescriptor* descriptor) {
return property_name;
}
+TProtoStringType GetOneofCaseName(const FieldDescriptor* descriptor) {
+ // The name in a oneof case enum is the same as for the property, but as we always have a "None"
+ // value as well, we need to reserve that by appending an underscore.
+ TProtoStringType property_name = GetPropertyName(descriptor);
+ return property_name == "None" ? "None_" : property_name;
+}
+
TProtoStringType GetOutputFile(const FileDescriptor* descriptor,
const TProtoStringType file_extension,
const bool generate_directories,