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
17ded826
Commit
17ded826
authored
May 19, 2010
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue 10 - check serialized size before writing to stream
parent
ae9b3ff2
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
93 additions
and
0 deletions
+93
-0
AddressBookProtos.cs
src/AddressBook/AddressBookProtos.cs
+3
-0
MessageGenerator.cs
src/ProtoGen/MessageGenerator.cs
+2
-0
MessageTest.cs
src/ProtocolBuffers.Test/MessageTest.cs
+11
-0
UnitTestCSharpOptionsProtoFile.cs
...Buffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
+1
-0
UnitTestCustomOptionsProtoFile.cs
...Buffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
+17
-0
UnitTestEmbedOptimizeForProtoFile.cs
...fers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
+1
-0
UnitTestImportProtoFile.cs
...rotocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
+1
-0
UnitTestMessageSetProtoFile.cs
...colBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
+6
-0
UnitTestProtoFile.cs
src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+31
-0
CSharpOptions.cs
src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
+2
-0
DescriptorProtoFile.cs
src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
+18
-0
No files found.
src/AddressBook/AddressBookProtos.cs
View file @
17ded826
...
...
@@ -146,6 +146,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasNumber
)
{
output
.
WriteString
(
1
,
Number
);
}
...
...
@@ -418,6 +419,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -755,6 +757,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
foreach
(
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
element
in
PersonList
)
{
output
.
WriteMessage
(
1
,
element
);
}
...
...
src/ProtoGen/MessageGenerator.cs
View file @
17ded826
...
...
@@ -193,6 +193,8 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer
.
WriteLine
(
"public override void WriteTo(pb::CodedOutputStream output) {"
);
writer
.
Indent
();
// Make sure we've computed the serialized length, so that packed fields are generated correctly.
writer
.
WriteLine
(
"int size = SerializedSize;"
);
if
(
Descriptor
.
Proto
.
ExtensionRangeList
.
Count
>
0
)
{
writer
.
WriteLine
(
"pb::ExtendableMessage<{0}, {0}.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);"
,
ClassName
);
...
...
src/ProtocolBuffers.Test/MessageTest.cs
View file @
17ded826
...
...
@@ -32,6 +32,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using
System.IO
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
...
...
@@ -313,6 +314,16 @@ namespace Google.ProtocolBuffers {
Assert
.
AreEqual
(
"Message missing required fields: a, b, c"
,
e
.
Message
);
}
}
[
Test
]
public
void
PackedTypesWrittenDirectlyToStream
()
{
TestPackedTypes
message
=
new
TestPackedTypes
.
Builder
{
PackedInt32List
=
{
0
,
1
,
2
}}.
Build
();
MemoryStream
stream
=
new
MemoryStream
();
message
.
WriteTo
(
stream
);
stream
.
Position
=
0
;
TestPackedTypes
readMessage
=
TestPackedTypes
.
ParseFrom
(
stream
);
Assert
.
AreEqual
(
message
,
readMessage
);
}
}
}
src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
View file @
17ded826
...
...
@@ -110,6 +110,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasNormal
)
{
output
.
WriteString
(
1
,
Normal
);
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
View file @
17ded826
...
...
@@ -432,6 +432,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasField1
)
{
output
.
WriteString
(
1
,
Field1
);
}
...
...
@@ -637,6 +638,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -810,6 +812,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -993,6 +996,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -1166,6 +1170,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -1339,6 +1344,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -1512,6 +1518,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -1685,6 +1692,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -1858,6 +1866,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -2031,6 +2040,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -2215,6 +2225,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
ComplexOptionType1
,
ComplexOptionType1
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
if
(
HasFoo
)
{
output
.
WriteInt32
(
1
,
Foo
);
...
...
@@ -2459,6 +2470,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasWaldo
)
{
output
.
WriteInt32
(
1
,
Waldo
);
}
...
...
@@ -2678,6 +2690,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
ComplexOptionType2
,
ComplexOptionType2
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
if
(
HasBar
)
{
output
.
WriteMessage
(
1
,
Bar
);
...
...
@@ -3028,6 +3041,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasPlugh
)
{
output
.
WriteInt32
(
3
,
Plugh
);
}
...
...
@@ -3233,6 +3247,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasQux
)
{
output
.
WriteInt32
(
1
,
Qux
);
}
...
...
@@ -3501,6 +3516,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasXyzzy
)
{
output
.
WriteInt32
(
7593951
,
Xyzzy
);
}
...
...
@@ -3705,6 +3721,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
View file @
17ded826
...
...
@@ -112,6 +112,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasOptionalMessage
)
{
output
.
WriteMessage
(
1
,
OptionalMessage
);
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
View file @
17ded826
...
...
@@ -99,6 +99,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasD
)
{
output
.
WriteInt32
(
1
,
D
);
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
View file @
17ded826
...
...
@@ -124,6 +124,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
TestMessageSet
,
TestMessageSet
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
extensionWriter
.
WriteUntil
(
536870912
,
output
);
UnknownFields
.
WriteAsMessageSetTo
(
output
);
...
...
@@ -311,6 +312,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasMessageSet
)
{
output
.
WriteMessage
(
1
,
MessageSet
);
}
...
...
@@ -550,6 +552,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasI
)
{
output
.
WriteInt32
(
15
,
I
);
}
...
...
@@ -766,6 +769,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasStr
)
{
output
.
WriteString
(
25
,
Str
);
}
...
...
@@ -1017,6 +1021,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasTypeId
)
{
output
.
WriteInt32
(
2
,
TypeId
);
}
...
...
@@ -1246,6 +1251,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
foreach
(
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
RawMessageSet
.
Types
.
Item
element
in
ItemList
)
{
output
.
WriteGroup
(
1
,
element
);
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
View file @
17ded826
...
...
@@ -989,6 +989,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasBb
)
{
output
.
WriteInt32
(
1
,
Bb
);
}
...
...
@@ -1203,6 +1204,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
17
,
A
);
}
...
...
@@ -1417,6 +1419,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
47
,
A
);
}
...
...
@@ -2346,6 +2349,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasOptionalInt32
)
{
output
.
WriteInt32
(
1
,
OptionalInt32
);
}
...
...
@@ -5257,6 +5261,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasC
)
{
output
.
WriteInt32
(
1
,
C
);
}
...
...
@@ -5462,6 +5467,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
TestAllExtensions
,
TestAllExtensions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
extensionWriter
.
WriteUntil
(
536870912
,
output
);
UnknownFields
.
WriteTo
(
output
);
...
...
@@ -5649,6 +5655,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
17
,
A
);
}
...
...
@@ -5863,6 +5870,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
47
,
A
);
}
...
...
@@ -6404,6 +6412,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
1
,
A
);
}
...
...
@@ -7638,6 +7647,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasOptionalMessage
)
{
output
.
WriteMessage
(
1
,
OptionalMessage
);
}
...
...
@@ -7960,6 +7970,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasForeignNested
)
{
output
.
WriteMessage
(
1
,
ForeignNested
);
}
...
...
@@ -8187,6 +8198,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -8361,6 +8373,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
TestEmptyMessageWithExtensions
,
TestEmptyMessageWithExtensions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
extensionWriter
.
WriteUntil
(
536870912
,
output
);
UnknownFields
.
WriteTo
(
output
);
...
...
@@ -8558,6 +8571,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
1
,
A
);
}
...
...
@@ -8813,6 +8827,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteMessage
(
1
,
A
);
}
...
...
@@ -9081,6 +9096,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasBb
)
{
output
.
WriteMessage
(
1
,
Bb
);
}
...
...
@@ -9328,6 +9344,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteMessage
(
1
,
A
);
}
...
...
@@ -9620,6 +9637,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
1
,
A
);
}
...
...
@@ -9834,6 +9852,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
1
,
A
);
}
...
...
@@ -10049,6 +10068,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasA
)
{
output
.
WriteInt32
(
1
,
A
);
}
...
...
@@ -10409,6 +10429,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
nestedmessageRepeatedInt32_
.
Count
>
0
)
{
foreach
(
int
element
in
nestedmessageRepeatedInt32_
)
{
output
.
WriteInt32
(
1
,
element
);
...
...
@@ -10674,6 +10695,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasOptionalNestedMessage
)
{
output
.
WriteMessage
(
1
,
OptionalNestedMessage
);
}
...
...
@@ -11033,6 +11055,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasPrimitiveField
)
{
output
.
WriteInt32
(
1
,
PrimitiveField
);
}
...
...
@@ -11762,6 +11785,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
TestFieldOrderings
,
TestFieldOrderings
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
if
(
HasMyInt
)
{
output
.
WriteInt64
(
1
,
MyInt
);
...
...
@@ -12096,6 +12120,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasEscapedBytes
)
{
output
.
WriteBytes
(
1
,
EscapedBytes
);
}
...
...
@@ -12651,6 +12676,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
packedInt32_
.
Count
>
0
)
{
output
.
WriteRawVarint32
(
722
);
output
.
WriteRawVarint32
((
uint
)
packedInt32MemoizedSerializedSize
);
...
...
@@ -13638,6 +13664,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
TestPackedExtensions
,
TestPackedExtensions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
extensionWriter
.
WriteUntil
(
536870912
,
output
);
UnknownFields
.
WriteTo
(
output
);
...
...
@@ -13815,6 +13842,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -13988,6 +14016,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -14161,6 +14190,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
@@ -14334,6 +14364,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
UnknownFields
.
WriteTo
(
output
);
}
...
...
src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
View file @
17ded826
...
...
@@ -169,6 +169,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasNamespace
)
{
output
.
WriteString
(
1
,
Namespace
);
}
...
...
@@ -571,6 +572,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasPropertyName
)
{
output
.
WriteString
(
1
,
PropertyName
);
}
...
...
src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
View file @
17ded826
...
...
@@ -264,6 +264,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
foreach
(
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
FileDescriptorProto
element
in
FileList
)
{
output
.
WriteMessage
(
1
,
element
);
}
...
...
@@ -596,6 +597,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -1196,6 +1198,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasStart
)
{
output
.
WriteInt32
(
1
,
Start
);
}
...
...
@@ -1507,6 +1510,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -2151,6 +2155,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -2653,6 +2658,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -2999,6 +3005,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -3327,6 +3334,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -3683,6 +3691,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasName
)
{
output
.
WriteString
(
1
,
Name
);
}
...
...
@@ -4072,6 +4081,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
FileOptions
,
FileOptions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
if
(
HasJavaPackage
)
{
output
.
WriteString
(
1
,
JavaPackage
);
...
...
@@ -4463,6 +4473,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
MessageOptions
,
MessageOptions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
if
(
HasMessageSetWireFormat
)
{
output
.
WriteBool
(
1
,
MessageSetWireFormat
);
...
...
@@ -4791,6 +4802,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
FieldOptions
,
FieldOptions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
if
(
HasCtype
)
{
output
.
WriteEnum
(
1
,
(
int
)
Ctype
);
...
...
@@ -5171,6 +5183,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
EnumOptions
,
EnumOptions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
foreach
(
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
UninterpretedOption
element
in
UninterpretedOptionList
)
{
output
.
WriteMessage
(
999
,
element
);
...
...
@@ -5418,6 +5431,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
EnumValueOptions
,
EnumValueOptions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
foreach
(
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
UninterpretedOption
element
in
UninterpretedOptionList
)
{
output
.
WriteMessage
(
999
,
element
);
...
...
@@ -5665,6 +5679,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
ServiceOptions
,
ServiceOptions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
foreach
(
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
UninterpretedOption
element
in
UninterpretedOptionList
)
{
output
.
WriteMessage
(
999
,
element
);
...
...
@@ -5912,6 +5927,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
pb
::
ExtendableMessage
<
MethodOptions
,
MethodOptions
.
Builder
>.
ExtensionWriter
extensionWriter
=
CreateExtensionWriter
(
this
);
foreach
(
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
UninterpretedOption
element
in
UninterpretedOptionList
)
{
output
.
WriteMessage
(
999
,
element
);
...
...
@@ -6189,6 +6205,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
if
(
HasNamePart_
)
{
output
.
WriteString
(
1
,
NamePart_
);
}
...
...
@@ -6472,6 +6489,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
int
size
=
SerializedSize
;
foreach
(
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
UninterpretedOption
.
Types
.
NamePart
element
in
NameList
)
{
output
.
WriteMessage
(
2
,
element
);
}
...
...
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