diff options
author | Jon Skeet <jonskeet@google.com> | 2015-07-15 13:36:56 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-07-15 22:04:45 +0100 |
commit | 541b442b99e1e9a1c514e2aacfe1e83561a9ab68 (patch) | |
tree | ea2efa102b0c12dc3c6e7ee453bb961682c13d85 /src/google/protobuf/compiler/csharp/csharp_helpers.h | |
parent | f8281604543697f1543938e4319a7f8cbda6510a (diff) | |
download | protobuf-541b442b99e1e9a1c514e2aacfe1e83561a9ab68.tar.gz protobuf-541b442b99e1e9a1c514e2aacfe1e83561a9ab68.tar.bz2 protobuf-541b442b99e1e9a1c514e2aacfe1e83561a9ab68.zip |
Don't create nested types (or field accessors) for map types.
I'm sure I've implemented this before, but somehow it's been lost in a maze of twisty little branches, all alike.
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_helpers.h')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_helpers.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.h b/src/google/protobuf/compiler/csharp/csharp_helpers.h index bd3d6e7d..a7c2395b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_helpers.h +++ b/src/google/protobuf/compiler/csharp/csharp_helpers.h @@ -105,6 +105,12 @@ uint FixedMakeTag(const FieldDescriptor* descriptor); FieldGeneratorBase* CreateFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal); +// Determines whether the given message is a map entry message, i.e. one implicitly created +// by protoc due to a map<key, value> field. +inline bool IsMapEntryMessage(const Descriptor* descriptor) { + return descriptor->options().map_entry(); +} + // Determines whether we're generating code for the proto representation of descriptors etc, // for use in the runtime. This is the only type which is allowed to use proto2 syntax, // and it generates internal classes. |