Commit 48ce28bf authored by Jon Skeet's avatar Jon Skeet

Copyright fixes, a bit of documentation, and removed unnecessary using directives.

parent 5923b372
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.Generic;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
using NUnit.Framework; using NUnit.Framework;
......
using System.IO; // Protocol Buffers - Google's data interchange format
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. // Copyright 2008 Google Inc.
// http://code.google.com/p/protobuf/ // http://code.google.com/p/protobuf/
// //
...@@ -14,6 +13,7 @@ ...@@ -14,6 +13,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
using System.IO;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
using NUnit.Framework; using NUnit.Framework;
......
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.Generic;
using System.Text; using System.Text;
using NUnit.Framework; using NUnit.Framework;
......
using System; using Google.ProtocolBuffers.TestProtos;
using System.Collections.Generic; // Protocol Buffers - Google's data interchange format
using System.Text; // 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 NUnit.Framework;
using Google.ProtocolBuffers.TestProtos;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
[TestFixture] [TestFixture]
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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.Descriptors;
using NUnit.Framework;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
using NUnit.Framework;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
[TestFixture] [TestFixture]
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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.Descriptors;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
using NUnit.Framework; using NUnit.Framework;
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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.Descriptors;
using NUnit.Framework;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
using NUnit.Framework;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
......
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.Descriptors;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
using NUnit.Framework; using NUnit.Framework;
......
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.Generic;
using System.Text;
using System.IO; using System.IO;
using System.Text;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
using NUnit.Framework; using NUnit.Framework;
......
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.IO;
using System.Text; using System.Text;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
......
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.Generic;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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 Google.ProtocolBuffers.TestProtos;
using NUnit.Framework; using NUnit.Framework;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
[TestFixture] [TestFixture]
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // http://code.google.com/p/protobuf/
using Google.ProtocolBuffers.Descriptors; //
// 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;
using System.Collections.Generic;
using System.IO; using System.IO;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
......
...@@ -159,7 +159,7 @@ namespace Google.ProtocolBuffers { ...@@ -159,7 +159,7 @@ namespace Google.ProtocolBuffers {
/// copying being involved. This has to be a nested type in order to have access /// copying being involved. This has to be a nested type in order to have access
/// to the private ByteString constructor. /// to the private ByteString constructor.
/// </summary> /// </summary>
internal class CodedBuilder { internal sealed class CodedBuilder {
private readonly CodedOutputStream output; private readonly CodedOutputStream output;
private readonly byte[] buffer; private readonly byte[] buffer;
......
...@@ -698,7 +698,7 @@ namespace Google.ProtocolBuffers { ...@@ -698,7 +698,7 @@ namespace Google.ProtocolBuffers {
/// Indicates that a CodedOutputStream wrapping a flat byte array /// Indicates that a CodedOutputStream wrapping a flat byte array
/// ran out of space. /// ran out of space.
/// </summary> /// </summary>
public class OutOfSpaceException : IOException { public sealed class OutOfSpaceException : IOException {
internal OutOfSpaceException() internal OutOfSpaceException()
: base("CodedOutputStream was writing to a flat byte array and ran out of space.") { : base("CodedOutputStream was writing to a flat byte array and ran out of space.") {
} }
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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;
using Google.ProtocolBuffers.Descriptors; using System.Collections.Generic;
namespace Google.ProtocolBuffers.Collections { namespace Google.ProtocolBuffers.Collections {
......
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.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Text;
namespace Google.ProtocolBuffers.Collections { namespace Google.ProtocolBuffers.Collections {
/// <summary>
/// Utility non-generic class for calling into Lists{T} using type inference.
/// </summary>
public static class Lists { public static class Lists {
/// <summary>
/// Returns a read-only view of the specified list.
/// </summary>
public static IList<T> AsReadOnly<T>(IList<T> list) { public static IList<T> AsReadOnly<T>(IList<T> list) {
return Lists<T>.AsReadOnly(list); return Lists<T>.AsReadOnly(list);
} }
} }
/// <summary> /// <summary>
/// Utilities class for dealing with lists. /// Utility class for dealing with lists.
/// </summary> /// </summary>
public static class Lists<T> { public static class Lists<T> {
......
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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using IEnumerable=System.Collections.IEnumerable;
namespace Google.ProtocolBuffers.Collections { namespace Google.ProtocolBuffers.Collections {
/// <summary> /// <summary>
/// Read-only wrapper around another dictionary. /// Read-only wrapper around another dictionary.
/// </summary> /// </summary>
public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue> { public sealed class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue> {
readonly IDictionary<TKey, TValue> wrapped; readonly IDictionary<TKey, TValue> wrapped;
public ReadOnlyDictionary(IDictionary<TKey, TValue> wrapped) { public ReadOnlyDictionary(IDictionary<TKey, TValue> wrapped) {
......
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> /// <summary>
/// Interface implemented by all DescriptorProtos. The generator doesn't /// Interface implemented by all DescriptorProtos. The generator doesn't
...@@ -13,6 +28,9 @@ ...@@ -13,6 +28,9 @@
/// </summary> /// </summary>
string Name { get; } string Name { get; }
/// <summary>
/// The options for this descriptor.
/// </summary>
TOptions Options { get; } TOptions Options { get; }
} }
} }
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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 // autogenerated classes, so that they implement
// IDescriptorProto // IDescriptorProto
namespace Google.ProtocolBuffers.DescriptorProtos { namespace Google.ProtocolBuffers.DescriptorProtos {
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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.DescriptorProtos;
using Google.ProtocolBuffers.Collections;
namespace Google.ProtocolBuffers.Descriptors { namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
......
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;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
...@@ -7,7 +22,7 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -7,7 +22,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
/// Contains lookup tables containing all the descriptors defined in a particular file. /// Contains lookup tables containing all the descriptors defined in a particular file.
/// </summary> /// </summary>
internal class DescriptorPool { internal sealed class DescriptorPool {
private readonly IDictionary<string, IDescriptor> descriptorsByName = private readonly IDictionary<string, IDescriptor> descriptorsByName =
new Dictionary<string, IDescriptor>(); new Dictionary<string, IDescriptor>();
......
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; using Google.ProtocolBuffers.Collections;
namespace Google.ProtocolBuffers.Descriptors { namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
/// Internal class containing utility methods when working with descriptors. /// Internal class containing utility methods when working with descriptors.
/// </summary> /// </summary>
static class DescriptorUtil { internal static class DescriptorUtil {
/// <summary> /// <summary>
/// Equivalent to Func[TInput, int, TOutput] but usable in .NET 2.0. Only used to convert /// Equivalent to Func[TInput, int, TOutput] but usable in .NET 2.0. Only used to convert
/// arrays. /// arrays.
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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 { 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 String name;
private readonly IMessage proto; private readonly IMessage proto;
......
 // Protocol Buffers - Google's data interchange format
using System; // 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.Generic;
using Google.ProtocolBuffers.DescriptorProtos; using Google.ProtocolBuffers.DescriptorProtos;
namespace Google.ProtocolBuffers.Descriptors { 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 MessageDescriptor containingType;
private readonly IList<EnumValueDescriptor> values; private readonly IList<EnumValueDescriptor> values;
......
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 { namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
......
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; using Google.ProtocolBuffers.DescriptorProtos;
namespace Google.ProtocolBuffers.Descriptors { 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; private readonly EnumDescriptor enumDescriptor;
......
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.Generic;
using System.Reflection; using System.Reflection;
using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.DescriptorProtos; using Google.ProtocolBuffers.DescriptorProtos;
using System.Collections.ObjectModel;
namespace Google.ProtocolBuffers.Descriptors { 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 readonly MessageDescriptor extensionScope;
private EnumDescriptor enumType; private EnumDescriptor enumType;
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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 { namespace Google.ProtocolBuffers.Descriptors {
...@@ -9,7 +22,7 @@ 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. /// this allows each field type to specify the mapped type and wire type.
/// </summary> /// </summary>
[AttributeUsage(AttributeTargets.Field)] [AttributeUsage(AttributeTargets.Field)]
internal class FieldMappingAttribute : Attribute { internal sealed class FieldMappingAttribute : Attribute {
internal FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType) { internal FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType) {
MappedType = mappedType; MappedType = mappedType;
WireType = wireType; WireType = wireType;
......
 // 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 { namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
/// Enumeration of all the possible field types. The odd formatting is to make it very clear /// Enumeration of all the possible field types. The odd formatting is to make it very clear
......
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 System.Collections.ObjectModel;
using Google.ProtocolBuffers.DescriptorProtos; using Google.ProtocolBuffers.DescriptorProtos;
using System.Collections.Generic;
using Google.ProtocolBuffers.Collections;
namespace Google.ProtocolBuffers.Descriptors { namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
...@@ -10,7 +25,7 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -10,7 +25,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// IDescriptor is implemented such that the File property returns this descriptor, /// IDescriptor is implemented such that the File property returns this descriptor,
/// and the FullName is the same as the Name. /// and the FullName is the same as the Name.
/// </summary> /// </summary>
public class FileDescriptor : IDescriptor<FileDescriptorProto> { public sealed class FileDescriptor : IDescriptor<FileDescriptorProto> {
private readonly FileDescriptorProto proto; private readonly FileDescriptorProto proto;
private readonly IList<MessageDescriptor> messageTypes; private readonly IList<MessageDescriptor> messageTypes;
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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 { namespace Google.ProtocolBuffers.Descriptors {
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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.DescriptorProtos;
namespace Google.ProtocolBuffers.Descriptors { namespace Google.ProtocolBuffers.Descriptors {
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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 { namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
......
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; using Google.ProtocolBuffers.DescriptorProtos;
namespace Google.ProtocolBuffers.Descriptors { namespace Google.ProtocolBuffers.Descriptors {
...@@ -6,7 +21,7 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -6,7 +21,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
/// Describes a message type. /// Describes a message type.
/// </summary> /// </summary>
public class MessageDescriptor : IndexedDescriptorBase<DescriptorProto, MessageOptions> { public sealed class MessageDescriptor : IndexedDescriptorBase<DescriptorProto, MessageOptions> {
private readonly MessageDescriptor containingType; private readonly MessageDescriptor containingType;
private readonly IList<MessageDescriptor> nestedTypes; private readonly IList<MessageDescriptor> nestedTypes;
......
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 { namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
/// Describes a single method in a service. /// Describes a single method in a service.
/// </summary> /// </summary>
public class MethodDescriptor : IndexedDescriptorBase<MethodDescriptorProto, MethodOptions> { public sealed class MethodDescriptor : IndexedDescriptorBase<MethodDescriptorProto, MethodOptions> {
private readonly ServiceDescriptor service; private readonly ServiceDescriptor service;
private MessageDescriptor inputType; private MessageDescriptor inputType;
......
...@@ -3,17 +3,12 @@ using System.Collections.Generic; ...@@ -3,17 +3,12 @@ using System.Collections.Generic;
using System.Text; using System.Text;
namespace Google.ProtocolBuffers.Descriptors { 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> /// <summary>
/// Represents a package in the symbol table. We use PackageDescriptors /// Represents a package in the symbol table. We use PackageDescriptors
/// just as placeholders so that someone cannot define, say, a message type /// just as placeholders so that someone cannot define, say, a message type
/// that has the same name as an existing package. /// that has the same name as an existing package.
/// </summary> /// </summary>
internal class PackageDescriptor : IDescriptor<IMessage> { internal sealed class PackageDescriptor : IDescriptor<IMessage> {
private readonly string name; private readonly string name;
private readonly string fullName; private readonly string fullName;
......
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.Generic;
using System.Text;
using Google.ProtocolBuffers.DescriptorProtos; using Google.ProtocolBuffers.DescriptorProtos;
namespace Google.ProtocolBuffers.Descriptors { namespace Google.ProtocolBuffers.Descriptors {
...@@ -8,7 +22,7 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -8,7 +22,7 @@ namespace Google.ProtocolBuffers.Descriptors {
/// <summary> /// <summary>
/// Describes a service type. /// Describes a service type.
/// </summary> /// </summary>
public class ServiceDescriptor : IndexedDescriptorBase<ServiceDescriptorProto, ServiceOptions> { public sealed class ServiceDescriptor : IndexedDescriptorBase<ServiceDescriptorProto, ServiceOptions> {
private readonly IList<MethodDescriptor> methods; private readonly IList<MethodDescriptor> methods;
......
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.Generic;
using System.IO; using System.IO;
using System.Text;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
...@@ -9,7 +23,7 @@ namespace Google.ProtocolBuffers { ...@@ -9,7 +23,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// An implementation of IMessage that can represent arbitrary types, given a MessageaDescriptor. /// An implementation of IMessage that can represent arbitrary types, given a MessageaDescriptor.
/// </summary> /// </summary>
public class DynamicMessage : AbstractMessage<DynamicMessage, DynamicMessage.Builder> { public sealed class DynamicMessage : AbstractMessage<DynamicMessage, DynamicMessage.Builder> {
private readonly MessageDescriptor type; private readonly MessageDescriptor type;
private readonly FieldSet fields; private readonly FieldSet fields;
...@@ -226,7 +240,10 @@ namespace Google.ProtocolBuffers { ...@@ -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 readonly MessageDescriptor type;
private FieldSet fields; private FieldSet fields;
private UnknownFieldSet unknownFields; private UnknownFieldSet unknownFields;
......
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.Generic;
using System.Text;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
......
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.Generic;
using System.Text;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
public abstract class ExtendableMessage<TMessage, TBuilder> : GeneratedMessage<TMessage, TBuilder> public abstract class ExtendableMessage<TMessage, TBuilder> : GeneratedMessage<TMessage, TBuilder>
......
// 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.Descriptors;
namespace Google.ProtocolBuffers namespace Google.ProtocolBuffers
......
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);
}
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.Descriptors;
namespace Google.ProtocolBuffers.FieldAccess { namespace Google.ProtocolBuffers.FieldAccess {
...@@ -8,7 +23,7 @@ namespace Google.ProtocolBuffers.FieldAccess { ...@@ -8,7 +23,7 @@ namespace Google.ProtocolBuffers.FieldAccess {
/// create appropriate instances in the .proto file description class. /// create appropriate instances in the .proto file description class.
/// TODO(jonskeet): See if we can hide it somewhere... /// TODO(jonskeet): See if we can hide it somewhere...
/// </summary> /// </summary>
public class FieldAccessorTable { public sealed class FieldAccessorTable {
readonly IFieldAccessor[] accessors; readonly IFieldAccessor[] accessors;
......
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> /// <summary>
/// Allows fields to be reflectively accessed in a smart manner. /// Allows fields to be reflectively accessed in a smart manner.
......
// 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;
using System.Reflection; using System.Reflection;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers.FieldAccess { 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.
using System; using System;
using System.Collections; using System.Collections;
using System.Reflection; using System.Reflection;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers.FieldAccess { namespace Google.ProtocolBuffers.FieldAccess {
/// <summary> /// <summary>
......
// 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;
using System.Collections.Generic;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers.FieldAccess { 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.
using System; using System;
using System.Reflection; using System.Reflection;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers.FieldAccess { namespace Google.ProtocolBuffers.FieldAccess {
/// <summary> /// <summary>
......
// 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;
using System.Reflection; using System.Reflection;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers.FieldAccess { namespace Google.ProtocolBuffers.FieldAccess {
/// <summary> /// <summary>
......
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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
...@@ -20,7 +34,7 @@ namespace Google.ProtocolBuffers { ...@@ -20,7 +34,7 @@ namespace Google.ProtocolBuffers {
/// ///
/// All repeated fields are stored as IList[object] even /// All repeated fields are stored as IList[object] even
/// </summary> /// </summary>
internal class FieldSet { internal sealed class FieldSet {
private static readonly FieldSet defaultInstance = new FieldSet(new Dictionary<FieldDescriptor, object>()).MakeImmutable(); private static readonly FieldSet defaultInstance = new FieldSet(new Dictionary<FieldDescriptor, object>()).MakeImmutable();
......
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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
using System.IO;
using Google.ProtocolBuffers.FieldAccess; using Google.ProtocolBuffers.FieldAccess;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
......
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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Text;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections; // 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.Generic;
using System.IO;
using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.FieldAccess; using Google.ProtocolBuffers.FieldAccess;
......
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.Generic;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
using System.Collections; using System.Collections;
...@@ -7,7 +22,7 @@ namespace Google.ProtocolBuffers { ...@@ -7,7 +22,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Class used to represent repeat extensions in generated classes. /// Class used to represent repeat extensions in generated classes.
/// </summary> /// </summary>
public class GeneratedRepeatExtension<TExtensionElement> : GeneratedExtensionBase<IList<TExtensionElement>> { public sealed class GeneratedRepeatExtension<TExtensionElement> : GeneratedExtensionBase<IList<TExtensionElement>> {
private GeneratedRepeatExtension(FieldDescriptor field) : base(field, typeof(TExtensionElement)) { private GeneratedRepeatExtension(FieldDescriptor field) : base(field, typeof(TExtensionElement)) {
} }
......
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.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
...@@ -6,7 +21,7 @@ namespace Google.ProtocolBuffers { ...@@ -6,7 +21,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Generated extension for a singular field. /// Generated extension for a singular field.
/// </remarks> /// </remarks>
public class GeneratedSingleExtension<TExtension> : GeneratedExtensionBase<TExtension> { public sealed class GeneratedSingleExtension<TExtension> : GeneratedExtensionBase<TExtension> {
internal GeneratedSingleExtension(FieldDescriptor descriptor) : base(descriptor, typeof(TExtension)) { internal GeneratedSingleExtension(FieldDescriptor descriptor) : base(descriptor, typeof(TExtension)) {
} }
......
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.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
......
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 { namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
......
...@@ -19,10 +19,8 @@ namespace Google.ProtocolBuffers { ...@@ -19,10 +19,8 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Thrown when a protocol message being parsed is invalid in some way, /// Thrown when a protocol message being parsed is invalid in some way,
/// e.g. it contains a malformed varint or a negative byte length. /// e.g. it contains a malformed varint or a negative byte length.
///
/// TODO(jonskeet): Make the methods throw directly? Rename them?
/// </summary> /// </summary>
public class InvalidProtocolBufferException : IOException { public sealed class InvalidProtocolBufferException : IOException {
internal InvalidProtocolBufferException(string message) internal InvalidProtocolBufferException(string message)
: base(message) { : base(message) {
...@@ -37,7 +35,6 @@ namespace Google.ProtocolBuffers { ...@@ -37,7 +35,6 @@ namespace Google.ProtocolBuffers {
"misreported its own length."); "misreported its own length.");
} }
/// TODO(jonskeet): Make this internal again and use InternalVisibleTo?
internal static InvalidProtocolBufferException NegativeSize() { internal static InvalidProtocolBufferException NegativeSize() {
return new InvalidProtocolBufferException( return new InvalidProtocolBufferException(
"CodedInputStream encountered an embedded string or message " + "CodedInputStream encountered an embedded string or message " +
......
using System.Reflection; // Protocol Buffers - Google's data interchange format
using System.Runtime.CompilerServices; // 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; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
<Compile Include="FieldAccess\SinglePrimitiveAccessor.cs" /> <Compile Include="FieldAccess\SinglePrimitiveAccessor.cs" />
<Compile Include="FieldAccess\RepeatedPrimitiveAccessor.cs" /> <Compile Include="FieldAccess\RepeatedPrimitiveAccessor.cs" />
<Compile Include="FieldAccess\RepeatedEnumAccessor.cs" /> <Compile Include="FieldAccess\RepeatedEnumAccessor.cs" />
<Compile Include="FieldAccess\Delegates.cs" />
<Compile Include="FieldAccess\IFieldAccessor.cs" /> <Compile Include="FieldAccess\IFieldAccessor.cs" />
<Compile Include="FieldAccess\FieldAccessorTable.cs" /> <Compile Include="FieldAccess\FieldAccessorTable.cs" />
<Compile Include="FieldAccess\RepeatedMessageAccessor.cs" /> <Compile Include="FieldAccess\RepeatedMessageAccessor.cs" />
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // Copyright 2008 Google Inc.
using System.Text; // 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 { namespace Google.ProtocolBuffers {
/// <summary>
/// Grab-bag of utility functions useful when dealing with RPCs.
/// </summary>
public static class RpcUtil { public static class RpcUtil {
/// <summary> /// <summary>
......
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.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
......
using System; // Protocol Buffers - Google's data interchange format
using System.Collections.Generic; // 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.IO;
using System.Text; using System.Text;
...@@ -8,7 +22,7 @@ namespace Google.ProtocolBuffers { ...@@ -8,7 +22,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Helper class to control indentation /// Helper class to control indentation
/// </summary> /// </summary>
internal class TextGenerator { internal sealed class TextGenerator {
/// <summary> /// <summary>
/// Writer to write formatted text to. /// Writer to write formatted text to.
......
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.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
......
...@@ -21,7 +21,7 @@ using Google.ProtocolBuffers.Collections; ...@@ -21,7 +21,7 @@ using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers { namespace Google.ProtocolBuffers {
public class UninitializedMessageException : Exception { public sealed class UninitializedMessageException : Exception {
private readonly IList<string> missingFields; private readonly IList<string> missingFields;
......
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 System.Collections.ObjectModel;
using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Collections;
...@@ -169,7 +184,7 @@ namespace Google.ProtocolBuffers { ...@@ -169,7 +184,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Used to build instances of UnknownField. /// Used to build instances of UnknownField.
/// </summary> /// </summary>
public class Builder { public sealed class Builder {
private List<ulong> varintList; private List<ulong> varintList;
private List<uint> fixed32List; private List<uint> fixed32List;
......
...@@ -19,7 +19,18 @@ using System.IO; ...@@ -19,7 +19,18 @@ using System.IO;
using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Collections;
namespace Google.ProtocolBuffers { 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>()); private static readonly UnknownFieldSet defaultInstance = new UnknownFieldSet(new Dictionary<int, UnknownField>());
...@@ -165,7 +176,6 @@ namespace Google.ProtocolBuffers { ...@@ -165,7 +176,6 @@ namespace Google.ProtocolBuffers {
} }
} }
/// <summary> /// <summary>
/// Parses an UnknownFieldSet from the given input. /// Parses an UnknownFieldSet from the given input.
/// </summary> /// </summary>
...@@ -194,7 +204,10 @@ namespace Google.ProtocolBuffers { ...@@ -194,7 +204,10 @@ namespace Google.ProtocolBuffers {
return CreateBuilder().MergeFrom(input).Build(); return CreateBuilder().MergeFrom(input).Build();
} }
public class Builder /// <summary>
/// Builder for UnknownFieldSets.
/// </summary>
public sealed class Builder
{ {
/// <summary> /// <summary>
/// Mapping from number to field. Note that by using a SortedList we ensure /// Mapping from number to field. Note that by using a SortedList we ensure
......
...@@ -28,7 +28,7 @@ namespace Google.ProtocolBuffers { ...@@ -28,7 +28,7 @@ namespace Google.ProtocolBuffers {
/// the Protocol Buffer wire format. /// the Protocol Buffer wire format.
/// </para> /// </para>
/// </summary> /// </summary>
public class WireFormat { public static class WireFormat {
public enum WireType : uint { public enum WireType : uint {
Varint = 0, Varint = 0,
Fixed64 = 1, Fixed64 = 1,
...@@ -38,13 +38,13 @@ namespace Google.ProtocolBuffers { ...@@ -38,13 +38,13 @@ namespace Google.ProtocolBuffers {
Fixed32 = 5 Fixed32 = 5
} }
internal class MessageSetField { internal static class MessageSetField {
internal const int Item = 1; internal const int Item = 1;
internal const int TypeID = 2; internal const int TypeID = 2;
internal const int Message = 3; 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 ItemStart = MakeTag(MessageSetField.Item, WireType.StartGroup);
internal static readonly uint ItemEnd = MakeTag(MessageSetField.Item, WireType.EndGroup); internal static readonly uint ItemEnd = MakeTag(MessageSetField.Item, WireType.EndGroup);
internal static readonly uint TypeID = MakeTag(MessageSetField.TypeID, WireType.Varint); internal static readonly uint TypeID = MakeTag(MessageSetField.TypeID, WireType.Varint);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment