diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-07-08 15:54:05 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-07-08 15:54:05 +0000 |
commit | fc7be18c76af2e700641f3598c4856baeef1428e (patch) | |
tree | 11dbca45eb321c3a4dd08b12152acc6ef5dd3fa9 /contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_helpers.cc | |
parent | ec0e7ed6da6fb317741fd8468602949a1362eca5 (diff) | |
parent | c92cb9d3a19331916f0c274d80e67f02a62caa9b (diff) | |
download | ydb-fc7be18c76af2e700641f3598c4856baeef1428e.tar.gz |
Merge branch 'rightlib' into mergelibs-240708-1553
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.cc | 7 |
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 b80131b024..8b5d09e531 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, |