diff options
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_helpers.h')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_helpers.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.h b/src/google/protobuf/compiler/csharp/csharp_helpers.h index c317ad0e..5b9f90e0 100644 --- a/src/google/protobuf/compiler/csharp/csharp_helpers.h +++ b/src/google/protobuf/compiler/csharp/csharp_helpers.h @@ -42,6 +42,8 @@ #include <google/protobuf/compiler/code_generator.h> #include <google/protobuf/io/printer.h> +#include <google/protobuf/port_def.inc> + namespace google { namespace protobuf { namespace compiler { @@ -96,7 +98,8 @@ std::string UnderscoresToPascalCase(const std::string& input); // Note that we wouldn't normally want to export this (we're not expecting // it to be used outside libprotoc itself) but this exposes it for testing. -std::string LIBPROTOBUF_EXPORT GetEnumValueName(const std::string& enum_name, const std::string& enum_value_name); +std::string PROTOC_EXPORT GetEnumValueName(const std::string& enum_name, + const std::string& enum_value_name); // TODO(jtattermusch): perhaps we could move this to strutil std::string StringToBase64(const std::string& input); @@ -104,9 +107,11 @@ std::string StringToBase64(const std::string& input); std::string FileDescriptorToBase64(const FileDescriptor* descriptor); FieldGeneratorBase* CreateFieldGenerator(const FieldDescriptor* descriptor, - int fieldOrdinal, + int presenceIndex, const Options* options); +bool IsNullable(const FieldDescriptor* descriptor); + // 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) { @@ -141,8 +146,15 @@ inline bool IsWrapperType(const FieldDescriptor* descriptor) { descriptor->message_type()->file()->name() == "google/protobuf/wrappers.proto"; } +inline bool IsProto2(const FileDescriptor* descriptor) { + return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO2; +} + } // namespace csharp } // namespace compiler } // namespace protobuf } // namespace google + +#include <google/protobuf/port_undef.inc> + #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_HELPERS_H__ |