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
fb1547b3
Commit
fb1547b3
authored
Jun 12, 2015
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Regenerate proto files
parent
a8dae140
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
60 deletions
+72
-60
Addressbook.cs
csharp/src/AddressBook/Addressbook.cs
+30
-22
UnittestImportProto3.cs
...c/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs
+1
-1
UnittestImportPublicProto3.cs
...ocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs
+1
-1
UnittestIssues.cs
csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs
+40
-36
UnittestProto3.cs
csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs
+0
-0
DescriptorProtoFile.cs
...c/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
+0
-0
No files found.
csharp/src/AddressBook/Addressbook.cs
View file @
fb1547b3
...
...
@@ -130,39 +130,43 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public
override
int
GetHashCode
()
{
int
hash
=
0
;
if
(
Name
!=
""
)
hash
^=
Name
.
GetHashCode
();
if
(
Name
.
Length
!=
0
)
hash
^=
Name
.
GetHashCode
();
if
(
Id
!=
0
)
hash
^=
Id
.
GetHashCode
();
if
(
Email
!=
""
)
hash
^=
Email
.
GetHashCode
();
if
(
Email
.
Length
!=
0
)
hash
^=
Email
.
GetHashCode
();
hash
^=
phone_
.
GetHashCode
();
return
hash
;
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
if
(
Name
!=
""
)
{
if
(
Name
.
Length
!=
0
)
{
output
.
WriteString
(
1
,
Name
);
}
if
(
Id
!=
0
)
{
output
.
WriteInt32
(
2
,
Id
);
}
if
(
Email
!=
""
)
{
if
(
Email
.
Length
!=
0
)
{
output
.
WriteString
(
3
,
Email
);
}
output
.
WriteMessageArray
(
4
,
phone_
);
if
(
phone_
.
Count
>
0
)
{
output
.
WriteMessageArray
(
4
,
phone_
);
}
}
public
int
CalculateSize
()
{
int
size
=
0
;
if
(
Name
!=
""
)
{
if
(
Name
.
Length
!=
0
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
1
,
Name
);
}
if
(
Id
!=
0
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeInt32Size
(
2
,
Id
);
}
if
(
Email
!=
""
)
{
if
(
Email
.
Length
!=
0
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
3
,
Email
);
}
foreach
(
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
element
in
phone_
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
4
,
element
);
if
(
phone_
.
Count
>
0
)
{
foreach
(
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
element
in
phone_
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
4
,
element
);
}
}
return
size
;
}
...
...
@@ -170,13 +174,13 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
if
(
other
==
null
)
{
return
;
}
if
(
other
.
Name
!=
""
)
{
if
(
other
.
Name
.
Length
!=
0
)
{
Name
=
other
.
Name
;
}
if
(
other
.
Id
!=
0
)
{
Id
=
other
.
Id
;
}
if
(
other
.
Email
!=
""
)
{
if
(
other
.
Email
.
Length
!=
0
)
{
Email
=
other
.
Email
;
}
phone_
.
Add
(
other
.
phone_
);
...
...
@@ -194,15 +198,15 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
break
;
case
10
:
{
name_
=
input
.
ReadString
();
Name
=
input
.
ReadString
();
break
;
}
case
16
:
{
id_
=
input
.
ReadInt32
();
Id
=
input
.
ReadInt32
();
break
;
}
case
26
:
{
email_
=
input
.
ReadString
();
Email
=
input
.
ReadString
();
break
;
}
case
34
:
{
...
...
@@ -275,13 +279,13 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public
override
int
GetHashCode
()
{
int
hash
=
0
;
if
(
Number
!=
""
)
hash
^=
Number
.
GetHashCode
();
if
(
Number
.
Length
!=
0
)
hash
^=
Number
.
GetHashCode
();
if
(
Type
!=
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
.
HOME
)
hash
^=
Type
.
GetHashCode
();
return
hash
;
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
if
(
Number
!=
""
)
{
if
(
Number
.
Length
!=
0
)
{
output
.
WriteString
(
1
,
Number
);
}
if
(
Type
!=
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
.
HOME
)
{
...
...
@@ -291,7 +295,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public
int
CalculateSize
()
{
int
size
=
0
;
if
(
Number
!=
""
)
{
if
(
Number
.
Length
!=
0
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
1
,
Number
);
}
if
(
Type
!=
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
.
HOME
)
{
...
...
@@ -303,7 +307,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
if
(
other
==
null
)
{
return
;
}
if
(
other
.
Number
!=
""
)
{
if
(
other
.
Number
.
Length
!=
0
)
{
Number
=
other
.
Number
;
}
if
(
other
.
Type
!=
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
.
HOME
)
{
...
...
@@ -323,7 +327,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
break
;
case
10
:
{
number_
=
input
.
ReadString
();
Number
=
input
.
ReadString
();
break
;
}
case
16
:
{
...
...
@@ -388,13 +392,17 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
output
.
WriteMessageArray
(
1
,
person_
);
if
(
person_
.
Count
>
0
)
{
output
.
WriteMessageArray
(
1
,
person_
);
}
}
public
int
CalculateSize
()
{
int
size
=
0
;
foreach
(
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
element
in
person_
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
1
,
element
);
if
(
person_
.
Count
>
0
)
{
foreach
(
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
element
in
person_
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
1
,
element
);
}
}
return
size
;
}
...
...
csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs
View file @
fb1547b3
...
...
@@ -141,7 +141,7 @@ namespace Google.Protobuf.TestProtos {
}
break
;
case
8
:
{
d_
=
input
.
ReadInt32
();
D
=
input
.
ReadInt32
();
break
;
}
}
...
...
csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs
View file @
fb1547b3
...
...
@@ -126,7 +126,7 @@ namespace Google.Protobuf.TestProtos {
}
break
;
case
8
:
{
e_
=
input
.
ReadInt32
();
E
=
input
.
ReadInt32
();
break
;
}
}
...
...
csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs
View file @
fb1547b3
...
...
@@ -157,8 +157,12 @@ namespace UnitTest.Issues.TestProtos {
if
(
Value
!=
global
::
UnitTest
.
Issues
.
TestProtos
.
NegativeEnum
.
NEGATIVE_ENUM_ZERO
)
{
output
.
WriteEnum
(
1
,
(
int
)
Value
);
}
output
.
WriteEnumArray
(
2
,
values_
);
output
.
WritePackedEnumArray
(
3
,
packedValues_
);
if
(
values_
.
Count
>
0
)
{
output
.
WriteEnumArray
(
2
,
values_
);
}
if
(
packedValues_
.
Count
>
0
)
{
output
.
WritePackedEnumArray
(
3
,
packedValues_
);
}
}
public
int
CalculateSize
()
{
...
...
@@ -166,26 +170,22 @@ namespace UnitTest.Issues.TestProtos {
if
(
Value
!=
global
::
UnitTest
.
Issues
.
TestProtos
.
NegativeEnum
.
NEGATIVE_ENUM_ZERO
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeEnumSize
(
1
,
(
int
)
Value
);
}
{
if
(
values_
.
Count
>
0
)
{
int
dataSize
=
0
;
if
(
values_
.
Count
>
0
)
{
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
NegativeEnum
element
in
values_
)
{
dataSize
+=
pb
::
CodedOutputStream
.
ComputeEnumSizeNoTag
((
int
)
element
);
}
size
+=
dataSize
;
size
+=
1
*
values_
.
Count
;
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
NegativeEnum
element
in
values_
)
{
dataSize
+=
pb
::
CodedOutputStream
.
ComputeEnumSizeNoTag
((
int
)
element
);
}
size
+=
dataSize
;
size
+=
1
*
values_
.
Count
;
}
{
if
(
packedValues_
.
Count
>
0
)
{
int
dataSize
=
0
;
if
(
packedValues_
.
Count
>
0
)
{
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
NegativeEnum
element
in
packedValues_
)
{
dataSize
+=
pb
::
CodedOutputStream
.
ComputeEnumSizeNoTag
((
int
)
element
);
}
size
+=
dataSize
;
size
+=
1
;
size
+=
pb
::
CodedOutputStream
.
ComputeRawVarint32Size
((
uint
)
dataSize
);
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
NegativeEnum
element
in
packedValues_
)
{
dataSize
+=
pb
::
CodedOutputStream
.
ComputeEnumSizeNoTag
((
int
)
element
);
}
size
+=
dataSize
;
size
+=
1
;
size
+=
pb
::
CodedOutputStream
.
ComputeRawVarint32Size
((
uint
)
dataSize
);
}
return
size
;
}
...
...
@@ -399,15 +399,21 @@ namespace UnitTest.Issues.TestProtos {
if
(
PrimitiveValue
!=
0
)
{
output
.
WriteInt32
(
1
,
PrimitiveValue
);
}
output
.
WritePackedInt32Array
(
2
,
primitiveArray_
);
if
(
primitiveArray_
.
Count
>
0
)
{
output
.
WritePackedInt32Array
(
2
,
primitiveArray_
);
}
if
(
messageValue_
!=
null
)
{
output
.
WriteMessage
(
3
,
MessageValue
);
}
output
.
WriteMessageArray
(
4
,
messageArray_
);
if
(
messageArray_
.
Count
>
0
)
{
output
.
WriteMessageArray
(
4
,
messageArray_
);
}
if
(
EnumValue
!=
global
::
UnitTest
.
Issues
.
TestProtos
.
DeprecatedEnum
.
DEPRECATED_ZERO
)
{
output
.
WriteEnum
(
5
,
(
int
)
EnumValue
);
}
output
.
WritePackedEnumArray
(
6
,
enumArray_
);
if
(
enumArray_
.
Count
>
0
)
{
output
.
WritePackedEnumArray
(
6
,
enumArray_
);
}
}
public
int
CalculateSize
()
{
...
...
@@ -415,35 +421,33 @@ namespace UnitTest.Issues.TestProtos {
if
(
PrimitiveValue
!=
0
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeInt32Size
(
1
,
PrimitiveValue
);
}
{
if
(
primitiveArray_
.
Count
>
0
)
{
int
dataSize
=
0
;
foreach
(
int
element
in
primitiveArray_
)
{
dataSize
+=
pb
::
CodedOutputStream
.
ComputeInt32SizeNoTag
(
element
);
}
size
+=
dataSize
;
if
(
primitiveArray_
.
Count
!=
0
)
{
size
+=
1
+
pb
::
CodedOutputStream
.
ComputeInt32SizeNoTag
(
dataSize
);
}
size
+=
1
+
pb
::
CodedOutputStream
.
ComputeInt32SizeNoTag
(
dataSize
);
}
if
(
messageValue_
!=
null
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
3
,
MessageValue
);
}
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
DeprecatedChild
element
in
messageArray_
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
4
,
element
);
if
(
messageArray_
.
Count
>
0
)
{
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
DeprecatedChild
element
in
messageArray_
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeMessageSize
(
4
,
element
);
}
}
if
(
EnumValue
!=
global
::
UnitTest
.
Issues
.
TestProtos
.
DeprecatedEnum
.
DEPRECATED_ZERO
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeEnumSize
(
5
,
(
int
)
EnumValue
);
}
{
if
(
enumArray_
.
Count
>
0
)
{
int
dataSize
=
0
;
if
(
enumArray_
.
Count
>
0
)
{
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
DeprecatedEnum
element
in
enumArray_
)
{
dataSize
+=
pb
::
CodedOutputStream
.
ComputeEnumSizeNoTag
((
int
)
element
);
}
size
+=
dataSize
;
size
+=
1
;
size
+=
pb
::
CodedOutputStream
.
ComputeRawVarint32Size
((
uint
)
dataSize
);
foreach
(
global
::
UnitTest
.
Issues
.
TestProtos
.
DeprecatedEnum
element
in
enumArray_
)
{
dataSize
+=
pb
::
CodedOutputStream
.
ComputeEnumSizeNoTag
((
int
)
element
);
}
size
+=
dataSize
;
size
+=
1
;
size
+=
pb
::
CodedOutputStream
.
ComputeRawVarint32Size
((
uint
)
dataSize
);
}
return
size
;
}
...
...
@@ -480,7 +484,7 @@ namespace UnitTest.Issues.TestProtos {
}
break
;
case
8
:
{
primitiveValue_
=
input
.
ReadInt32
();
PrimitiveValue
=
input
.
ReadInt32
();
break
;
}
case
18
:
...
...
@@ -596,7 +600,7 @@ namespace UnitTest.Issues.TestProtos {
}
break
;
case
8
:
{
item_
=
input
.
ReadInt32
();
Item
=
input
.
ReadInt32
();
break
;
}
}
...
...
csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs
View file @
fb1547b3
This diff is collapsed.
Click to expand it.
csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
View file @
fb1547b3
This diff is collapsed.
Click to expand it.
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