Skip to content

Commit

Permalink
C# Proto2 feature : Groups (#5183)
Browse files Browse the repository at this point in the history
Add group support for proto2
  • Loading branch information
ObsidianMinor authored and anandolee committed Nov 5, 2018
1 parent 29f27bf commit 6f73c50
Show file tree
Hide file tree
Showing 30 changed files with 619 additions and 173 deletions.
12 changes: 9 additions & 3 deletions csharp/src/AddressBook/Addressbook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
Name = input.ReadString();
Expand Down Expand Up @@ -440,7 +442,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
Number = input.ReadString();
Expand Down Expand Up @@ -573,7 +577,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
people_.AddEntriesFrom(input, _repeated_people_codec);
Expand Down
8 changes: 6 additions & 2 deletions csharp/src/Google.Protobuf.Conformance/Conformance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
ProtobufPayload = input.ReadBytes();
Expand Down Expand Up @@ -683,7 +685,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
ParseError = input.ReadString();
Expand Down
28 changes: 21 additions & 7 deletions csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
Expand Down Expand Up @@ -737,7 +739,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
if (testMap_ == null) {
Expand Down Expand Up @@ -861,7 +865,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec);
Expand Down Expand Up @@ -1001,7 +1007,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
map1_.AddEntriesFrom(input, _map_map1_codec);
Expand Down Expand Up @@ -1350,7 +1358,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
Expand Down Expand Up @@ -1531,7 +1541,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
type_.AddEntriesFrom(input, _map_type_codec);
Expand Down Expand Up @@ -1666,7 +1678,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
entry_.AddEntriesFrom(input, _map_entry_codec);
Expand Down
12 changes: 9 additions & 3 deletions csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
OptionalInt32 = input.ReadInt32();
Expand Down Expand Up @@ -3582,7 +3584,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
A = input.ReadInt32();
Expand Down Expand Up @@ -3723,7 +3727,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
C = input.ReadInt32();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
Field1 = input.ReadString();
Expand Down Expand Up @@ -478,7 +480,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -579,7 +583,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -680,7 +686,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -781,7 +789,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -882,7 +892,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -996,7 +1008,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -1097,7 +1111,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -1198,7 +1214,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -1299,7 +1317,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -1400,7 +1420,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -1501,7 +1523,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -1690,7 +1714,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
Foo = input.ReadInt32();
Expand Down Expand Up @@ -1902,7 +1928,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 10: {
if (bar_ == null) {
Expand Down Expand Up @@ -2051,7 +2079,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
Waldo = input.ReadInt32();
Expand Down Expand Up @@ -2185,7 +2215,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
Qux = input.ReadInt32();
Expand Down Expand Up @@ -2293,7 +2325,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -2475,7 +2509,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
I = input.ReadInt32();
Expand Down Expand Up @@ -2615,7 +2651,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
Fieldname = input.ReadInt32();
Expand Down Expand Up @@ -2723,7 +2761,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
}
}
Expand Down Expand Up @@ -2855,7 +2895,9 @@ public void MergeFrom(pb::CodedInputStream input) {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
return;
}
break;
case 8: {
NestedField = input.ReadInt32();
Expand Down
Loading

0 comments on commit 6f73c50

Please sign in to comment.