Commit 5b9288e4 authored by Jon Skeet's avatar Jon Skeet

Use the new JsonFormatter to implement ToString on generated messages.

parent f8c151f2
...@@ -160,6 +160,10 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -160,6 +160,10 @@ namespace Google.Protobuf.Examples.AddressBook {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -330,6 +334,10 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -330,6 +334,10 @@ namespace Google.Protobuf.Examples.AddressBook {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Number.Length != 0) { if (Number.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -463,6 +471,10 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -463,6 +471,10 @@ namespace Google.Protobuf.Examples.AddressBook {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
person_.WriteTo(output, _repeated_person_codec); person_.WriteTo(output, _repeated_person_codec);
} }
......
...@@ -602,6 +602,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -602,6 +602,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec); mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec);
mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec); mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec);
...@@ -836,6 +840,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -836,6 +840,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -978,6 +986,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -978,6 +986,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0L) { if (Key != 0L) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1120,6 +1132,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1120,6 +1132,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1262,6 +1278,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1262,6 +1278,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0UL) { if (Key != 0UL) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1404,6 +1424,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1404,6 +1424,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1546,6 +1570,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1546,6 +1570,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0L) { if (Key != 0L) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1688,6 +1716,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1688,6 +1716,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(13); output.WriteRawTag(13);
...@@ -1830,6 +1862,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1830,6 +1862,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0UL) { if (Key != 0UL) {
output.WriteRawTag(9); output.WriteRawTag(9);
...@@ -1972,6 +2008,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1972,6 +2008,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(13); output.WriteRawTag(13);
...@@ -2114,6 +2154,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2114,6 +2154,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0L) { if (Key != 0L) {
output.WriteRawTag(9); output.WriteRawTag(9);
...@@ -2256,6 +2300,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2256,6 +2300,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -2398,6 +2446,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2398,6 +2446,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -2540,6 +2592,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2540,6 +2592,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != false) { if (Key != false) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -2682,6 +2738,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2682,6 +2738,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key.Length != 0) { if (Key.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2824,6 +2884,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2824,6 +2884,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -2966,6 +3030,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2966,6 +3030,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3109,6 +3177,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3109,6 +3177,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3250,6 +3322,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3250,6 +3322,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (testMap_ != null) { if (testMap_ != null) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -3370,6 +3446,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3370,6 +3446,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
mapInt32Message_.WriteTo(output, _map_mapInt32Message_codec); mapInt32Message_.WriteTo(output, _map_mapInt32Message_codec);
} }
...@@ -3493,6 +3573,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3493,6 +3573,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3644,6 +3728,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3644,6 +3728,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
map1_.WriteTo(output, _map_map1_codec); map1_.WriteTo(output, _map_map1_codec);
map2_.WriteTo(output, _map_map2_codec); map2_.WriteTo(output, _map_map2_codec);
...@@ -3773,6 +3861,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3773,6 +3861,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3915,6 +4007,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3915,6 +4007,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4216,6 +4312,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4216,6 +4312,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec); mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec);
mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec); mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec);
...@@ -4436,6 +4536,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4436,6 +4536,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4578,6 +4682,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4578,6 +4682,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0L) { if (Key != 0L) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4720,6 +4828,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4720,6 +4828,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4862,6 +4974,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4862,6 +4974,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0UL) { if (Key != 0UL) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -5004,6 +5120,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5004,6 +5120,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -5146,6 +5266,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5146,6 +5266,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0L) { if (Key != 0L) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -5288,6 +5412,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5288,6 +5412,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(13); output.WriteRawTag(13);
...@@ -5430,6 +5558,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5430,6 +5558,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0UL) { if (Key != 0UL) {
output.WriteRawTag(9); output.WriteRawTag(9);
...@@ -5572,6 +5704,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5572,6 +5704,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(13); output.WriteRawTag(13);
...@@ -5714,6 +5850,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5714,6 +5850,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0L) { if (Key != 0L) {
output.WriteRawTag(9); output.WriteRawTag(9);
...@@ -5856,6 +5996,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5856,6 +5996,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -5998,6 +6142,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5998,6 +6142,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -6140,6 +6288,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6140,6 +6288,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != false) { if (Key != false) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -6282,6 +6434,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6282,6 +6434,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -6425,6 +6581,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6425,6 +6581,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -6564,6 +6724,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6564,6 +6724,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
type_.WriteTo(output, _map_type_codec); type_.WriteTo(output, _map_type_codec);
} }
...@@ -6691,6 +6855,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6691,6 +6855,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -6830,6 +6998,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6830,6 +6998,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
entry_.WriteTo(output, _map_entry_codec); entry_.WriteTo(output, _map_entry_codec);
} }
...@@ -6952,6 +7124,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6952,6 +7124,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Key != 0) { if (Key != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
......
...@@ -124,6 +124,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -124,6 +124,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (D != 0) { if (D != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
......
...@@ -109,6 +109,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -109,6 +109,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (E != 0) { if (E != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
......
...@@ -148,6 +148,10 @@ namespace UnitTest.Issues.TestProtos { ...@@ -148,6 +148,10 @@ namespace UnitTest.Issues.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -237,6 +241,10 @@ namespace UnitTest.Issues.TestProtos { ...@@ -237,6 +241,10 @@ namespace UnitTest.Issues.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -326,6 +334,10 @@ namespace UnitTest.Issues.TestProtos { ...@@ -326,6 +334,10 @@ namespace UnitTest.Issues.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -459,6 +471,10 @@ namespace UnitTest.Issues.TestProtos { ...@@ -459,6 +471,10 @@ namespace UnitTest.Issues.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) { if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -577,6 +593,10 @@ namespace UnitTest.Issues.TestProtos { ...@@ -577,6 +593,10 @@ namespace UnitTest.Issues.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -746,6 +766,10 @@ namespace UnitTest.Issues.TestProtos { ...@@ -746,6 +766,10 @@ namespace UnitTest.Issues.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (PrimitiveValue != 0) { if (PrimitiveValue != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -918,6 +942,10 @@ namespace UnitTest.Issues.TestProtos { ...@@ -918,6 +942,10 @@ namespace UnitTest.Issues.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Item != 0) { if (Item != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
......
...@@ -1019,6 +1019,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1019,6 +1019,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (SingleInt32 != 0) { if (SingleInt32 != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1695,6 +1699,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1695,6 +1699,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Bb != 0) { if (Bb != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1842,6 +1850,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1842,6 +1850,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (child_ != null) { if (child_ != null) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -1991,6 +2003,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1991,6 +2003,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (DeprecatedInt32 != 0) { if (DeprecatedInt32 != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -2106,6 +2122,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2106,6 +2122,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (C != 0) { if (C != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -2208,6 +2228,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2208,6 +2228,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -2310,6 +2334,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2310,6 +2334,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (foreignNested_ != null) { if (foreignNested_ != null) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2444,6 +2472,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2444,6 +2472,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (A != 0) { if (A != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -2587,6 +2619,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2587,6 +2619,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (a_ != null) { if (a_ != null) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2723,6 +2759,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2723,6 +2759,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (bb_ != null) { if (bb_ != null) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2858,6 +2898,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -2858,6 +2898,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (a_ != null) { if (a_ != null) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -3080,6 +3124,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3080,6 +3124,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (PrimitiveField != 0) { if (PrimitiveField != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3313,6 +3361,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3313,6 +3361,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (MyInt != 0L) { if (MyInt != 0L) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3490,6 +3542,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3490,6 +3542,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Bb != 0) { if (Bb != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3624,6 +3680,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3624,6 +3680,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.TEST_SPARSE_ENUM_UNSPECIFIED) { if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.TEST_SPARSE_ENUM_UNSPECIFIED) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3739,6 +3799,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3739,6 +3799,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data.Length != 0) { if (Data.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -3853,6 +3917,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3853,6 +3917,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
data_.WriteTo(output, _repeated_data_codec); data_.WriteTo(output, _repeated_data_codec);
} }
...@@ -3961,6 +4029,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -3961,6 +4029,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data.Length != 0) { if (Data.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -4076,6 +4148,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4076,6 +4148,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data.Length != 0) { if (Data.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -4191,6 +4267,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4191,6 +4267,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != 0) { if (Data != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4306,6 +4386,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4306,6 +4386,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != 0) { if (Data != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4421,6 +4505,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4421,6 +4505,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != 0L) { if (Data != 0L) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4536,6 +4624,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4536,6 +4624,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != 0UL) { if (Data != 0UL) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4651,6 +4743,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4651,6 +4743,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != false) { if (Data != false) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -4820,6 +4916,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -4820,6 +4916,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (fooCase_ == FooOneofCase.FooInt) { if (fooCase_ == FooOneofCase.FooInt) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -5125,6 +5225,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5125,6 +5225,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
packedInt32_.WriteTo(output, _repeated_packedInt32_codec); packedInt32_.WriteTo(output, _repeated_packedInt32_codec);
packedInt64_.WriteTo(output, _repeated_packedInt64_codec); packedInt64_.WriteTo(output, _repeated_packedInt64_codec);
...@@ -5492,6 +5596,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5492,6 +5596,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
unpackedInt32_.WriteTo(output, _repeated_unpackedInt32_codec); unpackedInt32_.WriteTo(output, _repeated_unpackedInt32_codec);
unpackedInt64_.WriteTo(output, _repeated_unpackedInt64_codec); unpackedInt64_.WriteTo(output, _repeated_unpackedInt64_codec);
...@@ -5764,6 +5872,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5764,6 +5872,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
repeatedFixed32_.WriteTo(output, _repeated_repeatedFixed32_codec); repeatedFixed32_.WriteTo(output, _repeated_repeatedFixed32_codec);
repeatedInt32_.WriteTo(output, _repeated_repeatedInt32_codec); repeatedInt32_.WriteTo(output, _repeated_repeatedInt32_codec);
...@@ -5913,6 +6025,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -5913,6 +6025,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (A.Length != 0) { if (A.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -6015,6 +6131,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6015,6 +6131,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -6103,6 +6223,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6103,6 +6223,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -6191,6 +6315,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6191,6 +6315,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -6279,6 +6407,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6279,6 +6407,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -6367,6 +6499,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6367,6 +6499,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
...@@ -6455,6 +6591,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -6455,6 +6591,10 @@ namespace Google.Protobuf.TestProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
} }
......
...@@ -299,6 +299,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -299,6 +299,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
file_.WriteTo(output, _repeated_file_codec); file_.WriteTo(output, _repeated_file_codec);
} }
...@@ -545,6 +549,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -545,6 +549,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -889,6 +897,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -889,6 +897,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -1094,6 +1106,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1094,6 +1106,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Start != 0) { if (Start != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1236,6 +1252,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1236,6 +1252,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Start != 0) { if (Start != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -1475,6 +1495,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1475,6 +1495,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -1741,6 +1765,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1741,6 +1765,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -1882,6 +1910,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1882,6 +1910,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2051,6 +2083,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2051,6 +2083,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2226,6 +2262,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2226,6 +2262,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2434,6 +2474,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2434,6 +2474,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -2806,6 +2850,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2806,6 +2850,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (JavaPackage.Length != 0) { if (JavaPackage.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -3173,6 +3221,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3173,6 +3221,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (MessageSetWireFormat != false) { if (MessageSetWireFormat != false) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3414,6 +3466,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3414,6 +3466,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Ctype != global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.CType.STRING) { if (Ctype != global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.CType.STRING) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3649,6 +3705,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3649,6 +3705,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (AllowAlias != false) { if (AllowAlias != false) {
output.WriteRawTag(16); output.WriteRawTag(16);
...@@ -3797,6 +3857,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3797,6 +3857,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Deprecated != false) { if (Deprecated != false) {
output.WriteRawTag(8); output.WriteRawTag(8);
...@@ -3931,6 +3995,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3931,6 +3995,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Deprecated != false) { if (Deprecated != false) {
output.WriteRawTag(136, 2); output.WriteRawTag(136, 2);
...@@ -4065,6 +4133,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4065,6 +4133,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Deprecated != false) { if (Deprecated != false) {
output.WriteRawTag(136, 2); output.WriteRawTag(136, 2);
...@@ -4264,6 +4336,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4264,6 +4336,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
name_.WriteTo(output, _repeated_name_codec); name_.WriteTo(output, _repeated_name_codec);
if (IdentifierValue.Length != 0) { if (IdentifierValue.Length != 0) {
...@@ -4470,6 +4546,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4470,6 +4546,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (NamePart_.Length != 0) { if (NamePart_.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
...@@ -4603,6 +4683,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4603,6 +4683,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
location_.WriteTo(output, _repeated_location_codec); location_.WriteTo(output, _repeated_location_codec);
} }
...@@ -4761,6 +4845,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4761,6 +4845,10 @@ namespace Google.Protobuf.DescriptorProtos {
return hash; return hash;
} }
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
path_.WriteTo(output, _repeated_path_codec); path_.WriteTo(output, _repeated_path_codec);
span_.WriteTo(output, _repeated_span_codec); span_.WriteTo(output, _repeated_span_codec);
......
...@@ -58,6 +58,7 @@ class FieldGeneratorBase : public SourceGeneratorBase { ...@@ -58,6 +58,7 @@ class FieldGeneratorBase : public SourceGeneratorBase {
virtual void WriteHash(io::Printer* printer) = 0; virtual void WriteHash(io::Printer* printer) = 0;
virtual void WriteEquals(io::Printer* printer) = 0; virtual void WriteEquals(io::Printer* printer) = 0;
// Currently unused, as we use reflection to generate JSON
virtual void WriteToString(io::Printer* printer) = 0; virtual void WriteToString(io::Printer* printer) = 0;
protected: protected:
......
...@@ -117,12 +117,9 @@ void MapFieldGenerator::WriteEquals(io::Printer* printer) { ...@@ -117,12 +117,9 @@ void MapFieldGenerator::WriteEquals(io::Printer* printer) {
variables_, variables_,
"if (!$property_name$.Equals(other.$property_name$)) return false;\n"); "if (!$property_name$.Equals(other.$property_name$)) return false;\n");
} }
void MapFieldGenerator::WriteToString(io::Printer* printer) { void MapFieldGenerator::WriteToString(io::Printer* printer) {
/* // TODO: If we ever actually use ToString, we'll need to impleme this...
variables_["field_name"] = GetFieldName(descriptor_);
printer->Print(
variables_,
"PrintField(\"$field_name$\", has$property_name$, $name$_, writer);\n");*/
} }
void MapFieldGenerator::GenerateCloningCode(io::Printer* printer) { void MapFieldGenerator::GenerateCloningCode(io::Printer* printer) {
......
...@@ -429,7 +429,10 @@ void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) { ...@@ -429,7 +429,10 @@ void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
printer->Outdent(); printer->Outdent();
printer->Print("}\n\n"); printer->Print("}\n\n");
// TODO(jonskeet): ToString. printer->Print(
"public override string ToString() {\n"
" return pb::JsonFormatter.Default.Format(this);\n"
"}\n\n");
} }
void MessageGenerator::GenerateMessageSerializationMethods(io::Printer* printer) { void MessageGenerator::GenerateMessageSerializationMethods(io::Printer* printer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment