Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
afbc89a2
Commit
afbc89a2
authored
Dec 17, 2015
by
Jon Skeet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1049 from jskeet/any-format
Handle Any formatting for diagnostic purposes
parents
33106681
adee6fe3
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
192 additions
and
118 deletions
+192
-118
Addressbook.cs
csharp/src/AddressBook/Addressbook.cs
+6
-3
Conformance.cs
csharp/src/Google.Protobuf.Conformance/Conformance.cs
+5
-5
MapUnittestProto3.cs
.../src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
+7
-7
UnittestImportProto3.cs
...c/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
+1
-1
UnittestImportPublicProto3.cs
...le.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
+1
-1
UnittestIssues.cs
csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
+10
-10
UnittestProto3.cs
csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
+35
-35
UnittestWellKnownTypes.cs
...Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
+4
-4
AnyTest.cs
csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs
+23
-0
JsonFormatter.cs
csharp/src/Google.Protobuf/JsonFormatter.cs
+51
-3
Descriptor.cs
csharp/src/Google.Protobuf/Reflection/Descriptor.cs
+22
-22
Any.cs
csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
+1
-1
Api.cs
csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
+3
-3
Duration.cs
csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
+1
-1
Empty.cs
csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
+1
-1
FieldMask.cs
csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
+1
-1
SourceContext.cs
csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
+1
-1
Struct.cs
csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
+3
-3
Timestamp.cs
csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
+1
-1
Type.cs
csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
+5
-5
Wrappers.cs
csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
+9
-9
csharp_message.cc
src/google/protobuf/compiler/csharp/csharp_message.cc
+1
-1
No files found.
csharp/src/AddressBook/Addressbook.cs
View file @
afbc89a2
...
...
@@ -43,6 +43,9 @@ namespace Google.Protobuf.Examples.AddressBook {
}
#
region
Messages
/// <summary>
/// [START messages]
/// </summary>
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
public
sealed
partial
class
Person
:
pb
::
IMessage
<
Person
>
{
private
static
readonly
pb
::
MessageParser
<
Person
>
_parser
=
new
pb
::
MessageParser
<
Person
>(()
=>
new
Person
());
...
...
@@ -143,7 +146,7 @@ namespace Google.Protobuf.Examples.AddressBook {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -302,7 +305,7 @@ namespace Google.Protobuf.Examples.AddressBook {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -426,7 +429,7 @@ namespace Google.Protobuf.Examples.AddressBook {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Conformance/Conformance.cs
View file @
afbc89a2
...
...
@@ -284,7 +284,7 @@ namespace Conformance {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -532,7 +532,7 @@ namespace Conformance {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1544,7 +1544,7 @@ namespace Conformance {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2343,7 +2343,7 @@ namespace Conformance {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2471,7 +2471,7 @@ namespace Conformance {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
View file @
afbc89a2
...
...
@@ -425,7 +425,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -633,7 +633,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -741,7 +741,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -851,7 +851,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1121,7 +1121,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1318,7 +1318,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1427,7 +1427,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
View file @
afbc89a2
...
...
@@ -110,7 +110,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
View file @
afbc89a2
...
...
@@ -96,7 +96,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
View file @
afbc89a2
...
...
@@ -126,7 +126,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -204,7 +204,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -282,7 +282,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -405,7 +405,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -511,7 +511,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -668,7 +668,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -831,7 +831,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -947,7 +947,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1056,7 +1056,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1279,7 +1279,7 @@ namespace UnitTest.Issues.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
View file @
afbc89a2
...
...
@@ -927,7 +927,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1600,7 +1600,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1736,7 +1736,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1873,7 +1873,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1980,7 +1980,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2070,7 +2070,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2162,7 +2162,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2291,7 +2291,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2421,7 +2421,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2547,7 +2547,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2669,7 +2669,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2883,7 +2883,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3107,7 +3107,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3278,7 +3278,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3400,7 +3400,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3506,7 +3506,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3608,7 +3608,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3704,7 +3704,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3807,7 +3807,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3913,7 +3913,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4016,7 +4016,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4119,7 +4119,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4222,7 +4222,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4325,7 +4325,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4486,7 +4486,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4780,7 +4780,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5140,7 +5140,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5414,7 +5414,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5554,7 +5554,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5647,7 +5647,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5723,7 +5723,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5799,7 +5799,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5875,7 +5875,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5951,7 +5951,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -6027,7 +6027,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
View file @
afbc89a2
...
...
@@ -466,7 +466,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1106,7 +1106,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1625,7 +1625,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2213,7 +2213,7 @@ namespace Google.Protobuf.TestProtos {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs
View file @
afbc89a2
...
...
@@ -62,5 +62,28 @@ namespace Google.Protobuf.WellKnownTypes
var
unpacked
=
any
.
Unpack
<
TestAllTypes
>();
Assert
.
AreEqual
(
message
,
unpacked
);
}
[
Test
]
public
void
ToString_WithValues
()
{
var
message
=
SampleMessages
.
CreateFullTestAllTypes
();
var
any
=
Any
.
Pack
(
message
);
var
text
=
any
.
ToString
();
Assert
.
That
(
text
,
Is
.
StringContaining
(
"\"@value\": \""
+
message
.
ToByteString
().
ToBase64
()
+
"\""
));
}
[
Test
]
public
void
ToString_Empty
()
{
var
any
=
new
Any
();
Assert
.
AreEqual
(
"{ \"@type\": \"\", \"@value\": \"\" }"
,
any
.
ToString
());
}
[
Test
]
public
void
ToString_MessageContainingAny
()
{
var
message
=
new
TestWellKnownTypes
{
AnyField
=
new
Any
()
};
Assert
.
AreEqual
(
"{ \"anyField\": { \"@type\": \"\", \"@value\": \"\" } }"
,
message
.
ToString
());
}
}
}
csharp/src/Google.Protobuf/JsonFormatter.cs
View file @
afbc89a2
...
...
@@ -56,17 +56,19 @@ namespace Google.Protobuf
public
sealed
class
JsonFormatter
{
internal
const
string
AnyTypeUrlField
=
"@type"
;
internal
const
string
AnyDiagnosticValueField
=
"@value"
;
internal
const
string
AnyWellKnownTypeValueField
=
"value"
;
private
const
string
TypeUrlPrefix
=
"type.googleapis.com"
;
private
const
string
NameValueSeparator
=
": "
;
private
const
string
PropertySeparator
=
", "
;
private
static
JsonFormatter
defaultInstance
=
new
JsonFormatter
(
Settings
.
Default
);
/// <summary>
/// Returns a formatter using the default settings.
/// </summary>
public
static
JsonFormatter
Default
{
get
{
return
defaultInstance
;
}
}
public
static
JsonFormatter
Default
{
get
;
}
=
new
JsonFormatter
(
Settings
.
Default
);
// A JSON formatter which *only* exists
private
static
readonly
JsonFormatter
diagnosticFormatter
=
new
JsonFormatter
(
Settings
.
Default
);
/// <summary>
/// The JSON representation of the first 160 characters of Unicode.
...
...
@@ -149,6 +151,29 @@ namespace Google.Protobuf
return
builder
.
ToString
();
}
/// <summary>
/// Converts a message to JSON for diagnostic purposes with no extra context.
/// </summary>
/// <remarks>
/// <para>
/// This differs from calling <see cref="Format(IMessage)"/> on the default JSON
/// formatter in its handling of <see cref="Any"/>. As no type registry is available
/// in <see cref="object.ToString"/> calls, the normal way of resolving the type of
/// an <c>Any</c> message cannot be applied. Instead, a JSON property named <c>@value</c>
/// is included with the base64 data from the <see cref="Any.Value"/> property of the message.
/// </para>
/// <para>The value returned by this method is only designed to be used for diagnostic
/// purposes. It may not be parsable by <see cref="JsonParser"/>, and may not be parsable
/// by other Protocol Buffer implementations.</para>
/// </remarks>
/// <param name="message">The message to format for diagnostic purposes.</param>
/// <returns>The diagnostic-only JSON representation of the message</returns>
public
static
string
ToDiagnosticString
(
IMessage
message
)
{
Preconditions
.
CheckNotNull
(
message
,
nameof
(
message
));
return
diagnosticFormatter
.
Format
(
message
);
}
private
void
WriteMessage
(
StringBuilder
builder
,
IMessage
message
)
{
if
(
message
==
null
)
...
...
@@ -516,6 +541,12 @@ namespace Google.Protobuf
private
void
WriteAny
(
StringBuilder
builder
,
IMessage
value
)
{
if
(
ReferenceEquals
(
this
,
diagnosticFormatter
))
{
WriteDiagnosticOnlyAny
(
builder
,
value
);
return
;
}
string
typeUrl
=
(
string
)
value
.
Descriptor
.
Fields
[
Any
.
TypeUrlFieldNumber
].
Accessor
.
GetValue
(
value
);
ByteString
data
=
(
ByteString
)
value
.
Descriptor
.
Fields
[
Any
.
ValueFieldNumber
].
Accessor
.
GetValue
(
value
);
string
typeName
=
GetTypeName
(
typeUrl
);
...
...
@@ -544,6 +575,23 @@ namespace Google.Protobuf
builder
.
Append
(
" }"
);
}
private
void
WriteDiagnosticOnlyAny
(
StringBuilder
builder
,
IMessage
value
)
{
string
typeUrl
=
(
string
)
value
.
Descriptor
.
Fields
[
Any
.
TypeUrlFieldNumber
].
Accessor
.
GetValue
(
value
);
ByteString
data
=
(
ByteString
)
value
.
Descriptor
.
Fields
[
Any
.
ValueFieldNumber
].
Accessor
.
GetValue
(
value
);
builder
.
Append
(
"{ "
);
WriteString
(
builder
,
AnyTypeUrlField
);
builder
.
Append
(
NameValueSeparator
);
WriteString
(
builder
,
typeUrl
);
builder
.
Append
(
PropertySeparator
);
WriteString
(
builder
,
AnyDiagnosticValueField
);
builder
.
Append
(
NameValueSeparator
);
builder
.
Append
(
'"'
);
builder
.
Append
(
data
.
ToBase64
());
builder
.
Append
(
'"'
);
builder
.
Append
(
" }"
);
}
internal
static
string
GetTypeName
(
String
typeUrl
)
{
string
[]
parts
=
typeUrl
.
Split
(
'/'
);
...
...
csharp/src/Google.Protobuf/Reflection/Descriptor.cs
View file @
afbc89a2
...
...
@@ -225,7 +225,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -489,7 +489,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -827,7 +827,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1021,7 +1021,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1162,7 +1162,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1436,7 +1436,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1741,7 +1741,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1872,7 +1872,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2031,7 +2031,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2196,7 +2196,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2404,7 +2404,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -2863,7 +2863,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3302,7 +3302,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3596,7 +3596,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3845,7 +3845,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -3990,7 +3990,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4121,7 +4121,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4252,7 +4252,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4451,7 +4451,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4653,7 +4653,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -4823,7 +4823,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -5051,7 +5051,7 @@ namespace Google.Protobuf.Reflection {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
View file @
afbc89a2
...
...
@@ -165,7 +165,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
View file @
afbc89a2
...
...
@@ -230,7 +230,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -503,7 +503,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -783,7 +783,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
View file @
afbc89a2
...
...
@@ -164,7 +164,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
View file @
afbc89a2
...
...
@@ -94,7 +94,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
View file @
afbc89a2
...
...
@@ -221,7 +221,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
View file @
afbc89a2
...
...
@@ -105,7 +105,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
View file @
afbc89a2
...
...
@@ -136,7 +136,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -361,7 +361,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -555,7 +555,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
View file @
afbc89a2
...
...
@@ -175,7 +175,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
View file @
afbc89a2
...
...
@@ -230,7 +230,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -522,7 +522,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -910,7 +910,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1098,7 +1098,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1244,7 +1244,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
View file @
afbc89a2
...
...
@@ -117,7 +117,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -228,7 +228,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -339,7 +339,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -450,7 +450,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -561,7 +561,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -672,7 +672,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -783,7 +783,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -894,7 +894,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
@@ -1005,7 +1005,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public
override
string
ToString
()
{
return
pb
::
JsonFormatter
.
Default
.
Format
(
this
);
return
pb
::
JsonFormatter
.
ToDiagnosticString
(
this
);
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
...
...
src/google/protobuf/compiler/csharp/csharp_message.cc
View file @
afbc89a2
...
...
@@ -353,7 +353,7 @@ void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
printer
->
Print
(
"public override string ToString() {
\n
"
" return pb::JsonFormatter.
Default.Format
(this);
\n
"
" return pb::JsonFormatter.
ToDiagnosticString
(this);
\n
"
"}
\n\n
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment