aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/WellKnownTypes
diff options
context:
space:
mode:
authorSydney Acksman <ObsidianMinor@users.noreply.github.com>2018-09-24 15:42:24 -0500
committerJie Luo <anandolee@gmail.com>2018-09-24 13:42:24 -0700
commit54176b26a9be6c9903b375596b778f51f5947921 (patch)
treea441d2831ecdb3db5e1f867b8fabc94ed523de13 /csharp/src/Google.Protobuf/WellKnownTypes
parentfb0a74b66076d6c55022a9bccabf6cdb08dbab83 (diff)
downloadprotobuf-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 'csharp/src/Google.Protobuf/WellKnownTypes')
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Api.cs10
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Type.cs26
2 files changed, 18 insertions, 18 deletions
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
index e4a4a365..438e1db8 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
@@ -328,7 +328,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
if (other.sourceContext_ != null) {
if (sourceContext_ == null) {
- sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
+ SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext();
}
SourceContext.MergeFrom(other.SourceContext);
}
@@ -365,9 +365,9 @@ namespace Google.Protobuf.WellKnownTypes {
}
case 42: {
if (sourceContext_ == null) {
- sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
+ SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext();
}
- input.ReadMessage(sourceContext_);
+ input.ReadMessage(SourceContext);
break;
}
case 50: {
@@ -375,7 +375,7 @@ namespace Google.Protobuf.WellKnownTypes {
break;
}
case 56: {
- syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
+ Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
@@ -688,7 +688,7 @@ namespace Google.Protobuf.WellKnownTypes {
break;
}
case 56: {
- syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
+ Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
index 3e2fe541..52bd343b 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
@@ -312,7 +312,7 @@ namespace Google.Protobuf.WellKnownTypes {
options_.Add(other.options_);
if (other.sourceContext_ != null) {
if (sourceContext_ == null) {
- sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
+ SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext();
}
SourceContext.MergeFrom(other.SourceContext);
}
@@ -348,13 +348,13 @@ namespace Google.Protobuf.WellKnownTypes {
}
case 42: {
if (sourceContext_ == null) {
- sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
+ SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext();
}
- input.ReadMessage(sourceContext_);
+ input.ReadMessage(SourceContext);
break;
}
case 48: {
- syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
+ Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
@@ -726,11 +726,11 @@ namespace Google.Protobuf.WellKnownTypes {
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
- kind_ = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum();
+ Kind = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum();
break;
}
case 16: {
- cardinality_ = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum();
+ Cardinality = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum();
break;
}
case 24: {
@@ -1084,7 +1084,7 @@ namespace Google.Protobuf.WellKnownTypes {
options_.Add(other.options_);
if (other.sourceContext_ != null) {
if (sourceContext_ == null) {
- sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
+ SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext();
}
SourceContext.MergeFrom(other.SourceContext);
}
@@ -1116,13 +1116,13 @@ namespace Google.Protobuf.WellKnownTypes {
}
case 34: {
if (sourceContext_ == null) {
- sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
+ SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext();
}
- input.ReadMessage(sourceContext_);
+ input.ReadMessage(SourceContext);
break;
}
case 40: {
- syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
+ Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
@@ -1467,7 +1467,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
if (other.value_ != null) {
if (value_ == null) {
- value_ = new global::Google.Protobuf.WellKnownTypes.Any();
+ Value = new global::Google.Protobuf.WellKnownTypes.Any();
}
Value.MergeFrom(other.Value);
}
@@ -1488,9 +1488,9 @@ namespace Google.Protobuf.WellKnownTypes {
}
case 18: {
if (value_ == null) {
- value_ = new global::Google.Protobuf.WellKnownTypes.Any();
+ Value = new global::Google.Protobuf.WellKnownTypes.Any();
}
- input.ReadMessage(value_);
+ input.ReadMessage(Value);
break;
}
}