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
0864d30b
Commit
0864d30b
authored
Jun 05, 2009
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include missing generated files
parent
df67f148
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
327 additions
and
0 deletions
+327
-0
UnitTestCSharpOptionsProtoFile.cs
...Buffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
+109
-0
UnitTestCustomOptionsProtoFile.cs
...Buffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
+0
-0
CSharpOptions.cs
src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
+218
-0
No files found.
src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
View file @
0864d30b
...
...
@@ -103,6 +103,47 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
customized_
;
}
}
public
override
bool
IsInitialized
{
get
{
return
true
;
}
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
if
(
HasNormal
)
{
output
.
WriteString
(
1
,
Normal
);
}
if
(
HasOptionsMessage_
)
{
output
.
WriteString
(
2
,
OptionsMessage_
);
}
if
(
HasCustomName
)
{
output
.
WriteString
(
3
,
CustomName
);
}
UnknownFields
.
WriteTo
(
output
);
}
private
int
memoizedSerializedSize
=
-
1
;
public
override
int
SerializedSize
{
get
{
int
size
=
memoizedSerializedSize
;
if
(
size
!=
-
1
)
return
size
;
size
=
0
;
if
(
HasNormal
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
1
,
Normal
);
}
if
(
HasOptionsMessage_
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
2
,
OptionsMessage_
);
}
if
(
HasCustomName
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
3
,
CustomName
);
}
size
+=
UnknownFields
.
SerializedSize
;
memoizedSerializedSize
=
size
;
return
size
;
}
}
public
static
OptionsMessage
ParseFrom
(
pb
::
ByteString
data
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
}
...
...
@@ -178,6 +219,74 @@ namespace Google.ProtocolBuffers.TestProtos {
return
returnMe
;
}
public
override
Builder
MergeFrom
(
pb
::
IMessage
other
)
{
if
(
other
is
OptionsMessage
)
{
return
MergeFrom
((
OptionsMessage
)
other
);
}
else
{
base
.
MergeFrom
(
other
);
return
this
;
}
}
public
override
Builder
MergeFrom
(
OptionsMessage
other
)
{
if
(
other
==
OptionsMessage
.
DefaultInstance
)
return
this
;
if
(
other
.
HasNormal
)
{
Normal
=
other
.
Normal
;
}
if
(
other
.
HasOptionsMessage_
)
{
OptionsMessage_
=
other
.
OptionsMessage_
;
}
if
(
other
.
HasCustomName
)
{
CustomName
=
other
.
CustomName
;
}
this
.
MergeUnknownFields
(
other
.
UnknownFields
);
return
this
;
}
public
override
Builder
MergeFrom
(
pb
::
CodedInputStream
input
)
{
return
MergeFrom
(
input
,
pb
::
ExtensionRegistry
.
Empty
);
}
public
override
Builder
MergeFrom
(
pb
::
CodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
pb
::
UnknownFieldSet
.
Builder
unknownFields
=
null
;
while
(
true
)
{
uint
tag
=
input
.
ReadTag
();
switch
(
tag
)
{
case
0
:
{
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
}
return
this
;
}
default
:
{
if
(
pb
::
WireFormat
.
IsEndGroupTag
(
tag
))
{
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
}
return
this
;
}
if
(
unknownFields
==
null
)
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
}
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
);
break
;
}
case
10
:
{
Normal
=
input
.
ReadString
();
break
;
}
case
18
:
{
OptionsMessage_
=
input
.
ReadString
();
break
;
}
case
26
:
{
CustomName
=
input
.
ReadString
();
break
;
}
}
}
}
public
bool
HasNormal
{
get
{
return
result
.
HasNormal
;
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
View file @
0864d30b
This diff is collapsed.
Click to expand it.
src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
View file @
0864d30b
...
...
@@ -141,6 +141,59 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
nestClasses_
;
}
}
public
override
bool
IsInitialized
{
get
{
return
true
;
}
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
if
(
HasNamespace
)
{
output
.
WriteString
(
1
,
Namespace
);
}
if
(
HasUmbrellaClassname
)
{
output
.
WriteString
(
2
,
UmbrellaClassname
);
}
if
(
HasPublicClasses
)
{
output
.
WriteBool
(
3
,
PublicClasses
);
}
if
(
HasMultipleFiles
)
{
output
.
WriteBool
(
4
,
MultipleFiles
);
}
if
(
HasNestClasses
)
{
output
.
WriteBool
(
5
,
NestClasses
);
}
UnknownFields
.
WriteTo
(
output
);
}
private
int
memoizedSerializedSize
=
-
1
;
public
override
int
SerializedSize
{
get
{
int
size
=
memoizedSerializedSize
;
if
(
size
!=
-
1
)
return
size
;
size
=
0
;
if
(
HasNamespace
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
1
,
Namespace
);
}
if
(
HasUmbrellaClassname
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
2
,
UmbrellaClassname
);
}
if
(
HasPublicClasses
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeBoolSize
(
3
,
PublicClasses
);
}
if
(
HasMultipleFiles
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeBoolSize
(
4
,
MultipleFiles
);
}
if
(
HasNestClasses
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeBoolSize
(
5
,
NestClasses
);
}
size
+=
UnknownFields
.
SerializedSize
;
memoizedSerializedSize
=
size
;
return
size
;
}
}
public
static
CSharpFileOptions
ParseFrom
(
pb
::
ByteString
data
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
}
...
...
@@ -216,6 +269,88 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
return
returnMe
;
}
public
override
Builder
MergeFrom
(
pb
::
IMessage
other
)
{
if
(
other
is
CSharpFileOptions
)
{
return
MergeFrom
((
CSharpFileOptions
)
other
);
}
else
{
base
.
MergeFrom
(
other
);
return
this
;
}
}
public
override
Builder
MergeFrom
(
CSharpFileOptions
other
)
{
if
(
other
==
CSharpFileOptions
.
DefaultInstance
)
return
this
;
if
(
other
.
HasNamespace
)
{
Namespace
=
other
.
Namespace
;
}
if
(
other
.
HasUmbrellaClassname
)
{
UmbrellaClassname
=
other
.
UmbrellaClassname
;
}
if
(
other
.
HasPublicClasses
)
{
PublicClasses
=
other
.
PublicClasses
;
}
if
(
other
.
HasMultipleFiles
)
{
MultipleFiles
=
other
.
MultipleFiles
;
}
if
(
other
.
HasNestClasses
)
{
NestClasses
=
other
.
NestClasses
;
}
this
.
MergeUnknownFields
(
other
.
UnknownFields
);
return
this
;
}
public
override
Builder
MergeFrom
(
pb
::
CodedInputStream
input
)
{
return
MergeFrom
(
input
,
pb
::
ExtensionRegistry
.
Empty
);
}
public
override
Builder
MergeFrom
(
pb
::
CodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
pb
::
UnknownFieldSet
.
Builder
unknownFields
=
null
;
while
(
true
)
{
uint
tag
=
input
.
ReadTag
();
switch
(
tag
)
{
case
0
:
{
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
}
return
this
;
}
default
:
{
if
(
pb
::
WireFormat
.
IsEndGroupTag
(
tag
))
{
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
}
return
this
;
}
if
(
unknownFields
==
null
)
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
}
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
);
break
;
}
case
10
:
{
Namespace
=
input
.
ReadString
();
break
;
}
case
18
:
{
UmbrellaClassname
=
input
.
ReadString
();
break
;
}
case
24
:
{
PublicClasses
=
input
.
ReadBool
();
break
;
}
case
32
:
{
MultipleFiles
=
input
.
ReadBool
();
break
;
}
case
40
:
{
NestClasses
=
input
.
ReadBool
();
break
;
}
}
}
}
public
bool
HasNamespace
{
get
{
return
result
.
HasNamespace
;
}
...
...
@@ -346,6 +481,35 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
propertyName_
;
}
}
public
override
bool
IsInitialized
{
get
{
return
true
;
}
}
public
override
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
if
(
HasPropertyName
)
{
output
.
WriteString
(
1
,
PropertyName
);
}
UnknownFields
.
WriteTo
(
output
);
}
private
int
memoizedSerializedSize
=
-
1
;
public
override
int
SerializedSize
{
get
{
int
size
=
memoizedSerializedSize
;
if
(
size
!=
-
1
)
return
size
;
size
=
0
;
if
(
HasPropertyName
)
{
size
+=
pb
::
CodedOutputStream
.
ComputeStringSize
(
1
,
PropertyName
);
}
size
+=
UnknownFields
.
SerializedSize
;
memoizedSerializedSize
=
size
;
return
size
;
}
}
public
static
CSharpFieldOptions
ParseFrom
(
pb
::
ByteString
data
)
{
return
((
Builder
)
CreateBuilder
().
MergeFrom
(
data
)).
BuildParsed
();
}
...
...
@@ -421,6 +585,60 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
return
returnMe
;
}
public
override
Builder
MergeFrom
(
pb
::
IMessage
other
)
{
if
(
other
is
CSharpFieldOptions
)
{
return
MergeFrom
((
CSharpFieldOptions
)
other
);
}
else
{
base
.
MergeFrom
(
other
);
return
this
;
}
}
public
override
Builder
MergeFrom
(
CSharpFieldOptions
other
)
{
if
(
other
==
CSharpFieldOptions
.
DefaultInstance
)
return
this
;
if
(
other
.
HasPropertyName
)
{
PropertyName
=
other
.
PropertyName
;
}
this
.
MergeUnknownFields
(
other
.
UnknownFields
);
return
this
;
}
public
override
Builder
MergeFrom
(
pb
::
CodedInputStream
input
)
{
return
MergeFrom
(
input
,
pb
::
ExtensionRegistry
.
Empty
);
}
public
override
Builder
MergeFrom
(
pb
::
CodedInputStream
input
,
pb
::
ExtensionRegistry
extensionRegistry
)
{
pb
::
UnknownFieldSet
.
Builder
unknownFields
=
null
;
while
(
true
)
{
uint
tag
=
input
.
ReadTag
();
switch
(
tag
)
{
case
0
:
{
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
}
return
this
;
}
default
:
{
if
(
pb
::
WireFormat
.
IsEndGroupTag
(
tag
))
{
if
(
unknownFields
!=
null
)
{
this
.
UnknownFields
=
unknownFields
.
Build
();
}
return
this
;
}
if
(
unknownFields
==
null
)
{
unknownFields
=
pb
::
UnknownFieldSet
.
CreateBuilder
(
this
.
UnknownFields
);
}
ParseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
);
break
;
}
case
10
:
{
PropertyName
=
input
.
ReadString
();
break
;
}
}
}
}
public
bool
HasPropertyName
{
get
{
return
result
.
HasPropertyName
;
}
...
...
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