diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-14 11:50:31 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-14 11:50:31 -0800 |
commit | f157a5651c79a7a36e242af216a5d5b383ba8af2 (patch) | |
tree | 368bb0ca0e89ab7514302e4df00435a4ef461a28 /src/google/protobuf/compiler/cpp/cpp_helpers.h | |
parent | faf581d20866ad5e586b3e515f6c547d2dcec2c1 (diff) |
Down-integrate from internal code base (C++ maps support).
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_helpers.h')
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_helpers.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.h b/src/google/protobuf/compiler/cpp/cpp_helpers.h index 1cff17c8..e60fa7c2 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.h +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.h @@ -149,6 +149,10 @@ inline bool UseUnknownFieldSet(const FileDescriptor* file) { } +// Does the file have any map fields, necessitating the file to include +// map_field_inl.h and map.h. +bool HasMapFields(const FileDescriptor* file); + // Does this file have any enum type definitions? bool HasEnumDefinitions(const FileDescriptor* file); @@ -200,6 +204,10 @@ void PrintHandlingOptionalStaticInitializers( const char* without_static_init); +inline bool IsMapEntryMessage(const Descriptor* descriptor) { + return descriptor->options().map_entry(); +} + // Returns true if the field's CPPTYPE is string or message. bool IsStringOrMessage(const FieldDescriptor* field); @@ -216,7 +224,7 @@ inline bool HasPreservingUnknownEnumSemantics(const FileDescriptor* file) { } inline bool SupportsArenas(const FileDescriptor* file) { - return true; + return file->options().cc_enable_arenas(); } inline bool SupportsArenas(const Descriptor* desc) { |