diff options
author | Sydney Acksman <ObsidianMinor@users.noreply.github.com> | 2018-09-24 15:42:24 -0500 |
---|---|---|
committer | Jie Luo <anandolee@gmail.com> | 2018-09-24 13:42:24 -0700 |
commit | 54176b26a9be6c9903b375596b778f51f5947921 (patch) | |
tree | a441d2831ecdb3db5e1f867b8fabc94ed523de13 /src/google/protobuf/compiler/csharp/csharp_field_base.h | |
parent | fb0a74b66076d6c55022a9bccabf6cdb08dbab83 (diff) | |
download | protobuf-54176b26a9be6c9903b375596b778f51f5947921.tar.gz protobuf-54176b26a9be6c9903b375596b778f51f5947921.tar.bz2 protobuf-54176b26a9be6c9903b375596b778f51f5947921.zip |
C# Proto2 feature : Field presence and default values (#4642)
* Compiler changes
* Generated code changes
* Library changes
* Compiler style changes
* Generated style changes
* Fix Windows build errors
* Implement changes from review
* Reintroduce proto2 check
* Compiler changes (required handling review)
* Generated code changes (required handling review)
* Library changes (required handling review
* Field presence rewrite (compiler changes)
* Field presence rewrite (generated code changes)
* Compiler comment
* IFieldAccessor.HasValue library implementation
* Remove Clear methods and default values from proto3 code (Compiler)
* Remove Clear methods and default values from proto3 code (Generated)
* Remove Clear methods and default values from proto3 code (Library)
* Fix distcheck error
* Rewrite default string values to use base64 and convert
* Library changes (IMessage2)
* Compiler changes (IMessage2)
* Generated changes (IMessage2)
* Rebased and regenerated
* Compiler changes (initialized extension)
* Generated changes (initialized extension)
* Library changes (initialized extension)
* Refactor MessageExtensions.IsRequired
* Move string default value creator and bytes default value creator back to seperate methods
* Dead code cleanup
* Fixed segmentation fault
Removed unused header method declarations
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_field_base.h')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_field_base.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_field_base.h b/src/google/protobuf/compiler/csharp/csharp_field_base.h index 62c25517..7eee6bf1 100644 --- a/src/google/protobuf/compiler/csharp/csharp_field_base.h +++ b/src/google/protobuf/compiler/csharp/csharp_field_base.h @@ -47,7 +47,7 @@ namespace csharp { class FieldGeneratorBase : public SourceGeneratorBase { public: FieldGeneratorBase(const FieldDescriptor* descriptor, - int fieldOrdinal, + int presenceIndex, const Options* options); ~FieldGeneratorBase(); @@ -67,7 +67,7 @@ class FieldGeneratorBase : public SourceGeneratorBase { protected: const FieldDescriptor* descriptor_; - const int fieldOrdinal_; + const int presenceIndex_; std::map<string, string> variables_; void AddDeprecatedFlag(io::Printer* printer); @@ -84,7 +84,6 @@ class FieldGeneratorBase : public SourceGeneratorBase { std::string type_name(); std::string type_name(const FieldDescriptor* descriptor); bool has_default_value(); - bool is_nullable_type(); std::string default_value(); std::string default_value(const FieldDescriptor* descriptor); std::string number(); @@ -92,8 +91,8 @@ class FieldGeneratorBase : public SourceGeneratorBase { private: void SetCommonFieldVariables(std::map<string, string>* variables); - std::string GetStringDefaultValueInternal(); - std::string GetBytesDefaultValueInternal(); + std::string GetStringDefaultValueInternal(const FieldDescriptor* descriptor); + std::string GetBytesDefaultValueInternal(const FieldDescriptor* descriptor); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorBase); }; |