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
6b812f8a
Commit
6b812f8a
authored
Nov 05, 2010
by
csharptest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working split for lite interfaces
parent
a6722c34
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
82 deletions
+80
-82
AbstractBuilder.cs
src/ProtocolBuffers/AbstractBuilder.cs
+74
-61
DynamicMessage.cs
src/ProtocolBuffers/DynamicMessage.cs
+1
-1
ExtensionRegistry.cs
src/ProtocolBuffers/ExtensionRegistry.cs
+2
-2
ExtensionRegistryLite.cs
src/ProtocolBuffers/ExtensionRegistryLite.cs
+2
-2
GeneratedExtensionLite.cs
src/ProtocolBuffers/GeneratedExtensionLite.cs
+0
-15
UnknownFieldSet.cs
src/ProtocolBuffers/UnknownFieldSet.cs
+1
-1
No files found.
src/ProtocolBuffers/AbstractBuilder.cs
View file @
6b812f8a
...
...
@@ -173,10 +173,6 @@ namespace Google.ProtocolBuffers {
}
public
virtual
TBuilder
MergeFrom
(
CodedInputStream
input
,
ExtensionRegistry
extensionRegistry
)
{
return
MergeFrom
(
input
,
(
ExtensionRegistryLite
)
extensionRegistry
);
}
public
virtual
TBuilder
MergeFrom
(
CodedInputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
{
UnknownFieldSet
.
Builder
unknownFields
=
UnknownFieldSet
.
CreateBuilder
(
UnknownFields
);
unknownFields
.
MergeFrom
(
input
,
extensionRegistry
,
this
);
UnknownFields
=
unknownFields
.
Build
();
...
...
@@ -198,10 +194,6 @@ namespace Google.ProtocolBuffers {
}
public
virtual
TBuilder
MergeFrom
(
ByteString
data
,
ExtensionRegistry
extensionRegistry
)
{
return
MergeFrom
(
data
,
(
ExtensionRegistryLite
)
extensionRegistry
);
}
public
virtual
TBuilder
MergeFrom
(
ByteString
data
,
ExtensionRegistryLite
extensionRegistry
)
{
CodedInputStream
input
=
data
.
CreateCodedInput
();
MergeFrom
(
input
,
extensionRegistry
);
input
.
CheckLastTagWas
(
0
);
...
...
@@ -216,10 +208,6 @@ namespace Google.ProtocolBuffers {
}
public
virtual
TBuilder
MergeFrom
(
byte
[]
data
,
ExtensionRegistry
extensionRegistry
)
{
return
MergeFrom
(
data
,
(
ExtensionRegistryLite
)
extensionRegistry
);
}
public
virtual
TBuilder
MergeFrom
(
byte
[]
data
,
ExtensionRegistryLite
extensionRegistry
)
{
CodedInputStream
input
=
CodedInputStream
.
CreateInstance
(
data
);
MergeFrom
(
input
,
extensionRegistry
);
input
.
CheckLastTagWas
(
0
);
...
...
@@ -234,10 +222,6 @@ namespace Google.ProtocolBuffers {
}
public
virtual
TBuilder
MergeFrom
(
Stream
input
,
ExtensionRegistry
extensionRegistry
)
{
return
MergeFrom
(
input
,
(
ExtensionRegistryLite
)
extensionRegistry
);
}
public
virtual
TBuilder
MergeFrom
(
Stream
input
,
ExtensionRegistryLite
extensionRegistry
)
{
CodedInputStream
codedInput
=
CodedInputStream
.
CreateInstance
(
input
);
MergeFrom
(
codedInput
,
extensionRegistry
);
codedInput
.
CheckLastTagWas
(
0
);
...
...
@@ -245,7 +229,7 @@ namespace Google.ProtocolBuffers {
}
public
TBuilder
MergeDelimitedFrom
(
Stream
input
,
ExtensionRegistry
extensionRegistry
)
{
return
MergeDelimitedFrom
(
input
,
(
ExtensionRegistryLite
)
extensionRegistry
);
return
Lite
.
MergeDelimitedFrom
(
input
,
extensionRegistry
);
}
public
TBuilder
MergeDelimitedFrom
(
Stream
input
,
ExtensionRegistryLite
extensionRegistry
)
{
...
...
@@ -268,6 +252,78 @@ namespace Google.ProtocolBuffers {
return
ThisBuilder
;
}
/// <summary>
/// used internally to explicitly resolve lite edition methods
/// </summary>
protected
IBuilderLite
<
TMessage
,
TBuilder
>
Lite
{
get
{
return
this
;
}
}
public
virtual
TBuilder
MergeFrom
(
IMessageLite
other
)
{
#warning Not implemented for Lite edition
return
MergeFrom
((
IMessage
)
other
);
}
public
TBuilder
MergeFrom
(
CodedInputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
{
#warning Not implemented for Lite edition
return
MergeFrom
(
input
,
(
ExtensionRegistry
)
extensionRegistry
);
}
public
virtual
TBuilder
MergeFrom
(
ByteString
data
,
ExtensionRegistryLite
extensionRegistry
)
{
#warning Not implemented for Lite edition
return
MergeFrom
(
data
,
(
ExtensionRegistry
)
extensionRegistry
);
}
public
virtual
TBuilder
MergeFrom
(
byte
[]
data
,
ExtensionRegistryLite
extensionRegistry
)
{
#warning Not implemented for Lite edition
return
MergeFrom
(
data
,
(
ExtensionRegistry
)
extensionRegistry
);
}
public
virtual
TBuilder
MergeFrom
(
Stream
input
,
ExtensionRegistryLite
extensionRegistry
)
{
#warning Not implemented for Lite edition
return
MergeFrom
(
input
,
(
ExtensionRegistry
)
extensionRegistry
);
}
IBuilderLite
IBuilderLite
.
WeakClear
()
{
return
WeakClear
();
}
public
IBuilderLite
WeakMergeFrom
(
IMessageLite
message
)
{
return
MergeFrom
(
message
);
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
ByteString
data
)
{
return
WeakMergeFrom
(
data
);
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
ByteString
data
,
ExtensionRegistryLite
registry
)
{
return
WeakMergeFrom
(
data
,
registry
);
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
CodedInputStream
input
)
{
return
WeakMergeFrom
(
input
);
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
CodedInputStream
input
,
ExtensionRegistryLite
registry
)
{
return
WeakMergeFrom
(
input
,
registry
);
}
IMessageLite
IBuilderLite
.
WeakBuild
()
{
return
WeakBuild
();
}
IMessageLite
IBuilderLite
.
WeakBuildPartial
()
{
return
WeakBuildPartial
();
}
IBuilderLite
IBuilderLite
.
WeakClone
()
{
return
WeakClone
();
}
IMessageLite
IBuilderLite
.
WeakDefaultInstanceForType
{
get
{
return
WeakDefaultInstanceForType
;
}
}
#
region
LimitedInputStream
/// <summary>
/// Stream implementation which proxies another stream, only allowing a certain amount
/// of data to be read. Note that this is only used to read delimited streams, so it
...
...
@@ -332,49 +388,6 @@ namespace Google.ProtocolBuffers {
throw
new
NotSupportedException
();
}
}
IBuilderLite
IBuilderLite
.
WeakClear
()
{
return
WeakClear
();
}
public
IBuilderLite
WeakMergeFrom
(
IMessageLite
message
)
{
return
MergeFrom
(
message
);
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
ByteString
data
)
{
return
WeakMergeFrom
(
data
);
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
ByteString
data
,
ExtensionRegistryLite
registry
)
{
throw
new
NotImplementedException
();
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
CodedInputStream
input
)
{
return
WeakMergeFrom
(
input
);
}
IBuilderLite
IBuilderLite
.
WeakMergeFrom
(
CodedInputStream
input
,
ExtensionRegistryLite
registry
)
{
throw
new
NotImplementedException
();
}
IMessageLite
IBuilderLite
.
WeakBuild
()
{
return
WeakBuild
();
}
IMessageLite
IBuilderLite
.
WeakBuildPartial
()
{
return
WeakBuildPartial
();
}
IBuilderLite
IBuilderLite
.
WeakClone
()
{
return
WeakClone
();
}
IMessageLite
IBuilderLite
.
WeakDefaultInstanceForType
{
get
{
return
WeakDefaultInstanceForType
;
}
}
public
TBuilder
MergeFrom
(
IMessageLite
other
)
{
throw
new
NotImplementedException
();
}
#
endregion
}
}
src/ProtocolBuffers/DynamicMessage.cs
View file @
6b812f8a
...
...
@@ -338,7 +338,7 @@ namespace Google.ProtocolBuffers {
get
{
return
fields
.
IsInitializedWithRespectTo
(
type
);
}
}
public
override
Builder
MergeFrom
(
CodedInputStream
input
,
ExtensionRegistry
Lite
extensionRegistry
)
{
public
override
Builder
MergeFrom
(
CodedInputStream
input
,
ExtensionRegistry
extensionRegistry
)
{
UnknownFieldSet
.
Builder
unknownFieldsBuilder
=
UnknownFieldSet
.
CreateBuilder
(
unknownFields
);
unknownFieldsBuilder
.
MergeFrom
(
input
,
extensionRegistry
,
this
);
unknownFields
=
unknownFieldsBuilder
.
Build
();
...
...
src/ProtocolBuffers/ExtensionRegistry.cs
View file @
6b812f8a
...
...
@@ -107,7 +107,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Construct a new, empty instance.
/// </summary>
public
static
new
ExtensionRegistry
CreateInstance
()
{
public
static
ExtensionRegistry
CreateInstance
()
{
return
new
ExtensionRegistry
(
new
Dictionary
<
string
,
ExtensionInfo
>(),
new
Dictionary
<
ExtensionIntPair
,
IGeneratedExtensionLite
>(),
false
);
}
...
...
@@ -115,7 +115,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Get the unmodifiable singleton empty instance.
/// </summary>
public
new
static
ExtensionRegistry
Empty
{
public
static
ExtensionRegistry
Empty
{
get
{
return
empty
;
}
}
...
...
src/ProtocolBuffers/ExtensionRegistryLite.cs
View file @
6b812f8a
...
...
@@ -103,7 +103,7 @@ namespace Google.ProtocolBuffers {
this
.
extensionsByNumber
=
extensionsByNumber
;
this
.
readOnly
=
readOnly
;
}
#if LITE
/// <summary>
/// Construct a new, empty instance.
/// </summary>
...
...
@@ -118,7 +118,7 @@ namespace Google.ProtocolBuffers {
public
static
ExtensionRegistryLite
Empty
{
get
{
return
empty
;
}
}
#endif
public
ExtensionRegistryLite
AsReadOnly
()
{
return
MakeReadOnly
();
}
...
...
src/ProtocolBuffers/GeneratedExtensionLite.cs
View file @
6b812f8a
...
...
@@ -7,18 +7,4 @@ namespace Google.ProtocolBuffers {
object
ContainingType
{
get
;
}
IMessageLite
MessageDefaultInstance
{
get
;
}
}
public
class
GeneratedExtensionLite
:
IGeneratedExtensionLite
{
public
int
Number
{
get
{
throw
new
NotImplementedException
();
}
}
public
object
ContainingType
{
get
{
throw
new
NotImplementedException
();
}
}
public
IMessageLite
MessageDefaultInstance
{
get
{
throw
new
NotImplementedException
();
}
}
}
}
\ No newline at end of file
src/ProtocolBuffers/UnknownFieldSet.cs
View file @
6b812f8a
...
...
@@ -504,7 +504,7 @@ namespace Google.ProtocolBuffers {
break
;
}
ExtensionRegistry
extensionRegistry
=
(
extensionRegistryLite
as
ExtensionRegistry
)
??
ExtensionRegistry
.
CreateInstance
()
;
ExtensionRegistry
extensionRegistry
=
(
ExtensionRegistry
)
extensionRegistryLite
;
if
(!
MergeFieldFrom
(
input
,
extensionRegistry
,
builder
,
tag
))
{
// end group tag
break
;
...
...
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