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
48ce28bf
Commit
48ce28bf
authored
Aug 14, 2008
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copyright fixes, a bit of documentation, and removed unnecessary using directives.
parent
5923b372
Hide whitespace changes
Inline
Side-by-side
Showing
70 changed files
with
1039 additions
and
181 deletions
+1039
-181
AbstractMessageTest.cs
csharp/ProtocolBuffers.Test/AbstractMessageTest.cs
+16
-1
CodedOutputStreamTest.cs
csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs
+2
-2
DescriptorsTest.cs
csharp/ProtocolBuffers.Test/DescriptorsTest.cs
+16
-1
DynamicMessageTest.cs
csharp/ProtocolBuffers.Test/DynamicMessageTest.cs
+16
-4
GeneratedMessageTest.cs
csharp/ProtocolBuffers.Test/GeneratedMessageTest.cs
+16
-4
MessageTest.cs
csharp/ProtocolBuffers.Test/MessageTest.cs
+15
-3
ReflectionTester.cs
csharp/ProtocolBuffers.Test/ReflectionTester.cs
+17
-4
ServiceTest.cs
csharp/ProtocolBuffers.Test/ServiceTest.cs
+16
-1
TestUtil.cs
csharp/ProtocolBuffers.Test/TestUtil.cs
+17
-2
TextFormatTest.cs
csharp/ProtocolBuffers.Test/TextFormatTest.cs
+16
-1
UnknownFieldSetTest.cs
csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs
+16
-1
WireFormatTest.cs
csharp/ProtocolBuffers.Test/WireFormatTest.cs
+16
-4
AbstractBuilder.cs
csharp/ProtocolBuffers/AbstractBuilder.cs
+18
-4
ByteString.cs
csharp/ProtocolBuffers/ByteString.cs
+1
-1
CodedOutputStream.cs
csharp/ProtocolBuffers/CodedOutputStream.cs
+1
-1
Dictionaries.cs
csharp/ProtocolBuffers/Collections/Dictionaries.cs
+17
-4
Lists.cs
csharp/ProtocolBuffers/Collections/Lists.cs
+22
-3
ReadOnlyDictionary.cs
csharp/ProtocolBuffers/Collections/ReadOnlyDictionary.cs
+17
-4
IDescriptorProto.cs
csharp/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs
+19
-1
PartialClasses.cs
csharp/ProtocolBuffers/DescriptorProtos/PartialClasses.cs
+16
-4
DescriptorBase.cs
csharp/ProtocolBuffers/Descriptors/DescriptorBase.cs
+15
-4
DescriptorPool.cs
csharp/ProtocolBuffers/Descriptors/DescriptorPool.cs
+17
-2
DescriptorUtil.cs
csharp/ProtocolBuffers/Descriptors/DescriptorUtil.cs
+18
-2
DescriptorValidationException.cs
...tocolBuffers/Descriptors/DescriptorValidationException.cs
+21
-4
EnumDescriptor.cs
csharp/ProtocolBuffers/Descriptors/EnumDescriptor.cs
+20
-3
EnumDescriptorIndexAttribute.cs
...otocolBuffers/Descriptors/EnumDescriptorIndexAttribute.cs
+16
-1
EnumValueDescriptor.cs
csharp/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs
+20
-2
FieldDescriptor.cs
csharp/ProtocolBuffers/Descriptors/FieldDescriptor.cs
+21
-3
FieldMappingAttribute.cs
csharp/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs
+17
-4
FieldType.cs
csharp/ProtocolBuffers/Descriptors/FieldType.cs
+16
-1
FileDescriptor.cs
csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs
+19
-4
IDescriptor.cs
csharp/ProtocolBuffers/Descriptors/IDescriptor.cs
+15
-3
IndexedDescriptorBase.cs
csharp/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs
+15
-3
MappedType.cs
csharp/ProtocolBuffers/Descriptors/MappedType.cs
+15
-3
MessageDescriptor.cs
csharp/ProtocolBuffers/Descriptors/MessageDescriptor.cs
+17
-2
MethodDescriptor.cs
csharp/ProtocolBuffers/Descriptors/MethodDescriptor.cs
+17
-2
PackageDescriptor.cs
csharp/ProtocolBuffers/Descriptors/PackageDescriptor.cs
+6
-11
ServiceDescriptor.cs
csharp/ProtocolBuffers/Descriptors/ServiceDescriptor.cs
+17
-3
DynamicMessage.cs
csharp/ProtocolBuffers/DynamicMessage.cs
+21
-4
ExtendableBuilder.cs
csharp/ProtocolBuffers/ExtendableBuilder.cs
+15
-2
ExtendableMessage.cs
csharp/ProtocolBuffers/ExtendableMessage.cs
+17
-3
ExtensionInfo.cs
csharp/ProtocolBuffers/ExtensionInfo.cs
+15
-0
Delegates.cs
csharp/ProtocolBuffers/FieldAccess/Delegates.cs
+0
-11
FieldAccessorTable.cs
csharp/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs
+17
-2
IFieldAccessor.cs
csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs
+17
-1
RepeatedMessageAccessor.cs
...rp/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs
+15
-1
RepeatedPrimitiveAccessor.cs
.../ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs
+15
-1
SingleEnumAccessor.cs
csharp/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs
+15
-1
SingleMessageAccessor.cs
csharp/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs
+15
-1
SinglePrimitiveAccessor.cs
...rp/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs
+15
-1
FieldSet.cs
csharp/ProtocolBuffers/FieldSet.cs
+18
-4
GeneratedBuilder.cs
csharp/ProtocolBuffers/GeneratedBuilder.cs
+16
-4
GeneratedExtensionBase.cs
csharp/ProtocolBuffers/GeneratedExtensionBase.cs
+16
-2
GeneratedMessage.cs
csharp/ProtocolBuffers/GeneratedMessage.cs
+16
-3
GeneratedRepeatException.cs
csharp/ProtocolBuffers/GeneratedRepeatException.cs
+17
-2
GeneratedSingleExtension.cs
csharp/ProtocolBuffers/GeneratedSingleExtension.cs
+17
-2
IRpcChannel.cs
csharp/ProtocolBuffers/IRpcChannel.cs
+16
-1
IRpcController.cs
csharp/ProtocolBuffers/IRpcController.cs
+16
-1
IService.cs
csharp/ProtocolBuffers/IService.cs
+16
-3
InvalidProtocolBufferException.cs
csharp/ProtocolBuffers/InvalidProtocolBufferException.cs
+1
-4
AssemblyInfo.cs
csharp/ProtocolBuffers/Properties/AssemblyInfo.cs
+16
-2
ProtocolBuffers.csproj
csharp/ProtocolBuffers/ProtocolBuffers.csproj
+0
-1
RpcUtil.cs
csharp/ProtocolBuffers/RpcUtil.cs
+19
-3
TextFormat.cs
csharp/ProtocolBuffers/TextFormat.cs
+16
-1
TextGenerator.cs
csharp/ProtocolBuffers/TextGenerator.cs
+17
-3
TextTokenizer.cs
csharp/ProtocolBuffers/TextTokenizer.cs
+16
-1
UninitializedMessageException.cs
csharp/ProtocolBuffers/UninitializedMessageException.cs
+1
-1
UnknownField.cs
csharp/ProtocolBuffers/UnknownField.cs
+17
-2
UnknownFieldSet.cs
csharp/ProtocolBuffers/UnknownFieldSet.cs
+16
-3
WireFormat.cs
csharp/ProtocolBuffers/WireFormat.cs
+3
-3
No files found.
csharp/ProtocolBuffers.Test/AbstractMessageTest.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.Descriptors
;
using
NUnit.Framework
;
...
...
csharp/ProtocolBuffers.Test/CodedOutputStreamTest.cs
View file @
48ce28bf
using
System.IO
;
// Protocol Buffers - Google's data interchange format
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
...
...
@@ -14,6 +13,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.IO
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
...
...
csharp/ProtocolBuffers.Test/DescriptorsTest.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
NUnit.Framework
;
...
...
csharp/ProtocolBuffers.Test/DynamicMessageTest.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.TestProtos
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
NUnit.Framework
;
using
Google.ProtocolBuffers.TestProtos
;
namespace
Google.ProtocolBuffers
{
[
TestFixture
]
...
...
csharp/ProtocolBuffers.Test/GeneratedMessageTest.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.Descriptors
;
using
NUnit.Framework
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
namespace
Google.ProtocolBuffers
{
[
TestFixture
]
...
...
csharp/ProtocolBuffers.Test/MessageTest.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
...
...
csharp/ProtocolBuffers.Test/ReflectionTester.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
Google.ProtocolBuffers.Descriptors
;
using
NUnit.Framework
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
namespace
Google.ProtocolBuffers
{
/// <summary>
...
...
csharp/ProtocolBuffers.Test/ServiceTest.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
...
...
csharp/ProtocolBuffers.Test/TestUtil.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.IO
;
using
System.Text
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
...
...
csharp/ProtocolBuffers.Test/TextFormatTest.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.IO
;
using
System.Text
;
using
Google.ProtocolBuffers.TestProtos
;
...
...
csharp/ProtocolBuffers.Test/UnknownFieldSetTest.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.TestProtos
;
...
...
csharp/ProtocolBuffers.Test/WireFormatTest.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.TestProtos
;
using
NUnit.Framework
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
[
TestFixture
]
...
...
csharp/ProtocolBuffers/AbstractBuilder.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.IO
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
/// <summary>
...
...
csharp/ProtocolBuffers/ByteString.cs
View file @
48ce28bf
...
...
@@ -159,7 +159,7 @@ namespace Google.ProtocolBuffers {
/// copying being involved. This has to be a nested type in order to have access
/// to the private ByteString constructor.
/// </summary>
internal
class
CodedBuilder
{
internal
sealed
class
CodedBuilder
{
private
readonly
CodedOutputStream
output
;
private
readonly
byte
[]
buffer
;
...
...
csharp/ProtocolBuffers/CodedOutputStream.cs
View file @
48ce28bf
...
...
@@ -698,7 +698,7 @@ namespace Google.ProtocolBuffers {
/// Indicates that a CodedOutputStream wrapping a flat byte array
/// ran out of space.
/// </summary>
public
class
OutOfSpaceException
:
IOException
{
public
sealed
class
OutOfSpaceException
:
IOException
{
internal
OutOfSpaceException
()
:
base
(
"CodedOutputStream was writing to a flat byte array and ran out of space."
)
{
}
...
...
csharp/ProtocolBuffers/Collections/Dictionaries.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections
;
using
Google.ProtocolBuffers.Descriptors
;
using
System.Collections.Generic
;
namespace
Google.ProtocolBuffers.Collections
{
...
...
csharp/ProtocolBuffers/Collections/Lists.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Text
;
namespace
Google.ProtocolBuffers.Collections
{
/// <summary>
/// Utility non-generic class for calling into Lists{T} using type inference.
/// </summary>
public
static
class
Lists
{
/// <summary>
/// Returns a read-only view of the specified list.
/// </summary>
public
static
IList
<
T
>
AsReadOnly
<
T
>(
IList
<
T
>
list
)
{
return
Lists
<
T
>.
AsReadOnly
(
list
);
}
}
/// <summary>
/// Utilit
ies
class for dealing with lists.
/// Utilit
y
class for dealing with lists.
/// </summary>
public
static
class
Lists
<
T
>
{
...
...
csharp/ProtocolBuffers/Collections/ReadOnlyDictionary.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Text
;
using
IEnumerable
=
System
.
Collections
.
IEnumerable
;
namespace
Google.ProtocolBuffers.Collections
{
/// <summary>
/// Read-only wrapper around another dictionary.
/// </summary>
public
class
ReadOnlyDictionary
<
TKey
,
TValue
>
:
IDictionary
<
TKey
,
TValue
>
{
public
sealed
class
ReadOnlyDictionary
<
TKey
,
TValue
>
:
IDictionary
<
TKey
,
TValue
>
{
readonly
IDictionary
<
TKey
,
TValue
>
wrapped
;
public
ReadOnlyDictionary
(
IDictionary
<
TKey
,
TValue
>
wrapped
)
{
...
...
csharp/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs
View file @
48ce28bf
namespace
Google.ProtocolBuffers.DescriptorProtos
{
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace
Google.ProtocolBuffers.DescriptorProtos
{
/// <summary>
/// Interface implemented by all DescriptorProtos. The generator doesn't
...
...
@@ -13,6 +28,9 @@
/// </summary>
string
Name
{
get
;
}
/// <summary>
/// The options for this descriptor.
/// </summary>
TOptions
Options
{
get
;
}
}
}
csharp/ProtocolBuffers/DescriptorProtos/PartialClasses.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This
class
just contains partial classes for each of the
// This
file
just contains partial classes for each of the
// autogenerated classes, so that they implement
// IDescriptorProto
namespace
Google.ProtocolBuffers.DescriptorProtos
{
...
...
csharp/ProtocolBuffers/Descriptors/DescriptorBase.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.DescriptorProtos
;
using
Google.ProtocolBuffers.Collections
;
namespace
Google.ProtocolBuffers.Descriptors
{
/// <summary>
...
...
csharp/ProtocolBuffers/Descriptors/DescriptorPool.cs
View file @
48ce28bf
using
System.Collections.Generic
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Collections.Generic
;
using
System
;
using
System.Text
;
using
System.Text.RegularExpressions
;
...
...
@@ -7,7 +22,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// <summary>
/// Contains lookup tables containing all the descriptors defined in a particular file.
/// </summary>
internal
class
DescriptorPool
{
internal
sealed
class
DescriptorPool
{
private
readonly
IDictionary
<
string
,
IDescriptor
>
descriptorsByName
=
new
Dictionary
<
string
,
IDescriptor
>();
...
...
csharp/ProtocolBuffers/Descriptors/DescriptorUtil.cs
View file @
48ce28bf
using
System.Collections.Generic
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.Collections
;
namespace
Google.ProtocolBuffers.Descriptors
{
/// <summary>
/// Internal class containing utility methods when working with descriptors.
/// </summary>
static
class
DescriptorUtil
{
internal
static
class
DescriptorUtil
{
/// <summary>
/// Equivalent to Func[TInput, int, TOutput] but usable in .NET 2.0. Only used to convert
/// arrays.
...
...
csharp/ProtocolBuffers/Descriptors/DescriptorValidationException.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
namespace
Google.ProtocolBuffers.Descriptors
{
public
class
DescriptorValidationException
:
Exception
{
/// <summary>
/// Thrown when building descriptors fails because the source DescriptorProtos
/// are not valid.
/// </summary>
public
sealed
class
DescriptorValidationException
:
Exception
{
private
readonly
String
name
;
private
readonly
IMessage
proto
;
...
...
csharp/ProtocolBuffers/Descriptors/EnumDescriptor.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.DescriptorProtos
;
namespace
Google.ProtocolBuffers.Descriptors
{
public
class
EnumDescriptor
:
IndexedDescriptorBase
<
EnumDescriptorProto
,
EnumOptions
>
{
/// <summary>
/// Descriptor for an enum type in a .proto file.
/// </summary>
public
sealed
class
EnumDescriptor
:
IndexedDescriptorBase
<
EnumDescriptorProto
,
EnumOptions
>
{
private
readonly
MessageDescriptor
containingType
;
private
readonly
IList
<
EnumValueDescriptor
>
values
;
...
...
csharp/ProtocolBuffers/Descriptors/EnumDescriptorIndexAttribute.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
namespace
Google.ProtocolBuffers.Descriptors
{
/// <summary>
...
...
csharp/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.DescriptorProtos
;
namespace
Google.ProtocolBuffers.Descriptors
{
public
class
EnumValueDescriptor
:
IndexedDescriptorBase
<
EnumValueDescriptorProto
,
EnumValueOptions
>
{
/// <summary>
/// Descriptor for a single enum value within an enum in a .proto file.
/// </summary>
public
sealed
class
EnumValueDescriptor
:
IndexedDescriptorBase
<
EnumValueDescriptorProto
,
EnumValueOptions
>
{
private
readonly
EnumDescriptor
enumDescriptor
;
...
...
csharp/ProtocolBuffers/Descriptors/FieldDescriptor.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.Reflection
;
using
Google.ProtocolBuffers.Collections
;
using
Google.ProtocolBuffers.DescriptorProtos
;
using
System.Collections.ObjectModel
;
namespace
Google.ProtocolBuffers.Descriptors
{
public
class
FieldDescriptor
:
IndexedDescriptorBase
<
FieldDescriptorProto
,
FieldOptions
>,
IComparable
<
FieldDescriptor
>
{
/// <summary>
/// Descriptor for a field or extension within a message in a .proto file.
/// </summary>
public
sealed
class
FieldDescriptor
:
IndexedDescriptorBase
<
FieldDescriptorProto
,
FieldOptions
>,
IComparable
<
FieldDescriptor
>
{
private
readonly
MessageDescriptor
extensionScope
;
private
EnumDescriptor
enumType
;
...
...
csharp/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
namespace
Google.ProtocolBuffers.Descriptors
{
...
...
@@ -9,7 +22,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// this allows each field type to specify the mapped type and wire type.
/// </summary>
[
AttributeUsage
(
AttributeTargets
.
Field
)]
internal
class
FieldMappingAttribute
:
Attribute
{
internal
sealed
class
FieldMappingAttribute
:
Attribute
{
internal
FieldMappingAttribute
(
MappedType
mappedType
,
WireFormat
.
WireType
wireType
)
{
MappedType
=
mappedType
;
WireType
=
wireType
;
...
...
csharp/ProtocolBuffers/Descriptors/FieldType.cs
View file @
48ce28bf
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace
Google.ProtocolBuffers.Descriptors
{
/// <summary>
/// Enumeration of all the possible field types. The odd formatting is to make it very clear
...
...
csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
Google.ProtocolBuffers.DescriptorProtos
;
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.Collections
;
namespace
Google.ProtocolBuffers.Descriptors
{
/// <summary>
...
...
@@ -10,7 +25,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// IDescriptor is implemented such that the File property returns this descriptor,
/// and the FullName is the same as the Name.
/// </summary>
public
class
FileDescriptor
:
IDescriptor
<
FileDescriptorProto
>
{
public
sealed
class
FileDescriptor
:
IDescriptor
<
FileDescriptorProto
>
{
private
readonly
FileDescriptorProto
proto
;
private
readonly
IList
<
MessageDescriptor
>
messageTypes
;
...
...
csharp/ProtocolBuffers/Descriptors/IDescriptor.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace
Google.ProtocolBuffers.Descriptors
{
...
...
csharp/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.DescriptorProtos
;
namespace
Google.ProtocolBuffers.Descriptors
{
...
...
csharp/ProtocolBuffers/Descriptors/MappedType.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace
Google.ProtocolBuffers.Descriptors
{
/// <summary>
...
...
csharp/ProtocolBuffers/Descriptors/MessageDescriptor.cs
View file @
48ce28bf
using
System.Collections.Generic
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.DescriptorProtos
;
namespace
Google.ProtocolBuffers.Descriptors
{
...
...
@@ -6,7 +21,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// <summary>
/// Describes a message type.
/// </summary>
public
class
MessageDescriptor
:
IndexedDescriptorBase
<
DescriptorProto
,
MessageOptions
>
{
public
sealed
class
MessageDescriptor
:
IndexedDescriptorBase
<
DescriptorProto
,
MessageOptions
>
{
private
readonly
MessageDescriptor
containingType
;
private
readonly
IList
<
MessageDescriptor
>
nestedTypes
;
...
...
csharp/ProtocolBuffers/Descriptors/MethodDescriptor.cs
View file @
48ce28bf
using
Google.ProtocolBuffers.DescriptorProtos
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.DescriptorProtos
;
namespace
Google.ProtocolBuffers.Descriptors
{
/// <summary>
/// Describes a single method in a service.
/// </summary>
public
class
MethodDescriptor
:
IndexedDescriptorBase
<
MethodDescriptorProto
,
MethodOptions
>
{
public
sealed
class
MethodDescriptor
:
IndexedDescriptorBase
<
MethodDescriptorProto
,
MethodOptions
>
{
private
readonly
ServiceDescriptor
service
;
private
MessageDescriptor
inputType
;
...
...
csharp/ProtocolBuffers/Descriptors/PackageDescriptor.cs
View file @
48ce28bf
...
...
@@ -3,17 +3,12 @@ using System.Collections.Generic;
using
System.Text
;
namespace
Google.ProtocolBuffers.Descriptors
{
/*
* Represents a package in the symbol table. We use PackageDescriptors
* just as placeholders so that someone cannot define, say, a message type
* that has the same name as an existing package.
*/
/// <summary>
/// Represents a package in the symbol table. We use PackageDescriptors
/// just as placeholders so that someone cannot define, say, a message type
/// that has the same name as an existing package.
/// </summary>
internal
class
PackageDescriptor
:
IDescriptor
<
IMessage
>
{
/// <summary>
/// Represents a package in the symbol table. We use PackageDescriptors
/// just as placeholders so that someone cannot define, say, a message type
/// that has the same name as an existing package.
/// </summary>
internal
sealed
class
PackageDescriptor
:
IDescriptor
<
IMessage
>
{
private
readonly
string
name
;
private
readonly
string
fullName
;
...
...
csharp/ProtocolBuffers/Descriptors/ServiceDescriptor.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.DescriptorProtos
;
namespace
Google.ProtocolBuffers.Descriptors
{
...
...
@@ -8,7 +22,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// <summary>
/// Describes a service type.
/// </summary>
public
class
ServiceDescriptor
:
IndexedDescriptorBase
<
ServiceDescriptorProto
,
ServiceOptions
>
{
public
sealed
class
ServiceDescriptor
:
IndexedDescriptorBase
<
ServiceDescriptorProto
,
ServiceOptions
>
{
private
readonly
IList
<
MethodDescriptor
>
methods
;
...
...
csharp/ProtocolBuffers/DynamicMessage.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
...
...
@@ -9,7 +23,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// An implementation of IMessage that can represent arbitrary types, given a MessageaDescriptor.
/// </summary>
public
class
DynamicMessage
:
AbstractMessage
<
DynamicMessage
,
DynamicMessage
.
Builder
>
{
public
sealed
class
DynamicMessage
:
AbstractMessage
<
DynamicMessage
,
DynamicMessage
.
Builder
>
{
private
readonly
MessageDescriptor
type
;
private
readonly
FieldSet
fields
;
...
...
@@ -226,7 +240,10 @@ namespace Google.ProtocolBuffers {
}
}
public
class
Builder
:
AbstractBuilder
<
DynamicMessage
,
DynamicMessage
.
Builder
>
{
/// <summary>
/// Builder for dynamic messages. Instances are created with DynamicMessage.CreateBuilder.
/// </summary>
public
sealed
class
Builder
:
AbstractBuilder
<
DynamicMessage
,
Builder
>
{
private
readonly
MessageDescriptor
type
;
private
FieldSet
fields
;
private
UnknownFieldSet
unknownFields
;
...
...
csharp/ProtocolBuffers/ExtendableBuilder.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
...
...
csharp/ProtocolBuffers/ExtendableMessage.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.Collections
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
public
abstract
class
ExtendableMessage
<
TMessage
,
TBuilder
>
:
GeneratedMessage
<
TMessage
,
TBuilder
>
...
...
csharp/ProtocolBuffers/ExtensionInfo.cs
View file @
48ce28bf
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
...
...
csharp/ProtocolBuffers/FieldAccess/Delegates.cs
deleted
100644 → 0
View file @
5923b372
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Google.ProtocolBuffers.FieldAccess
{
/// <summary>
/// Declarations of delegate types used for field access. Can't
/// use Func and Action (other than one parameter) as we can't guarantee .NET 3.5.
/// </summary>
internal
delegate
bool
HasFunction
<
TMessage
>(
TMessage
message
);
}
csharp/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers.FieldAccess
{
...
...
@@ -8,7 +23,7 @@ namespace Google.ProtocolBuffers.FieldAccess {
/// create appropriate instances in the .proto file description class.
/// TODO(jonskeet): See if we can hide it somewhere...
/// </summary>
public
class
FieldAccessorTable
{
public
sealed
class
FieldAccessorTable
{
readonly
IFieldAccessor
[]
accessors
;
...
...
csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs
View file @
48ce28bf
namespace
Google.ProtocolBuffers.FieldAccess
{
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace
Google.ProtocolBuffers.FieldAccess
{
/// <summary>
/// Allows fields to be reflectively accessed in a smart manner.
...
...
csharp/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs
View file @
48ce28bf
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Reflection
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers.FieldAccess
{
...
...
csharp/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs
View file @
48ce28bf
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections
;
using
System.Reflection
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers.FieldAccess
{
/// <summary>
...
...
csharp/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs
View file @
48ce28bf
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers.FieldAccess
{
...
...
csharp/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs
View file @
48ce28bf
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Reflection
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers.FieldAccess
{
/// <summary>
...
...
csharp/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs
View file @
48ce28bf
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Reflection
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers.FieldAccess
{
/// <summary>
...
...
csharp/ProtocolBuffers/FieldSet.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.Collections
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
/// <summary>
...
...
@@ -20,7 +34,7 @@ namespace Google.ProtocolBuffers {
///
/// All repeated fields are stored as IList[object] even
/// </summary>
internal
class
FieldSet
{
internal
sealed
class
FieldSet
{
private
static
readonly
FieldSet
defaultInstance
=
new
FieldSet
(
new
Dictionary
<
FieldDescriptor
,
object
>()).
MakeImmutable
();
...
...
csharp/ProtocolBuffers/GeneratedBuilder.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.Collections
;
using
Google.ProtocolBuffers.Descriptors
;
using
System.IO
;
using
Google.ProtocolBuffers.FieldAccess
;
namespace
Google.ProtocolBuffers
{
...
...
csharp/ProtocolBuffers/GeneratedExtensionBase.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Reflection
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
...
...
csharp/ProtocolBuffers/GeneratedMessage.cs
View file @
48ce28bf
using
System
;
using
System.Collections
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
Google.ProtocolBuffers.Collections
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.FieldAccess
;
...
...
csharp/ProtocolBuffers/GeneratedRepeatException.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
Google.ProtocolBuffers.Descriptors
;
using
System.Collections
;
...
...
@@ -7,7 +22,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Class used to represent repeat extensions in generated classes.
/// </summary>
public
class
GeneratedRepeatExtension
<
TExtensionElement
>
:
GeneratedExtensionBase
<
IList
<
TExtensionElement
>>
{
public
sealed
class
GeneratedRepeatExtension
<
TExtensionElement
>
:
GeneratedExtensionBase
<
IList
<
TExtensionElement
>>
{
private
GeneratedRepeatExtension
(
FieldDescriptor
field
)
:
base
(
field
,
typeof
(
TExtensionElement
))
{
}
...
...
csharp/ProtocolBuffers/GeneratedSingleExtension.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
...
...
@@ -6,7 +21,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Generated extension for a singular field.
/// </remarks>
public
class
GeneratedSingleExtension
<
TExtension
>
:
GeneratedExtensionBase
<
TExtension
>
{
public
sealed
class
GeneratedSingleExtension
<
TExtension
>
:
GeneratedExtensionBase
<
TExtension
>
{
internal
GeneratedSingleExtension
(
FieldDescriptor
descriptor
)
:
base
(
descriptor
,
typeof
(
TExtension
))
{
}
...
...
csharp/ProtocolBuffers/IRpcChannel.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
...
...
csharp/ProtocolBuffers/IRpcController.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
namespace
Google.ProtocolBuffers
{
/// <summary>
...
...
csharp/ProtocolBuffers/IService.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
...
...
csharp/ProtocolBuffers/InvalidProtocolBufferException.cs
View file @
48ce28bf
...
...
@@ -19,10 +19,8 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Thrown when a protocol message being parsed is invalid in some way,
/// e.g. it contains a malformed varint or a negative byte length.
///
/// TODO(jonskeet): Make the methods throw directly? Rename them?
/// </summary>
public
class
InvalidProtocolBufferException
:
IOException
{
public
sealed
class
InvalidProtocolBufferException
:
IOException
{
internal
InvalidProtocolBufferException
(
string
message
)
:
base
(
message
)
{
...
...
@@ -37,7 +35,6 @@ namespace Google.ProtocolBuffers {
"misreported its own length."
);
}
/// TODO(jonskeet): Make this internal again and use InternalVisibleTo?
internal
static
InvalidProtocolBufferException
NegativeSize
()
{
return
new
InvalidProtocolBufferException
(
"CodedInputStream encountered an embedded string or message "
+
...
...
csharp/ProtocolBuffers/Properties/AssemblyInfo.cs
View file @
48ce28bf
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Reflection
;
using
System.Runtime.InteropServices
;
// General Information about an assembly is controlled through the following
...
...
csharp/ProtocolBuffers/ProtocolBuffers.csproj
View file @
48ce28bf
...
...
@@ -77,7 +77,6 @@
<Compile
Include=
"FieldAccess\SinglePrimitiveAccessor.cs"
/>
<Compile
Include=
"FieldAccess\RepeatedPrimitiveAccessor.cs"
/>
<Compile
Include=
"FieldAccess\RepeatedEnumAccessor.cs"
/>
<Compile
Include=
"FieldAccess\Delegates.cs"
/>
<Compile
Include=
"FieldAccess\IFieldAccessor.cs"
/>
<Compile
Include=
"FieldAccess\FieldAccessorTable.cs"
/>
<Compile
Include=
"FieldAccess\RepeatedMessageAccessor.cs"
/>
...
...
csharp/ProtocolBuffers/RpcUtil.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
namespace
Google.ProtocolBuffers
{
/// <summary>
/// Grab-bag of utility functions useful when dealing with RPCs.
/// </summary>
public
static
class
RpcUtil
{
/// <summary>
...
...
csharp/ProtocolBuffers/TextFormat.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.IO
;
...
...
csharp/ProtocolBuffers/TextGenerator.cs
View file @
48ce28bf
using
System
;
using
System.Collections.Generic
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.IO
;
using
System.Text
;
...
...
@@ -8,7 +22,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Helper class to control indentation
/// </summary>
internal
class
TextGenerator
{
internal
sealed
class
TextGenerator
{
/// <summary>
/// Writer to write formatted text to.
...
...
csharp/ProtocolBuffers/TextTokenizer.cs
View file @
48ce28bf
using
System
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System
;
using
System.Globalization
;
using
System.Text.RegularExpressions
;
...
...
csharp/ProtocolBuffers/UninitializedMessageException.cs
View file @
48ce28bf
...
...
@@ -21,7 +21,7 @@ using Google.ProtocolBuffers.Collections;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
public
class
UninitializedMessageException
:
Exception
{
public
sealed
class
UninitializedMessageException
:
Exception
{
private
readonly
IList
<
string
>
missingFields
;
...
...
csharp/ProtocolBuffers/UnknownField.cs
View file @
48ce28bf
using
System.Collections.Generic
;
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
Google.ProtocolBuffers.Collections
;
...
...
@@ -169,7 +184,7 @@ namespace Google.ProtocolBuffers {
/// <summary>
/// Used to build instances of UnknownField.
/// </summary>
public
class
Builder
{
public
sealed
class
Builder
{
private
List
<
ulong
>
varintList
;
private
List
<
uint
>
fixed32List
;
...
...
csharp/ProtocolBuffers/UnknownFieldSet.cs
View file @
48ce28bf
...
...
@@ -19,7 +19,18 @@ using System.IO;
using
Google.ProtocolBuffers.Collections
;
namespace
Google.ProtocolBuffers
{
public
class
UnknownFieldSet
{
/// <summary>
/// Used to keep track of fields which were seen when parsing a protocol message
/// but whose field numbers or types are unrecognized. This most frequently
/// occurs when new fields are added to a message type and then messages containing
/// those fields are read by old software that was built before the new types were
/// added.
///
/// Every message contains an UnknownFieldSet.
///
/// Most users will never need to use this class directly.
/// </summary>
public
sealed
class
UnknownFieldSet
{
private
static
readonly
UnknownFieldSet
defaultInstance
=
new
UnknownFieldSet
(
new
Dictionary
<
int
,
UnknownField
>());
...
...
@@ -165,7 +176,6 @@ namespace Google.ProtocolBuffers {
}
}
/// <summary>
/// Parses an UnknownFieldSet from the given input.
/// </summary>
...
...
@@ -194,7 +204,10 @@ namespace Google.ProtocolBuffers {
return
CreateBuilder
().
MergeFrom
(
input
).
Build
();
}
public
class
Builder
/// <summary>
/// Builder for UnknownFieldSets.
/// </summary>
public
sealed
class
Builder
{
/// <summary>
/// Mapping from number to field. Note that by using a SortedList we ensure
...
...
csharp/ProtocolBuffers/WireFormat.cs
View file @
48ce28bf
...
...
@@ -28,7 +28,7 @@ namespace Google.ProtocolBuffers {
/// the Protocol Buffer wire format.
/// </para>
/// </summary>
public
class
WireFormat
{
public
static
class
WireFormat
{
public
enum
WireType
:
uint
{
Varint
=
0
,
Fixed64
=
1
,
...
...
@@ -38,13 +38,13 @@ namespace Google.ProtocolBuffers {
Fixed32
=
5
}
internal
class
MessageSetField
{
internal
static
class
MessageSetField
{
internal
const
int
Item
=
1
;
internal
const
int
TypeID
=
2
;
internal
const
int
Message
=
3
;
}
internal
class
MessageSetTag
{
internal
static
class
MessageSetTag
{
internal
static
readonly
uint
ItemStart
=
MakeTag
(
MessageSetField
.
Item
,
WireType
.
StartGroup
);
internal
static
readonly
uint
ItemEnd
=
MakeTag
(
MessageSetField
.
Item
,
WireType
.
EndGroup
);
internal
static
readonly
uint
TypeID
=
MakeTag
(
MessageSetField
.
TypeID
,
WireType
.
Varint
);
...
...
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