From f3504cf3b1d456a843e8242fdee9ba0bf2991dc1 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 28 Apr 2015 14:49:49 +0100 Subject: First part of making the C# runtime work with the new codegen. 1) Remove CSharpOptions 2) A new version of DescriptorProtoFile (with manual changes from codegen - it would otherwise be Descriptor.cs) 3) Turn off CLS compliance (which we'll remove from the codebase entirely; I don't think it's actually relevant these days) 4) Add "public imports" to FileDescriptor, with code broadly copied from the Java codebase. Lots more changes to commit before it will build and tests run, but one step at a time... --- .../src/ProtocolBuffers.Test/CSharpOptionsTest.cs | 127 - .../Descriptors/MessageDescriptorTest.cs | 72 - .../Properties/AssemblyInfo.cs | 2 +- .../ProtocolBuffers.Test.csproj | 2 - .../DescriptorProtos/CSharpOptions.cs | 1887 -- .../DescriptorProtos/DescriptorProtoFile.cs | 19643 ++++++++++--------- .../ProtocolBuffers/Descriptors/DescriptorPool.cs | 22 +- .../ProtocolBuffers/Descriptors/FieldDescriptor.cs | 54 +- .../ProtocolBuffers/Descriptors/FileDescriptor.cs | 193 +- .../Descriptors/MessageDescriptor.cs | 19 - csharp/src/ProtocolBuffers/ProtocolBuffers.csproj | 1 - 11 files changed, 10632 insertions(+), 11390 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers.Test/CSharpOptionsTest.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs delete mode 100644 csharp/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/CSharpOptionsTest.cs b/csharp/src/ProtocolBuffers.Test/CSharpOptionsTest.cs deleted file mode 100644 index 752d9a0c..00000000 --- a/csharp/src/ProtocolBuffers.Test/CSharpOptionsTest.cs +++ /dev/null @@ -1,127 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class DescriptorUtilTest - { - [TestMethod] - public void ExplicitNamespace() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder - { - Name = "x", - Package = "pack", - Options = - new FileOptions.Builder().SetExtension( - CSharpOptions.CSharpFileOptions, - new CSharpFileOptions.Builder {Namespace = "Foo.Bar"}.Build()). - Build() - }.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("Foo.Bar", descriptor.CSharpOptions.Namespace); - } - - [TestMethod] - public void NoNamespaceFallsBackToPackage() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x", Package = "pack"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("pack", descriptor.CSharpOptions.Namespace); - } - - [TestMethod] - public void NoNamespaceOrPackageFallsBackToEmptyString() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("", descriptor.CSharpOptions.Namespace); - } - - [TestMethod] - public void ExplicitlyNamedFileClass() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder - { - Name = "x", - Options = - new FileOptions.Builder().SetExtension( - CSharpOptions.CSharpFileOptions, - new CSharpFileOptions.Builder {UmbrellaClassname = "Foo"}.Build()) - .Build() - }.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("Foo", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithProtoSuffix() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.proto"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithProtoDevelSuffix() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.protodevel"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithNoSuffix() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithDirectoryStructure() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x/y/foo_bar"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs b/csharp/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs deleted file mode 100644 index 79033e6e..00000000 --- a/csharp/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Google.ProtocolBuffers.TestProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - [TestClass] - public class MessageDescriptorTest - { - [TestMethod] - public void FindPropertyWithDefaultName() - { - Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.NormalFieldNumber), - OptionsMessage.Descriptor.FindFieldByPropertyName("Normal")); - } - - [TestMethod] - public void FindPropertyWithAutoModifiedName() - { - Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.OptionsMessage_FieldNumber), - OptionsMessage.Descriptor.FindFieldByPropertyName("OptionsMessage_")); - } - - [TestMethod] - public void FindPropertyWithCustomizedName() - { - Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.CustomNameFieldNumber), - OptionsMessage.Descriptor.FindFieldByPropertyName("CustomName")); - } - - [TestMethod] - public void FindPropertyWithInvalidName() - { - Assert.IsNull(OptionsMessage.Descriptor.FindFieldByPropertyName("Bogus")); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs index cea5da58..b443ea3a 100644 --- a/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ using System.Runtime.InteropServices; // We don't really need CLSCompliance, but if the assembly builds with no warnings, // that means the generator is okay. -[assembly: CLSCompliant(true)] \ No newline at end of file +[assembly: CLSCompliant(false)] \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index 267fedc0..0dcdd1e6 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -86,10 +86,8 @@ - - diff --git a/csharp/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs b/csharp/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs deleted file mode 100644 index 9a77d6e0..00000000 --- a/csharp/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs +++ /dev/null @@ -1,1887 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.DescriptorProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class CSharpOptions { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFileOptions); - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFieldOptions); - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpServiceOptions); - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpMethodOptions); - } - #endregion - #region Extensions - public const int CSharpFileOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CSharpFileOptions; - public const int CSharpFieldOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CSharpFieldOptions; - public const int CsharpServiceOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CsharpServiceOptions; - public const int CsharpMethodOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CsharpMethodOptions; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpFileOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpFieldOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpServiceOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpServiceOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpMethodOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpMethodOptions__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static CSharpOptions() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8SD2dvb2ds", - "ZS5wcm90b2J1ZhogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8i", - "pwQKEUNTaGFycEZpbGVPcHRpb25zEhEKCW5hbWVzcGFjZRgBIAEoCRIaChJ1", - "bWJyZWxsYV9jbGFzc25hbWUYAiABKAkSHAoOcHVibGljX2NsYXNzZXMYAyAB", - "KAg6BHRydWUSFgoObXVsdGlwbGVfZmlsZXMYBCABKAgSFAoMbmVzdF9jbGFz", - "c2VzGAUgASgIEhYKDmNvZGVfY29udHJhY3RzGAYgASgIEiQKHGV4cGFuZF9u", - "YW1lc3BhY2VfZGlyZWN0b3JpZXMYByABKAgSHAoOY2xzX2NvbXBsaWFuY2UY", - "CCABKAg6BHRydWUSHwoQYWRkX3NlcmlhbGl6YWJsZRgJIAEoCDoFZmFsc2US", - "IwoVZ2VuZXJhdGVfcHJpdmF0ZV9jdG9yGAogASgIOgR0cnVlEhwKDmZpbGVf", - "ZXh0ZW5zaW9uGN0BIAEoCToDLmNzEhsKEnVtYnJlbGxhX25hbWVzcGFjZRje", - "ASABKAkSHAoQb3V0cHV0X2RpcmVjdG9yeRjfASABKAk6AS4SJgoWaWdub3Jl", - "X2dvb2dsZV9wcm90b2J1ZhjgASABKAg6BWZhbHNlEkkKFnNlcnZpY2VfZ2Vu", - "ZXJhdG9yX3R5cGUY4QEgASgOMiIuZ29vZ2xlLnByb3RvYnVmLkNTaGFycFNl", - "cnZpY2VUeXBlOgROT05FEikKGWdlbmVyYXRlZF9jb2RlX2F0dHJpYnV0ZXMY", - "4gEgASgIOgVmYWxzZSIrChJDU2hhcnBGaWVsZE9wdGlvbnMSFQoNcHJvcGVy", - "dHlfbmFtZRgBIAEoCSIsChRDU2hhcnBTZXJ2aWNlT3B0aW9ucxIUCgxpbnRl", - "cmZhY2VfaWQYASABKAkiKgoTQ1NoYXJwTWV0aG9kT3B0aW9ucxITCgtkaXNw", - "YXRjaF9pZBgBIAEoBSpLChFDU2hhcnBTZXJ2aWNlVHlwZRIICgROT05FEAAS", - "CwoHR0VORVJJQxABEg0KCUlOVEVSRkFDRRACEhAKDElSUENESVNQQVRDSBAD", - "Ol4KE2NzaGFycF9maWxlX29wdGlvbnMSHC5nb29nbGUucHJvdG9idWYuRmls", - "ZU9wdGlvbnMY6AcgASgLMiIuZ29vZ2xlLnByb3RvYnVmLkNTaGFycEZpbGVP", - "cHRpb25zOmEKFGNzaGFycF9maWVsZF9vcHRpb25zEh0uZ29vZ2xlLnByb3Rv", - "YnVmLkZpZWxkT3B0aW9ucxjoByABKAsyIy5nb29nbGUucHJvdG9idWYuQ1No", - "YXJwRmllbGRPcHRpb25zOmcKFmNzaGFycF9zZXJ2aWNlX29wdGlvbnMSHy5n", - "b29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMY6AcgASgLMiUuZ29vZ2xl", - "LnByb3RvYnVmLkNTaGFycFNlcnZpY2VPcHRpb25zOmQKFWNzaGFycF9tZXRo", - "b2Rfb3B0aW9ucxIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGOgH", - "IAEoCzIkLmdvb2dsZS5wcm90b2J1Zi5DU2hhcnBNZXRob2RPcHRpb25z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_CSharpFileOptions__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpFileOptions__Descriptor, - new string[] { "Namespace", "UmbrellaClassname", "PublicClasses", "MultipleFiles", "NestClasses", "CodeContracts", "ExpandNamespaceDirectories", "ClsCompliance", "AddSerializable", "GeneratePrivateCtor", "FileExtension", "UmbrellaNamespace", "OutputDirectory", "IgnoreGoogleProtobuf", "ServiceGeneratorType", "GeneratedCodeAttributes", }); - internal__static_google_protobuf_CSharpFieldOptions__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpFieldOptions__Descriptor, - new string[] { "PropertyName", }); - internal__static_google_protobuf_CSharpServiceOptions__Descriptor = Descriptor.MessageTypes[2]; - internal__static_google_protobuf_CSharpServiceOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpServiceOptions__Descriptor, - new string[] { "InterfaceId", }); - internal__static_google_protobuf_CSharpMethodOptions__Descriptor = Descriptor.MessageTypes[3]; - internal__static_google_protobuf_CSharpMethodOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpMethodOptions__Descriptor, - new string[] { "DispatchId", }); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFileOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFieldOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpServiceOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpMethodOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[3]); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum CSharpServiceType { - NONE = 0, - GENERIC = 1, - INTERFACE = 2, - IRPCDISPATCH = 3, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpFileOptions : pb::GeneratedMessage { - private CSharpFileOptions() { } - private static readonly CSharpFileOptions defaultInstance = new CSharpFileOptions().MakeReadOnly(); - private static readonly string[] _cSharpFileOptionsFieldNames = new string[] { "add_serializable", "cls_compliance", "code_contracts", "expand_namespace_directories", "file_extension", "generate_private_ctor", "generated_code_attributes", "ignore_google_protobuf", "multiple_files", "namespace", "nest_classes", "output_directory", "public_classes", "service_generator_type", "umbrella_classname", "umbrella_namespace" }; - private static readonly uint[] _cSharpFileOptionsFieldTags = new uint[] { 72, 64, 48, 56, 1770, 80, 1808, 1792, 32, 10, 40, 1786, 24, 1800, 18, 1778 }; - public static CSharpFileOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpFileOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpFileOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable; } - } - - public const int NamespaceFieldNumber = 1; - private bool hasNamespace; - private string namespace_ = ""; - public bool HasNamespace { - get { return hasNamespace; } - } - public string Namespace { - get { return namespace_; } - } - - public const int UmbrellaClassnameFieldNumber = 2; - private bool hasUmbrellaClassname; - private string umbrellaClassname_ = ""; - public bool HasUmbrellaClassname { - get { return hasUmbrellaClassname; } - } - public string UmbrellaClassname { - get { return umbrellaClassname_; } - } - - public const int PublicClassesFieldNumber = 3; - private bool hasPublicClasses; - private bool publicClasses_ = true; - public bool HasPublicClasses { - get { return hasPublicClasses; } - } - public bool PublicClasses { - get { return publicClasses_; } - } - - public const int MultipleFilesFieldNumber = 4; - private bool hasMultipleFiles; - private bool multipleFiles_; - public bool HasMultipleFiles { - get { return hasMultipleFiles; } - } - public bool MultipleFiles { - get { return multipleFiles_; } - } - - public const int NestClassesFieldNumber = 5; - private bool hasNestClasses; - private bool nestClasses_; - public bool HasNestClasses { - get { return hasNestClasses; } - } - public bool NestClasses { - get { return nestClasses_; } - } - - public const int CodeContractsFieldNumber = 6; - private bool hasCodeContracts; - private bool codeContracts_; - public bool HasCodeContracts { - get { return hasCodeContracts; } - } - public bool CodeContracts { - get { return codeContracts_; } - } - - public const int ExpandNamespaceDirectoriesFieldNumber = 7; - private bool hasExpandNamespaceDirectories; - private bool expandNamespaceDirectories_; - public bool HasExpandNamespaceDirectories { - get { return hasExpandNamespaceDirectories; } - } - public bool ExpandNamespaceDirectories { - get { return expandNamespaceDirectories_; } - } - - public const int ClsComplianceFieldNumber = 8; - private bool hasClsCompliance; - private bool clsCompliance_ = true; - public bool HasClsCompliance { - get { return hasClsCompliance; } - } - public bool ClsCompliance { - get { return clsCompliance_; } - } - - public const int AddSerializableFieldNumber = 9; - private bool hasAddSerializable; - private bool addSerializable_; - public bool HasAddSerializable { - get { return hasAddSerializable; } - } - public bool AddSerializable { - get { return addSerializable_; } - } - - public const int GeneratePrivateCtorFieldNumber = 10; - private bool hasGeneratePrivateCtor; - private bool generatePrivateCtor_ = true; - public bool HasGeneratePrivateCtor { - get { return hasGeneratePrivateCtor; } - } - public bool GeneratePrivateCtor { - get { return generatePrivateCtor_; } - } - - public const int FileExtensionFieldNumber = 221; - private bool hasFileExtension; - private string fileExtension_ = ".cs"; - public bool HasFileExtension { - get { return hasFileExtension; } - } - public string FileExtension { - get { return fileExtension_; } - } - - public const int UmbrellaNamespaceFieldNumber = 222; - private bool hasUmbrellaNamespace; - private string umbrellaNamespace_ = ""; - public bool HasUmbrellaNamespace { - get { return hasUmbrellaNamespace; } - } - public string UmbrellaNamespace { - get { return umbrellaNamespace_; } - } - - public const int OutputDirectoryFieldNumber = 223; - private bool hasOutputDirectory; - private string outputDirectory_ = "."; - public bool HasOutputDirectory { - get { return hasOutputDirectory; } - } - public string OutputDirectory { - get { return outputDirectory_; } - } - - public const int IgnoreGoogleProtobufFieldNumber = 224; - private bool hasIgnoreGoogleProtobuf; - private bool ignoreGoogleProtobuf_; - public bool HasIgnoreGoogleProtobuf { - get { return hasIgnoreGoogleProtobuf; } - } - public bool IgnoreGoogleProtobuf { - get { return ignoreGoogleProtobuf_; } - } - - public const int ServiceGeneratorTypeFieldNumber = 225; - private bool hasServiceGeneratorType; - private global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType serviceGeneratorType_ = global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType.NONE; - public bool HasServiceGeneratorType { - get { return hasServiceGeneratorType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType ServiceGeneratorType { - get { return serviceGeneratorType_; } - } - - public const int GeneratedCodeAttributesFieldNumber = 226; - private bool hasGeneratedCodeAttributes; - private bool generatedCodeAttributes_; - public bool HasGeneratedCodeAttributes { - get { return hasGeneratedCodeAttributes; } - } - public bool GeneratedCodeAttributes { - get { return generatedCodeAttributes_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpFileOptionsFieldNames; - if (hasNamespace) { - output.WriteString(1, field_names[9], Namespace); - } - if (hasUmbrellaClassname) { - output.WriteString(2, field_names[14], UmbrellaClassname); - } - if (hasPublicClasses) { - output.WriteBool(3, field_names[12], PublicClasses); - } - if (hasMultipleFiles) { - output.WriteBool(4, field_names[8], MultipleFiles); - } - if (hasNestClasses) { - output.WriteBool(5, field_names[10], NestClasses); - } - if (hasCodeContracts) { - output.WriteBool(6, field_names[2], CodeContracts); - } - if (hasExpandNamespaceDirectories) { - output.WriteBool(7, field_names[3], ExpandNamespaceDirectories); - } - if (hasClsCompliance) { - output.WriteBool(8, field_names[1], ClsCompliance); - } - if (hasAddSerializable) { - output.WriteBool(9, field_names[0], AddSerializable); - } - if (hasGeneratePrivateCtor) { - output.WriteBool(10, field_names[5], GeneratePrivateCtor); - } - if (hasFileExtension) { - output.WriteString(221, field_names[4], FileExtension); - } - if (hasUmbrellaNamespace) { - output.WriteString(222, field_names[15], UmbrellaNamespace); - } - if (hasOutputDirectory) { - output.WriteString(223, field_names[11], OutputDirectory); - } - if (hasIgnoreGoogleProtobuf) { - output.WriteBool(224, field_names[7], IgnoreGoogleProtobuf); - } - if (hasServiceGeneratorType) { - output.WriteEnum(225, field_names[13], (int) ServiceGeneratorType, ServiceGeneratorType); - } - if (hasGeneratedCodeAttributes) { - output.WriteBool(226, field_names[6], GeneratedCodeAttributes); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNamespace) { - size += pb::CodedOutputStream.ComputeStringSize(1, Namespace); - } - if (hasUmbrellaClassname) { - size += pb::CodedOutputStream.ComputeStringSize(2, UmbrellaClassname); - } - if (hasPublicClasses) { - size += pb::CodedOutputStream.ComputeBoolSize(3, PublicClasses); - } - if (hasMultipleFiles) { - size += pb::CodedOutputStream.ComputeBoolSize(4, MultipleFiles); - } - if (hasNestClasses) { - size += pb::CodedOutputStream.ComputeBoolSize(5, NestClasses); - } - if (hasCodeContracts) { - size += pb::CodedOutputStream.ComputeBoolSize(6, CodeContracts); - } - if (hasExpandNamespaceDirectories) { - size += pb::CodedOutputStream.ComputeBoolSize(7, ExpandNamespaceDirectories); - } - if (hasClsCompliance) { - size += pb::CodedOutputStream.ComputeBoolSize(8, ClsCompliance); - } - if (hasAddSerializable) { - size += pb::CodedOutputStream.ComputeBoolSize(9, AddSerializable); - } - if (hasGeneratePrivateCtor) { - size += pb::CodedOutputStream.ComputeBoolSize(10, GeneratePrivateCtor); - } - if (hasFileExtension) { - size += pb::CodedOutputStream.ComputeStringSize(221, FileExtension); - } - if (hasUmbrellaNamespace) { - size += pb::CodedOutputStream.ComputeStringSize(222, UmbrellaNamespace); - } - if (hasOutputDirectory) { - size += pb::CodedOutputStream.ComputeStringSize(223, OutputDirectory); - } - if (hasIgnoreGoogleProtobuf) { - size += pb::CodedOutputStream.ComputeBoolSize(224, IgnoreGoogleProtobuf); - } - if (hasServiceGeneratorType) { - size += pb::CodedOutputStream.ComputeEnumSize(225, (int) ServiceGeneratorType); - } - if (hasGeneratedCodeAttributes) { - size += pb::CodedOutputStream.ComputeBoolSize(226, GeneratedCodeAttributes); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpFileOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpFileOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpFileOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpFileOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpFileOptions result; - - private CSharpFileOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpFileOptions original = result; - result = new CSharpFileOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpFileOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.Descriptor; } - } - - public override CSharpFileOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance; } - } - - public override CSharpFileOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpFileOptions) { - return MergeFrom((CSharpFileOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpFileOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNamespace) { - Namespace = other.Namespace; - } - if (other.HasUmbrellaClassname) { - UmbrellaClassname = other.UmbrellaClassname; - } - if (other.HasPublicClasses) { - PublicClasses = other.PublicClasses; - } - if (other.HasMultipleFiles) { - MultipleFiles = other.MultipleFiles; - } - if (other.HasNestClasses) { - NestClasses = other.NestClasses; - } - if (other.HasCodeContracts) { - CodeContracts = other.CodeContracts; - } - if (other.HasExpandNamespaceDirectories) { - ExpandNamespaceDirectories = other.ExpandNamespaceDirectories; - } - if (other.HasClsCompliance) { - ClsCompliance = other.ClsCompliance; - } - if (other.HasAddSerializable) { - AddSerializable = other.AddSerializable; - } - if (other.HasGeneratePrivateCtor) { - GeneratePrivateCtor = other.GeneratePrivateCtor; - } - if (other.HasFileExtension) { - FileExtension = other.FileExtension; - } - if (other.HasUmbrellaNamespace) { - UmbrellaNamespace = other.UmbrellaNamespace; - } - if (other.HasOutputDirectory) { - OutputDirectory = other.OutputDirectory; - } - if (other.HasIgnoreGoogleProtobuf) { - IgnoreGoogleProtobuf = other.IgnoreGoogleProtobuf; - } - if (other.HasServiceGeneratorType) { - ServiceGeneratorType = other.ServiceGeneratorType; - } - if (other.HasGeneratedCodeAttributes) { - GeneratedCodeAttributes = other.GeneratedCodeAttributes; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpFileOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpFileOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNamespace = input.ReadString(ref result.namespace_); - break; - } - case 18: { - result.hasUmbrellaClassname = input.ReadString(ref result.umbrellaClassname_); - break; - } - case 24: { - result.hasPublicClasses = input.ReadBool(ref result.publicClasses_); - break; - } - case 32: { - result.hasMultipleFiles = input.ReadBool(ref result.multipleFiles_); - break; - } - case 40: { - result.hasNestClasses = input.ReadBool(ref result.nestClasses_); - break; - } - case 48: { - result.hasCodeContracts = input.ReadBool(ref result.codeContracts_); - break; - } - case 56: { - result.hasExpandNamespaceDirectories = input.ReadBool(ref result.expandNamespaceDirectories_); - break; - } - case 64: { - result.hasClsCompliance = input.ReadBool(ref result.clsCompliance_); - break; - } - case 72: { - result.hasAddSerializable = input.ReadBool(ref result.addSerializable_); - break; - } - case 80: { - result.hasGeneratePrivateCtor = input.ReadBool(ref result.generatePrivateCtor_); - break; - } - case 1770: { - result.hasFileExtension = input.ReadString(ref result.fileExtension_); - break; - } - case 1778: { - result.hasUmbrellaNamespace = input.ReadString(ref result.umbrellaNamespace_); - break; - } - case 1786: { - result.hasOutputDirectory = input.ReadString(ref result.outputDirectory_); - break; - } - case 1792: { - result.hasIgnoreGoogleProtobuf = input.ReadBool(ref result.ignoreGoogleProtobuf_); - break; - } - case 1800: { - object unknown; - if(input.ReadEnum(ref result.serviceGeneratorType_, out unknown)) { - result.hasServiceGeneratorType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(225, (ulong)(int)unknown); - } - break; - } - case 1808: { - result.hasGeneratedCodeAttributes = input.ReadBool(ref result.generatedCodeAttributes_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNamespace { - get { return result.hasNamespace; } - } - public string Namespace { - get { return result.Namespace; } - set { SetNamespace(value); } - } - public Builder SetNamespace(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNamespace = true; - result.namespace_ = value; - return this; - } - public Builder ClearNamespace() { - PrepareBuilder(); - result.hasNamespace = false; - result.namespace_ = ""; - return this; - } - - public bool HasUmbrellaClassname { - get { return result.hasUmbrellaClassname; } - } - public string UmbrellaClassname { - get { return result.UmbrellaClassname; } - set { SetUmbrellaClassname(value); } - } - public Builder SetUmbrellaClassname(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUmbrellaClassname = true; - result.umbrellaClassname_ = value; - return this; - } - public Builder ClearUmbrellaClassname() { - PrepareBuilder(); - result.hasUmbrellaClassname = false; - result.umbrellaClassname_ = ""; - return this; - } - - public bool HasPublicClasses { - get { return result.hasPublicClasses; } - } - public bool PublicClasses { - get { return result.PublicClasses; } - set { SetPublicClasses(value); } - } - public Builder SetPublicClasses(bool value) { - PrepareBuilder(); - result.hasPublicClasses = true; - result.publicClasses_ = value; - return this; - } - public Builder ClearPublicClasses() { - PrepareBuilder(); - result.hasPublicClasses = false; - result.publicClasses_ = true; - return this; - } - - public bool HasMultipleFiles { - get { return result.hasMultipleFiles; } - } - public bool MultipleFiles { - get { return result.MultipleFiles; } - set { SetMultipleFiles(value); } - } - public Builder SetMultipleFiles(bool value) { - PrepareBuilder(); - result.hasMultipleFiles = true; - result.multipleFiles_ = value; - return this; - } - public Builder ClearMultipleFiles() { - PrepareBuilder(); - result.hasMultipleFiles = false; - result.multipleFiles_ = false; - return this; - } - - public bool HasNestClasses { - get { return result.hasNestClasses; } - } - public bool NestClasses { - get { return result.NestClasses; } - set { SetNestClasses(value); } - } - public Builder SetNestClasses(bool value) { - PrepareBuilder(); - result.hasNestClasses = true; - result.nestClasses_ = value; - return this; - } - public Builder ClearNestClasses() { - PrepareBuilder(); - result.hasNestClasses = false; - result.nestClasses_ = false; - return this; - } - - public bool HasCodeContracts { - get { return result.hasCodeContracts; } - } - public bool CodeContracts { - get { return result.CodeContracts; } - set { SetCodeContracts(value); } - } - public Builder SetCodeContracts(bool value) { - PrepareBuilder(); - result.hasCodeContracts = true; - result.codeContracts_ = value; - return this; - } - public Builder ClearCodeContracts() { - PrepareBuilder(); - result.hasCodeContracts = false; - result.codeContracts_ = false; - return this; - } - - public bool HasExpandNamespaceDirectories { - get { return result.hasExpandNamespaceDirectories; } - } - public bool ExpandNamespaceDirectories { - get { return result.ExpandNamespaceDirectories; } - set { SetExpandNamespaceDirectories(value); } - } - public Builder SetExpandNamespaceDirectories(bool value) { - PrepareBuilder(); - result.hasExpandNamespaceDirectories = true; - result.expandNamespaceDirectories_ = value; - return this; - } - public Builder ClearExpandNamespaceDirectories() { - PrepareBuilder(); - result.hasExpandNamespaceDirectories = false; - result.expandNamespaceDirectories_ = false; - return this; - } - - public bool HasClsCompliance { - get { return result.hasClsCompliance; } - } - public bool ClsCompliance { - get { return result.ClsCompliance; } - set { SetClsCompliance(value); } - } - public Builder SetClsCompliance(bool value) { - PrepareBuilder(); - result.hasClsCompliance = true; - result.clsCompliance_ = value; - return this; - } - public Builder ClearClsCompliance() { - PrepareBuilder(); - result.hasClsCompliance = false; - result.clsCompliance_ = true; - return this; - } - - public bool HasAddSerializable { - get { return result.hasAddSerializable; } - } - public bool AddSerializable { - get { return result.AddSerializable; } - set { SetAddSerializable(value); } - } - public Builder SetAddSerializable(bool value) { - PrepareBuilder(); - result.hasAddSerializable = true; - result.addSerializable_ = value; - return this; - } - public Builder ClearAddSerializable() { - PrepareBuilder(); - result.hasAddSerializable = false; - result.addSerializable_ = false; - return this; - } - - public bool HasGeneratePrivateCtor { - get { return result.hasGeneratePrivateCtor; } - } - public bool GeneratePrivateCtor { - get { return result.GeneratePrivateCtor; } - set { SetGeneratePrivateCtor(value); } - } - public Builder SetGeneratePrivateCtor(bool value) { - PrepareBuilder(); - result.hasGeneratePrivateCtor = true; - result.generatePrivateCtor_ = value; - return this; - } - public Builder ClearGeneratePrivateCtor() { - PrepareBuilder(); - result.hasGeneratePrivateCtor = false; - result.generatePrivateCtor_ = true; - return this; - } - - public bool HasFileExtension { - get { return result.hasFileExtension; } - } - public string FileExtension { - get { return result.FileExtension; } - set { SetFileExtension(value); } - } - public Builder SetFileExtension(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasFileExtension = true; - result.fileExtension_ = value; - return this; - } - public Builder ClearFileExtension() { - PrepareBuilder(); - result.hasFileExtension = false; - result.fileExtension_ = ".cs"; - return this; - } - - public bool HasUmbrellaNamespace { - get { return result.hasUmbrellaNamespace; } - } - public string UmbrellaNamespace { - get { return result.UmbrellaNamespace; } - set { SetUmbrellaNamespace(value); } - } - public Builder SetUmbrellaNamespace(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUmbrellaNamespace = true; - result.umbrellaNamespace_ = value; - return this; - } - public Builder ClearUmbrellaNamespace() { - PrepareBuilder(); - result.hasUmbrellaNamespace = false; - result.umbrellaNamespace_ = ""; - return this; - } - - public bool HasOutputDirectory { - get { return result.hasOutputDirectory; } - } - public string OutputDirectory { - get { return result.OutputDirectory; } - set { SetOutputDirectory(value); } - } - public Builder SetOutputDirectory(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOutputDirectory = true; - result.outputDirectory_ = value; - return this; - } - public Builder ClearOutputDirectory() { - PrepareBuilder(); - result.hasOutputDirectory = false; - result.outputDirectory_ = "."; - return this; - } - - public bool HasIgnoreGoogleProtobuf { - get { return result.hasIgnoreGoogleProtobuf; } - } - public bool IgnoreGoogleProtobuf { - get { return result.IgnoreGoogleProtobuf; } - set { SetIgnoreGoogleProtobuf(value); } - } - public Builder SetIgnoreGoogleProtobuf(bool value) { - PrepareBuilder(); - result.hasIgnoreGoogleProtobuf = true; - result.ignoreGoogleProtobuf_ = value; - return this; - } - public Builder ClearIgnoreGoogleProtobuf() { - PrepareBuilder(); - result.hasIgnoreGoogleProtobuf = false; - result.ignoreGoogleProtobuf_ = false; - return this; - } - - public bool HasServiceGeneratorType { - get { return result.hasServiceGeneratorType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType ServiceGeneratorType { - get { return result.ServiceGeneratorType; } - set { SetServiceGeneratorType(value); } - } - public Builder SetServiceGeneratorType(global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType value) { - PrepareBuilder(); - result.hasServiceGeneratorType = true; - result.serviceGeneratorType_ = value; - return this; - } - public Builder ClearServiceGeneratorType() { - PrepareBuilder(); - result.hasServiceGeneratorType = false; - result.serviceGeneratorType_ = global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType.NONE; - return this; - } - - public bool HasGeneratedCodeAttributes { - get { return result.hasGeneratedCodeAttributes; } - } - public bool GeneratedCodeAttributes { - get { return result.GeneratedCodeAttributes; } - set { SetGeneratedCodeAttributes(value); } - } - public Builder SetGeneratedCodeAttributes(bool value) { - PrepareBuilder(); - result.hasGeneratedCodeAttributes = true; - result.generatedCodeAttributes_ = value; - return this; - } - public Builder ClearGeneratedCodeAttributes() { - PrepareBuilder(); - result.hasGeneratedCodeAttributes = false; - result.generatedCodeAttributes_ = false; - return this; - } - } - static CSharpFileOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpFieldOptions : pb::GeneratedMessage { - private CSharpFieldOptions() { } - private static readonly CSharpFieldOptions defaultInstance = new CSharpFieldOptions().MakeReadOnly(); - private static readonly string[] _cSharpFieldOptionsFieldNames = new string[] { "property_name" }; - private static readonly uint[] _cSharpFieldOptionsFieldTags = new uint[] { 10 }; - public static CSharpFieldOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpFieldOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpFieldOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable; } - } - - public const int PropertyNameFieldNumber = 1; - private bool hasPropertyName; - private string propertyName_ = ""; - public bool HasPropertyName { - get { return hasPropertyName; } - } - public string PropertyName { - get { return propertyName_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpFieldOptionsFieldNames; - if (hasPropertyName) { - output.WriteString(1, field_names[0], PropertyName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPropertyName) { - size += pb::CodedOutputStream.ComputeStringSize(1, PropertyName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpFieldOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpFieldOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpFieldOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpFieldOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpFieldOptions result; - - private CSharpFieldOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpFieldOptions original = result; - result = new CSharpFieldOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpFieldOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.Descriptor; } - } - - public override CSharpFieldOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance; } - } - - public override CSharpFieldOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpFieldOptions) { - return MergeFrom((CSharpFieldOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpFieldOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPropertyName) { - PropertyName = other.PropertyName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpFieldOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpFieldOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasPropertyName = input.ReadString(ref result.propertyName_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPropertyName { - get { return result.hasPropertyName; } - } - public string PropertyName { - get { return result.PropertyName; } - set { SetPropertyName(value); } - } - public Builder SetPropertyName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPropertyName = true; - result.propertyName_ = value; - return this; - } - public Builder ClearPropertyName() { - PrepareBuilder(); - result.hasPropertyName = false; - result.propertyName_ = ""; - return this; - } - } - static CSharpFieldOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpServiceOptions : pb::GeneratedMessage { - private CSharpServiceOptions() { } - private static readonly CSharpServiceOptions defaultInstance = new CSharpServiceOptions().MakeReadOnly(); - private static readonly string[] _cSharpServiceOptionsFieldNames = new string[] { "interface_id" }; - private static readonly uint[] _cSharpServiceOptionsFieldTags = new uint[] { 10 }; - public static CSharpServiceOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpServiceOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpServiceOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpServiceOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpServiceOptions__FieldAccessorTable; } - } - - public const int InterfaceIdFieldNumber = 1; - private bool hasInterfaceId; - private string interfaceId_ = ""; - public bool HasInterfaceId { - get { return hasInterfaceId; } - } - public string InterfaceId { - get { return interfaceId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpServiceOptionsFieldNames; - if (hasInterfaceId) { - output.WriteString(1, field_names[0], InterfaceId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasInterfaceId) { - size += pb::CodedOutputStream.ComputeStringSize(1, InterfaceId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpServiceOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpServiceOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpServiceOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpServiceOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpServiceOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpServiceOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpServiceOptions result; - - private CSharpServiceOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpServiceOptions original = result; - result = new CSharpServiceOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpServiceOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceOptions.Descriptor; } - } - - public override CSharpServiceOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceOptions.DefaultInstance; } - } - - public override CSharpServiceOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpServiceOptions) { - return MergeFrom((CSharpServiceOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpServiceOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasInterfaceId) { - InterfaceId = other.InterfaceId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpServiceOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpServiceOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasInterfaceId = input.ReadString(ref result.interfaceId_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasInterfaceId { - get { return result.hasInterfaceId; } - } - public string InterfaceId { - get { return result.InterfaceId; } - set { SetInterfaceId(value); } - } - public Builder SetInterfaceId(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasInterfaceId = true; - result.interfaceId_ = value; - return this; - } - public Builder ClearInterfaceId() { - PrepareBuilder(); - result.hasInterfaceId = false; - result.interfaceId_ = ""; - return this; - } - } - static CSharpServiceOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpMethodOptions : pb::GeneratedMessage { - private CSharpMethodOptions() { } - private static readonly CSharpMethodOptions defaultInstance = new CSharpMethodOptions().MakeReadOnly(); - private static readonly string[] _cSharpMethodOptionsFieldNames = new string[] { "dispatch_id" }; - private static readonly uint[] _cSharpMethodOptionsFieldTags = new uint[] { 8 }; - public static CSharpMethodOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpMethodOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpMethodOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpMethodOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpMethodOptions__FieldAccessorTable; } - } - - public const int DispatchIdFieldNumber = 1; - private bool hasDispatchId; - private int dispatchId_; - public bool HasDispatchId { - get { return hasDispatchId; } - } - public int DispatchId { - get { return dispatchId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpMethodOptionsFieldNames; - if (hasDispatchId) { - output.WriteInt32(1, field_names[0], DispatchId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDispatchId) { - size += pb::CodedOutputStream.ComputeInt32Size(1, DispatchId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpMethodOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpMethodOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpMethodOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpMethodOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpMethodOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpMethodOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpMethodOptions result; - - private CSharpMethodOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpMethodOptions original = result; - result = new CSharpMethodOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpMethodOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpMethodOptions.Descriptor; } - } - - public override CSharpMethodOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpMethodOptions.DefaultInstance; } - } - - public override CSharpMethodOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpMethodOptions) { - return MergeFrom((CSharpMethodOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpMethodOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpMethodOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDispatchId) { - DispatchId = other.DispatchId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpMethodOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpMethodOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasDispatchId = input.ReadInt32(ref result.dispatchId_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasDispatchId { - get { return result.hasDispatchId; } - } - public int DispatchId { - get { return result.DispatchId; } - set { SetDispatchId(value); } - } - public Builder SetDispatchId(int value) { - PrepareBuilder(); - result.hasDispatchId = true; - result.dispatchId_ = value; - return this; - } - public Builder ClearDispatchId() { - PrepareBuilder(); - result.hasDispatchId = false; - result.dispatchId_ = 0; - return this; - } - } - static CSharpMethodOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs b/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs index c319c60e..69310a2f 100644 --- a/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs +++ b/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs @@ -1,9110 +1,10533 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.DescriptorProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class DescriptorProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MessageOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MessageOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static DescriptorProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIkcKEUZpbGVEZXNjcmlwdG9yU2V0EjIKBGZpbGUYASADKAsyJC5n", - "b29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90byKXAwoTRmlsZURl", - "c2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg8KB3BhY2thZ2UYAiABKAkS", - "EgoKZGVwZW5kZW5jeRgDIAMoCRI2CgxtZXNzYWdlX3R5cGUYBCADKAsyIC5n", - "b29nbGUucHJvdG9idWYuRGVzY3JpcHRvclByb3RvEjcKCWVudW1fdHlwZRgF", - "IAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5FbnVtRGVzY3JpcHRvclByb3RvEjgK", - "B3NlcnZpY2UYBiADKAsyJy5nb29nbGUucHJvdG9idWYuU2VydmljZURlc2Ny", - "aXB0b3JQcm90bxI4CglleHRlbnNpb24YByADKAsyJS5nb29nbGUucHJvdG9i", - "dWYuRmllbGREZXNjcmlwdG9yUHJvdG8SLQoHb3B0aW9ucxgIIAEoCzIcLmdv", - "b2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxI5ChBzb3VyY2VfY29kZV9pbmZv", - "GAkgASgLMh8uZ29vZ2xlLnByb3RvYnVmLlNvdXJjZUNvZGVJbmZvIqkDCg9E", - "ZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRI0CgVmaWVsZBgCIAMoCzIl", - "Lmdvb2dsZS5wcm90b2J1Zi5GaWVsZERlc2NyaXB0b3JQcm90bxI4CglleHRl", - "bnNpb24YBiADKAsyJS5nb29nbGUucHJvdG9idWYuRmllbGREZXNjcmlwdG9y", - "UHJvdG8SNQoLbmVzdGVkX3R5cGUYAyADKAsyIC5nb29nbGUucHJvdG9idWYu", - "RGVzY3JpcHRvclByb3RvEjcKCWVudW1fdHlwZRgEIAMoCzIkLmdvb2dsZS5w", - "cm90b2J1Zi5FbnVtRGVzY3JpcHRvclByb3RvEkgKD2V4dGVuc2lvbl9yYW5n", - "ZRgFIAMoCzIvLmdvb2dsZS5wcm90b2J1Zi5EZXNjcmlwdG9yUHJvdG8uRXh0", - "ZW5zaW9uUmFuZ2USMAoHb3B0aW9ucxgHIAEoCzIfLmdvb2dsZS5wcm90b2J1", - "Zi5NZXNzYWdlT3B0aW9ucxosCg5FeHRlbnNpb25SYW5nZRINCgVzdGFydBgB", - "IAEoBRILCgNlbmQYAiABKAUilAUKFEZpZWxkRGVzY3JpcHRvclByb3RvEgwK", - "BG5hbWUYASABKAkSDgoGbnVtYmVyGAMgASgFEjoKBWxhYmVsGAQgASgOMisu", - "Z29vZ2xlLnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvLkxhYmVsEjgK", - "BHR5cGUYBSABKA4yKi5nb29nbGUucHJvdG9idWYuRmllbGREZXNjcmlwdG9y", - "UHJvdG8uVHlwZRIRCgl0eXBlX25hbWUYBiABKAkSEAoIZXh0ZW5kZWUYAiAB", - "KAkSFQoNZGVmYXVsdF92YWx1ZRgHIAEoCRIuCgdvcHRpb25zGAggASgLMh0u", - "Z29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucyK2AgoEVHlwZRIPCgtUWVBF", - "X0RPVUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpUWVBFX0lOVDY0EAMSDwoL", - "VFlQRV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUSEAoMVFlQRV9GSVhFRDY0", - "EAYSEAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9CT09MEAgSDwoLVFlQRV9T", - "VFJJTkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQRV9NRVNTQUdFEAsSDgoK", - "VFlQRV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0SDQoJVFlQRV9FTlVNEA4S", - "EQoNVFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJWEVENjQQEBIPCgtUWVBF", - "X1NJTlQzMhAREg8KC1RZUEVfU0lOVDY0EBIiQwoFTGFiZWwSEgoOTEFCRUxf", - "T1BUSU9OQUwQARISCg5MQUJFTF9SRVFVSVJFRBACEhIKDkxBQkVMX1JFUEVB", - "VEVEEAMijAEKE0VudW1EZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRI4", - "CgV2YWx1ZRgCIAMoCzIpLmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVEZXNj", - "cmlwdG9yUHJvdG8SLQoHb3B0aW9ucxgDIAEoCzIcLmdvb2dsZS5wcm90b2J1", - "Zi5FbnVtT3B0aW9ucyJsChhFbnVtVmFsdWVEZXNjcmlwdG9yUHJvdG8SDAoE", - "bmFtZRgBIAEoCRIOCgZudW1iZXIYAiABKAUSMgoHb3B0aW9ucxgDIAEoCzIh", - "Lmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVPcHRpb25zIpABChZTZXJ2aWNl", - "RGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkSNgoGbWV0aG9kGAIgAygL", - "MiYuZ29vZ2xlLnByb3RvYnVmLk1ldGhvZERlc2NyaXB0b3JQcm90bxIwCgdv", - "cHRpb25zGAMgASgLMh8uZ29vZ2xlLnByb3RvYnVmLlNlcnZpY2VPcHRpb25z", - "In8KFU1ldGhvZERlc2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEhIKCmlu", - "cHV0X3R5cGUYAiABKAkSEwoLb3V0cHV0X3R5cGUYAyABKAkSLwoHb3B0aW9u", - "cxgEIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zItUDCgtG", - "aWxlT3B0aW9ucxIUCgxqYXZhX3BhY2thZ2UYASABKAkSHAoUamF2YV9vdXRl", - "cl9jbGFzc25hbWUYCCABKAkSIgoTamF2YV9tdWx0aXBsZV9maWxlcxgKIAEo", - "CDoFZmFsc2USLAodamF2YV9nZW5lcmF0ZV9lcXVhbHNfYW5kX2hhc2gYFCAB", - "KAg6BWZhbHNlEkYKDG9wdGltaXplX2ZvchgJIAEoDjIpLmdvb2dsZS5wcm90", - "b2J1Zi5GaWxlT3B0aW9ucy5PcHRpbWl6ZU1vZGU6BVNQRUVEEiIKE2NjX2dl", - "bmVyaWNfc2VydmljZXMYECABKAg6BWZhbHNlEiQKFWphdmFfZ2VuZXJpY19z", - "ZXJ2aWNlcxgRIAEoCDoFZmFsc2USIgoTcHlfZ2VuZXJpY19zZXJ2aWNlcxgS", - "IAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQu", - "Z29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24iOgoMT3B0aW1p", - "emVNb2RlEgkKBVNQRUVEEAESDQoJQ09ERV9TSVpFEAISEAoMTElURV9SVU5U", - "SU1FEAMqCQjoBxCAgICAAiK4AQoOTWVzc2FnZU9wdGlvbnMSJgoXbWVzc2Fn", - "ZV9zZXRfd2lyZV9mb3JtYXQYASABKAg6BWZhbHNlEi4KH25vX3N0YW5kYXJk", - "X2Rlc2NyaXB0b3JfYWNjZXNzb3IYAiABKAg6BWZhbHNlEkMKFHVuaW50ZXJw", - "cmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVy", - "cHJldGVkT3B0aW9uKgkI6AcQgICAgAIilAIKDEZpZWxkT3B0aW9ucxI6CgVj", - "dHlwZRgBIAEoDjIjLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMuQ1R5", - "cGU6BlNUUklORxIOCgZwYWNrZWQYAiABKAgSGQoKZGVwcmVjYXRlZBgDIAEo", - "CDoFZmFsc2USHAoUZXhwZXJpbWVudGFsX21hcF9rZXkYCSABKAkSQwoUdW5p", - "bnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVu", - "aW50ZXJwcmV0ZWRPcHRpb24iLwoFQ1R5cGUSCgoGU1RSSU5HEAASCAoEQ09S", - "RBABEhAKDFNUUklOR19QSUVDRRACKgkI6AcQgICAgAIiXQoLRW51bU9wdGlv", - "bnMSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnBy", - "b3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiJiChBFbnVt", - "VmFsdWVPcHRpb25zEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIk", - "Lmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQgICA", - "gAIiYAoOU2VydmljZU9wdGlvbnMSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y", - "5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24q", - "CQjoBxCAgICAAiJfCg1NZXRob2RPcHRpb25zEkMKFHVuaW50ZXJwcmV0ZWRf", - "b3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVk", - "T3B0aW9uKgkI6AcQgICAgAIingIKE1VuaW50ZXJwcmV0ZWRPcHRpb24SOwoE", - "bmFtZRgCIAMoCzItLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0", - "aW9uLk5hbWVQYXJ0EhgKEGlkZW50aWZpZXJfdmFsdWUYAyABKAkSGgoScG9z", - "aXRpdmVfaW50X3ZhbHVlGAQgASgEEhoKEm5lZ2F0aXZlX2ludF92YWx1ZRgF", - "IAEoAxIUCgxkb3VibGVfdmFsdWUYBiABKAESFAoMc3RyaW5nX3ZhbHVlGAcg", - "ASgMEhcKD2FnZ3JlZ2F0ZV92YWx1ZRgIIAEoCRozCghOYW1lUGFydBIRCglu", - "YW1lX3BhcnQYASACKAkSFAoMaXNfZXh0ZW5zaW9uGAIgAigIInwKDlNvdXJj", - "ZUNvZGVJbmZvEjoKCGxvY2F0aW9uGAEgAygLMiguZ29vZ2xlLnByb3RvYnVm", - "LlNvdXJjZUNvZGVJbmZvLkxvY2F0aW9uGi4KCExvY2F0aW9uEhAKBHBhdGgY", - "ASADKAVCAhABEhAKBHNwYW4YAiADKAVCAhABQikKE2NvbS5nb29nbGUucHJv", - "dG9idWZCEERlc2NyaXB0b3JQcm90b3NIAQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_FileDescriptorSet__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorSet__Descriptor, - new string[] { "File", }); - internal__static_google_protobuf_FileDescriptorProto__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorProto__Descriptor, - new string[] { "Name", "Package", "Dependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", }); - internal__static_google_protobuf_DescriptorProto__Descriptor = Descriptor.MessageTypes[2]; - internal__static_google_protobuf_DescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto__Descriptor, - new string[] { "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "Options", }); - internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor = internal__static_google_protobuf_DescriptorProto__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor, - new string[] { "Start", "End", }); - internal__static_google_protobuf_FieldDescriptorProto__Descriptor = Descriptor.MessageTypes[3]; - internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "Options", }); - internal__static_google_protobuf_EnumDescriptorProto__Descriptor = Descriptor.MessageTypes[4]; - internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumDescriptorProto__Descriptor, - new string[] { "Name", "Value", "Options", }); - internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor = Descriptor.MessageTypes[5]; - internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Options", }); - internal__static_google_protobuf_ServiceDescriptorProto__Descriptor = Descriptor.MessageTypes[6]; - internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceDescriptorProto__Descriptor, - new string[] { "Name", "Method", "Options", }); - internal__static_google_protobuf_MethodDescriptorProto__Descriptor = Descriptor.MessageTypes[7]; - internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodDescriptorProto__Descriptor, - new string[] { "Name", "InputType", "OutputType", "Options", }); - internal__static_google_protobuf_FileOptions__Descriptor = Descriptor.MessageTypes[8]; - internal__static_google_protobuf_FileOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileOptions__Descriptor, - new string[] { "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "OptimizeFor", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "UninterpretedOption", }); - internal__static_google_protobuf_MessageOptions__Descriptor = Descriptor.MessageTypes[9]; - internal__static_google_protobuf_MessageOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MessageOptions__Descriptor, - new string[] { "MessageSetWireFormat", "NoStandardDescriptorAccessor", "UninterpretedOption", }); - internal__static_google_protobuf_FieldOptions__Descriptor = Descriptor.MessageTypes[10]; - internal__static_google_protobuf_FieldOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldOptions__Descriptor, - new string[] { "Ctype", "Packed", "Deprecated", "ExperimentalMapKey", "UninterpretedOption", }); - internal__static_google_protobuf_EnumOptions__Descriptor = Descriptor.MessageTypes[11]; - internal__static_google_protobuf_EnumOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_EnumValueOptions__Descriptor = Descriptor.MessageTypes[12]; - internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_ServiceOptions__Descriptor = Descriptor.MessageTypes[13]; - internal__static_google_protobuf_ServiceOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_MethodOptions__Descriptor = Descriptor.MessageTypes[14]; - internal__static_google_protobuf_MethodOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_UninterpretedOption__Descriptor = Descriptor.MessageTypes[15]; - internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption__Descriptor, - new string[] { "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue", }); - internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor = internal__static_google_protobuf_UninterpretedOption__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor, - new string[] { "NamePart_", "IsExtension", }); - internal__static_google_protobuf_SourceCodeInfo__Descriptor = Descriptor.MessageTypes[16]; - internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo__Descriptor, - new string[] { "Location", }); - internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor = internal__static_google_protobuf_SourceCodeInfo__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor, - new string[] { "Path", "Span", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileDescriptorSet : pb::GeneratedMessage { - private FileDescriptorSet() { } - private static readonly FileDescriptorSet defaultInstance = new FileDescriptorSet().MakeReadOnly(); - private static readonly string[] _fileDescriptorSetFieldNames = new string[] { "file" }; - private static readonly uint[] _fileDescriptorSetFieldTags = new uint[] { 10 }; - public static FileDescriptorSet DefaultInstance { - get { return defaultInstance; } - } - - public override FileDescriptorSet DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FileDescriptorSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; } - } - - public const int FileFieldNumber = 1; - private pbc::PopsicleList file_ = new pbc::PopsicleList(); - public scg::IList FileList { - get { return file_; } - } - public int FileCount { - get { return file_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { - return file_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fileDescriptorSetFieldNames; - if (file_.Count > 0) { - output.WriteMessageArray(1, field_names[0], file_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FileDescriptorSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FileDescriptorSet MakeReadOnly() { - file_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileDescriptorSet prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FileDescriptorSet cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FileDescriptorSet result; - - private FileDescriptorSet PrepareBuilder() { - if (resultIsReadOnly) { - FileDescriptorSet original = result; - result = new FileDescriptorSet(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FileDescriptorSet MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.Descriptor; } - } - - public override FileDescriptorSet DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance; } - } - - public override FileDescriptorSet BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileDescriptorSet) { - return MergeFrom((FileDescriptorSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileDescriptorSet other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance) return this; - PrepareBuilder(); - if (other.file_.Count != 0) { - result.file_.Add(other.file_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileDescriptorSetFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileDescriptorSetFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.file_, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList FileList { - get { return PrepareBuilder().file_; } - } - public int FileCount { - get { return result.FileCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { - return result.GetFile(index); - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_[index] = value; - return this; - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_[index] = builderForValue.Build(); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_.Add(value); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFile(scg::IEnumerable values) { - PrepareBuilder(); - result.file_.Add(values); - return this; - } - public Builder ClearFile() { - PrepareBuilder(); - result.file_.Clear(); - return this; - } - } - static FileDescriptorSet() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileDescriptorProto : pb::GeneratedMessage { - private FileDescriptorProto() { } - private static readonly FileDescriptorProto defaultInstance = new FileDescriptorProto().MakeReadOnly(); - private static readonly string[] _fileDescriptorProtoFieldNames = new string[] { "dependency", "enum_type", "extension", "message_type", "name", "options", "package", "service", "source_code_info" }; - private static readonly uint[] _fileDescriptorProtoFieldTags = new uint[] { 26, 42, 58, 34, 10, 66, 18, 50, 74 }; - public static FileDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override FileDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FileDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int PackageFieldNumber = 2; - private bool hasPackage; - private string package_ = ""; - public bool HasPackage { - get { return hasPackage; } - } - public string Package { - get { return package_; } - } - - public const int DependencyFieldNumber = 3; - private pbc::PopsicleList dependency_ = new pbc::PopsicleList(); - public scg::IList DependencyList { - get { return pbc::Lists.AsReadOnly(dependency_); } - } - public int DependencyCount { - get { return dependency_.Count; } - } - public string GetDependency(int index) { - return dependency_[index]; - } - - public const int MessageTypeFieldNumber = 4; - private pbc::PopsicleList messageType_ = new pbc::PopsicleList(); - public scg::IList MessageTypeList { - get { return messageType_; } - } - public int MessageTypeCount { - get { return messageType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { - return messageType_[index]; - } - - public const int EnumTypeFieldNumber = 5; - private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); - public scg::IList EnumTypeList { - get { return enumType_; } - } - public int EnumTypeCount { - get { return enumType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return enumType_[index]; - } - - public const int ServiceFieldNumber = 6; - private pbc::PopsicleList service_ = new pbc::PopsicleList(); - public scg::IList ServiceList { - get { return service_; } - } - public int ServiceCount { - get { return service_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { - return service_[index]; - } - - public const int ExtensionFieldNumber = 7; - private pbc::PopsicleList extension_ = new pbc::PopsicleList(); - public scg::IList ExtensionList { - get { return extension_; } - } - public int ExtensionCount { - get { return extension_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return extension_[index]; - } - - public const int OptionsFieldNumber = 8; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } - } - - public const int SourceCodeInfoFieldNumber = 9; - private bool hasSourceCodeInfo; - private global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo sourceCodeInfo_; - public bool HasSourceCodeInfo { - get { return hasSourceCodeInfo; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo SourceCodeInfo { - get { return sourceCodeInfo_ ?? global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fileDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[4], Name); - } - if (hasPackage) { - output.WriteString(2, field_names[6], Package); - } - if (dependency_.Count > 0) { - output.WriteStringArray(3, field_names[0], dependency_); - } - if (messageType_.Count > 0) { - output.WriteMessageArray(4, field_names[3], messageType_); - } - if (enumType_.Count > 0) { - output.WriteMessageArray(5, field_names[1], enumType_); - } - if (service_.Count > 0) { - output.WriteMessageArray(6, field_names[7], service_); - } - if (extension_.Count > 0) { - output.WriteMessageArray(7, field_names[2], extension_); - } - if (hasOptions) { - output.WriteMessage(8, field_names[5], Options); - } - if (hasSourceCodeInfo) { - output.WriteMessage(9, field_names[8], SourceCodeInfo); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasPackage) { - size += pb::CodedOutputStream.ComputeStringSize(2, Package); - } - { - int dataSize = 0; - foreach (string element in DependencyList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * dependency_.Count; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - size += pb::CodedOutputStream.ComputeMessageSize(7, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Options); - } - if (hasSourceCodeInfo) { - size += pb::CodedOutputStream.ComputeMessageSize(9, SourceCodeInfo); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FileDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FileDescriptorProto MakeReadOnly() { - dependency_.MakeReadOnly(); - messageType_.MakeReadOnly(); - enumType_.MakeReadOnly(); - service_.MakeReadOnly(); - extension_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FileDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FileDescriptorProto result; - - private FileDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - FileDescriptorProto original = result; - result = new FileDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FileDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Descriptor; } - } - - public override FileDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance; } - } - - public override FileDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileDescriptorProto) { - return MergeFrom((FileDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasPackage) { - Package = other.Package; - } - if (other.dependency_.Count != 0) { - result.dependency_.Add(other.dependency_); - } - if (other.messageType_.Count != 0) { - result.messageType_.Add(other.messageType_); - } - if (other.enumType_.Count != 0) { - result.enumType_.Add(other.enumType_); - } - if (other.service_.Count != 0) { - result.service_.Add(other.service_); - } - if (other.extension_.Count != 0) { - result.extension_.Add(other.extension_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - if (other.HasSourceCodeInfo) { - MergeSourceCodeInfo(other.SourceCodeInfo); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasPackage = input.ReadString(ref result.package_); - break; - } - case 26: { - input.ReadStringArray(tag, field_name, result.dependency_); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.messageType_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 42: { - input.ReadMessageArray(tag, field_name, result.enumType_, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 50: { - input.ReadMessageArray(tag, field_name, result.service_, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 58: { - input.ReadMessageArray(tag, field_name, result.extension_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 66: { - global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - case 74: { - global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.CreateBuilder(); - if (result.hasSourceCodeInfo) { - subBuilder.MergeFrom(SourceCodeInfo); - } - input.ReadMessage(subBuilder, extensionRegistry); - SourceCodeInfo = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasPackage { - get { return result.hasPackage; } - } - public string Package { - get { return result.Package; } - set { SetPackage(value); } - } - public Builder SetPackage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPackage = true; - result.package_ = value; - return this; - } - public Builder ClearPackage() { - PrepareBuilder(); - result.hasPackage = false; - result.package_ = ""; - return this; - } - - public pbc::IPopsicleList DependencyList { - get { return PrepareBuilder().dependency_; } - } - public int DependencyCount { - get { return result.DependencyCount; } - } - public string GetDependency(int index) { - return result.GetDependency(index); - } - public Builder SetDependency(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.dependency_[index] = value; - return this; - } - public Builder AddDependency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.dependency_.Add(value); - return this; - } - public Builder AddRangeDependency(scg::IEnumerable values) { - PrepareBuilder(); - result.dependency_.Add(values); - return this; - } - public Builder ClearDependency() { - PrepareBuilder(); - result.dependency_.Clear(); - return this; - } - - public pbc::IPopsicleList MessageTypeList { - get { return PrepareBuilder().messageType_; } - } - public int MessageTypeCount { - get { return result.MessageTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { - return result.GetMessageType(index); - } - public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageType_[index] = value; - return this; - } - public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageType_[index] = builderForValue.Build(); - return this; - } - public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageType_.Add(value); - return this; - } - public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMessageType(scg::IEnumerable values) { - PrepareBuilder(); - result.messageType_.Add(values); - return this; - } - public Builder ClearMessageType() { - PrepareBuilder(); - result.messageType_.Clear(); - return this; - } - - public pbc::IPopsicleList EnumTypeList { - get { return PrepareBuilder().enumType_; } - } - public int EnumTypeCount { - get { return result.EnumTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return result.GetEnumType(index); - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_[index] = value; - return this; - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_[index] = builderForValue.Build(); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_.Add(value); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeEnumType(scg::IEnumerable values) { - PrepareBuilder(); - result.enumType_.Add(values); - return this; - } - public Builder ClearEnumType() { - PrepareBuilder(); - result.enumType_.Clear(); - return this; - } - - public pbc::IPopsicleList ServiceList { - get { return PrepareBuilder().service_; } - } - public int ServiceCount { - get { return result.ServiceCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { - return result.GetService(index); - } - public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.service_[index] = value; - return this; - } - public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.service_[index] = builderForValue.Build(); - return this; - } - public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.service_.Add(value); - return this; - } - public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.service_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeService(scg::IEnumerable values) { - PrepareBuilder(); - result.service_.Add(values); - return this; - } - public Builder ClearService() { - PrepareBuilder(); - result.service_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionList { - get { return PrepareBuilder().extension_; } - } - public int ExtensionCount { - get { return result.ExtensionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return result.GetExtension(index); - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_[index] = value; - return this; - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_.Add(value); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.extension_.Add(values); - return this; - } - public Builder ClearExtension() { - PrepareBuilder(); - result.extension_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - - public bool HasSourceCodeInfo { - get { return result.hasSourceCodeInfo; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo SourceCodeInfo { - get { return result.SourceCodeInfo; } - set { SetSourceCodeInfo(value); } - } - public Builder SetSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasSourceCodeInfo = true; - result.sourceCodeInfo_ = value; - return this; - } - public Builder SetSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasSourceCodeInfo = true; - result.sourceCodeInfo_ = builderForValue.Build(); - return this; - } - public Builder MergeSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasSourceCodeInfo && - result.sourceCodeInfo_ != global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance) { - result.sourceCodeInfo_ = global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.CreateBuilder(result.sourceCodeInfo_).MergeFrom(value).BuildPartial(); - } else { - result.sourceCodeInfo_ = value; - } - result.hasSourceCodeInfo = true; - return this; - } - public Builder ClearSourceCodeInfo() { - PrepareBuilder(); - result.hasSourceCodeInfo = false; - result.sourceCodeInfo_ = null; - return this; - } - } - static FileDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DescriptorProto : pb::GeneratedMessage { - private DescriptorProto() { } - private static readonly DescriptorProto defaultInstance = new DescriptorProto().MakeReadOnly(); - private static readonly string[] _descriptorProtoFieldNames = new string[] { "enum_type", "extension", "extension_range", "field", "name", "nested_type", "options" }; - private static readonly uint[] _descriptorProtoFieldTags = new uint[] { 34, 50, 42, 18, 10, 26, 58 }; - public static DescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override DescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ExtensionRange : pb::GeneratedMessage { - private ExtensionRange() { } - private static readonly ExtensionRange defaultInstance = new ExtensionRange().MakeReadOnly(); - private static readonly string[] _extensionRangeFieldNames = new string[] { "end", "start" }; - private static readonly uint[] _extensionRangeFieldTags = new uint[] { 16, 8 }; - public static ExtensionRange DefaultInstance { - get { return defaultInstance; } - } - - public override ExtensionRange DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ExtensionRange ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; } - } - - public const int StartFieldNumber = 1; - private bool hasStart; - private int start_; - public bool HasStart { - get { return hasStart; } - } - public int Start { - get { return start_; } - } - - public const int EndFieldNumber = 2; - private bool hasEnd; - private int end_; - public bool HasEnd { - get { return hasEnd; } - } - public int End { - get { return end_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _extensionRangeFieldNames; - if (hasStart) { - output.WriteInt32(1, field_names[1], Start); - } - if (hasEnd) { - output.WriteInt32(2, field_names[0], End); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasStart) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Start); - } - if (hasEnd) { - size += pb::CodedOutputStream.ComputeInt32Size(2, End); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ExtensionRange ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExtensionRange ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExtensionRange ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ExtensionRange MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ExtensionRange prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ExtensionRange cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ExtensionRange result; - - private ExtensionRange PrepareBuilder() { - if (resultIsReadOnly) { - ExtensionRange original = result; - result = new ExtensionRange(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ExtensionRange MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Descriptor; } - } - - public override ExtensionRange DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance; } - } - - public override ExtensionRange BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ExtensionRange) { - return MergeFrom((ExtensionRange) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ExtensionRange other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasStart) { - Start = other.Start; - } - if (other.HasEnd) { - End = other.End; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_extensionRangeFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _extensionRangeFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasStart = input.ReadInt32(ref result.start_); - break; - } - case 16: { - result.hasEnd = input.ReadInt32(ref result.end_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasStart { - get { return result.hasStart; } - } - public int Start { - get { return result.Start; } - set { SetStart(value); } - } - public Builder SetStart(int value) { - PrepareBuilder(); - result.hasStart = true; - result.start_ = value; - return this; - } - public Builder ClearStart() { - PrepareBuilder(); - result.hasStart = false; - result.start_ = 0; - return this; - } - - public bool HasEnd { - get { return result.hasEnd; } - } - public int End { - get { return result.End; } - set { SetEnd(value); } - } - public Builder SetEnd(int value) { - PrepareBuilder(); - result.hasEnd = true; - result.end_ = value; - return this; - } - public Builder ClearEnd() { - PrepareBuilder(); - result.hasEnd = false; - result.end_ = 0; - return this; - } - } - static ExtensionRange() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int FieldFieldNumber = 2; - private pbc::PopsicleList field_ = new pbc::PopsicleList(); - public scg::IList FieldList { - get { return field_; } - } - public int FieldCount { - get { return field_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { - return field_[index]; - } - - public const int ExtensionFieldNumber = 6; - private pbc::PopsicleList extension_ = new pbc::PopsicleList(); - public scg::IList ExtensionList { - get { return extension_; } - } - public int ExtensionCount { - get { return extension_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return extension_[index]; - } - - public const int NestedTypeFieldNumber = 3; - private pbc::PopsicleList nestedType_ = new pbc::PopsicleList(); - public scg::IList NestedTypeList { - get { return nestedType_; } - } - public int NestedTypeCount { - get { return nestedType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { - return nestedType_[index]; - } - - public const int EnumTypeFieldNumber = 4; - private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); - public scg::IList EnumTypeList { - get { return enumType_; } - } - public int EnumTypeCount { - get { return enumType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return enumType_[index]; - } - - public const int ExtensionRangeFieldNumber = 5; - private pbc::PopsicleList extensionRange_ = new pbc::PopsicleList(); - public scg::IList ExtensionRangeList { - get { return extensionRange_; } - } - public int ExtensionRangeCount { - get { return extensionRange_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { - return extensionRange_[index]; - } - - public const int OptionsFieldNumber = 7; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _descriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[4], Name); - } - if (field_.Count > 0) { - output.WriteMessageArray(2, field_names[3], field_); - } - if (nestedType_.Count > 0) { - output.WriteMessageArray(3, field_names[5], nestedType_); - } - if (enumType_.Count > 0) { - output.WriteMessageArray(4, field_names[0], enumType_); - } - if (extensionRange_.Count > 0) { - output.WriteMessageArray(5, field_names[2], extensionRange_); - } - if (extension_.Count > 0) { - output.WriteMessageArray(6, field_names[1], extension_); - } - if (hasOptions) { - output.WriteMessage(7, field_names[6], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange element in ExtensionRangeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(7, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DescriptorProto MakeReadOnly() { - field_.MakeReadOnly(); - extension_.MakeReadOnly(); - nestedType_.MakeReadOnly(); - enumType_.MakeReadOnly(); - extensionRange_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DescriptorProto result; - - private DescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - DescriptorProto original = result; - result = new DescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Descriptor; } - } - - public override DescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance; } - } - - public override DescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DescriptorProto) { - return MergeFrom((DescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.field_.Count != 0) { - result.field_.Add(other.field_); - } - if (other.extension_.Count != 0) { - result.extension_.Add(other.extension_); - } - if (other.nestedType_.Count != 0) { - result.nestedType_.Add(other.nestedType_); - } - if (other.enumType_.Count != 0) { - result.enumType_.Add(other.enumType_); - } - if (other.extensionRange_.Count != 0) { - result.extensionRange_.Add(other.extensionRange_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_descriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _descriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.field_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 26: { - input.ReadMessageArray(tag, field_name, result.nestedType_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.enumType_, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 42: { - input.ReadMessageArray(tag, field_name, result.extensionRange_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance, extensionRegistry); - break; - } - case 50: { - input.ReadMessageArray(tag, field_name, result.extension_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 58: { - global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList FieldList { - get { return PrepareBuilder().field_; } - } - public int FieldCount { - get { return result.FieldCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { - return result.GetField(index); - } - public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field_[index] = value; - return this; - } - public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.field_[index] = builderForValue.Build(); - return this; - } - public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field_.Add(value); - return this; - } - public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.field_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeField(scg::IEnumerable values) { - PrepareBuilder(); - result.field_.Add(values); - return this; - } - public Builder ClearField() { - PrepareBuilder(); - result.field_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionList { - get { return PrepareBuilder().extension_; } - } - public int ExtensionCount { - get { return result.ExtensionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return result.GetExtension(index); - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_[index] = value; - return this; - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_.Add(value); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.extension_.Add(values); - return this; - } - public Builder ClearExtension() { - PrepareBuilder(); - result.extension_.Clear(); - return this; - } - - public pbc::IPopsicleList NestedTypeList { - get { return PrepareBuilder().nestedType_; } - } - public int NestedTypeCount { - get { return result.NestedTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { - return result.GetNestedType(index); - } - public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedType_[index] = value; - return this; - } - public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedType_[index] = builderForValue.Build(); - return this; - } - public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedType_.Add(value); - return this; - } - public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeNestedType(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedType_.Add(values); - return this; - } - public Builder ClearNestedType() { - PrepareBuilder(); - result.nestedType_.Clear(); - return this; - } - - public pbc::IPopsicleList EnumTypeList { - get { return PrepareBuilder().enumType_; } - } - public int EnumTypeCount { - get { return result.EnumTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return result.GetEnumType(index); - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_[index] = value; - return this; - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_[index] = builderForValue.Build(); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_.Add(value); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeEnumType(scg::IEnumerable values) { - PrepareBuilder(); - result.enumType_.Add(values); - return this; - } - public Builder ClearEnumType() { - PrepareBuilder(); - result.enumType_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionRangeList { - get { return PrepareBuilder().extensionRange_; } - } - public int ExtensionRangeCount { - get { return result.ExtensionRangeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { - return result.GetExtensionRange(index); - } - public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extensionRange_[index] = value; - return this; - } - public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extensionRange_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extensionRange_.Add(value); - return this; - } - public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extensionRange_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtensionRange(scg::IEnumerable values) { - PrepareBuilder(); - result.extensionRange_.Add(values); - return this; - } - public Builder ClearExtensionRange() { - PrepareBuilder(); - result.extensionRange_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static DescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FieldDescriptorProto : pb::GeneratedMessage { - private FieldDescriptorProto() { } - private static readonly FieldDescriptorProto defaultInstance = new FieldDescriptorProto().MakeReadOnly(); - private static readonly string[] _fieldDescriptorProtoFieldNames = new string[] { "default_value", "extendee", "label", "name", "number", "options", "type", "type_name" }; - private static readonly uint[] _fieldDescriptorProtoFieldTags = new uint[] { 58, 18, 32, 10, 24, 66, 40, 50 }; - public static FieldDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override FieldDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FieldDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18, - } - - public enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3, - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int NumberFieldNumber = 3; - private bool hasNumber; - private int number_; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public const int LabelFieldNumber = 4; - private bool hasLabel; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - public bool HasLabel { - get { return hasLabel; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { - get { return label_; } - } - - public const int TypeFieldNumber = 5; - private bool hasType; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - public bool HasType { - get { return hasType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { - get { return type_; } - } - - public const int TypeNameFieldNumber = 6; - private bool hasTypeName; - private string typeName_ = ""; - public bool HasTypeName { - get { return hasTypeName; } - } - public string TypeName { - get { return typeName_; } - } - - public const int ExtendeeFieldNumber = 2; - private bool hasExtendee; - private string extendee_ = ""; - public bool HasExtendee { - get { return hasExtendee; } - } - public string Extendee { - get { return extendee_; } - } - - public const int DefaultValueFieldNumber = 7; - private bool hasDefaultValue; - private string defaultValue_ = ""; - public bool HasDefaultValue { - get { return hasDefaultValue; } - } - public string DefaultValue { - get { return defaultValue_; } - } - - public const int OptionsFieldNumber = 8; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fieldDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[3], Name); - } - if (hasExtendee) { - output.WriteString(2, field_names[1], Extendee); - } - if (hasNumber) { - output.WriteInt32(3, field_names[4], Number); - } - if (hasLabel) { - output.WriteEnum(4, field_names[2], (int) Label, Label); - } - if (hasType) { - output.WriteEnum(5, field_names[6], (int) Type, Type); - } - if (hasTypeName) { - output.WriteString(6, field_names[7], TypeName); - } - if (hasDefaultValue) { - output.WriteString(7, field_names[0], DefaultValue); - } - if (hasOptions) { - output.WriteMessage(8, field_names[5], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Number); - } - if (hasLabel) { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int) Label); - } - if (hasType) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) Type); - } - if (hasTypeName) { - size += pb::CodedOutputStream.ComputeStringSize(6, TypeName); - } - if (hasExtendee) { - size += pb::CodedOutputStream.ComputeStringSize(2, Extendee); - } - if (hasDefaultValue) { - size += pb::CodedOutputStream.ComputeStringSize(7, DefaultValue); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FieldDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FieldDescriptorProto MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FieldDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FieldDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FieldDescriptorProto result; - - private FieldDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - FieldDescriptorProto original = result; - result = new FieldDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FieldDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Descriptor; } - } - - public override FieldDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance; } - } - - public override FieldDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FieldDescriptorProto) { - return MergeFrom((FieldDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FieldDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasLabel) { - Label = other.Label; - } - if (other.HasType) { - Type = other.Type; - } - if (other.HasTypeName) { - TypeName = other.TypeName; - } - if (other.HasExtendee) { - Extendee = other.Extendee; - } - if (other.HasDefaultValue) { - DefaultValue = other.DefaultValue; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fieldDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fieldDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasExtendee = input.ReadString(ref result.extendee_); - break; - } - case 24: { - result.hasNumber = input.ReadInt32(ref result.number_); - break; - } - case 32: { - object unknown; - if(input.ReadEnum(ref result.label_, out unknown)) { - result.hasLabel = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong)(int)unknown); - } - break; - } - case 40: { - object unknown; - if(input.ReadEnum(ref result.type_, out unknown)) { - result.hasType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong)(int)unknown); - } - break; - } - case 50: { - result.hasTypeName = input.ReadString(ref result.typeName_); - break; - } - case 58: { - result.hasDefaultValue = input.ReadString(ref result.defaultValue_); - break; - } - case 66: { - global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasNumber { - get { return result.hasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0; - return this; - } - - public bool HasLabel { - get { return result.hasLabel; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { - get { return result.Label; } - set { SetLabel(value); } - } - public Builder SetLabel(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label value) { - PrepareBuilder(); - result.hasLabel = true; - result.label_ = value; - return this; - } - public Builder ClearLabel() { - PrepareBuilder(); - result.hasLabel = false; - result.label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - return this; - } - - public bool HasType { - get { return result.hasType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type value) { - PrepareBuilder(); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - PrepareBuilder(); - result.hasType = false; - result.type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - return this; - } - - public bool HasTypeName { - get { return result.hasTypeName; } - } - public string TypeName { - get { return result.TypeName; } - set { SetTypeName(value); } - } - public Builder SetTypeName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasTypeName = true; - result.typeName_ = value; - return this; - } - public Builder ClearTypeName() { - PrepareBuilder(); - result.hasTypeName = false; - result.typeName_ = ""; - return this; - } - - public bool HasExtendee { - get { return result.hasExtendee; } - } - public string Extendee { - get { return result.Extendee; } - set { SetExtendee(value); } - } - public Builder SetExtendee(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasExtendee = true; - result.extendee_ = value; - return this; - } - public Builder ClearExtendee() { - PrepareBuilder(); - result.hasExtendee = false; - result.extendee_ = ""; - return this; - } - - public bool HasDefaultValue { - get { return result.hasDefaultValue; } - } - public string DefaultValue { - get { return result.DefaultValue; } - set { SetDefaultValue(value); } - } - public Builder SetDefaultValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultValue = true; - result.defaultValue_ = value; - return this; - } - public Builder ClearDefaultValue() { - PrepareBuilder(); - result.hasDefaultValue = false; - result.defaultValue_ = ""; - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static FieldDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumDescriptorProto : pb::GeneratedMessage { - private EnumDescriptorProto() { } - private static readonly EnumDescriptorProto defaultInstance = new EnumDescriptorProto().MakeReadOnly(); - private static readonly string[] _enumDescriptorProtoFieldNames = new string[] { "name", "options", "value" }; - private static readonly uint[] _enumDescriptorProtoFieldTags = new uint[] { 10, 26, 18 }; - public static EnumDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override EnumDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int ValueFieldNumber = 2; - private pbc::PopsicleList value_ = new pbc::PopsicleList(); - public scg::IList ValueList { - get { return value_; } - } - public int ValueCount { - get { return value_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { - return value_[index]; - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[0], Name); - } - if (value_.Count > 0) { - output.WriteMessageArray(2, field_names[2], value_); - } - if (hasOptions) { - output.WriteMessage(3, field_names[1], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumDescriptorProto MakeReadOnly() { - value_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumDescriptorProto result; - - private EnumDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - EnumDescriptorProto original = result; - result = new EnumDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Descriptor; } - } - - public override EnumDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance; } - } - - public override EnumDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumDescriptorProto) { - return MergeFrom((EnumDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.value_.Count != 0) { - result.value_.Add(other.value_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.value_, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList ValueList { - get { return PrepareBuilder().value_; } - } - public int ValueCount { - get { return result.ValueCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { - return result.GetValue(index); - } - public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.value_[index] = value; - return this; - } - public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.value_[index] = builderForValue.Build(); - return this; - } - public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.value_.Add(value); - return this; - } - public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.value_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeValue(scg::IEnumerable values) { - PrepareBuilder(); - result.value_.Add(values); - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.value_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static EnumDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumValueDescriptorProto : pb::GeneratedMessage { - private EnumValueDescriptorProto() { } - private static readonly EnumValueDescriptorProto defaultInstance = new EnumValueDescriptorProto().MakeReadOnly(); - private static readonly string[] _enumValueDescriptorProtoFieldNames = new string[] { "name", "number", "options" }; - private static readonly uint[] _enumValueDescriptorProtoFieldTags = new uint[] { 10, 16, 26 }; - public static EnumValueDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override EnumValueDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumValueDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int NumberFieldNumber = 2; - private bool hasNumber; - private int number_; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumValueDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[0], Name); - } - if (hasNumber) { - output.WriteInt32(2, field_names[1], Number); - } - if (hasOptions) { - output.WriteMessage(3, field_names[2], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Number); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumValueDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumValueDescriptorProto MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumValueDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumValueDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumValueDescriptorProto result; - - private EnumValueDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - EnumValueDescriptorProto original = result; - result = new EnumValueDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumValueDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Descriptor; } - } - - public override EnumValueDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance; } - } - - public override EnumValueDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumValueDescriptorProto) { - return MergeFrom((EnumValueDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumValueDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumValueDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumValueDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 16: { - result.hasNumber = input.ReadInt32(ref result.number_); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasNumber { - get { return result.hasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0; - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static EnumValueDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ServiceDescriptorProto : pb::GeneratedMessage { - private ServiceDescriptorProto() { } - private static readonly ServiceDescriptorProto defaultInstance = new ServiceDescriptorProto().MakeReadOnly(); - private static readonly string[] _serviceDescriptorProtoFieldNames = new string[] { "method", "name", "options" }; - private static readonly uint[] _serviceDescriptorProtoFieldTags = new uint[] { 18, 10, 26 }; - public static ServiceDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ServiceDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int MethodFieldNumber = 2; - private pbc::PopsicleList method_ = new pbc::PopsicleList(); - public scg::IList MethodList { - get { return method_; } - } - public int MethodCount { - get { return method_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { - return method_[index]; - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _serviceDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[1], Name); - } - if (method_.Count > 0) { - output.WriteMessageArray(2, field_names[0], method_); - } - if (hasOptions) { - output.WriteMessage(3, field_names[2], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ServiceDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ServiceDescriptorProto MakeReadOnly() { - method_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ServiceDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ServiceDescriptorProto result; - - private ServiceDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - ServiceDescriptorProto original = result; - result = new ServiceDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ServiceDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Descriptor; } - } - - public override ServiceDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance; } - } - - public override ServiceDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceDescriptorProto) { - return MergeFrom((ServiceDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.method_.Count != 0) { - result.method_.Add(other.method_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_serviceDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _serviceDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.method_, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList MethodList { - get { return PrepareBuilder().method_; } - } - public int MethodCount { - get { return result.MethodCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { - return result.GetMethod(index); - } - public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.method_[index] = value; - return this; - } - public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.method_[index] = builderForValue.Build(); - return this; - } - public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.method_.Add(value); - return this; - } - public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.method_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMethod(scg::IEnumerable values) { - PrepareBuilder(); - result.method_.Add(values); - return this; - } - public Builder ClearMethod() { - PrepareBuilder(); - result.method_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static ServiceDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MethodDescriptorProto : pb::GeneratedMessage { - private MethodDescriptorProto() { } - private static readonly MethodDescriptorProto defaultInstance = new MethodDescriptorProto().MakeReadOnly(); - private static readonly string[] _methodDescriptorProtoFieldNames = new string[] { "input_type", "name", "options", "output_type" }; - private static readonly uint[] _methodDescriptorProtoFieldTags = new uint[] { 18, 10, 34, 26 }; - public static MethodDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override MethodDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MethodDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int InputTypeFieldNumber = 2; - private bool hasInputType; - private string inputType_ = ""; - public bool HasInputType { - get { return hasInputType; } - } - public string InputType { - get { return inputType_; } - } - - public const int OutputTypeFieldNumber = 3; - private bool hasOutputType; - private string outputType_ = ""; - public bool HasOutputType { - get { return hasOutputType; } - } - public string OutputType { - get { return outputType_; } - } - - public const int OptionsFieldNumber = 4; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _methodDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[1], Name); - } - if (hasInputType) { - output.WriteString(2, field_names[0], InputType); - } - if (hasOutputType) { - output.WriteString(3, field_names[3], OutputType); - } - if (hasOptions) { - output.WriteMessage(4, field_names[2], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasInputType) { - size += pb::CodedOutputStream.ComputeStringSize(2, InputType); - } - if (hasOutputType) { - size += pb::CodedOutputStream.ComputeStringSize(3, OutputType); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(4, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MethodDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MethodDescriptorProto MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MethodDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MethodDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MethodDescriptorProto result; - - private MethodDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - MethodDescriptorProto original = result; - result = new MethodDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MethodDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Descriptor; } - } - - public override MethodDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance; } - } - - public override MethodDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MethodDescriptorProto) { - return MergeFrom((MethodDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MethodDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasInputType) { - InputType = other.InputType; - } - if (other.HasOutputType) { - OutputType = other.OutputType; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_methodDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _methodDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasInputType = input.ReadString(ref result.inputType_); - break; - } - case 26: { - result.hasOutputType = input.ReadString(ref result.outputType_); - break; - } - case 34: { - global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasInputType { - get { return result.hasInputType; } - } - public string InputType { - get { return result.InputType; } - set { SetInputType(value); } - } - public Builder SetInputType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasInputType = true; - result.inputType_ = value; - return this; - } - public Builder ClearInputType() { - PrepareBuilder(); - result.hasInputType = false; - result.inputType_ = ""; - return this; - } - - public bool HasOutputType { - get { return result.hasOutputType; } - } - public string OutputType { - get { return result.OutputType; } - set { SetOutputType(value); } - } - public Builder SetOutputType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOutputType = true; - result.outputType_ = value; - return this; - } - public Builder ClearOutputType() { - PrepareBuilder(); - result.hasOutputType = false; - result.outputType_ = ""; - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static MethodDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileOptions : pb::ExtendableMessage { - private FileOptions() { } - private static readonly FileOptions defaultInstance = new FileOptions().MakeReadOnly(); - private static readonly string[] _fileOptionsFieldNames = new string[] { "cc_generic_services", "java_generate_equals_and_hash", "java_generic_services", "java_multiple_files", "java_outer_classname", "java_package", "optimize_for", "py_generic_services", "uninterpreted_option" }; - private static readonly uint[] _fileOptionsFieldTags = new uint[] { 128, 160, 136, 80, 66, 10, 72, 144, 7994 }; - public static FileOptions DefaultInstance { - get { return defaultInstance; } - } - - public override FileOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FileOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3, - } - - } - #endregion - - public const int JavaPackageFieldNumber = 1; - private bool hasJavaPackage; - private string javaPackage_ = ""; - public bool HasJavaPackage { - get { return hasJavaPackage; } - } - public string JavaPackage { - get { return javaPackage_; } - } - - public const int JavaOuterClassnameFieldNumber = 8; - private bool hasJavaOuterClassname; - private string javaOuterClassname_ = ""; - public bool HasJavaOuterClassname { - get { return hasJavaOuterClassname; } - } - public string JavaOuterClassname { - get { return javaOuterClassname_; } - } - - public const int JavaMultipleFilesFieldNumber = 10; - private bool hasJavaMultipleFiles; - private bool javaMultipleFiles_; - public bool HasJavaMultipleFiles { - get { return hasJavaMultipleFiles; } - } - public bool JavaMultipleFiles { - get { return javaMultipleFiles_; } - } - - public const int JavaGenerateEqualsAndHashFieldNumber = 20; - private bool hasJavaGenerateEqualsAndHash; - private bool javaGenerateEqualsAndHash_; - public bool HasJavaGenerateEqualsAndHash { - get { return hasJavaGenerateEqualsAndHash; } - } - public bool JavaGenerateEqualsAndHash { - get { return javaGenerateEqualsAndHash_; } - } - - public const int OptimizeForFieldNumber = 9; - private bool hasOptimizeFor; - private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; - public bool HasOptimizeFor { - get { return hasOptimizeFor; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { - get { return optimizeFor_; } - } - - public const int CcGenericServicesFieldNumber = 16; - private bool hasCcGenericServices; - private bool ccGenericServices_; - public bool HasCcGenericServices { - get { return hasCcGenericServices; } - } - public bool CcGenericServices { - get { return ccGenericServices_; } - } - - public const int JavaGenericServicesFieldNumber = 17; - private bool hasJavaGenericServices; - private bool javaGenericServices_; - public bool HasJavaGenericServices { - get { return hasJavaGenericServices; } - } - public bool JavaGenericServices { - get { return javaGenericServices_; } - } - - public const int PyGenericServicesFieldNumber = 18; - private bool hasPyGenericServices; - private bool pyGenericServices_; - public bool HasPyGenericServices { - get { return hasPyGenericServices; } - } - public bool PyGenericServices { - get { return pyGenericServices_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fileOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasJavaPackage) { - output.WriteString(1, field_names[5], JavaPackage); - } - if (hasJavaOuterClassname) { - output.WriteString(8, field_names[4], JavaOuterClassname); - } - if (hasOptimizeFor) { - output.WriteEnum(9, field_names[6], (int) OptimizeFor, OptimizeFor); - } - if (hasJavaMultipleFiles) { - output.WriteBool(10, field_names[3], JavaMultipleFiles); - } - if (hasCcGenericServices) { - output.WriteBool(16, field_names[0], CcGenericServices); - } - if (hasJavaGenericServices) { - output.WriteBool(17, field_names[2], JavaGenericServices); - } - if (hasPyGenericServices) { - output.WriteBool(18, field_names[7], PyGenericServices); - } - if (hasJavaGenerateEqualsAndHash) { - output.WriteBool(20, field_names[1], JavaGenerateEqualsAndHash); - } - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[8], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasJavaPackage) { - size += pb::CodedOutputStream.ComputeStringSize(1, JavaPackage); - } - if (hasJavaOuterClassname) { - size += pb::CodedOutputStream.ComputeStringSize(8, JavaOuterClassname); - } - if (hasJavaMultipleFiles) { - size += pb::CodedOutputStream.ComputeBoolSize(10, JavaMultipleFiles); - } - if (hasJavaGenerateEqualsAndHash) { - size += pb::CodedOutputStream.ComputeBoolSize(20, JavaGenerateEqualsAndHash); - } - if (hasOptimizeFor) { - size += pb::CodedOutputStream.ComputeEnumSize(9, (int) OptimizeFor); - } - if (hasCcGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(16, CcGenericServices); - } - if (hasJavaGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(17, JavaGenericServices); - } - if (hasPyGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(18, PyGenericServices); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FileOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FileOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FileOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FileOptions result; - - private FileOptions PrepareBuilder() { - if (resultIsReadOnly) { - FileOptions original = result; - result = new FileOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FileOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Descriptor; } - } - - public override FileOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } - } - - public override FileOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileOptions) { - return MergeFrom((FileOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasJavaPackage) { - JavaPackage = other.JavaPackage; - } - if (other.HasJavaOuterClassname) { - JavaOuterClassname = other.JavaOuterClassname; - } - if (other.HasJavaMultipleFiles) { - JavaMultipleFiles = other.JavaMultipleFiles; - } - if (other.HasJavaGenerateEqualsAndHash) { - JavaGenerateEqualsAndHash = other.JavaGenerateEqualsAndHash; - } - if (other.HasOptimizeFor) { - OptimizeFor = other.OptimizeFor; - } - if (other.HasCcGenericServices) { - CcGenericServices = other.CcGenericServices; - } - if (other.HasJavaGenericServices) { - JavaGenericServices = other.JavaGenericServices; - } - if (other.HasPyGenericServices) { - PyGenericServices = other.PyGenericServices; - } - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasJavaPackage = input.ReadString(ref result.javaPackage_); - break; - } - case 66: { - result.hasJavaOuterClassname = input.ReadString(ref result.javaOuterClassname_); - break; - } - case 72: { - object unknown; - if(input.ReadEnum(ref result.optimizeFor_, out unknown)) { - result.hasOptimizeFor = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(9, (ulong)(int)unknown); - } - break; - } - case 80: { - result.hasJavaMultipleFiles = input.ReadBool(ref result.javaMultipleFiles_); - break; - } - case 128: { - result.hasCcGenericServices = input.ReadBool(ref result.ccGenericServices_); - break; - } - case 136: { - result.hasJavaGenericServices = input.ReadBool(ref result.javaGenericServices_); - break; - } - case 144: { - result.hasPyGenericServices = input.ReadBool(ref result.pyGenericServices_); - break; - } - case 160: { - result.hasJavaGenerateEqualsAndHash = input.ReadBool(ref result.javaGenerateEqualsAndHash_); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasJavaPackage { - get { return result.hasJavaPackage; } - } - public string JavaPackage { - get { return result.JavaPackage; } - set { SetJavaPackage(value); } - } - public Builder SetJavaPackage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasJavaPackage = true; - result.javaPackage_ = value; - return this; - } - public Builder ClearJavaPackage() { - PrepareBuilder(); - result.hasJavaPackage = false; - result.javaPackage_ = ""; - return this; - } - - public bool HasJavaOuterClassname { - get { return result.hasJavaOuterClassname; } - } - public string JavaOuterClassname { - get { return result.JavaOuterClassname; } - set { SetJavaOuterClassname(value); } - } - public Builder SetJavaOuterClassname(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasJavaOuterClassname = true; - result.javaOuterClassname_ = value; - return this; - } - public Builder ClearJavaOuterClassname() { - PrepareBuilder(); - result.hasJavaOuterClassname = false; - result.javaOuterClassname_ = ""; - return this; - } - - public bool HasJavaMultipleFiles { - get { return result.hasJavaMultipleFiles; } - } - public bool JavaMultipleFiles { - get { return result.JavaMultipleFiles; } - set { SetJavaMultipleFiles(value); } - } - public Builder SetJavaMultipleFiles(bool value) { - PrepareBuilder(); - result.hasJavaMultipleFiles = true; - result.javaMultipleFiles_ = value; - return this; - } - public Builder ClearJavaMultipleFiles() { - PrepareBuilder(); - result.hasJavaMultipleFiles = false; - result.javaMultipleFiles_ = false; - return this; - } - - public bool HasJavaGenerateEqualsAndHash { - get { return result.hasJavaGenerateEqualsAndHash; } - } - public bool JavaGenerateEqualsAndHash { - get { return result.JavaGenerateEqualsAndHash; } - set { SetJavaGenerateEqualsAndHash(value); } - } - public Builder SetJavaGenerateEqualsAndHash(bool value) { - PrepareBuilder(); - result.hasJavaGenerateEqualsAndHash = true; - result.javaGenerateEqualsAndHash_ = value; - return this; - } - public Builder ClearJavaGenerateEqualsAndHash() { - PrepareBuilder(); - result.hasJavaGenerateEqualsAndHash = false; - result.javaGenerateEqualsAndHash_ = false; - return this; - } - - public bool HasOptimizeFor { - get { return result.hasOptimizeFor; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { - get { return result.OptimizeFor; } - set { SetOptimizeFor(value); } - } - public Builder SetOptimizeFor(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode value) { - PrepareBuilder(); - result.hasOptimizeFor = true; - result.optimizeFor_ = value; - return this; - } - public Builder ClearOptimizeFor() { - PrepareBuilder(); - result.hasOptimizeFor = false; - result.optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; - return this; - } - - public bool HasCcGenericServices { - get { return result.hasCcGenericServices; } - } - public bool CcGenericServices { - get { return result.CcGenericServices; } - set { SetCcGenericServices(value); } - } - public Builder SetCcGenericServices(bool value) { - PrepareBuilder(); - result.hasCcGenericServices = true; - result.ccGenericServices_ = value; - return this; - } - public Builder ClearCcGenericServices() { - PrepareBuilder(); - result.hasCcGenericServices = false; - result.ccGenericServices_ = false; - return this; - } - - public bool HasJavaGenericServices { - get { return result.hasJavaGenericServices; } - } - public bool JavaGenericServices { - get { return result.JavaGenericServices; } - set { SetJavaGenericServices(value); } - } - public Builder SetJavaGenericServices(bool value) { - PrepareBuilder(); - result.hasJavaGenericServices = true; - result.javaGenericServices_ = value; - return this; - } - public Builder ClearJavaGenericServices() { - PrepareBuilder(); - result.hasJavaGenericServices = false; - result.javaGenericServices_ = false; - return this; - } - - public bool HasPyGenericServices { - get { return result.hasPyGenericServices; } - } - public bool PyGenericServices { - get { return result.PyGenericServices; } - set { SetPyGenericServices(value); } - } - public Builder SetPyGenericServices(bool value) { - PrepareBuilder(); - result.hasPyGenericServices = true; - result.pyGenericServices_ = value; - return this; - } - public Builder ClearPyGenericServices() { - PrepareBuilder(); - result.hasPyGenericServices = false; - result.pyGenericServices_ = false; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static FileOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MessageOptions : pb::ExtendableMessage { - private MessageOptions() { } - private static readonly MessageOptions defaultInstance = new MessageOptions().MakeReadOnly(); - private static readonly string[] _messageOptionsFieldNames = new string[] { "message_set_wire_format", "no_standard_descriptor_accessor", "uninterpreted_option" }; - private static readonly uint[] _messageOptionsFieldTags = new uint[] { 8, 16, 7994 }; - public static MessageOptions DefaultInstance { - get { return defaultInstance; } - } - - public override MessageOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MessageOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__FieldAccessorTable; } - } - - public const int MessageSetWireFormatFieldNumber = 1; - private bool hasMessageSetWireFormat; - private bool messageSetWireFormat_; - public bool HasMessageSetWireFormat { - get { return hasMessageSetWireFormat; } - } - public bool MessageSetWireFormat { - get { return messageSetWireFormat_; } - } - - public const int NoStandardDescriptorAccessorFieldNumber = 2; - private bool hasNoStandardDescriptorAccessor; - private bool noStandardDescriptorAccessor_; - public bool HasNoStandardDescriptorAccessor { - get { return hasNoStandardDescriptorAccessor; } - } - public bool NoStandardDescriptorAccessor { - get { return noStandardDescriptorAccessor_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _messageOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasMessageSetWireFormat) { - output.WriteBool(1, field_names[0], MessageSetWireFormat); - } - if (hasNoStandardDescriptorAccessor) { - output.WriteBool(2, field_names[1], NoStandardDescriptorAccessor); - } - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[2], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasMessageSetWireFormat) { - size += pb::CodedOutputStream.ComputeBoolSize(1, MessageSetWireFormat); - } - if (hasNoStandardDescriptorAccessor) { - size += pb::CodedOutputStream.ComputeBoolSize(2, NoStandardDescriptorAccessor); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MessageOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MessageOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MessageOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MessageOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MessageOptions result; - - private MessageOptions PrepareBuilder() { - if (resultIsReadOnly) { - MessageOptions original = result; - result = new MessageOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MessageOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Descriptor; } - } - - public override MessageOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; } - } - - public override MessageOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MessageOptions) { - return MergeFrom((MessageOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MessageOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasMessageSetWireFormat) { - MessageSetWireFormat = other.MessageSetWireFormat; - } - if (other.HasNoStandardDescriptorAccessor) { - NoStandardDescriptorAccessor = other.NoStandardDescriptorAccessor; - } - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_messageOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _messageOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasMessageSetWireFormat = input.ReadBool(ref result.messageSetWireFormat_); - break; - } - case 16: { - result.hasNoStandardDescriptorAccessor = input.ReadBool(ref result.noStandardDescriptorAccessor_); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasMessageSetWireFormat { - get { return result.hasMessageSetWireFormat; } - } - public bool MessageSetWireFormat { - get { return result.MessageSetWireFormat; } - set { SetMessageSetWireFormat(value); } - } - public Builder SetMessageSetWireFormat(bool value) { - PrepareBuilder(); - result.hasMessageSetWireFormat = true; - result.messageSetWireFormat_ = value; - return this; - } - public Builder ClearMessageSetWireFormat() { - PrepareBuilder(); - result.hasMessageSetWireFormat = false; - result.messageSetWireFormat_ = false; - return this; - } - - public bool HasNoStandardDescriptorAccessor { - get { return result.hasNoStandardDescriptorAccessor; } - } - public bool NoStandardDescriptorAccessor { - get { return result.NoStandardDescriptorAccessor; } - set { SetNoStandardDescriptorAccessor(value); } - } - public Builder SetNoStandardDescriptorAccessor(bool value) { - PrepareBuilder(); - result.hasNoStandardDescriptorAccessor = true; - result.noStandardDescriptorAccessor_ = value; - return this; - } - public Builder ClearNoStandardDescriptorAccessor() { - PrepareBuilder(); - result.hasNoStandardDescriptorAccessor = false; - result.noStandardDescriptorAccessor_ = false; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static MessageOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FieldOptions : pb::ExtendableMessage { - private FieldOptions() { } - private static readonly FieldOptions defaultInstance = new FieldOptions().MakeReadOnly(); - private static readonly string[] _fieldOptionsFieldNames = new string[] { "ctype", "deprecated", "experimental_map_key", "packed", "uninterpreted_option" }; - private static readonly uint[] _fieldOptionsFieldTags = new uint[] { 8, 24, 74, 16, 7994 }; - public static FieldOptions DefaultInstance { - get { return defaultInstance; } - } - - public override FieldOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FieldOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2, - } - - } - #endregion - - public const int CtypeFieldNumber = 1; - private bool hasCtype; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; - public bool HasCtype { - get { return hasCtype; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { - get { return ctype_; } - } - - public const int PackedFieldNumber = 2; - private bool hasPacked; - private bool packed_; - public bool HasPacked { - get { return hasPacked; } - } - public bool Packed { - get { return packed_; } - } - - public const int DeprecatedFieldNumber = 3; - private bool hasDeprecated; - private bool deprecated_; - public bool HasDeprecated { - get { return hasDeprecated; } - } - public bool Deprecated { - get { return deprecated_; } - } - - public const int ExperimentalMapKeyFieldNumber = 9; - private bool hasExperimentalMapKey; - private string experimentalMapKey_ = ""; - public bool HasExperimentalMapKey { - get { return hasExperimentalMapKey; } - } - public string ExperimentalMapKey { - get { return experimentalMapKey_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fieldOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasCtype) { - output.WriteEnum(1, field_names[0], (int) Ctype, Ctype); - } - if (hasPacked) { - output.WriteBool(2, field_names[3], Packed); - } - if (hasDeprecated) { - output.WriteBool(3, field_names[1], Deprecated); - } - if (hasExperimentalMapKey) { - output.WriteString(9, field_names[2], ExperimentalMapKey); - } - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[4], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasCtype) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Ctype); - } - if (hasPacked) { - size += pb::CodedOutputStream.ComputeBoolSize(2, Packed); - } - if (hasDeprecated) { - size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated); - } - if (hasExperimentalMapKey) { - size += pb::CodedOutputStream.ComputeStringSize(9, ExperimentalMapKey); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FieldOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FieldOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FieldOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FieldOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FieldOptions result; - - private FieldOptions PrepareBuilder() { - if (resultIsReadOnly) { - FieldOptions original = result; - result = new FieldOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FieldOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Descriptor; } - } - - public override FieldOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; } - } - - public override FieldOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FieldOptions) { - return MergeFrom((FieldOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FieldOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasCtype) { - Ctype = other.Ctype; - } - if (other.HasPacked) { - Packed = other.Packed; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasExperimentalMapKey) { - ExperimentalMapKey = other.ExperimentalMapKey; - } - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fieldOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fieldOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.ctype_, out unknown)) { - result.hasCtype = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 16: { - result.hasPacked = input.ReadBool(ref result.packed_); - break; - } - case 24: { - result.hasDeprecated = input.ReadBool(ref result.deprecated_); - break; - } - case 74: { - result.hasExperimentalMapKey = input.ReadString(ref result.experimentalMapKey_); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasCtype { - get { return result.hasCtype; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { - get { return result.Ctype; } - set { SetCtype(value); } - } - public Builder SetCtype(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType value) { - PrepareBuilder(); - result.hasCtype = true; - result.ctype_ = value; - return this; - } - public Builder ClearCtype() { - PrepareBuilder(); - result.hasCtype = false; - result.ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; - return this; - } - - public bool HasPacked { - get { return result.hasPacked; } - } - public bool Packed { - get { return result.Packed; } - set { SetPacked(value); } - } - public Builder SetPacked(bool value) { - PrepareBuilder(); - result.hasPacked = true; - result.packed_ = value; - return this; - } - public Builder ClearPacked() { - PrepareBuilder(); - result.hasPacked = false; - result.packed_ = false; - return this; - } - - public bool HasDeprecated { - get { return result.hasDeprecated; } - } - public bool Deprecated { - get { return result.Deprecated; } - set { SetDeprecated(value); } - } - public Builder SetDeprecated(bool value) { - PrepareBuilder(); - result.hasDeprecated = true; - result.deprecated_ = value; - return this; - } - public Builder ClearDeprecated() { - PrepareBuilder(); - result.hasDeprecated = false; - result.deprecated_ = false; - return this; - } - - public bool HasExperimentalMapKey { - get { return result.hasExperimentalMapKey; } - } - public string ExperimentalMapKey { - get { return result.ExperimentalMapKey; } - set { SetExperimentalMapKey(value); } - } - public Builder SetExperimentalMapKey(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasExperimentalMapKey = true; - result.experimentalMapKey_ = value; - return this; - } - public Builder ClearExperimentalMapKey() { - PrepareBuilder(); - result.hasExperimentalMapKey = false; - result.experimentalMapKey_ = ""; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static FieldOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumOptions : pb::ExtendableMessage { - private EnumOptions() { } - private static readonly EnumOptions defaultInstance = new EnumOptions().MakeReadOnly(); - private static readonly string[] _enumOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _enumOptionsFieldTags = new uint[] { 7994 }; - public static EnumOptions DefaultInstance { - get { return defaultInstance; } - } - - public override EnumOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumOptions result; - - private EnumOptions PrepareBuilder() { - if (resultIsReadOnly) { - EnumOptions original = result; - result = new EnumOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Descriptor; } - } - - public override EnumOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; } - } - - public override EnumOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumOptions) { - return MergeFrom((EnumOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static EnumOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumValueOptions : pb::ExtendableMessage { - private EnumValueOptions() { } - private static readonly EnumValueOptions defaultInstance = new EnumValueOptions().MakeReadOnly(); - private static readonly string[] _enumValueOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _enumValueOptionsFieldTags = new uint[] { 7994 }; - public static EnumValueOptions DefaultInstance { - get { return defaultInstance; } - } - - public override EnumValueOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumValueOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumValueOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumValueOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumValueOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumValueOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumValueOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumValueOptions result; - - private EnumValueOptions PrepareBuilder() { - if (resultIsReadOnly) { - EnumValueOptions original = result; - result = new EnumValueOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumValueOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Descriptor; } - } - - public override EnumValueOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; } - } - - public override EnumValueOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumValueOptions) { - return MergeFrom((EnumValueOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumValueOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumValueOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumValueOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static EnumValueOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ServiceOptions : pb::ExtendableMessage { - private ServiceOptions() { } - private static readonly ServiceOptions defaultInstance = new ServiceOptions().MakeReadOnly(); - private static readonly string[] _serviceOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _serviceOptionsFieldTags = new uint[] { 7994 }; - public static ServiceOptions DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ServiceOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _serviceOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ServiceOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ServiceOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ServiceOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ServiceOptions result; - - private ServiceOptions PrepareBuilder() { - if (resultIsReadOnly) { - ServiceOptions original = result; - result = new ServiceOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ServiceOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Descriptor; } - } - - public override ServiceOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; } - } - - public override ServiceOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceOptions) { - return MergeFrom((ServiceOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_serviceOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _serviceOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static ServiceOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MethodOptions : pb::ExtendableMessage { - private MethodOptions() { } - private static readonly MethodOptions defaultInstance = new MethodOptions().MakeReadOnly(); - private static readonly string[] _methodOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _methodOptionsFieldTags = new uint[] { 7994 }; - public static MethodOptions DefaultInstance { - get { return defaultInstance; } - } - - public override MethodOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MethodOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _methodOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MethodOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MethodOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MethodOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MethodOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MethodOptions result; - - private MethodOptions PrepareBuilder() { - if (resultIsReadOnly) { - MethodOptions original = result; - result = new MethodOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MethodOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Descriptor; } - } - - public override MethodOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; } - } - - public override MethodOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MethodOptions) { - return MergeFrom((MethodOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MethodOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_methodOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _methodOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static MethodOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class UninterpretedOption : pb::GeneratedMessage { - private UninterpretedOption() { } - private static readonly UninterpretedOption defaultInstance = new UninterpretedOption().MakeReadOnly(); - private static readonly string[] _uninterpretedOptionFieldNames = new string[] { "aggregate_value", "double_value", "identifier_value", "name", "negative_int_value", "positive_int_value", "string_value" }; - private static readonly uint[] _uninterpretedOptionFieldTags = new uint[] { 66, 49, 26, 18, 40, 32, 58 }; - public static UninterpretedOption DefaultInstance { - get { return defaultInstance; } - } - - public override UninterpretedOption DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override UninterpretedOption ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NamePart : pb::GeneratedMessage { - private NamePart() { } - private static readonly NamePart defaultInstance = new NamePart().MakeReadOnly(); - private static readonly string[] _namePartFieldNames = new string[] { "is_extension", "name_part" }; - private static readonly uint[] _namePartFieldTags = new uint[] { 16, 10 }; - public static NamePart DefaultInstance { - get { return defaultInstance; } - } - - public override NamePart DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NamePart ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; } - } - - public const int NamePart_FieldNumber = 1; - private bool hasNamePart_; - private string namePart_ = ""; - public bool HasNamePart_ { - get { return hasNamePart_; } - } - public string NamePart_ { - get { return namePart_; } - } - - public const int IsExtensionFieldNumber = 2; - private bool hasIsExtension; - private bool isExtension_; - public bool HasIsExtension { - get { return hasIsExtension; } - } - public bool IsExtension { - get { return isExtension_; } - } - - public override bool IsInitialized { - get { - if (!hasNamePart_) return false; - if (!hasIsExtension) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _namePartFieldNames; - if (hasNamePart_) { - output.WriteString(1, field_names[1], NamePart_); - } - if (hasIsExtension) { - output.WriteBool(2, field_names[0], IsExtension); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNamePart_) { - size += pb::CodedOutputStream.ComputeStringSize(1, NamePart_); - } - if (hasIsExtension) { - size += pb::CodedOutputStream.ComputeBoolSize(2, IsExtension); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NamePart ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NamePart ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NamePart ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NamePart ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NamePart ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NamePart ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NamePart ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NamePart MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NamePart prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NamePart cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NamePart result; - - private NamePart PrepareBuilder() { - if (resultIsReadOnly) { - NamePart original = result; - result = new NamePart(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NamePart MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Descriptor; } - } - - public override NamePart DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance; } - } - - public override NamePart BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NamePart) { - return MergeFrom((NamePart) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NamePart other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNamePart_) { - NamePart_ = other.NamePart_; - } - if (other.HasIsExtension) { - IsExtension = other.IsExtension; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_namePartFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _namePartFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNamePart_ = input.ReadString(ref result.namePart_); - break; - } - case 16: { - result.hasIsExtension = input.ReadBool(ref result.isExtension_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNamePart_ { - get { return result.hasNamePart_; } - } - public string NamePart_ { - get { return result.NamePart_; } - set { SetNamePart_(value); } - } - public Builder SetNamePart_(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNamePart_ = true; - result.namePart_ = value; - return this; - } - public Builder ClearNamePart_() { - PrepareBuilder(); - result.hasNamePart_ = false; - result.namePart_ = ""; - return this; - } - - public bool HasIsExtension { - get { return result.hasIsExtension; } - } - public bool IsExtension { - get { return result.IsExtension; } - set { SetIsExtension(value); } - } - public Builder SetIsExtension(bool value) { - PrepareBuilder(); - result.hasIsExtension = true; - result.isExtension_ = value; - return this; - } - public Builder ClearIsExtension() { - PrepareBuilder(); - result.hasIsExtension = false; - result.isExtension_ = false; - return this; - } - } - static NamePart() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 2; - private pbc::PopsicleList name_ = new pbc::PopsicleList(); - public scg::IList NameList { - get { return name_; } - } - public int NameCount { - get { return name_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { - return name_[index]; - } - - public const int IdentifierValueFieldNumber = 3; - private bool hasIdentifierValue; - private string identifierValue_ = ""; - public bool HasIdentifierValue { - get { return hasIdentifierValue; } - } - public string IdentifierValue { - get { return identifierValue_; } - } - - public const int PositiveIntValueFieldNumber = 4; - private bool hasPositiveIntValue; - private ulong positiveIntValue_; - public bool HasPositiveIntValue { - get { return hasPositiveIntValue; } - } - [global::System.CLSCompliant(false)] - public ulong PositiveIntValue { - get { return positiveIntValue_; } - } - - public const int NegativeIntValueFieldNumber = 5; - private bool hasNegativeIntValue; - private long negativeIntValue_; - public bool HasNegativeIntValue { - get { return hasNegativeIntValue; } - } - public long NegativeIntValue { - get { return negativeIntValue_; } - } - - public const int DoubleValueFieldNumber = 6; - private bool hasDoubleValue; - private double doubleValue_; - public bool HasDoubleValue { - get { return hasDoubleValue; } - } - public double DoubleValue { - get { return doubleValue_; } - } - - public const int StringValueFieldNumber = 7; - private bool hasStringValue; - private pb::ByteString stringValue_ = pb::ByteString.Empty; - public bool HasStringValue { - get { return hasStringValue; } - } - public pb::ByteString StringValue { - get { return stringValue_; } - } - - public const int AggregateValueFieldNumber = 8; - private bool hasAggregateValue; - private string aggregateValue_ = ""; - public bool HasAggregateValue { - get { return hasAggregateValue; } - } - public string AggregateValue { - get { return aggregateValue_; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _uninterpretedOptionFieldNames; - if (name_.Count > 0) { - output.WriteMessageArray(2, field_names[3], name_); - } - if (hasIdentifierValue) { - output.WriteString(3, field_names[2], IdentifierValue); - } - if (hasPositiveIntValue) { - output.WriteUInt64(4, field_names[5], PositiveIntValue); - } - if (hasNegativeIntValue) { - output.WriteInt64(5, field_names[4], NegativeIntValue); - } - if (hasDoubleValue) { - output.WriteDouble(6, field_names[1], DoubleValue); - } - if (hasStringValue) { - output.WriteBytes(7, field_names[6], StringValue); - } - if (hasAggregateValue) { - output.WriteString(8, field_names[0], AggregateValue); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasIdentifierValue) { - size += pb::CodedOutputStream.ComputeStringSize(3, IdentifierValue); - } - if (hasPositiveIntValue) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, PositiveIntValue); - } - if (hasNegativeIntValue) { - size += pb::CodedOutputStream.ComputeInt64Size(5, NegativeIntValue); - } - if (hasDoubleValue) { - size += pb::CodedOutputStream.ComputeDoubleSize(6, DoubleValue); - } - if (hasStringValue) { - size += pb::CodedOutputStream.ComputeBytesSize(7, StringValue); - } - if (hasAggregateValue) { - size += pb::CodedOutputStream.ComputeStringSize(8, AggregateValue); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static UninterpretedOption ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private UninterpretedOption MakeReadOnly() { - name_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UninterpretedOption prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(UninterpretedOption cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private UninterpretedOption result; - - private UninterpretedOption PrepareBuilder() { - if (resultIsReadOnly) { - UninterpretedOption original = result; - result = new UninterpretedOption(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override UninterpretedOption MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Descriptor; } - } - - public override UninterpretedOption DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance; } - } - - public override UninterpretedOption BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UninterpretedOption) { - return MergeFrom((UninterpretedOption) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UninterpretedOption other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance) return this; - PrepareBuilder(); - if (other.name_.Count != 0) { - result.name_.Add(other.name_); - } - if (other.HasIdentifierValue) { - IdentifierValue = other.IdentifierValue; - } - if (other.HasPositiveIntValue) { - PositiveIntValue = other.PositiveIntValue; - } - if (other.HasNegativeIntValue) { - NegativeIntValue = other.NegativeIntValue; - } - if (other.HasDoubleValue) { - DoubleValue = other.DoubleValue; - } - if (other.HasStringValue) { - StringValue = other.StringValue; - } - if (other.HasAggregateValue) { - AggregateValue = other.AggregateValue; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_uninterpretedOptionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _uninterpretedOptionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.name_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance, extensionRegistry); - break; - } - case 26: { - result.hasIdentifierValue = input.ReadString(ref result.identifierValue_); - break; - } - case 32: { - result.hasPositiveIntValue = input.ReadUInt64(ref result.positiveIntValue_); - break; - } - case 40: { - result.hasNegativeIntValue = input.ReadInt64(ref result.negativeIntValue_); - break; - } - case 49: { - result.hasDoubleValue = input.ReadDouble(ref result.doubleValue_); - break; - } - case 58: { - result.hasStringValue = input.ReadBytes(ref result.stringValue_); - break; - } - case 66: { - result.hasAggregateValue = input.ReadString(ref result.aggregateValue_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList NameList { - get { return PrepareBuilder().name_; } - } - public int NameCount { - get { return result.NameCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { - return result.GetName(index); - } - public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.name_[index] = value; - return this; - } - public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.name_[index] = builderForValue.Build(); - return this; - } - public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.name_.Add(value); - return this; - } - public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.name_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeName(scg::IEnumerable values) { - PrepareBuilder(); - result.name_.Add(values); - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.name_.Clear(); - return this; - } - - public bool HasIdentifierValue { - get { return result.hasIdentifierValue; } - } - public string IdentifierValue { - get { return result.IdentifierValue; } - set { SetIdentifierValue(value); } - } - public Builder SetIdentifierValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasIdentifierValue = true; - result.identifierValue_ = value; - return this; - } - public Builder ClearIdentifierValue() { - PrepareBuilder(); - result.hasIdentifierValue = false; - result.identifierValue_ = ""; - return this; - } - - public bool HasPositiveIntValue { - get { return result.hasPositiveIntValue; } - } - [global::System.CLSCompliant(false)] - public ulong PositiveIntValue { - get { return result.PositiveIntValue; } - set { SetPositiveIntValue(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetPositiveIntValue(ulong value) { - PrepareBuilder(); - result.hasPositiveIntValue = true; - result.positiveIntValue_ = value; - return this; - } - public Builder ClearPositiveIntValue() { - PrepareBuilder(); - result.hasPositiveIntValue = false; - result.positiveIntValue_ = 0UL; - return this; - } - - public bool HasNegativeIntValue { - get { return result.hasNegativeIntValue; } - } - public long NegativeIntValue { - get { return result.NegativeIntValue; } - set { SetNegativeIntValue(value); } - } - public Builder SetNegativeIntValue(long value) { - PrepareBuilder(); - result.hasNegativeIntValue = true; - result.negativeIntValue_ = value; - return this; - } - public Builder ClearNegativeIntValue() { - PrepareBuilder(); - result.hasNegativeIntValue = false; - result.negativeIntValue_ = 0L; - return this; - } - - public bool HasDoubleValue { - get { return result.hasDoubleValue; } - } - public double DoubleValue { - get { return result.DoubleValue; } - set { SetDoubleValue(value); } - } - public Builder SetDoubleValue(double value) { - PrepareBuilder(); - result.hasDoubleValue = true; - result.doubleValue_ = value; - return this; - } - public Builder ClearDoubleValue() { - PrepareBuilder(); - result.hasDoubleValue = false; - result.doubleValue_ = 0D; - return this; - } - - public bool HasStringValue { - get { return result.hasStringValue; } - } - public pb::ByteString StringValue { - get { return result.StringValue; } - set { SetStringValue(value); } - } - public Builder SetStringValue(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringValue = true; - result.stringValue_ = value; - return this; - } - public Builder ClearStringValue() { - PrepareBuilder(); - result.hasStringValue = false; - result.stringValue_ = pb::ByteString.Empty; - return this; - } - - public bool HasAggregateValue { - get { return result.hasAggregateValue; } - } - public string AggregateValue { - get { return result.AggregateValue; } - set { SetAggregateValue(value); } - } - public Builder SetAggregateValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasAggregateValue = true; - result.aggregateValue_ = value; - return this; - } - public Builder ClearAggregateValue() { - PrepareBuilder(); - result.hasAggregateValue = false; - result.aggregateValue_ = ""; - return this; - } - } - static UninterpretedOption() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SourceCodeInfo : pb::GeneratedMessage { - private SourceCodeInfo() { } - private static readonly SourceCodeInfo defaultInstance = new SourceCodeInfo().MakeReadOnly(); - private static readonly string[] _sourceCodeInfoFieldNames = new string[] { "location" }; - private static readonly uint[] _sourceCodeInfoFieldTags = new uint[] { 10 }; - public static SourceCodeInfo DefaultInstance { - get { return defaultInstance; } - } - - public override SourceCodeInfo DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SourceCodeInfo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Location : pb::GeneratedMessage { - private Location() { } - private static readonly Location defaultInstance = new Location().MakeReadOnly(); - private static readonly string[] _locationFieldNames = new string[] { "path", "span" }; - private static readonly uint[] _locationFieldTags = new uint[] { 10, 18 }; - public static Location DefaultInstance { - get { return defaultInstance; } - } - - public override Location DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Location ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; } - } - - public const int PathFieldNumber = 1; - private int pathMemoizedSerializedSize; - private pbc::PopsicleList path_ = new pbc::PopsicleList(); - public scg::IList PathList { - get { return pbc::Lists.AsReadOnly(path_); } - } - public int PathCount { - get { return path_.Count; } - } - public int GetPath(int index) { - return path_[index]; - } - - public const int SpanFieldNumber = 2; - private int spanMemoizedSerializedSize; - private pbc::PopsicleList span_ = new pbc::PopsicleList(); - public scg::IList SpanList { - get { return pbc::Lists.AsReadOnly(span_); } - } - public int SpanCount { - get { return span_.Count; } - } - public int GetSpan(int index) { - return span_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _locationFieldNames; - if (path_.Count > 0) { - output.WritePackedInt32Array(1, field_names[0], pathMemoizedSerializedSize, path_); - } - if (span_.Count > 0) { - output.WritePackedInt32Array(2, field_names[1], spanMemoizedSerializedSize, span_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in PathList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (path_.Count != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - pathMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (int element in SpanList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (span_.Count != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - spanMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Location ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Location ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Location ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Location ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Location ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Location ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Location ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Location ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Location ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Location ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Location MakeReadOnly() { - path_.MakeReadOnly(); - span_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Location prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Location cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Location result; - - private Location PrepareBuilder() { - if (resultIsReadOnly) { - Location original = result; - result = new Location(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Location MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Descriptor; } - } - - public override Location DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance; } - } - - public override Location BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Location) { - return MergeFrom((Location) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Location other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance) return this; - PrepareBuilder(); - if (other.path_.Count != 0) { - result.path_.Add(other.path_); - } - if (other.span_.Count != 0) { - result.span_.Add(other.span_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_locationFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _locationFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: - case 8: { - input.ReadInt32Array(tag, field_name, result.path_); - break; - } - case 18: - case 16: { - input.ReadInt32Array(tag, field_name, result.span_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList PathList { - get { return PrepareBuilder().path_; } - } - public int PathCount { - get { return result.PathCount; } - } - public int GetPath(int index) { - return result.GetPath(index); - } - public Builder SetPath(int index, int value) { - PrepareBuilder(); - result.path_[index] = value; - return this; - } - public Builder AddPath(int value) { - PrepareBuilder(); - result.path_.Add(value); - return this; - } - public Builder AddRangePath(scg::IEnumerable values) { - PrepareBuilder(); - result.path_.Add(values); - return this; - } - public Builder ClearPath() { - PrepareBuilder(); - result.path_.Clear(); - return this; - } - - public pbc::IPopsicleList SpanList { - get { return PrepareBuilder().span_; } - } - public int SpanCount { - get { return result.SpanCount; } - } - public int GetSpan(int index) { - return result.GetSpan(index); - } - public Builder SetSpan(int index, int value) { - PrepareBuilder(); - result.span_[index] = value; - return this; - } - public Builder AddSpan(int value) { - PrepareBuilder(); - result.span_.Add(value); - return this; - } - public Builder AddRangeSpan(scg::IEnumerable values) { - PrepareBuilder(); - result.span_.Add(values); - return this; - } - public Builder ClearSpan() { - PrepareBuilder(); - result.span_.Clear(); - return this; - } - } - static Location() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int LocationFieldNumber = 1; - private pbc::PopsicleList location_ = new pbc::PopsicleList(); - public scg::IList LocationList { - get { return location_; } - } - public int LocationCount { - get { return location_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location GetLocation(int index) { - return location_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _sourceCodeInfoFieldNames; - if (location_.Count > 0) { - output.WriteMessageArray(1, field_names[0], location_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location element in LocationList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SourceCodeInfo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SourceCodeInfo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SourceCodeInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SourceCodeInfo MakeReadOnly() { - location_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SourceCodeInfo prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SourceCodeInfo cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SourceCodeInfo result; - - private SourceCodeInfo PrepareBuilder() { - if (resultIsReadOnly) { - SourceCodeInfo original = result; - result = new SourceCodeInfo(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SourceCodeInfo MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Descriptor; } - } - - public override SourceCodeInfo DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance; } - } - - public override SourceCodeInfo BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SourceCodeInfo) { - return MergeFrom((SourceCodeInfo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SourceCodeInfo other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance) return this; - PrepareBuilder(); - if (other.location_.Count != 0) { - result.location_.Add(other.location_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_sourceCodeInfoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _sourceCodeInfoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.location_, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList LocationList { - get { return PrepareBuilder().location_; } - } - public int LocationCount { - get { return result.LocationCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location GetLocation(int index) { - return result.GetLocation(index); - } - public Builder SetLocation(int index, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.location_[index] = value; - return this; - } - public Builder SetLocation(int index, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.location_[index] = builderForValue.Build(); - return this; - } - public Builder AddLocation(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.location_.Add(value); - return this; - } - public Builder AddLocation(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.location_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeLocation(scg::IEnumerable values) { - PrepareBuilder(); - result.location_.Add(values); - return this; - } - public Builder ClearLocation() { - PrepareBuilder(); - result.location_.Clear(); - return this; - } - } - static SourceCodeInfo() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: descriptor.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace Google.ProtocolBuffers.DescriptorProtos { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class DescriptorProtoFile { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorSet__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldDescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_OneofDescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumDescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodDescriptorProto__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_FileOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_MessageOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MessageOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; + #endregion + #region DescriptorProtoFile + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static DescriptorProtoFile() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChBkZXNjcmlwdG9yLnByb3RvEg9nb29nbGUucHJvdG9idWYiRwoRRmlsZURl", + "c2NyaXB0b3JTZXQSMgoEZmlsZRgBIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5G", + "aWxlRGVzY3JpcHRvclByb3RvItsDChNGaWxlRGVzY3JpcHRvclByb3RvEgwK", + "BG5hbWUYASABKAkSDwoHcGFja2FnZRgCIAEoCRISCgpkZXBlbmRlbmN5GAMg", + "AygJEhkKEXB1YmxpY19kZXBlbmRlbmN5GAogAygFEhcKD3dlYWtfZGVwZW5k", + "ZW5jeRgLIAMoBRI2CgxtZXNzYWdlX3R5cGUYBCADKAsyIC5nb29nbGUucHJv", + "dG9idWYuRGVzY3JpcHRvclByb3RvEjcKCWVudW1fdHlwZRgFIAMoCzIkLmdv", + "b2dsZS5wcm90b2J1Zi5FbnVtRGVzY3JpcHRvclByb3RvEjgKB3NlcnZpY2UY", + "BiADKAsyJy5nb29nbGUucHJvdG9idWYuU2VydmljZURlc2NyaXB0b3JQcm90", + "bxI4CglleHRlbnNpb24YByADKAsyJS5nb29nbGUucHJvdG9idWYuRmllbGRE", + "ZXNjcmlwdG9yUHJvdG8SLQoHb3B0aW9ucxgIIAEoCzIcLmdvb2dsZS5wcm90", + "b2J1Zi5GaWxlT3B0aW9ucxI5ChBzb3VyY2VfY29kZV9pbmZvGAkgASgLMh8u", + "Z29vZ2xlLnByb3RvYnVmLlNvdXJjZUNvZGVJbmZvEg4KBnN5bnRheBgMIAEo", + "CSLkAwoPRGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkSNAoFZmllbGQY", + "AiADKAsyJS5nb29nbGUucHJvdG9idWYuRmllbGREZXNjcmlwdG9yUHJvdG8S", + "OAoJZXh0ZW5zaW9uGAYgAygLMiUuZ29vZ2xlLnByb3RvYnVmLkZpZWxkRGVz", + "Y3JpcHRvclByb3RvEjUKC25lc3RlZF90eXBlGAMgAygLMiAuZ29vZ2xlLnBy", + "b3RvYnVmLkRlc2NyaXB0b3JQcm90bxI3CgllbnVtX3R5cGUYBCADKAsyJC5n", + "b29nbGUucHJvdG9idWYuRW51bURlc2NyaXB0b3JQcm90bxJICg9leHRlbnNp", + "b25fcmFuZ2UYBSADKAsyLy5nb29nbGUucHJvdG9idWYuRGVzY3JpcHRvclBy", + "b3RvLkV4dGVuc2lvblJhbmdlEjkKCm9uZW9mX2RlY2wYCCADKAsyJS5nb29n", + "bGUucHJvdG9idWYuT25lb2ZEZXNjcmlwdG9yUHJvdG8SMAoHb3B0aW9ucxgH", + "IAEoCzIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxosCg5FeHRl", + "bnNpb25SYW5nZRINCgVzdGFydBgBIAEoBRILCgNlbmQYAiABKAUiqQUKFEZp", + "ZWxkRGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkSDgoGbnVtYmVyGAMg", + "ASgFEjoKBWxhYmVsGAQgASgOMisuZ29vZ2xlLnByb3RvYnVmLkZpZWxkRGVz", + "Y3JpcHRvclByb3RvLkxhYmVsEjgKBHR5cGUYBSABKA4yKi5nb29nbGUucHJv", + "dG9idWYuRmllbGREZXNjcmlwdG9yUHJvdG8uVHlwZRIRCgl0eXBlX25hbWUY", + "BiABKAkSEAoIZXh0ZW5kZWUYAiABKAkSFQoNZGVmYXVsdF92YWx1ZRgHIAEo", + "CRITCgtvbmVvZl9pbmRleBgJIAEoBRIuCgdvcHRpb25zGAggASgLMh0uZ29v", + "Z2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucyK2AgoEVHlwZRIPCgtUWVBFX0RP", + "VUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpUWVBFX0lOVDY0EAMSDwoLVFlQ", + "RV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUSEAoMVFlQRV9GSVhFRDY0EAYS", + "EAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9CT09MEAgSDwoLVFlQRV9TVFJJ", + "TkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQRV9NRVNTQUdFEAsSDgoKVFlQ", + "RV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0SDQoJVFlQRV9FTlVNEA4SEQoN", + "VFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJWEVENjQQEBIPCgtUWVBFX1NJ", + "TlQzMhAREg8KC1RZUEVfU0lOVDY0EBIiQwoFTGFiZWwSEgoOTEFCRUxfT1BU", + "SU9OQUwQARISCg5MQUJFTF9SRVFVSVJFRBACEhIKDkxBQkVMX1JFUEVBVEVE", + "EAMiJAoUT25lb2ZEZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCSKMAQoT", + "RW51bURlc2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEjgKBXZhbHVlGAIg", + "AygLMikuZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZURlc2NyaXB0b3JQcm90", + "bxItCgdvcHRpb25zGAMgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkVudW1PcHRp", + "b25zImwKGEVudW1WYWx1ZURlc2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJ", + "Eg4KBm51bWJlchgCIAEoBRIyCgdvcHRpb25zGAMgASgLMiEuZ29vZ2xlLnBy", + "b3RvYnVmLkVudW1WYWx1ZU9wdGlvbnMikAEKFlNlcnZpY2VEZXNjcmlwdG9y", + "UHJvdG8SDAoEbmFtZRgBIAEoCRI2CgZtZXRob2QYAiADKAsyJi5nb29nbGUu", + "cHJvdG9idWYuTWV0aG9kRGVzY3JpcHRvclByb3RvEjAKB29wdGlvbnMYAyAB", + "KAsyHy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMiwQEKFU1ldGhv", + "ZERlc2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEhIKCmlucHV0X3R5cGUY", + "AiABKAkSEwoLb3V0cHV0X3R5cGUYAyABKAkSLwoHb3B0aW9ucxgEIAEoCzIe", + "Lmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zEh8KEGNsaWVudF9zdHJl", + "YW1pbmcYBSABKAg6BWZhbHNlEh8KEHNlcnZlcl9zdHJlYW1pbmcYBiABKAg6", + "BWZhbHNlIoEFCgtGaWxlT3B0aW9ucxIUCgxqYXZhX3BhY2thZ2UYASABKAkS", + "HAoUamF2YV9vdXRlcl9jbGFzc25hbWUYCCABKAkSIgoTamF2YV9tdWx0aXBs", + "ZV9maWxlcxgKIAEoCDoFZmFsc2USLAodamF2YV9nZW5lcmF0ZV9lcXVhbHNf", + "YW5kX2hhc2gYFCABKAg6BWZhbHNlEiUKFmphdmFfc3RyaW5nX2NoZWNrX3V0", + "ZjgYGyABKAg6BWZhbHNlEkYKDG9wdGltaXplX2ZvchgJIAEoDjIpLmdvb2ds", + "ZS5wcm90b2J1Zi5GaWxlT3B0aW9ucy5PcHRpbWl6ZU1vZGU6BVNQRUVEEhIK", + "CmdvX3BhY2thZ2UYCyABKAkSIgoTY2NfZ2VuZXJpY19zZXJ2aWNlcxgQIAEo", + "CDoFZmFsc2USJAoVamF2YV9nZW5lcmljX3NlcnZpY2VzGBEgASgIOgVmYWxz", + "ZRIiChNweV9nZW5lcmljX3NlcnZpY2VzGBIgASgIOgVmYWxzZRIZCgpkZXBy", + "ZWNhdGVkGBcgASgIOgVmYWxzZRIfChBjY19lbmFibGVfYXJlbmFzGB8gASgI", + "OgVmYWxzZRIZChFvYmpjX2NsYXNzX3ByZWZpeBgkIAEoCRIYChBjc2hhcnBf", + "bmFtZXNwYWNlGCUgASgJEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMo", + "CzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uIjoKDE9w", + "dGltaXplTW9kZRIJCgVTUEVFRBABEg0KCUNPREVfU0laRRACEhAKDExJVEVf", + "UlVOVElNRRADKgkI6AcQgICAgAIi5gEKDk1lc3NhZ2VPcHRpb25zEiYKF21l", + "c3NhZ2Vfc2V0X3dpcmVfZm9ybWF0GAEgASgIOgVmYWxzZRIuCh9ub19zdGFu", + "ZGFyZF9kZXNjcmlwdG9yX2FjY2Vzc29yGAIgASgIOgVmYWxzZRIZCgpkZXBy", + "ZWNhdGVkGAMgASgIOgVmYWxzZRIRCgltYXBfZW50cnkYByABKAgSQwoUdW5p", + "bnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVu", + "aW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiKgAgoMRmllbGRPcHRpb25z", + "EjoKBWN0eXBlGAEgASgOMiMuZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9u", + "cy5DVHlwZToGU1RSSU5HEg4KBnBhY2tlZBgCIAEoCBITCgRsYXp5GAUgASgI", + "OgVmYWxzZRIZCgpkZXByZWNhdGVkGAMgASgIOgVmYWxzZRITCgR3ZWFrGAog", + "ASgIOgVmYWxzZRJDChR1bmludGVycHJldGVkX29wdGlvbhjnByADKAsyJC5n", + "b29nbGUucHJvdG9idWYuVW5pbnRlcnByZXRlZE9wdGlvbiIvCgVDVHlwZRIK", + "CgZTVFJJTkcQABIICgRDT1JEEAESEAoMU1RSSU5HX1BJRUNFEAIqCQjoBxCA", + "gICAAiKNAQoLRW51bU9wdGlvbnMSEwoLYWxsb3dfYWxpYXMYAiABKAgSGQoK", + "ZGVwcmVjYXRlZBgDIAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRp", + "b24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRp", + "b24qCQjoBxCAgICAAiJ9ChBFbnVtVmFsdWVPcHRpb25zEhkKCmRlcHJlY2F0", + "ZWQYASABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMo", + "CzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQ", + "gICAgAIiewoOU2VydmljZU9wdGlvbnMSGQoKZGVwcmVjYXRlZBghIAEoCDoF", + "ZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xl", + "LnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiJ6Cg1N", + "ZXRob2RPcHRpb25zEhkKCmRlcHJlY2F0ZWQYISABKAg6BWZhbHNlEkMKFHVu", + "aW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5V", + "bmludGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAIingIKE1VuaW50ZXJwcmV0", + "ZWRPcHRpb24SOwoEbmFtZRgCIAMoCzItLmdvb2dsZS5wcm90b2J1Zi5Vbmlu", + "dGVycHJldGVkT3B0aW9uLk5hbWVQYXJ0EhgKEGlkZW50aWZpZXJfdmFsdWUY", + "AyABKAkSGgoScG9zaXRpdmVfaW50X3ZhbHVlGAQgASgEEhoKEm5lZ2F0aXZl", + "X2ludF92YWx1ZRgFIAEoAxIUCgxkb3VibGVfdmFsdWUYBiABKAESFAoMc3Ry", + "aW5nX3ZhbHVlGAcgASgMEhcKD2FnZ3JlZ2F0ZV92YWx1ZRgIIAEoCRozCghO", + "YW1lUGFydBIRCgluYW1lX3BhcnQYASACKAkSFAoMaXNfZXh0ZW5zaW9uGAIg", + "AigIItUBCg5Tb3VyY2VDb2RlSW5mbxI6Cghsb2NhdGlvbhgBIAMoCzIoLmdv", + "b2dsZS5wcm90b2J1Zi5Tb3VyY2VDb2RlSW5mby5Mb2NhdGlvbhqGAQoITG9j", + "YXRpb24SEAoEcGF0aBgBIAMoBUICEAESEAoEc3BhbhgCIAMoBUICEAESGAoQ", + "bGVhZGluZ19jb21tZW50cxgDIAEoCRIZChF0cmFpbGluZ19jb21tZW50cxgE", + "IAEoCRIhChlsZWFkaW5nX2RldGFjaGVkX2NvbW1lbnRzGAYgAygJQlMKE2Nv", + "bS5nb29nbGUucHJvdG9idWZCEERlc2NyaXB0b3JQcm90b3NIAaoCJ0dvb2ds", + "ZS5Qcm90b2NvbEJ1ZmZlcnMuRGVzY3JpcHRvclByb3Rvcw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_google_protobuf_FileDescriptorSet__Descriptor = Descriptor.MessageTypes[0]; + internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorSet__Descriptor, + new string[] { "File", }); + internal__static_google_protobuf_FileDescriptorProto__Descriptor = Descriptor.MessageTypes[1]; + internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorProto__Descriptor, + new string[] { "Name", "Package", "Dependency", "PublicDependency", "WeakDependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", "Syntax", }); + internal__static_google_protobuf_DescriptorProto__Descriptor = Descriptor.MessageTypes[2]; + internal__static_google_protobuf_DescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto__Descriptor, + new string[] { "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "OneofDecl", "Options", }); + internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor = internal__static_google_protobuf_DescriptorProto__Descriptor.NestedTypes[0]; + internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor, + new string[] { "Start", "End", }); + internal__static_google_protobuf_FieldDescriptorProto__Descriptor = Descriptor.MessageTypes[3]; + internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldDescriptorProto__Descriptor, + new string[] { "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "Options", }); + internal__static_google_protobuf_OneofDescriptorProto__Descriptor = Descriptor.MessageTypes[4]; + internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_OneofDescriptorProto__Descriptor, + new string[] { "Name", }); + internal__static_google_protobuf_EnumDescriptorProto__Descriptor = Descriptor.MessageTypes[5]; + internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumDescriptorProto__Descriptor, + new string[] { "Name", "Value", "Options", }); + internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor = Descriptor.MessageTypes[6]; + internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor, + new string[] { "Name", "Number", "Options", }); + internal__static_google_protobuf_ServiceDescriptorProto__Descriptor = Descriptor.MessageTypes[7]; + internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceDescriptorProto__Descriptor, + new string[] { "Name", "Method", "Options", }); + internal__static_google_protobuf_MethodDescriptorProto__Descriptor = Descriptor.MessageTypes[8]; + internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodDescriptorProto__Descriptor, + new string[] { "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming", }); + internal__static_google_protobuf_FileOptions__Descriptor = Descriptor.MessageTypes[9]; + internal__static_google_protobuf_FileOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileOptions__Descriptor, + new string[] { "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "JavaStringCheckUtf8", "OptimizeFor", "GoPackage", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "Deprecated", "CcEnableArenas", "ObjcClassPrefix", "CsharpNamespace", "UninterpretedOption", }); + internal__static_google_protobuf_MessageOptions__Descriptor = Descriptor.MessageTypes[10]; + internal__static_google_protobuf_MessageOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MessageOptions__Descriptor, + new string[] { "MessageSetWireFormat", "NoStandardDescriptorAccessor", "Deprecated", "MapEntry", "UninterpretedOption", }); + internal__static_google_protobuf_FieldOptions__Descriptor = Descriptor.MessageTypes[11]; + internal__static_google_protobuf_FieldOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldOptions__Descriptor, + new string[] { "Ctype", "Packed", "Lazy", "Deprecated", "Weak", "UninterpretedOption", }); + internal__static_google_protobuf_EnumOptions__Descriptor = Descriptor.MessageTypes[12]; + internal__static_google_protobuf_EnumOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumOptions__Descriptor, + new string[] { "AllowAlias", "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_EnumValueOptions__Descriptor = Descriptor.MessageTypes[13]; + internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueOptions__Descriptor, + new string[] { "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_ServiceOptions__Descriptor = Descriptor.MessageTypes[14]; + internal__static_google_protobuf_ServiceOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceOptions__Descriptor, + new string[] { "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_MethodOptions__Descriptor = Descriptor.MessageTypes[15]; + internal__static_google_protobuf_MethodOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodOptions__Descriptor, + new string[] { "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_UninterpretedOption__Descriptor = Descriptor.MessageTypes[16]; + internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption__Descriptor, + new string[] { "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue", }); + internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor = internal__static_google_protobuf_UninterpretedOption__Descriptor.NestedTypes[0]; + internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor, + new string[] { "NamePart_", "IsExtension", }); + internal__static_google_protobuf_SourceCodeInfo__Descriptor = Descriptor.MessageTypes[17]; + internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo__Descriptor, + new string[] { "Location", }); + internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor = internal__static_google_protobuf_SourceCodeInfo__Descriptor.NestedTypes[0]; + internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor, + new string[] { "Path", "Span", "LeadingComments", "TrailingComments", "LeadingDetachedComments", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FileDescriptorSet : pb::GeneratedMessage { + private FileDescriptorSet() { } + private static readonly FileDescriptorSet defaultInstance = new FileDescriptorSet().MakeReadOnly(); + private static readonly string[] _fileDescriptorSetFieldNames = new string[] { "file" }; + private static readonly uint[] _fileDescriptorSetFieldTags = new uint[] { 10 }; + public static FileDescriptorSet DefaultInstance { + get { return defaultInstance; } + } + + public override FileDescriptorSet DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FileDescriptorSet ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; } + } + + public const int FileFieldNumber = 1; + private pbc::PopsicleList file_ = new pbc::PopsicleList(); + public scg::IList FileList { + get { return file_; } + } + public int FileCount { + get { return file_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { + return file_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fileDescriptorSetFieldNames; + if (file_.Count > 0) { + output.WriteMessageArray(1, field_names[0], file_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FileDescriptorSet ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FileDescriptorSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FileDescriptorSet ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FileDescriptorSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FileDescriptorSet ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FileDescriptorSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FileDescriptorSet ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FileDescriptorSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FileDescriptorSet MakeReadOnly() { + file_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FileDescriptorSet prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FileDescriptorSet cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FileDescriptorSet result; + + private FileDescriptorSet PrepareBuilder() { + if (resultIsReadOnly) { + FileDescriptorSet original = result; + result = new FileDescriptorSet(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FileDescriptorSet MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.Descriptor; } + } + + public override FileDescriptorSet DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance; } + } + + public override FileDescriptorSet BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FileDescriptorSet) { + return MergeFrom((FileDescriptorSet) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FileDescriptorSet other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance) return this; + PrepareBuilder(); + if (other.file_.Count != 0) { + result.file_.Add(other.file_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fileDescriptorSetFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fileDescriptorSetFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.file_, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList FileList { + get { return PrepareBuilder().file_; } + } + public int FileCount { + get { return result.FileCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { + return result.GetFile(index); + } + public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.file_[index] = value; + return this; + } + public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.file_[index] = builderForValue.Build(); + return this; + } + public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.file_.Add(value); + return this; + } + public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.file_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFile(scg::IEnumerable values) { + PrepareBuilder(); + result.file_.Add(values); + return this; + } + public Builder ClearFile() { + PrepareBuilder(); + result.file_.Clear(); + return this; + } + } + static FileDescriptorSet() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FileDescriptorProto : pb::GeneratedMessage { + private FileDescriptorProto() { } + private static readonly FileDescriptorProto defaultInstance = new FileDescriptorProto().MakeReadOnly(); + private static readonly string[] _fileDescriptorProtoFieldNames = new string[] { "dependency", "enum_type", "extension", "message_type", "name", "options", "package", "public_dependency", "service", "source_code_info", "syntax", "weak_dependency" }; + private static readonly uint[] _fileDescriptorProtoFieldTags = new uint[] { 26, 42, 58, 34, 10, 66, 18, 80, 50, 74, 98, 88 }; + public static FileDescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override FileDescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FileDescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int PackageFieldNumber = 2; + private bool hasPackage; + private string package_ = ""; + public bool HasPackage { + get { return hasPackage; } + } + public string Package { + get { return package_; } + } + + public const int DependencyFieldNumber = 3; + private pbc::PopsicleList dependency_ = new pbc::PopsicleList(); + public scg::IList DependencyList { + get { return pbc::Lists.AsReadOnly(dependency_); } + } + public int DependencyCount { + get { return dependency_.Count; } + } + public string GetDependency(int index) { + return dependency_[index]; + } + + public const int PublicDependencyFieldNumber = 10; + private pbc::PopsicleList publicDependency_ = new pbc::PopsicleList(); + public scg::IList PublicDependencyList { + get { return pbc::Lists.AsReadOnly(publicDependency_); } + } + public int PublicDependencyCount { + get { return publicDependency_.Count; } + } + public int GetPublicDependency(int index) { + return publicDependency_[index]; + } + + public const int WeakDependencyFieldNumber = 11; + private pbc::PopsicleList weakDependency_ = new pbc::PopsicleList(); + public scg::IList WeakDependencyList { + get { return pbc::Lists.AsReadOnly(weakDependency_); } + } + public int WeakDependencyCount { + get { return weakDependency_.Count; } + } + public int GetWeakDependency(int index) { + return weakDependency_[index]; + } + + public const int MessageTypeFieldNumber = 4; + private pbc::PopsicleList messageType_ = new pbc::PopsicleList(); + public scg::IList MessageTypeList { + get { return messageType_; } + } + public int MessageTypeCount { + get { return messageType_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { + return messageType_[index]; + } + + public const int EnumTypeFieldNumber = 5; + private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); + public scg::IList EnumTypeList { + get { return enumType_; } + } + public int EnumTypeCount { + get { return enumType_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { + return enumType_[index]; + } + + public const int ServiceFieldNumber = 6; + private pbc::PopsicleList service_ = new pbc::PopsicleList(); + public scg::IList ServiceList { + get { return service_; } + } + public int ServiceCount { + get { return service_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { + return service_[index]; + } + + public const int ExtensionFieldNumber = 7; + private pbc::PopsicleList extension_ = new pbc::PopsicleList(); + public scg::IList ExtensionList { + get { return extension_; } + } + public int ExtensionCount { + get { return extension_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { + return extension_[index]; + } + + public const int OptionsFieldNumber = 8; + private bool hasOptions; + private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { + get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } + } + + public const int SourceCodeInfoFieldNumber = 9; + private bool hasSourceCodeInfo; + private global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo sourceCodeInfo_; + public bool HasSourceCodeInfo { + get { return hasSourceCodeInfo; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo SourceCodeInfo { + get { return sourceCodeInfo_ ?? global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance; } + } + + public const int SyntaxFieldNumber = 12; + private bool hasSyntax; + private string syntax_ = ""; + public bool HasSyntax { + get { return hasSyntax; } + } + public string Syntax { + get { return syntax_; } + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { + if (!element.IsInitialized) return false; + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { + if (!element.IsInitialized) return false; + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { + if (!element.IsInitialized) return false; + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { + if (!element.IsInitialized) return false; + } + if (HasOptions) { + if (!Options.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fileDescriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[4], Name); + } + if (hasPackage) { + output.WriteString(2, field_names[6], Package); + } + if (dependency_.Count > 0) { + output.WriteStringArray(3, field_names[0], dependency_); + } + if (messageType_.Count > 0) { + output.WriteMessageArray(4, field_names[3], messageType_); + } + if (enumType_.Count > 0) { + output.WriteMessageArray(5, field_names[1], enumType_); + } + if (service_.Count > 0) { + output.WriteMessageArray(6, field_names[8], service_); + } + if (extension_.Count > 0) { + output.WriteMessageArray(7, field_names[2], extension_); + } + if (hasOptions) { + output.WriteMessage(8, field_names[5], Options); + } + if (hasSourceCodeInfo) { + output.WriteMessage(9, field_names[9], SourceCodeInfo); + } + if (publicDependency_.Count > 0) { + output.WriteInt32Array(10, field_names[7], publicDependency_); + } + if (weakDependency_.Count > 0) { + output.WriteInt32Array(11, field_names[11], weakDependency_); + } + if (hasSyntax) { + output.WriteString(12, field_names[10], Syntax); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasPackage) { + size += pb::CodedOutputStream.ComputeStringSize(2, Package); + } + { + int dataSize = 0; + foreach (string element in DependencyList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * dependency_.Count; + } + { + int dataSize = 0; + foreach (int element in PublicDependencyList) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + size += 1 * publicDependency_.Count; + } + { + int dataSize = 0; + foreach (int element in WeakDependencyList) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + size += 1 * weakDependency_.Count; + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { + size += pb::CodedOutputStream.ComputeMessageSize(5, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { + size += pb::CodedOutputStream.ComputeMessageSize(6, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { + size += pb::CodedOutputStream.ComputeMessageSize(7, element); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(8, Options); + } + if (hasSourceCodeInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(9, SourceCodeInfo); + } + if (hasSyntax) { + size += pb::CodedOutputStream.ComputeStringSize(12, Syntax); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FileDescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FileDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FileDescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FileDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FileDescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FileDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FileDescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FileDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FileDescriptorProto MakeReadOnly() { + dependency_.MakeReadOnly(); + publicDependency_.MakeReadOnly(); + weakDependency_.MakeReadOnly(); + messageType_.MakeReadOnly(); + enumType_.MakeReadOnly(); + service_.MakeReadOnly(); + extension_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FileDescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FileDescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FileDescriptorProto result; + + private FileDescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + FileDescriptorProto original = result; + result = new FileDescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FileDescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Descriptor; } + } + + public override FileDescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance; } + } + + public override FileDescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FileDescriptorProto) { + return MergeFrom((FileDescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FileDescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasPackage) { + Package = other.Package; + } + if (other.dependency_.Count != 0) { + result.dependency_.Add(other.dependency_); + } + if (other.publicDependency_.Count != 0) { + result.publicDependency_.Add(other.publicDependency_); + } + if (other.weakDependency_.Count != 0) { + result.weakDependency_.Add(other.weakDependency_); + } + if (other.messageType_.Count != 0) { + result.messageType_.Add(other.messageType_); + } + if (other.enumType_.Count != 0) { + result.enumType_.Add(other.enumType_); + } + if (other.service_.Count != 0) { + result.service_.Add(other.service_); + } + if (other.extension_.Count != 0) { + result.extension_.Add(other.extension_); + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + if (other.HasSourceCodeInfo) { + MergeSourceCodeInfo(other.SourceCodeInfo); + } + if (other.HasSyntax) { + Syntax = other.Syntax; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fileDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fileDescriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 18: { + result.hasPackage = input.ReadString(ref result.package_); + break; + } + case 26: { + input.ReadStringArray(tag, field_name, result.dependency_); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.messageType_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 42: { + input.ReadMessageArray(tag, field_name, result.enumType_, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 50: { + input.ReadMessageArray(tag, field_name, result.service_, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 58: { + input.ReadMessageArray(tag, field_name, result.extension_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 66: { + global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + case 74: { + global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.CreateBuilder(); + if (result.hasSourceCodeInfo) { + subBuilder.MergeFrom(SourceCodeInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + SourceCodeInfo = subBuilder.BuildPartial(); + break; + } + case 82: + case 80: { + input.ReadInt32Array(tag, field_name, result.publicDependency_); + break; + } + case 90: + case 88: { + input.ReadInt32Array(tag, field_name, result.weakDependency_); + break; + } + case 98: { + result.hasSyntax = input.ReadString(ref result.syntax_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasPackage { + get { return result.hasPackage; } + } + public string Package { + get { return result.Package; } + set { SetPackage(value); } + } + public Builder SetPackage(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPackage = true; + result.package_ = value; + return this; + } + public Builder ClearPackage() { + PrepareBuilder(); + result.hasPackage = false; + result.package_ = ""; + return this; + } + + public pbc::IPopsicleList DependencyList { + get { return PrepareBuilder().dependency_; } + } + public int DependencyCount { + get { return result.DependencyCount; } + } + public string GetDependency(int index) { + return result.GetDependency(index); + } + public Builder SetDependency(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.dependency_[index] = value; + return this; + } + public Builder AddDependency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.dependency_.Add(value); + return this; + } + public Builder AddRangeDependency(scg::IEnumerable values) { + PrepareBuilder(); + result.dependency_.Add(values); + return this; + } + public Builder ClearDependency() { + PrepareBuilder(); + result.dependency_.Clear(); + return this; + } + + public pbc::IPopsicleList PublicDependencyList { + get { return PrepareBuilder().publicDependency_; } + } + public int PublicDependencyCount { + get { return result.PublicDependencyCount; } + } + public int GetPublicDependency(int index) { + return result.GetPublicDependency(index); + } + public Builder SetPublicDependency(int index, int value) { + PrepareBuilder(); + result.publicDependency_[index] = value; + return this; + } + public Builder AddPublicDependency(int value) { + PrepareBuilder(); + result.publicDependency_.Add(value); + return this; + } + public Builder AddRangePublicDependency(scg::IEnumerable values) { + PrepareBuilder(); + result.publicDependency_.Add(values); + return this; + } + public Builder ClearPublicDependency() { + PrepareBuilder(); + result.publicDependency_.Clear(); + return this; + } + + public pbc::IPopsicleList WeakDependencyList { + get { return PrepareBuilder().weakDependency_; } + } + public int WeakDependencyCount { + get { return result.WeakDependencyCount; } + } + public int GetWeakDependency(int index) { + return result.GetWeakDependency(index); + } + public Builder SetWeakDependency(int index, int value) { + PrepareBuilder(); + result.weakDependency_[index] = value; + return this; + } + public Builder AddWeakDependency(int value) { + PrepareBuilder(); + result.weakDependency_.Add(value); + return this; + } + public Builder AddRangeWeakDependency(scg::IEnumerable values) { + PrepareBuilder(); + result.weakDependency_.Add(values); + return this; + } + public Builder ClearWeakDependency() { + PrepareBuilder(); + result.weakDependency_.Clear(); + return this; + } + + public pbc::IPopsicleList MessageTypeList { + get { return PrepareBuilder().messageType_; } + } + public int MessageTypeCount { + get { return result.MessageTypeCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { + return result.GetMessageType(index); + } + public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.messageType_[index] = value; + return this; + } + public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.messageType_[index] = builderForValue.Build(); + return this; + } + public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.messageType_.Add(value); + return this; + } + public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.messageType_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMessageType(scg::IEnumerable values) { + PrepareBuilder(); + result.messageType_.Add(values); + return this; + } + public Builder ClearMessageType() { + PrepareBuilder(); + result.messageType_.Clear(); + return this; + } + + public pbc::IPopsicleList EnumTypeList { + get { return PrepareBuilder().enumType_; } + } + public int EnumTypeCount { + get { return result.EnumTypeCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { + return result.GetEnumType(index); + } + public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.enumType_[index] = value; + return this; + } + public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.enumType_[index] = builderForValue.Build(); + return this; + } + public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.enumType_.Add(value); + return this; + } + public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.enumType_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeEnumType(scg::IEnumerable values) { + PrepareBuilder(); + result.enumType_.Add(values); + return this; + } + public Builder ClearEnumType() { + PrepareBuilder(); + result.enumType_.Clear(); + return this; + } + + public pbc::IPopsicleList ServiceList { + get { return PrepareBuilder().service_; } + } + public int ServiceCount { + get { return result.ServiceCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { + return result.GetService(index); + } + public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.service_[index] = value; + return this; + } + public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.service_[index] = builderForValue.Build(); + return this; + } + public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.service_.Add(value); + return this; + } + public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.service_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeService(scg::IEnumerable values) { + PrepareBuilder(); + result.service_.Add(values); + return this; + } + public Builder ClearService() { + PrepareBuilder(); + result.service_.Clear(); + return this; + } + + public pbc::IPopsicleList ExtensionList { + get { return PrepareBuilder().extension_; } + } + public int ExtensionCount { + get { return result.ExtensionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { + return result.GetExtension(index); + } + public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.extension_[index] = value; + return this; + } + public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.extension_[index] = builderForValue.Build(); + return this; + } + public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.extension_.Add(value); + return this; + } + public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.extension_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeExtension(scg::IEnumerable values) { + PrepareBuilder(); + result.extension_.Add(values); + return this; + } + public Builder ClearExtension() { + PrepareBuilder(); + result.extension_.Clear(); + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) { + result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + + public bool HasSourceCodeInfo { + get { return result.hasSourceCodeInfo; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo SourceCodeInfo { + get { return result.SourceCodeInfo; } + set { SetSourceCodeInfo(value); } + } + public Builder SetSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSourceCodeInfo = true; + result.sourceCodeInfo_ = value; + return this; + } + public Builder SetSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSourceCodeInfo = true; + result.sourceCodeInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSourceCodeInfo && + result.sourceCodeInfo_ != global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance) { + result.sourceCodeInfo_ = global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.CreateBuilder(result.sourceCodeInfo_).MergeFrom(value).BuildPartial(); + } else { + result.sourceCodeInfo_ = value; + } + result.hasSourceCodeInfo = true; + return this; + } + public Builder ClearSourceCodeInfo() { + PrepareBuilder(); + result.hasSourceCodeInfo = false; + result.sourceCodeInfo_ = null; + return this; + } + + public bool HasSyntax { + get { return result.hasSyntax; } + } + public string Syntax { + get { return result.Syntax; } + set { SetSyntax(value); } + } + public Builder SetSyntax(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSyntax = true; + result.syntax_ = value; + return this; + } + public Builder ClearSyntax() { + PrepareBuilder(); + result.hasSyntax = false; + result.syntax_ = ""; + return this; + } + } + static FileDescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DescriptorProto : pb::GeneratedMessage { + private DescriptorProto() { } + private static readonly DescriptorProto defaultInstance = new DescriptorProto().MakeReadOnly(); + private static readonly string[] _descriptorProtoFieldNames = new string[] { "enum_type", "extension", "extension_range", "field", "name", "nested_type", "oneof_decl", "options" }; + private static readonly uint[] _descriptorProtoFieldTags = new uint[] { 34, 50, 42, 18, 10, 26, 66, 58 }; + public static DescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override DescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ExtensionRange : pb::GeneratedMessage { + private ExtensionRange() { } + private static readonly ExtensionRange defaultInstance = new ExtensionRange().MakeReadOnly(); + private static readonly string[] _extensionRangeFieldNames = new string[] { "end", "start" }; + private static readonly uint[] _extensionRangeFieldTags = new uint[] { 16, 8 }; + public static ExtensionRange DefaultInstance { + get { return defaultInstance; } + } + + public override ExtensionRange DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ExtensionRange ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; } + } + + public const int StartFieldNumber = 1; + private bool hasStart; + private int start_; + public bool HasStart { + get { return hasStart; } + } + public int Start { + get { return start_; } + } + + public const int EndFieldNumber = 2; + private bool hasEnd; + private int end_; + public bool HasEnd { + get { return hasEnd; } + } + public int End { + get { return end_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _extensionRangeFieldNames; + if (hasStart) { + output.WriteInt32(1, field_names[1], Start); + } + if (hasEnd) { + output.WriteInt32(2, field_names[0], End); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStart) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Start); + } + if (hasEnd) { + size += pb::CodedOutputStream.ComputeInt32Size(2, End); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ExtensionRange ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ExtensionRange ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ExtensionRange ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ExtensionRange ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ExtensionRange ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ExtensionRange ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ExtensionRange ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ExtensionRange ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ExtensionRange MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ExtensionRange prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ExtensionRange cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ExtensionRange result; + + private ExtensionRange PrepareBuilder() { + if (resultIsReadOnly) { + ExtensionRange original = result; + result = new ExtensionRange(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ExtensionRange MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Descriptor; } + } + + public override ExtensionRange DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance; } + } + + public override ExtensionRange BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ExtensionRange) { + return MergeFrom((ExtensionRange) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ExtensionRange other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStart) { + Start = other.Start; + } + if (other.HasEnd) { + End = other.End; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_extensionRangeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _extensionRangeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasStart = input.ReadInt32(ref result.start_); + break; + } + case 16: { + result.hasEnd = input.ReadInt32(ref result.end_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStart { + get { return result.hasStart; } + } + public int Start { + get { return result.Start; } + set { SetStart(value); } + } + public Builder SetStart(int value) { + PrepareBuilder(); + result.hasStart = true; + result.start_ = value; + return this; + } + public Builder ClearStart() { + PrepareBuilder(); + result.hasStart = false; + result.start_ = 0; + return this; + } + + public bool HasEnd { + get { return result.hasEnd; } + } + public int End { + get { return result.End; } + set { SetEnd(value); } + } + public Builder SetEnd(int value) { + PrepareBuilder(); + result.hasEnd = true; + result.end_ = value; + return this; + } + public Builder ClearEnd() { + PrepareBuilder(); + result.hasEnd = false; + result.end_ = 0; + return this; + } + } + static ExtensionRange() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + } + #endregion + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int FieldFieldNumber = 2; + private pbc::PopsicleList field_ = new pbc::PopsicleList(); + public scg::IList FieldList { + get { return field_; } + } + public int FieldCount { + get { return field_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { + return field_[index]; + } + + public const int ExtensionFieldNumber = 6; + private pbc::PopsicleList extension_ = new pbc::PopsicleList(); + public scg::IList ExtensionList { + get { return extension_; } + } + public int ExtensionCount { + get { return extension_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { + return extension_[index]; + } + + public const int NestedTypeFieldNumber = 3; + private pbc::PopsicleList nestedType_ = new pbc::PopsicleList(); + public scg::IList NestedTypeList { + get { return nestedType_; } + } + public int NestedTypeCount { + get { return nestedType_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { + return nestedType_[index]; + } + + public const int EnumTypeFieldNumber = 4; + private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); + public scg::IList EnumTypeList { + get { return enumType_; } + } + public int EnumTypeCount { + get { return enumType_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { + return enumType_[index]; + } + + public const int ExtensionRangeFieldNumber = 5; + private pbc::PopsicleList extensionRange_ = new pbc::PopsicleList(); + public scg::IList ExtensionRangeList { + get { return extensionRange_; } + } + public int ExtensionRangeCount { + get { return extensionRange_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { + return extensionRange_[index]; + } + + public const int OneofDeclFieldNumber = 8; + private pbc::PopsicleList oneofDecl_ = new pbc::PopsicleList(); + public scg::IList OneofDeclList { + get { return oneofDecl_; } + } + public int OneofDeclCount { + get { return oneofDecl_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto GetOneofDecl(int index) { + return oneofDecl_[index]; + } + + public const int OptionsFieldNumber = 7; + private bool hasOptions; + private global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { + get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; } + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { + if (!element.IsInitialized) return false; + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { + if (!element.IsInitialized) return false; + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { + if (!element.IsInitialized) return false; + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { + if (!element.IsInitialized) return false; + } + if (HasOptions) { + if (!Options.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _descriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[4], Name); + } + if (field_.Count > 0) { + output.WriteMessageArray(2, field_names[3], field_); + } + if (nestedType_.Count > 0) { + output.WriteMessageArray(3, field_names[5], nestedType_); + } + if (enumType_.Count > 0) { + output.WriteMessageArray(4, field_names[0], enumType_); + } + if (extensionRange_.Count > 0) { + output.WriteMessageArray(5, field_names[2], extensionRange_); + } + if (extension_.Count > 0) { + output.WriteMessageArray(6, field_names[1], extension_); + } + if (hasOptions) { + output.WriteMessage(7, field_names[7], Options); + } + if (oneofDecl_.Count > 0) { + output.WriteMessageArray(8, field_names[6], oneofDecl_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { + size += pb::CodedOutputStream.ComputeMessageSize(6, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange element in ExtensionRangeList) { + size += pb::CodedOutputStream.ComputeMessageSize(5, element); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto element in OneofDeclList) { + size += pb::CodedOutputStream.ComputeMessageSize(8, element); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(7, Options); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DescriptorProto MakeReadOnly() { + field_.MakeReadOnly(); + extension_.MakeReadOnly(); + nestedType_.MakeReadOnly(); + enumType_.MakeReadOnly(); + extensionRange_.MakeReadOnly(); + oneofDecl_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DescriptorProto result; + + private DescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + DescriptorProto original = result; + result = new DescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Descriptor; } + } + + public override DescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance; } + } + + public override DescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DescriptorProto) { + return MergeFrom((DescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.field_.Count != 0) { + result.field_.Add(other.field_); + } + if (other.extension_.Count != 0) { + result.extension_.Add(other.extension_); + } + if (other.nestedType_.Count != 0) { + result.nestedType_.Add(other.nestedType_); + } + if (other.enumType_.Count != 0) { + result.enumType_.Add(other.enumType_); + } + if (other.extensionRange_.Count != 0) { + result.extensionRange_.Add(other.extensionRange_); + } + if (other.oneofDecl_.Count != 0) { + result.oneofDecl_.Add(other.oneofDecl_); + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_descriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _descriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.field_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.nestedType_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.enumType_, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 42: { + input.ReadMessageArray(tag, field_name, result.extensionRange_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance, extensionRegistry); + break; + } + case 50: { + input.ReadMessageArray(tag, field_name, result.extension_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 58: { + global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + case 66: { + input.ReadMessageArray(tag, field_name, result.oneofDecl_, global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public pbc::IPopsicleList FieldList { + get { return PrepareBuilder().field_; } + } + public int FieldCount { + get { return result.FieldCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { + return result.GetField(index); + } + public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field_[index] = value; + return this; + } + public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.field_[index] = builderForValue.Build(); + return this; + } + public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field_.Add(value); + return this; + } + public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.field_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeField(scg::IEnumerable values) { + PrepareBuilder(); + result.field_.Add(values); + return this; + } + public Builder ClearField() { + PrepareBuilder(); + result.field_.Clear(); + return this; + } + + public pbc::IPopsicleList ExtensionList { + get { return PrepareBuilder().extension_; } + } + public int ExtensionCount { + get { return result.ExtensionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { + return result.GetExtension(index); + } + public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.extension_[index] = value; + return this; + } + public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.extension_[index] = builderForValue.Build(); + return this; + } + public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.extension_.Add(value); + return this; + } + public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.extension_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeExtension(scg::IEnumerable values) { + PrepareBuilder(); + result.extension_.Add(values); + return this; + } + public Builder ClearExtension() { + PrepareBuilder(); + result.extension_.Clear(); + return this; + } + + public pbc::IPopsicleList NestedTypeList { + get { return PrepareBuilder().nestedType_; } + } + public int NestedTypeCount { + get { return result.NestedTypeCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { + return result.GetNestedType(index); + } + public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.nestedType_[index] = value; + return this; + } + public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.nestedType_[index] = builderForValue.Build(); + return this; + } + public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.nestedType_.Add(value); + return this; + } + public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.nestedType_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeNestedType(scg::IEnumerable values) { + PrepareBuilder(); + result.nestedType_.Add(values); + return this; + } + public Builder ClearNestedType() { + PrepareBuilder(); + result.nestedType_.Clear(); + return this; + } + + public pbc::IPopsicleList EnumTypeList { + get { return PrepareBuilder().enumType_; } + } + public int EnumTypeCount { + get { return result.EnumTypeCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { + return result.GetEnumType(index); + } + public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.enumType_[index] = value; + return this; + } + public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.enumType_[index] = builderForValue.Build(); + return this; + } + public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.enumType_.Add(value); + return this; + } + public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.enumType_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeEnumType(scg::IEnumerable values) { + PrepareBuilder(); + result.enumType_.Add(values); + return this; + } + public Builder ClearEnumType() { + PrepareBuilder(); + result.enumType_.Clear(); + return this; + } + + public pbc::IPopsicleList ExtensionRangeList { + get { return PrepareBuilder().extensionRange_; } + } + public int ExtensionRangeCount { + get { return result.ExtensionRangeCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { + return result.GetExtensionRange(index); + } + public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.extensionRange_[index] = value; + return this; + } + public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.extensionRange_[index] = builderForValue.Build(); + return this; + } + public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.extensionRange_.Add(value); + return this; + } + public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.extensionRange_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeExtensionRange(scg::IEnumerable values) { + PrepareBuilder(); + result.extensionRange_.Add(values); + return this; + } + public Builder ClearExtensionRange() { + PrepareBuilder(); + result.extensionRange_.Clear(); + return this; + } + + public pbc::IPopsicleList OneofDeclList { + get { return PrepareBuilder().oneofDecl_; } + } + public int OneofDeclCount { + get { return result.OneofDeclCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto GetOneofDecl(int index) { + return result.GetOneofDecl(index); + } + public Builder SetOneofDecl(int index, global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.oneofDecl_[index] = value; + return this; + } + public Builder SetOneofDecl(int index, global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.oneofDecl_[index] = builderForValue.Build(); + return this; + } + public Builder AddOneofDecl(global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.oneofDecl_.Add(value); + return this; + } + public Builder AddOneofDecl(global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.oneofDecl_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeOneofDecl(scg::IEnumerable values) { + PrepareBuilder(); + result.oneofDecl_.Add(values); + return this; + } + public Builder ClearOneofDecl() { + PrepareBuilder(); + result.oneofDecl_.Clear(); + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) { + result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + } + static DescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FieldDescriptorProto : pb::GeneratedMessage { + private FieldDescriptorProto() { } + private static readonly FieldDescriptorProto defaultInstance = new FieldDescriptorProto().MakeReadOnly(); + private static readonly string[] _fieldDescriptorProtoFieldNames = new string[] { "default_value", "extendee", "label", "name", "number", "oneof_index", "options", "type", "type_name" }; + private static readonly uint[] _fieldDescriptorProtoFieldTags = new uint[] { 58, 18, 32, 10, 24, 72, 66, 40, 50 }; + public static FieldDescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override FieldDescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FieldDescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18, + } + + public enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + } + + } + #endregion + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int NumberFieldNumber = 3; + private bool hasNumber; + private int number_; + public bool HasNumber { + get { return hasNumber; } + } + public int Number { + get { return number_; } + } + + public const int LabelFieldNumber = 4; + private bool hasLabel; + private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; + public bool HasLabel { + get { return hasLabel; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { + get { return label_; } + } + + public const int TypeFieldNumber = 5; + private bool hasType; + private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; + public bool HasType { + get { return hasType; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { + get { return type_; } + } + + public const int TypeNameFieldNumber = 6; + private bool hasTypeName; + private string typeName_ = ""; + public bool HasTypeName { + get { return hasTypeName; } + } + public string TypeName { + get { return typeName_; } + } + + public const int ExtendeeFieldNumber = 2; + private bool hasExtendee; + private string extendee_ = ""; + public bool HasExtendee { + get { return hasExtendee; } + } + public string Extendee { + get { return extendee_; } + } + + public const int DefaultValueFieldNumber = 7; + private bool hasDefaultValue; + private string defaultValue_ = ""; + public bool HasDefaultValue { + get { return hasDefaultValue; } + } + public string DefaultValue { + get { return defaultValue_; } + } + + public const int OneofIndexFieldNumber = 9; + private bool hasOneofIndex; + private int oneofIndex_; + public bool HasOneofIndex { + get { return hasOneofIndex; } + } + public int OneofIndex { + get { return oneofIndex_; } + } + + public const int OptionsFieldNumber = 8; + private bool hasOptions; + private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { + get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasOptions) { + if (!Options.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fieldDescriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[3], Name); + } + if (hasExtendee) { + output.WriteString(2, field_names[1], Extendee); + } + if (hasNumber) { + output.WriteInt32(3, field_names[4], Number); + } + if (hasLabel) { + output.WriteEnum(4, field_names[2], (int) Label, Label); + } + if (hasType) { + output.WriteEnum(5, field_names[7], (int) Type, Type); + } + if (hasTypeName) { + output.WriteString(6, field_names[8], TypeName); + } + if (hasDefaultValue) { + output.WriteString(7, field_names[0], DefaultValue); + } + if (hasOptions) { + output.WriteMessage(8, field_names[6], Options); + } + if (hasOneofIndex) { + output.WriteInt32(9, field_names[5], OneofIndex); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasNumber) { + size += pb::CodedOutputStream.ComputeInt32Size(3, Number); + } + if (hasLabel) { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int) Label); + } + if (hasType) { + size += pb::CodedOutputStream.ComputeEnumSize(5, (int) Type); + } + if (hasTypeName) { + size += pb::CodedOutputStream.ComputeStringSize(6, TypeName); + } + if (hasExtendee) { + size += pb::CodedOutputStream.ComputeStringSize(2, Extendee); + } + if (hasDefaultValue) { + size += pb::CodedOutputStream.ComputeStringSize(7, DefaultValue); + } + if (hasOneofIndex) { + size += pb::CodedOutputStream.ComputeInt32Size(9, OneofIndex); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(8, Options); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FieldDescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldDescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FieldDescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FieldDescriptorProto MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FieldDescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FieldDescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FieldDescriptorProto result; + + private FieldDescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + FieldDescriptorProto original = result; + result = new FieldDescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FieldDescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Descriptor; } + } + + public override FieldDescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance; } + } + + public override FieldDescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FieldDescriptorProto) { + return MergeFrom((FieldDescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FieldDescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasNumber) { + Number = other.Number; + } + if (other.HasLabel) { + Label = other.Label; + } + if (other.HasType) { + Type = other.Type; + } + if (other.HasTypeName) { + TypeName = other.TypeName; + } + if (other.HasExtendee) { + Extendee = other.Extendee; + } + if (other.HasDefaultValue) { + DefaultValue = other.DefaultValue; + } + if (other.HasOneofIndex) { + OneofIndex = other.OneofIndex; + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldDescriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 18: { + result.hasExtendee = input.ReadString(ref result.extendee_); + break; + } + case 24: { + result.hasNumber = input.ReadInt32(ref result.number_); + break; + } + case 32: { + object unknown; + if(input.ReadEnum(ref result.label_, out unknown)) { + result.hasLabel = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + case 40: { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(5, (ulong)(int)unknown); + } + break; + } + case 50: { + result.hasTypeName = input.ReadString(ref result.typeName_); + break; + } + case 58: { + result.hasDefaultValue = input.ReadString(ref result.defaultValue_); + break; + } + case 66: { + global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + case 72: { + result.hasOneofIndex = input.ReadInt32(ref result.oneofIndex_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasNumber { + get { return result.hasNumber; } + } + public int Number { + get { return result.Number; } + set { SetNumber(value); } + } + public Builder SetNumber(int value) { + PrepareBuilder(); + result.hasNumber = true; + result.number_ = value; + return this; + } + public Builder ClearNumber() { + PrepareBuilder(); + result.hasNumber = false; + result.number_ = 0; + return this; + } + + public bool HasLabel { + get { return result.hasLabel; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { + get { return result.Label; } + set { SetLabel(value); } + } + public Builder SetLabel(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label value) { + PrepareBuilder(); + result.hasLabel = true; + result.label_ = value; + return this; + } + public Builder ClearLabel() { + PrepareBuilder(); + result.hasLabel = false; + result.label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; + return this; + } + + public bool HasType { + get { return result.hasType; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; + return this; + } + + public bool HasTypeName { + get { return result.hasTypeName; } + } + public string TypeName { + get { return result.TypeName; } + set { SetTypeName(value); } + } + public Builder SetTypeName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTypeName = true; + result.typeName_ = value; + return this; + } + public Builder ClearTypeName() { + PrepareBuilder(); + result.hasTypeName = false; + result.typeName_ = ""; + return this; + } + + public bool HasExtendee { + get { return result.hasExtendee; } + } + public string Extendee { + get { return result.Extendee; } + set { SetExtendee(value); } + } + public Builder SetExtendee(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExtendee = true; + result.extendee_ = value; + return this; + } + public Builder ClearExtendee() { + PrepareBuilder(); + result.hasExtendee = false; + result.extendee_ = ""; + return this; + } + + public bool HasDefaultValue { + get { return result.hasDefaultValue; } + } + public string DefaultValue { + get { return result.DefaultValue; } + set { SetDefaultValue(value); } + } + public Builder SetDefaultValue(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDefaultValue = true; + result.defaultValue_ = value; + return this; + } + public Builder ClearDefaultValue() { + PrepareBuilder(); + result.hasDefaultValue = false; + result.defaultValue_ = ""; + return this; + } + + public bool HasOneofIndex { + get { return result.hasOneofIndex; } + } + public int OneofIndex { + get { return result.OneofIndex; } + set { SetOneofIndex(value); } + } + public Builder SetOneofIndex(int value) { + PrepareBuilder(); + result.hasOneofIndex = true; + result.oneofIndex_ = value; + return this; + } + public Builder ClearOneofIndex() { + PrepareBuilder(); + result.hasOneofIndex = false; + result.oneofIndex_ = 0; + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) { + result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + } + static FieldDescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class OneofDescriptorProto : pb::GeneratedMessage { + private OneofDescriptorProto() { } + private static readonly OneofDescriptorProto defaultInstance = new OneofDescriptorProto().MakeReadOnly(); + private static readonly string[] _oneofDescriptorProtoFieldNames = new string[] { "name" }; + private static readonly uint[] _oneofDescriptorProtoFieldTags = new uint[] { 10 }; + public static OneofDescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override OneofDescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OneofDescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_OneofDescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _oneofDescriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static OneofDescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OneofDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OneofDescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OneofDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OneofDescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OneofDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OneofDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OneofDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OneofDescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OneofDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OneofDescriptorProto MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OneofDescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OneofDescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OneofDescriptorProto result; + + private OneofDescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + OneofDescriptorProto original = result; + result = new OneofDescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OneofDescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto.Descriptor; } + } + + public override OneofDescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto.DefaultInstance; } + } + + public override OneofDescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OneofDescriptorProto) { + return MergeFrom((OneofDescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OneofDescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.OneofDescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_oneofDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _oneofDescriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + } + static OneofDescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class EnumDescriptorProto : pb::GeneratedMessage { + private EnumDescriptorProto() { } + private static readonly EnumDescriptorProto defaultInstance = new EnumDescriptorProto().MakeReadOnly(); + private static readonly string[] _enumDescriptorProtoFieldNames = new string[] { "name", "options", "value" }; + private static readonly uint[] _enumDescriptorProtoFieldTags = new uint[] { 10, 26, 18 }; + public static EnumDescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override EnumDescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EnumDescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int ValueFieldNumber = 2; + private pbc::PopsicleList value_ = new pbc::PopsicleList(); + public scg::IList ValueList { + get { return value_; } + } + public int ValueCount { + get { return value_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { + return value_[index]; + } + + public const int OptionsFieldNumber = 3; + private bool hasOptions; + private global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { + get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; } + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { + if (!element.IsInitialized) return false; + } + if (HasOptions) { + if (!Options.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _enumDescriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); + } + if (value_.Count > 0) { + output.WriteMessageArray(2, field_names[2], value_); + } + if (hasOptions) { + output.WriteMessage(3, field_names[1], Options); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Options); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static EnumDescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumDescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EnumDescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EnumDescriptorProto MakeReadOnly() { + value_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EnumDescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EnumDescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EnumDescriptorProto result; + + private EnumDescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + EnumDescriptorProto original = result; + result = new EnumDescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EnumDescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Descriptor; } + } + + public override EnumDescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance; } + } + + public override EnumDescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EnumDescriptorProto) { + return MergeFrom((EnumDescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EnumDescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.value_.Count != 0) { + result.value_.Add(other.value_); + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_enumDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _enumDescriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.value_, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 26: { + global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public pbc::IPopsicleList ValueList { + get { return PrepareBuilder().value_; } + } + public int ValueCount { + get { return result.ValueCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { + return result.GetValue(index); + } + public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.value_[index] = value; + return this; + } + public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.value_[index] = builderForValue.Build(); + return this; + } + public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.value_.Add(value); + return this; + } + public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.value_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeValue(scg::IEnumerable values) { + PrepareBuilder(); + result.value_.Add(values); + return this; + } + public Builder ClearValue() { + PrepareBuilder(); + result.value_.Clear(); + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) { + result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + } + static EnumDescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class EnumValueDescriptorProto : pb::GeneratedMessage { + private EnumValueDescriptorProto() { } + private static readonly EnumValueDescriptorProto defaultInstance = new EnumValueDescriptorProto().MakeReadOnly(); + private static readonly string[] _enumValueDescriptorProtoFieldNames = new string[] { "name", "number", "options" }; + private static readonly uint[] _enumValueDescriptorProtoFieldTags = new uint[] { 10, 16, 26 }; + public static EnumValueDescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override EnumValueDescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EnumValueDescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int NumberFieldNumber = 2; + private bool hasNumber; + private int number_; + public bool HasNumber { + get { return hasNumber; } + } + public int Number { + get { return number_; } + } + + public const int OptionsFieldNumber = 3; + private bool hasOptions; + private global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { + get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasOptions) { + if (!Options.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _enumValueDescriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); + } + if (hasNumber) { + output.WriteInt32(2, field_names[1], Number); + } + if (hasOptions) { + output.WriteMessage(3, field_names[2], Options); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasNumber) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Number); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Options); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static EnumValueDescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumValueDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumValueDescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumValueDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EnumValueDescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumValueDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EnumValueDescriptorProto MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EnumValueDescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EnumValueDescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EnumValueDescriptorProto result; + + private EnumValueDescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + EnumValueDescriptorProto original = result; + result = new EnumValueDescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EnumValueDescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Descriptor; } + } + + public override EnumValueDescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance; } + } + + public override EnumValueDescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EnumValueDescriptorProto) { + return MergeFrom((EnumValueDescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EnumValueDescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasNumber) { + Number = other.Number; + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_enumValueDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _enumValueDescriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 16: { + result.hasNumber = input.ReadInt32(ref result.number_); + break; + } + case 26: { + global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasNumber { + get { return result.hasNumber; } + } + public int Number { + get { return result.Number; } + set { SetNumber(value); } + } + public Builder SetNumber(int value) { + PrepareBuilder(); + result.hasNumber = true; + result.number_ = value; + return this; + } + public Builder ClearNumber() { + PrepareBuilder(); + result.hasNumber = false; + result.number_ = 0; + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) { + result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + } + static EnumValueDescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ServiceDescriptorProto : pb::GeneratedMessage { + private ServiceDescriptorProto() { } + private static readonly ServiceDescriptorProto defaultInstance = new ServiceDescriptorProto().MakeReadOnly(); + private static readonly string[] _serviceDescriptorProtoFieldNames = new string[] { "method", "name", "options" }; + private static readonly uint[] _serviceDescriptorProtoFieldTags = new uint[] { 18, 10, 26 }; + public static ServiceDescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override ServiceDescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServiceDescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int MethodFieldNumber = 2; + private pbc::PopsicleList method_ = new pbc::PopsicleList(); + public scg::IList MethodList { + get { return method_; } + } + public int MethodCount { + get { return method_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { + return method_[index]; + } + + public const int OptionsFieldNumber = 3; + private bool hasOptions; + private global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { + get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; } + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { + if (!element.IsInitialized) return false; + } + if (HasOptions) { + if (!Options.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _serviceDescriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[1], Name); + } + if (method_.Count > 0) { + output.WriteMessageArray(2, field_names[0], method_); + } + if (hasOptions) { + output.WriteMessage(3, field_names[2], Options); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Options); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ServiceDescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServiceDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServiceDescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServiceDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServiceDescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServiceDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServiceDescriptorProto MakeReadOnly() { + method_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServiceDescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServiceDescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServiceDescriptorProto result; + + private ServiceDescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + ServiceDescriptorProto original = result; + result = new ServiceDescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServiceDescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Descriptor; } + } + + public override ServiceDescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance; } + } + + public override ServiceDescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServiceDescriptorProto) { + return MergeFrom((ServiceDescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServiceDescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.method_.Count != 0) { + result.method_.Add(other.method_); + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serviceDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serviceDescriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.method_, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance, extensionRegistry); + break; + } + case 26: { + global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public pbc::IPopsicleList MethodList { + get { return PrepareBuilder().method_; } + } + public int MethodCount { + get { return result.MethodCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { + return result.GetMethod(index); + } + public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.method_[index] = value; + return this; + } + public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.method_[index] = builderForValue.Build(); + return this; + } + public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.method_.Add(value); + return this; + } + public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.method_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMethod(scg::IEnumerable values) { + PrepareBuilder(); + result.method_.Add(values); + return this; + } + public Builder ClearMethod() { + PrepareBuilder(); + result.method_.Clear(); + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) { + result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + } + static ServiceDescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class MethodDescriptorProto : pb::GeneratedMessage { + private MethodDescriptorProto() { } + private static readonly MethodDescriptorProto defaultInstance = new MethodDescriptorProto().MakeReadOnly(); + private static readonly string[] _methodDescriptorProtoFieldNames = new string[] { "client_streaming", "input_type", "name", "options", "output_type", "server_streaming" }; + private static readonly uint[] _methodDescriptorProtoFieldTags = new uint[] { 40, 18, 10, 34, 26, 48 }; + public static MethodDescriptorProto DefaultInstance { + get { return defaultInstance; } + } + + public override MethodDescriptorProto DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MethodDescriptorProto ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int InputTypeFieldNumber = 2; + private bool hasInputType; + private string inputType_ = ""; + public bool HasInputType { + get { return hasInputType; } + } + public string InputType { + get { return inputType_; } + } + + public const int OutputTypeFieldNumber = 3; + private bool hasOutputType; + private string outputType_ = ""; + public bool HasOutputType { + get { return hasOutputType; } + } + public string OutputType { + get { return outputType_; } + } + + public const int OptionsFieldNumber = 4; + private bool hasOptions; + private global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { + get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; } + } + + public const int ClientStreamingFieldNumber = 5; + private bool hasClientStreaming; + private bool clientStreaming_; + public bool HasClientStreaming { + get { return hasClientStreaming; } + } + public bool ClientStreaming { + get { return clientStreaming_; } + } + + public const int ServerStreamingFieldNumber = 6; + private bool hasServerStreaming; + private bool serverStreaming_; + public bool HasServerStreaming { + get { return hasServerStreaming; } + } + public bool ServerStreaming { + get { return serverStreaming_; } + } + + public override bool IsInitialized { + get { + if (HasOptions) { + if (!Options.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _methodDescriptorProtoFieldNames; + if (hasName) { + output.WriteString(1, field_names[2], Name); + } + if (hasInputType) { + output.WriteString(2, field_names[1], InputType); + } + if (hasOutputType) { + output.WriteString(3, field_names[4], OutputType); + } + if (hasOptions) { + output.WriteMessage(4, field_names[3], Options); + } + if (hasClientStreaming) { + output.WriteBool(5, field_names[0], ClientStreaming); + } + if (hasServerStreaming) { + output.WriteBool(6, field_names[5], ServerStreaming); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasInputType) { + size += pb::CodedOutputStream.ComputeStringSize(2, InputType); + } + if (hasOutputType) { + size += pb::CodedOutputStream.ComputeStringSize(3, OutputType); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(4, Options); + } + if (hasClientStreaming) { + size += pb::CodedOutputStream.ComputeBoolSize(5, ClientStreaming); + } + if (hasServerStreaming) { + size += pb::CodedOutputStream.ComputeBoolSize(6, ServerStreaming); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static MethodDescriptorProto ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MethodDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MethodDescriptorProto ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MethodDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MethodDescriptorProto ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MethodDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MethodDescriptorProto MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MethodDescriptorProto prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MethodDescriptorProto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MethodDescriptorProto result; + + private MethodDescriptorProto PrepareBuilder() { + if (resultIsReadOnly) { + MethodDescriptorProto original = result; + result = new MethodDescriptorProto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MethodDescriptorProto MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Descriptor; } + } + + public override MethodDescriptorProto DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance; } + } + + public override MethodDescriptorProto BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MethodDescriptorProto) { + return MergeFrom((MethodDescriptorProto) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MethodDescriptorProto other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasInputType) { + InputType = other.InputType; + } + if (other.HasOutputType) { + OutputType = other.OutputType; + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + if (other.HasClientStreaming) { + ClientStreaming = other.ClientStreaming; + } + if (other.HasServerStreaming) { + ServerStreaming = other.ServerStreaming; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_methodDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _methodDescriptorProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 18: { + result.hasInputType = input.ReadString(ref result.inputType_); + break; + } + case 26: { + result.hasOutputType = input.ReadString(ref result.outputType_); + break; + } + case 34: { + global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + case 40: { + result.hasClientStreaming = input.ReadBool(ref result.clientStreaming_); + break; + } + case 48: { + result.hasServerStreaming = input.ReadBool(ref result.serverStreaming_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasInputType { + get { return result.hasInputType; } + } + public string InputType { + get { return result.InputType; } + set { SetInputType(value); } + } + public Builder SetInputType(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInputType = true; + result.inputType_ = value; + return this; + } + public Builder ClearInputType() { + PrepareBuilder(); + result.hasInputType = false; + result.inputType_ = ""; + return this; + } + + public bool HasOutputType { + get { return result.hasOutputType; } + } + public string OutputType { + get { return result.OutputType; } + set { SetOutputType(value); } + } + public Builder SetOutputType(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOutputType = true; + result.outputType_ = value; + return this; + } + public Builder ClearOutputType() { + PrepareBuilder(); + result.hasOutputType = false; + result.outputType_ = ""; + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) { + result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + + public bool HasClientStreaming { + get { return result.hasClientStreaming; } + } + public bool ClientStreaming { + get { return result.ClientStreaming; } + set { SetClientStreaming(value); } + } + public Builder SetClientStreaming(bool value) { + PrepareBuilder(); + result.hasClientStreaming = true; + result.clientStreaming_ = value; + return this; + } + public Builder ClearClientStreaming() { + PrepareBuilder(); + result.hasClientStreaming = false; + result.clientStreaming_ = false; + return this; + } + + public bool HasServerStreaming { + get { return result.hasServerStreaming; } + } + public bool ServerStreaming { + get { return result.ServerStreaming; } + set { SetServerStreaming(value); } + } + public Builder SetServerStreaming(bool value) { + PrepareBuilder(); + result.hasServerStreaming = true; + result.serverStreaming_ = value; + return this; + } + public Builder ClearServerStreaming() { + PrepareBuilder(); + result.hasServerStreaming = false; + result.serverStreaming_ = false; + return this; + } + } + static MethodDescriptorProto() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FileOptions : pb::ExtendableMessage { + private FileOptions() { } + private static readonly FileOptions defaultInstance = new FileOptions().MakeReadOnly(); + private static readonly string[] _fileOptionsFieldNames = new string[] { "cc_enable_arenas", "cc_generic_services", "csharp_namespace", "deprecated", "go_package", "java_generate_equals_and_hash", "java_generic_services", "java_multiple_files", "java_outer_classname", "java_package", "java_string_check_utf8", "objc_class_prefix", "optimize_for", "py_generic_services", "uninterpreted_option" }; + private static readonly uint[] _fileOptionsFieldTags = new uint[] { 248, 128, 298, 184, 90, 160, 136, 80, 66, 10, 216, 290, 72, 144, 7994 }; + public static FileOptions DefaultInstance { + get { return defaultInstance; } + } + + public override FileOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FileOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3, + } + + } + #endregion + + public const int JavaPackageFieldNumber = 1; + private bool hasJavaPackage; + private string javaPackage_ = ""; + public bool HasJavaPackage { + get { return hasJavaPackage; } + } + public string JavaPackage { + get { return javaPackage_; } + } + + public const int JavaOuterClassnameFieldNumber = 8; + private bool hasJavaOuterClassname; + private string javaOuterClassname_ = ""; + public bool HasJavaOuterClassname { + get { return hasJavaOuterClassname; } + } + public string JavaOuterClassname { + get { return javaOuterClassname_; } + } + + public const int JavaMultipleFilesFieldNumber = 10; + private bool hasJavaMultipleFiles; + private bool javaMultipleFiles_; + public bool HasJavaMultipleFiles { + get { return hasJavaMultipleFiles; } + } + public bool JavaMultipleFiles { + get { return javaMultipleFiles_; } + } + + public const int JavaGenerateEqualsAndHashFieldNumber = 20; + private bool hasJavaGenerateEqualsAndHash; + private bool javaGenerateEqualsAndHash_; + public bool HasJavaGenerateEqualsAndHash { + get { return hasJavaGenerateEqualsAndHash; } + } + public bool JavaGenerateEqualsAndHash { + get { return javaGenerateEqualsAndHash_; } + } + + public const int JavaStringCheckUtf8FieldNumber = 27; + private bool hasJavaStringCheckUtf8; + private bool javaStringCheckUtf8_; + public bool HasJavaStringCheckUtf8 { + get { return hasJavaStringCheckUtf8; } + } + public bool JavaStringCheckUtf8 { + get { return javaStringCheckUtf8_; } + } + + public const int OptimizeForFieldNumber = 9; + private bool hasOptimizeFor; + private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; + public bool HasOptimizeFor { + get { return hasOptimizeFor; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { + get { return optimizeFor_; } + } + + public const int GoPackageFieldNumber = 11; + private bool hasGoPackage; + private string goPackage_ = ""; + public bool HasGoPackage { + get { return hasGoPackage; } + } + public string GoPackage { + get { return goPackage_; } + } + + public const int CcGenericServicesFieldNumber = 16; + private bool hasCcGenericServices; + private bool ccGenericServices_; + public bool HasCcGenericServices { + get { return hasCcGenericServices; } + } + public bool CcGenericServices { + get { return ccGenericServices_; } + } + + public const int JavaGenericServicesFieldNumber = 17; + private bool hasJavaGenericServices; + private bool javaGenericServices_; + public bool HasJavaGenericServices { + get { return hasJavaGenericServices; } + } + public bool JavaGenericServices { + get { return javaGenericServices_; } + } + + public const int PyGenericServicesFieldNumber = 18; + private bool hasPyGenericServices; + private bool pyGenericServices_; + public bool HasPyGenericServices { + get { return hasPyGenericServices; } + } + public bool PyGenericServices { + get { return pyGenericServices_; } + } + + public const int DeprecatedFieldNumber = 23; + private bool hasDeprecated; + private bool deprecated_; + public bool HasDeprecated { + get { return hasDeprecated; } + } + public bool Deprecated { + get { return deprecated_; } + } + + public const int CcEnableArenasFieldNumber = 31; + private bool hasCcEnableArenas; + private bool ccEnableArenas_; + public bool HasCcEnableArenas { + get { return hasCcEnableArenas; } + } + public bool CcEnableArenas { + get { return ccEnableArenas_; } + } + + public const int ObjcClassPrefixFieldNumber = 36; + private bool hasObjcClassPrefix; + private string objcClassPrefix_ = ""; + public bool HasObjcClassPrefix { + get { return hasObjcClassPrefix; } + } + public string ObjcClassPrefix { + get { return objcClassPrefix_; } + } + + public const int CsharpNamespaceFieldNumber = 37; + private bool hasCsharpNamespace; + private string csharpNamespace_ = ""; + public bool HasCsharpNamespace { + get { return hasCsharpNamespace; } + } + public string CsharpNamespace { + get { return csharpNamespace_; } + } + + public const int UninterpretedOptionFieldNumber = 999; + private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); + public scg::IList UninterpretedOptionList { + get { return uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return uninterpretedOption_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return uninterpretedOption_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fileOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasJavaPackage) { + output.WriteString(1, field_names[9], JavaPackage); + } + if (hasJavaOuterClassname) { + output.WriteString(8, field_names[8], JavaOuterClassname); + } + if (hasOptimizeFor) { + output.WriteEnum(9, field_names[12], (int) OptimizeFor, OptimizeFor); + } + if (hasJavaMultipleFiles) { + output.WriteBool(10, field_names[7], JavaMultipleFiles); + } + if (hasGoPackage) { + output.WriteString(11, field_names[4], GoPackage); + } + if (hasCcGenericServices) { + output.WriteBool(16, field_names[1], CcGenericServices); + } + if (hasJavaGenericServices) { + output.WriteBool(17, field_names[6], JavaGenericServices); + } + if (hasPyGenericServices) { + output.WriteBool(18, field_names[13], PyGenericServices); + } + if (hasJavaGenerateEqualsAndHash) { + output.WriteBool(20, field_names[5], JavaGenerateEqualsAndHash); + } + if (hasDeprecated) { + output.WriteBool(23, field_names[3], Deprecated); + } + if (hasJavaStringCheckUtf8) { + output.WriteBool(27, field_names[10], JavaStringCheckUtf8); + } + if (hasCcEnableArenas) { + output.WriteBool(31, field_names[0], CcEnableArenas); + } + if (hasObjcClassPrefix) { + output.WriteString(36, field_names[11], ObjcClassPrefix); + } + if (hasCsharpNamespace) { + output.WriteString(37, field_names[2], CsharpNamespace); + } + if (uninterpretedOption_.Count > 0) { + output.WriteMessageArray(999, field_names[14], uninterpretedOption_); + } + extensionWriter.WriteUntil(536870912, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasJavaPackage) { + size += pb::CodedOutputStream.ComputeStringSize(1, JavaPackage); + } + if (hasJavaOuterClassname) { + size += pb::CodedOutputStream.ComputeStringSize(8, JavaOuterClassname); + } + if (hasJavaMultipleFiles) { + size += pb::CodedOutputStream.ComputeBoolSize(10, JavaMultipleFiles); + } + if (hasJavaGenerateEqualsAndHash) { + size += pb::CodedOutputStream.ComputeBoolSize(20, JavaGenerateEqualsAndHash); + } + if (hasJavaStringCheckUtf8) { + size += pb::CodedOutputStream.ComputeBoolSize(27, JavaStringCheckUtf8); + } + if (hasOptimizeFor) { + size += pb::CodedOutputStream.ComputeEnumSize(9, (int) OptimizeFor); + } + if (hasGoPackage) { + size += pb::CodedOutputStream.ComputeStringSize(11, GoPackage); + } + if (hasCcGenericServices) { + size += pb::CodedOutputStream.ComputeBoolSize(16, CcGenericServices); + } + if (hasJavaGenericServices) { + size += pb::CodedOutputStream.ComputeBoolSize(17, JavaGenericServices); + } + if (hasPyGenericServices) { + size += pb::CodedOutputStream.ComputeBoolSize(18, PyGenericServices); + } + if (hasDeprecated) { + size += pb::CodedOutputStream.ComputeBoolSize(23, Deprecated); + } + if (hasCcEnableArenas) { + size += pb::CodedOutputStream.ComputeBoolSize(31, CcEnableArenas); + } + if (hasObjcClassPrefix) { + size += pb::CodedOutputStream.ComputeStringSize(36, ObjcClassPrefix); + } + if (hasCsharpNamespace) { + size += pb::CodedOutputStream.ComputeStringSize(37, CsharpNamespace); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + size += pb::CodedOutputStream.ComputeMessageSize(999, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FileOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FileOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FileOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FileOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FileOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FileOptions MakeReadOnly() { + uninterpretedOption_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FileOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FileOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FileOptions result; + + private FileOptions PrepareBuilder() { + if (resultIsReadOnly) { + FileOptions original = result; + result = new FileOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FileOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Descriptor; } + } + + public override FileOptions DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } + } + + public override FileOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FileOptions) { + return MergeFrom((FileOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FileOptions other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasJavaPackage) { + JavaPackage = other.JavaPackage; + } + if (other.HasJavaOuterClassname) { + JavaOuterClassname = other.JavaOuterClassname; + } + if (other.HasJavaMultipleFiles) { + JavaMultipleFiles = other.JavaMultipleFiles; + } + if (other.HasJavaGenerateEqualsAndHash) { + JavaGenerateEqualsAndHash = other.JavaGenerateEqualsAndHash; + } + if (other.HasJavaStringCheckUtf8) { + JavaStringCheckUtf8 = other.JavaStringCheckUtf8; + } + if (other.HasOptimizeFor) { + OptimizeFor = other.OptimizeFor; + } + if (other.HasGoPackage) { + GoPackage = other.GoPackage; + } + if (other.HasCcGenericServices) { + CcGenericServices = other.CcGenericServices; + } + if (other.HasJavaGenericServices) { + JavaGenericServices = other.JavaGenericServices; + } + if (other.HasPyGenericServices) { + PyGenericServices = other.PyGenericServices; + } + if (other.HasDeprecated) { + Deprecated = other.Deprecated; + } + if (other.HasCcEnableArenas) { + CcEnableArenas = other.CcEnableArenas; + } + if (other.HasObjcClassPrefix) { + ObjcClassPrefix = other.ObjcClassPrefix; + } + if (other.HasCsharpNamespace) { + CsharpNamespace = other.CsharpNamespace; + } + if (other.uninterpretedOption_.Count != 0) { + result.uninterpretedOption_.Add(other.uninterpretedOption_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fileOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fileOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasJavaPackage = input.ReadString(ref result.javaPackage_); + break; + } + case 66: { + result.hasJavaOuterClassname = input.ReadString(ref result.javaOuterClassname_); + break; + } + case 72: { + object unknown; + if(input.ReadEnum(ref result.optimizeFor_, out unknown)) { + result.hasOptimizeFor = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(9, (ulong)(int)unknown); + } + break; + } + case 80: { + result.hasJavaMultipleFiles = input.ReadBool(ref result.javaMultipleFiles_); + break; + } + case 90: { + result.hasGoPackage = input.ReadString(ref result.goPackage_); + break; + } + case 128: { + result.hasCcGenericServices = input.ReadBool(ref result.ccGenericServices_); + break; + } + case 136: { + result.hasJavaGenericServices = input.ReadBool(ref result.javaGenericServices_); + break; + } + case 144: { + result.hasPyGenericServices = input.ReadBool(ref result.pyGenericServices_); + break; + } + case 160: { + result.hasJavaGenerateEqualsAndHash = input.ReadBool(ref result.javaGenerateEqualsAndHash_); + break; + } + case 184: { + result.hasDeprecated = input.ReadBool(ref result.deprecated_); + break; + } + case 216: { + result.hasJavaStringCheckUtf8 = input.ReadBool(ref result.javaStringCheckUtf8_); + break; + } + case 248: { + result.hasCcEnableArenas = input.ReadBool(ref result.ccEnableArenas_); + break; + } + case 290: { + result.hasObjcClassPrefix = input.ReadString(ref result.objcClassPrefix_); + break; + } + case 298: { + result.hasCsharpNamespace = input.ReadString(ref result.csharpNamespace_); + break; + } + case 7994: { + input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasJavaPackage { + get { return result.hasJavaPackage; } + } + public string JavaPackage { + get { return result.JavaPackage; } + set { SetJavaPackage(value); } + } + public Builder SetJavaPackage(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasJavaPackage = true; + result.javaPackage_ = value; + return this; + } + public Builder ClearJavaPackage() { + PrepareBuilder(); + result.hasJavaPackage = false; + result.javaPackage_ = ""; + return this; + } + + public bool HasJavaOuterClassname { + get { return result.hasJavaOuterClassname; } + } + public string JavaOuterClassname { + get { return result.JavaOuterClassname; } + set { SetJavaOuterClassname(value); } + } + public Builder SetJavaOuterClassname(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasJavaOuterClassname = true; + result.javaOuterClassname_ = value; + return this; + } + public Builder ClearJavaOuterClassname() { + PrepareBuilder(); + result.hasJavaOuterClassname = false; + result.javaOuterClassname_ = ""; + return this; + } + + public bool HasJavaMultipleFiles { + get { return result.hasJavaMultipleFiles; } + } + public bool JavaMultipleFiles { + get { return result.JavaMultipleFiles; } + set { SetJavaMultipleFiles(value); } + } + public Builder SetJavaMultipleFiles(bool value) { + PrepareBuilder(); + result.hasJavaMultipleFiles = true; + result.javaMultipleFiles_ = value; + return this; + } + public Builder ClearJavaMultipleFiles() { + PrepareBuilder(); + result.hasJavaMultipleFiles = false; + result.javaMultipleFiles_ = false; + return this; + } + + public bool HasJavaGenerateEqualsAndHash { + get { return result.hasJavaGenerateEqualsAndHash; } + } + public bool JavaGenerateEqualsAndHash { + get { return result.JavaGenerateEqualsAndHash; } + set { SetJavaGenerateEqualsAndHash(value); } + } + public Builder SetJavaGenerateEqualsAndHash(bool value) { + PrepareBuilder(); + result.hasJavaGenerateEqualsAndHash = true; + result.javaGenerateEqualsAndHash_ = value; + return this; + } + public Builder ClearJavaGenerateEqualsAndHash() { + PrepareBuilder(); + result.hasJavaGenerateEqualsAndHash = false; + result.javaGenerateEqualsAndHash_ = false; + return this; + } + + public bool HasJavaStringCheckUtf8 { + get { return result.hasJavaStringCheckUtf8; } + } + public bool JavaStringCheckUtf8 { + get { return result.JavaStringCheckUtf8; } + set { SetJavaStringCheckUtf8(value); } + } + public Builder SetJavaStringCheckUtf8(bool value) { + PrepareBuilder(); + result.hasJavaStringCheckUtf8 = true; + result.javaStringCheckUtf8_ = value; + return this; + } + public Builder ClearJavaStringCheckUtf8() { + PrepareBuilder(); + result.hasJavaStringCheckUtf8 = false; + result.javaStringCheckUtf8_ = false; + return this; + } + + public bool HasOptimizeFor { + get { return result.hasOptimizeFor; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { + get { return result.OptimizeFor; } + set { SetOptimizeFor(value); } + } + public Builder SetOptimizeFor(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode value) { + PrepareBuilder(); + result.hasOptimizeFor = true; + result.optimizeFor_ = value; + return this; + } + public Builder ClearOptimizeFor() { + PrepareBuilder(); + result.hasOptimizeFor = false; + result.optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; + return this; + } + + public bool HasGoPackage { + get { return result.hasGoPackage; } + } + public string GoPackage { + get { return result.GoPackage; } + set { SetGoPackage(value); } + } + public Builder SetGoPackage(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGoPackage = true; + result.goPackage_ = value; + return this; + } + public Builder ClearGoPackage() { + PrepareBuilder(); + result.hasGoPackage = false; + result.goPackage_ = ""; + return this; + } + + public bool HasCcGenericServices { + get { return result.hasCcGenericServices; } + } + public bool CcGenericServices { + get { return result.CcGenericServices; } + set { SetCcGenericServices(value); } + } + public Builder SetCcGenericServices(bool value) { + PrepareBuilder(); + result.hasCcGenericServices = true; + result.ccGenericServices_ = value; + return this; + } + public Builder ClearCcGenericServices() { + PrepareBuilder(); + result.hasCcGenericServices = false; + result.ccGenericServices_ = false; + return this; + } + + public bool HasJavaGenericServices { + get { return result.hasJavaGenericServices; } + } + public bool JavaGenericServices { + get { return result.JavaGenericServices; } + set { SetJavaGenericServices(value); } + } + public Builder SetJavaGenericServices(bool value) { + PrepareBuilder(); + result.hasJavaGenericServices = true; + result.javaGenericServices_ = value; + return this; + } + public Builder ClearJavaGenericServices() { + PrepareBuilder(); + result.hasJavaGenericServices = false; + result.javaGenericServices_ = false; + return this; + } + + public bool HasPyGenericServices { + get { return result.hasPyGenericServices; } + } + public bool PyGenericServices { + get { return result.PyGenericServices; } + set { SetPyGenericServices(value); } + } + public Builder SetPyGenericServices(bool value) { + PrepareBuilder(); + result.hasPyGenericServices = true; + result.pyGenericServices_ = value; + return this; + } + public Builder ClearPyGenericServices() { + PrepareBuilder(); + result.hasPyGenericServices = false; + result.pyGenericServices_ = false; + return this; + } + + public bool HasDeprecated { + get { return result.hasDeprecated; } + } + public bool Deprecated { + get { return result.Deprecated; } + set { SetDeprecated(value); } + } + public Builder SetDeprecated(bool value) { + PrepareBuilder(); + result.hasDeprecated = true; + result.deprecated_ = value; + return this; + } + public Builder ClearDeprecated() { + PrepareBuilder(); + result.hasDeprecated = false; + result.deprecated_ = false; + return this; + } + + public bool HasCcEnableArenas { + get { return result.hasCcEnableArenas; } + } + public bool CcEnableArenas { + get { return result.CcEnableArenas; } + set { SetCcEnableArenas(value); } + } + public Builder SetCcEnableArenas(bool value) { + PrepareBuilder(); + result.hasCcEnableArenas = true; + result.ccEnableArenas_ = value; + return this; + } + public Builder ClearCcEnableArenas() { + PrepareBuilder(); + result.hasCcEnableArenas = false; + result.ccEnableArenas_ = false; + return this; + } + + public bool HasObjcClassPrefix { + get { return result.hasObjcClassPrefix; } + } + public string ObjcClassPrefix { + get { return result.ObjcClassPrefix; } + set { SetObjcClassPrefix(value); } + } + public Builder SetObjcClassPrefix(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasObjcClassPrefix = true; + result.objcClassPrefix_ = value; + return this; + } + public Builder ClearObjcClassPrefix() { + PrepareBuilder(); + result.hasObjcClassPrefix = false; + result.objcClassPrefix_ = ""; + return this; + } + + public bool HasCsharpNamespace { + get { return result.hasCsharpNamespace; } + } + public string CsharpNamespace { + get { return result.CsharpNamespace; } + set { SetCsharpNamespace(value); } + } + public Builder SetCsharpNamespace(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCsharpNamespace = true; + result.csharpNamespace_ = value; + return this; + } + public Builder ClearCsharpNamespace() { + PrepareBuilder(); + result.hasCsharpNamespace = false; + result.csharpNamespace_ = ""; + return this; + } + + public pbc::IPopsicleList UninterpretedOptionList { + get { return PrepareBuilder().uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return result.UninterpretedOptionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return result.GetUninterpretedOption(index); + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_[index] = value; + return this; + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_[index] = builderForValue.Build(); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_.Add(value); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { + PrepareBuilder(); + result.uninterpretedOption_.Add(values); + return this; + } + public Builder ClearUninterpretedOption() { + PrepareBuilder(); + result.uninterpretedOption_.Clear(); + return this; + } + } + static FileOptions() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class MessageOptions : pb::ExtendableMessage { + private MessageOptions() { } + private static readonly MessageOptions defaultInstance = new MessageOptions().MakeReadOnly(); + private static readonly string[] _messageOptionsFieldNames = new string[] { "deprecated", "map_entry", "message_set_wire_format", "no_standard_descriptor_accessor", "uninterpreted_option" }; + private static readonly uint[] _messageOptionsFieldTags = new uint[] { 24, 56, 8, 16, 7994 }; + public static MessageOptions DefaultInstance { + get { return defaultInstance; } + } + + public override MessageOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MessageOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__FieldAccessorTable; } + } + + public const int MessageSetWireFormatFieldNumber = 1; + private bool hasMessageSetWireFormat; + private bool messageSetWireFormat_; + public bool HasMessageSetWireFormat { + get { return hasMessageSetWireFormat; } + } + public bool MessageSetWireFormat { + get { return messageSetWireFormat_; } + } + + public const int NoStandardDescriptorAccessorFieldNumber = 2; + private bool hasNoStandardDescriptorAccessor; + private bool noStandardDescriptorAccessor_; + public bool HasNoStandardDescriptorAccessor { + get { return hasNoStandardDescriptorAccessor; } + } + public bool NoStandardDescriptorAccessor { + get { return noStandardDescriptorAccessor_; } + } + + public const int DeprecatedFieldNumber = 3; + private bool hasDeprecated; + private bool deprecated_; + public bool HasDeprecated { + get { return hasDeprecated; } + } + public bool Deprecated { + get { return deprecated_; } + } + + public const int MapEntryFieldNumber = 7; + private bool hasMapEntry; + private bool mapEntry_; + public bool HasMapEntry { + get { return hasMapEntry; } + } + public bool MapEntry { + get { return mapEntry_; } + } + + public const int UninterpretedOptionFieldNumber = 999; + private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); + public scg::IList UninterpretedOptionList { + get { return uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return uninterpretedOption_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return uninterpretedOption_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _messageOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasMessageSetWireFormat) { + output.WriteBool(1, field_names[2], MessageSetWireFormat); + } + if (hasNoStandardDescriptorAccessor) { + output.WriteBool(2, field_names[3], NoStandardDescriptorAccessor); + } + if (hasDeprecated) { + output.WriteBool(3, field_names[0], Deprecated); + } + if (hasMapEntry) { + output.WriteBool(7, field_names[1], MapEntry); + } + if (uninterpretedOption_.Count > 0) { + output.WriteMessageArray(999, field_names[4], uninterpretedOption_); + } + extensionWriter.WriteUntil(536870912, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMessageSetWireFormat) { + size += pb::CodedOutputStream.ComputeBoolSize(1, MessageSetWireFormat); + } + if (hasNoStandardDescriptorAccessor) { + size += pb::CodedOutputStream.ComputeBoolSize(2, NoStandardDescriptorAccessor); + } + if (hasDeprecated) { + size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated); + } + if (hasMapEntry) { + size += pb::CodedOutputStream.ComputeBoolSize(7, MapEntry); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + size += pb::CodedOutputStream.ComputeMessageSize(999, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static MessageOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MessageOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MessageOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MessageOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MessageOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MessageOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MessageOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MessageOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MessageOptions MakeReadOnly() { + uninterpretedOption_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MessageOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MessageOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MessageOptions result; + + private MessageOptions PrepareBuilder() { + if (resultIsReadOnly) { + MessageOptions original = result; + result = new MessageOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MessageOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Descriptor; } + } + + public override MessageOptions DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; } + } + + public override MessageOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MessageOptions) { + return MergeFrom((MessageOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MessageOptions other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasMessageSetWireFormat) { + MessageSetWireFormat = other.MessageSetWireFormat; + } + if (other.HasNoStandardDescriptorAccessor) { + NoStandardDescriptorAccessor = other.NoStandardDescriptorAccessor; + } + if (other.HasDeprecated) { + Deprecated = other.Deprecated; + } + if (other.HasMapEntry) { + MapEntry = other.MapEntry; + } + if (other.uninterpretedOption_.Count != 0) { + result.uninterpretedOption_.Add(other.uninterpretedOption_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_messageOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _messageOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasMessageSetWireFormat = input.ReadBool(ref result.messageSetWireFormat_); + break; + } + case 16: { + result.hasNoStandardDescriptorAccessor = input.ReadBool(ref result.noStandardDescriptorAccessor_); + break; + } + case 24: { + result.hasDeprecated = input.ReadBool(ref result.deprecated_); + break; + } + case 56: { + result.hasMapEntry = input.ReadBool(ref result.mapEntry_); + break; + } + case 7994: { + input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasMessageSetWireFormat { + get { return result.hasMessageSetWireFormat; } + } + public bool MessageSetWireFormat { + get { return result.MessageSetWireFormat; } + set { SetMessageSetWireFormat(value); } + } + public Builder SetMessageSetWireFormat(bool value) { + PrepareBuilder(); + result.hasMessageSetWireFormat = true; + result.messageSetWireFormat_ = value; + return this; + } + public Builder ClearMessageSetWireFormat() { + PrepareBuilder(); + result.hasMessageSetWireFormat = false; + result.messageSetWireFormat_ = false; + return this; + } + + public bool HasNoStandardDescriptorAccessor { + get { return result.hasNoStandardDescriptorAccessor; } + } + public bool NoStandardDescriptorAccessor { + get { return result.NoStandardDescriptorAccessor; } + set { SetNoStandardDescriptorAccessor(value); } + } + public Builder SetNoStandardDescriptorAccessor(bool value) { + PrepareBuilder(); + result.hasNoStandardDescriptorAccessor = true; + result.noStandardDescriptorAccessor_ = value; + return this; + } + public Builder ClearNoStandardDescriptorAccessor() { + PrepareBuilder(); + result.hasNoStandardDescriptorAccessor = false; + result.noStandardDescriptorAccessor_ = false; + return this; + } + + public bool HasDeprecated { + get { return result.hasDeprecated; } + } + public bool Deprecated { + get { return result.Deprecated; } + set { SetDeprecated(value); } + } + public Builder SetDeprecated(bool value) { + PrepareBuilder(); + result.hasDeprecated = true; + result.deprecated_ = value; + return this; + } + public Builder ClearDeprecated() { + PrepareBuilder(); + result.hasDeprecated = false; + result.deprecated_ = false; + return this; + } + + public bool HasMapEntry { + get { return result.hasMapEntry; } + } + public bool MapEntry { + get { return result.MapEntry; } + set { SetMapEntry(value); } + } + public Builder SetMapEntry(bool value) { + PrepareBuilder(); + result.hasMapEntry = true; + result.mapEntry_ = value; + return this; + } + public Builder ClearMapEntry() { + PrepareBuilder(); + result.hasMapEntry = false; + result.mapEntry_ = false; + return this; + } + + public pbc::IPopsicleList UninterpretedOptionList { + get { return PrepareBuilder().uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return result.UninterpretedOptionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return result.GetUninterpretedOption(index); + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_[index] = value; + return this; + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_[index] = builderForValue.Build(); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_.Add(value); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { + PrepareBuilder(); + result.uninterpretedOption_.Add(values); + return this; + } + public Builder ClearUninterpretedOption() { + PrepareBuilder(); + result.uninterpretedOption_.Clear(); + return this; + } + } + static MessageOptions() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FieldOptions : pb::ExtendableMessage { + private FieldOptions() { } + private static readonly FieldOptions defaultInstance = new FieldOptions().MakeReadOnly(); + private static readonly string[] _fieldOptionsFieldNames = new string[] { "ctype", "deprecated", "lazy", "packed", "uninterpreted_option", "weak" }; + private static readonly uint[] _fieldOptionsFieldTags = new uint[] { 8, 24, 40, 16, 7994, 80 }; + public static FieldOptions DefaultInstance { + get { return defaultInstance; } + } + + public override FieldOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FieldOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + } + + } + #endregion + + public const int CtypeFieldNumber = 1; + private bool hasCtype; + private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; + public bool HasCtype { + get { return hasCtype; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { + get { return ctype_; } + } + + public const int PackedFieldNumber = 2; + private bool hasPacked; + private bool packed_; + public bool HasPacked { + get { return hasPacked; } + } + public bool Packed { + get { return packed_; } + } + + public const int LazyFieldNumber = 5; + private bool hasLazy; + private bool lazy_; + public bool HasLazy { + get { return hasLazy; } + } + public bool Lazy { + get { return lazy_; } + } + + public const int DeprecatedFieldNumber = 3; + private bool hasDeprecated; + private bool deprecated_; + public bool HasDeprecated { + get { return hasDeprecated; } + } + public bool Deprecated { + get { return deprecated_; } + } + + public const int WeakFieldNumber = 10; + private bool hasWeak; + private bool weak_; + public bool HasWeak { + get { return hasWeak; } + } + public bool Weak { + get { return weak_; } + } + + public const int UninterpretedOptionFieldNumber = 999; + private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); + public scg::IList UninterpretedOptionList { + get { return uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return uninterpretedOption_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return uninterpretedOption_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fieldOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasCtype) { + output.WriteEnum(1, field_names[0], (int) Ctype, Ctype); + } + if (hasPacked) { + output.WriteBool(2, field_names[3], Packed); + } + if (hasDeprecated) { + output.WriteBool(3, field_names[1], Deprecated); + } + if (hasLazy) { + output.WriteBool(5, field_names[2], Lazy); + } + if (hasWeak) { + output.WriteBool(10, field_names[5], Weak); + } + if (uninterpretedOption_.Count > 0) { + output.WriteMessageArray(999, field_names[4], uninterpretedOption_); + } + extensionWriter.WriteUntil(536870912, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCtype) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Ctype); + } + if (hasPacked) { + size += pb::CodedOutputStream.ComputeBoolSize(2, Packed); + } + if (hasLazy) { + size += pb::CodedOutputStream.ComputeBoolSize(5, Lazy); + } + if (hasDeprecated) { + size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated); + } + if (hasWeak) { + size += pb::CodedOutputStream.ComputeBoolSize(10, Weak); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + size += pb::CodedOutputStream.ComputeMessageSize(999, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FieldOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FieldOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FieldOptions MakeReadOnly() { + uninterpretedOption_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FieldOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FieldOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FieldOptions result; + + private FieldOptions PrepareBuilder() { + if (resultIsReadOnly) { + FieldOptions original = result; + result = new FieldOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FieldOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Descriptor; } + } + + public override FieldOptions DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; } + } + + public override FieldOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FieldOptions) { + return MergeFrom((FieldOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FieldOptions other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCtype) { + Ctype = other.Ctype; + } + if (other.HasPacked) { + Packed = other.Packed; + } + if (other.HasLazy) { + Lazy = other.Lazy; + } + if (other.HasDeprecated) { + Deprecated = other.Deprecated; + } + if (other.HasWeak) { + Weak = other.Weak; + } + if (other.uninterpretedOption_.Count != 0) { + result.uninterpretedOption_.Add(other.uninterpretedOption_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.ctype_, out unknown)) { + result.hasCtype = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 16: { + result.hasPacked = input.ReadBool(ref result.packed_); + break; + } + case 24: { + result.hasDeprecated = input.ReadBool(ref result.deprecated_); + break; + } + case 40: { + result.hasLazy = input.ReadBool(ref result.lazy_); + break; + } + case 80: { + result.hasWeak = input.ReadBool(ref result.weak_); + break; + } + case 7994: { + input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCtype { + get { return result.hasCtype; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { + get { return result.Ctype; } + set { SetCtype(value); } + } + public Builder SetCtype(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType value) { + PrepareBuilder(); + result.hasCtype = true; + result.ctype_ = value; + return this; + } + public Builder ClearCtype() { + PrepareBuilder(); + result.hasCtype = false; + result.ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; + return this; + } + + public bool HasPacked { + get { return result.hasPacked; } + } + public bool Packed { + get { return result.Packed; } + set { SetPacked(value); } + } + public Builder SetPacked(bool value) { + PrepareBuilder(); + result.hasPacked = true; + result.packed_ = value; + return this; + } + public Builder ClearPacked() { + PrepareBuilder(); + result.hasPacked = false; + result.packed_ = false; + return this; + } + + public bool HasLazy { + get { return result.hasLazy; } + } + public bool Lazy { + get { return result.Lazy; } + set { SetLazy(value); } + } + public Builder SetLazy(bool value) { + PrepareBuilder(); + result.hasLazy = true; + result.lazy_ = value; + return this; + } + public Builder ClearLazy() { + PrepareBuilder(); + result.hasLazy = false; + result.lazy_ = false; + return this; + } + + public bool HasDeprecated { + get { return result.hasDeprecated; } + } + public bool Deprecated { + get { return result.Deprecated; } + set { SetDeprecated(value); } + } + public Builder SetDeprecated(bool value) { + PrepareBuilder(); + result.hasDeprecated = true; + result.deprecated_ = value; + return this; + } + public Builder ClearDeprecated() { + PrepareBuilder(); + result.hasDeprecated = false; + result.deprecated_ = false; + return this; + } + + public bool HasWeak { + get { return result.hasWeak; } + } + public bool Weak { + get { return result.Weak; } + set { SetWeak(value); } + } + public Builder SetWeak(bool value) { + PrepareBuilder(); + result.hasWeak = true; + result.weak_ = value; + return this; + } + public Builder ClearWeak() { + PrepareBuilder(); + result.hasWeak = false; + result.weak_ = false; + return this; + } + + public pbc::IPopsicleList UninterpretedOptionList { + get { return PrepareBuilder().uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return result.UninterpretedOptionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return result.GetUninterpretedOption(index); + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_[index] = value; + return this; + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_[index] = builderForValue.Build(); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_.Add(value); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { + PrepareBuilder(); + result.uninterpretedOption_.Add(values); + return this; + } + public Builder ClearUninterpretedOption() { + PrepareBuilder(); + result.uninterpretedOption_.Clear(); + return this; + } + } + static FieldOptions() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class EnumOptions : pb::ExtendableMessage { + private EnumOptions() { } + private static readonly EnumOptions defaultInstance = new EnumOptions().MakeReadOnly(); + private static readonly string[] _enumOptionsFieldNames = new string[] { "allow_alias", "deprecated", "uninterpreted_option" }; + private static readonly uint[] _enumOptionsFieldTags = new uint[] { 16, 24, 7994 }; + public static EnumOptions DefaultInstance { + get { return defaultInstance; } + } + + public override EnumOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EnumOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__FieldAccessorTable; } + } + + public const int AllowAliasFieldNumber = 2; + private bool hasAllowAlias; + private bool allowAlias_; + public bool HasAllowAlias { + get { return hasAllowAlias; } + } + public bool AllowAlias { + get { return allowAlias_; } + } + + public const int DeprecatedFieldNumber = 3; + private bool hasDeprecated; + private bool deprecated_; + public bool HasDeprecated { + get { return hasDeprecated; } + } + public bool Deprecated { + get { return deprecated_; } + } + + public const int UninterpretedOptionFieldNumber = 999; + private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); + public scg::IList UninterpretedOptionList { + get { return uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return uninterpretedOption_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return uninterpretedOption_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _enumOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasAllowAlias) { + output.WriteBool(2, field_names[0], AllowAlias); + } + if (hasDeprecated) { + output.WriteBool(3, field_names[1], Deprecated); + } + if (uninterpretedOption_.Count > 0) { + output.WriteMessageArray(999, field_names[2], uninterpretedOption_); + } + extensionWriter.WriteUntil(536870912, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAllowAlias) { + size += pb::CodedOutputStream.ComputeBoolSize(2, AllowAlias); + } + if (hasDeprecated) { + size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + size += pb::CodedOutputStream.ComputeMessageSize(999, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static EnumOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EnumOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EnumOptions MakeReadOnly() { + uninterpretedOption_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EnumOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EnumOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EnumOptions result; + + private EnumOptions PrepareBuilder() { + if (resultIsReadOnly) { + EnumOptions original = result; + result = new EnumOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EnumOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Descriptor; } + } + + public override EnumOptions DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; } + } + + public override EnumOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EnumOptions) { + return MergeFrom((EnumOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EnumOptions other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAllowAlias) { + AllowAlias = other.AllowAlias; + } + if (other.HasDeprecated) { + Deprecated = other.Deprecated; + } + if (other.uninterpretedOption_.Count != 0) { + result.uninterpretedOption_.Add(other.uninterpretedOption_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_enumOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _enumOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 16: { + result.hasAllowAlias = input.ReadBool(ref result.allowAlias_); + break; + } + case 24: { + result.hasDeprecated = input.ReadBool(ref result.deprecated_); + break; + } + case 7994: { + input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAllowAlias { + get { return result.hasAllowAlias; } + } + public bool AllowAlias { + get { return result.AllowAlias; } + set { SetAllowAlias(value); } + } + public Builder SetAllowAlias(bool value) { + PrepareBuilder(); + result.hasAllowAlias = true; + result.allowAlias_ = value; + return this; + } + public Builder ClearAllowAlias() { + PrepareBuilder(); + result.hasAllowAlias = false; + result.allowAlias_ = false; + return this; + } + + public bool HasDeprecated { + get { return result.hasDeprecated; } + } + public bool Deprecated { + get { return result.Deprecated; } + set { SetDeprecated(value); } + } + public Builder SetDeprecated(bool value) { + PrepareBuilder(); + result.hasDeprecated = true; + result.deprecated_ = value; + return this; + } + public Builder ClearDeprecated() { + PrepareBuilder(); + result.hasDeprecated = false; + result.deprecated_ = false; + return this; + } + + public pbc::IPopsicleList UninterpretedOptionList { + get { return PrepareBuilder().uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return result.UninterpretedOptionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return result.GetUninterpretedOption(index); + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_[index] = value; + return this; + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_[index] = builderForValue.Build(); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_.Add(value); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { + PrepareBuilder(); + result.uninterpretedOption_.Add(values); + return this; + } + public Builder ClearUninterpretedOption() { + PrepareBuilder(); + result.uninterpretedOption_.Clear(); + return this; + } + } + static EnumOptions() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class EnumValueOptions : pb::ExtendableMessage { + private EnumValueOptions() { } + private static readonly EnumValueOptions defaultInstance = new EnumValueOptions().MakeReadOnly(); + private static readonly string[] _enumValueOptionsFieldNames = new string[] { "deprecated", "uninterpreted_option" }; + private static readonly uint[] _enumValueOptionsFieldTags = new uint[] { 8, 7994 }; + public static EnumValueOptions DefaultInstance { + get { return defaultInstance; } + } + + public override EnumValueOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EnumValueOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; } + } + + public const int DeprecatedFieldNumber = 1; + private bool hasDeprecated; + private bool deprecated_; + public bool HasDeprecated { + get { return hasDeprecated; } + } + public bool Deprecated { + get { return deprecated_; } + } + + public const int UninterpretedOptionFieldNumber = 999; + private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); + public scg::IList UninterpretedOptionList { + get { return uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return uninterpretedOption_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return uninterpretedOption_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _enumValueOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasDeprecated) { + output.WriteBool(1, field_names[0], Deprecated); + } + if (uninterpretedOption_.Count > 0) { + output.WriteMessageArray(999, field_names[1], uninterpretedOption_); + } + extensionWriter.WriteUntil(536870912, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasDeprecated) { + size += pb::CodedOutputStream.ComputeBoolSize(1, Deprecated); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + size += pb::CodedOutputStream.ComputeMessageSize(999, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static EnumValueOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumValueOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumValueOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnumValueOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnumValueOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumValueOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EnumValueOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnumValueOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EnumValueOptions MakeReadOnly() { + uninterpretedOption_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EnumValueOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EnumValueOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EnumValueOptions result; + + private EnumValueOptions PrepareBuilder() { + if (resultIsReadOnly) { + EnumValueOptions original = result; + result = new EnumValueOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EnumValueOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Descriptor; } + } + + public override EnumValueOptions DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; } + } + + public override EnumValueOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EnumValueOptions) { + return MergeFrom((EnumValueOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EnumValueOptions other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasDeprecated) { + Deprecated = other.Deprecated; + } + if (other.uninterpretedOption_.Count != 0) { + result.uninterpretedOption_.Add(other.uninterpretedOption_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_enumValueOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _enumValueOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasDeprecated = input.ReadBool(ref result.deprecated_); + break; + } + case 7994: { + input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasDeprecated { + get { return result.hasDeprecated; } + } + public bool Deprecated { + get { return result.Deprecated; } + set { SetDeprecated(value); } + } + public Builder SetDeprecated(bool value) { + PrepareBuilder(); + result.hasDeprecated = true; + result.deprecated_ = value; + return this; + } + public Builder ClearDeprecated() { + PrepareBuilder(); + result.hasDeprecated = false; + result.deprecated_ = false; + return this; + } + + public pbc::IPopsicleList UninterpretedOptionList { + get { return PrepareBuilder().uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return result.UninterpretedOptionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return result.GetUninterpretedOption(index); + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_[index] = value; + return this; + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_[index] = builderForValue.Build(); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_.Add(value); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { + PrepareBuilder(); + result.uninterpretedOption_.Add(values); + return this; + } + public Builder ClearUninterpretedOption() { + PrepareBuilder(); + result.uninterpretedOption_.Clear(); + return this; + } + } + static EnumValueOptions() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ServiceOptions : pb::ExtendableMessage { + private ServiceOptions() { } + private static readonly ServiceOptions defaultInstance = new ServiceOptions().MakeReadOnly(); + private static readonly string[] _serviceOptionsFieldNames = new string[] { "deprecated", "uninterpreted_option" }; + private static readonly uint[] _serviceOptionsFieldTags = new uint[] { 264, 7994 }; + public static ServiceOptions DefaultInstance { + get { return defaultInstance; } + } + + public override ServiceOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServiceOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; } + } + + public const int DeprecatedFieldNumber = 33; + private bool hasDeprecated; + private bool deprecated_; + public bool HasDeprecated { + get { return hasDeprecated; } + } + public bool Deprecated { + get { return deprecated_; } + } + + public const int UninterpretedOptionFieldNumber = 999; + private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); + public scg::IList UninterpretedOptionList { + get { return uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return uninterpretedOption_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return uninterpretedOption_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _serviceOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasDeprecated) { + output.WriteBool(33, field_names[0], Deprecated); + } + if (uninterpretedOption_.Count > 0) { + output.WriteMessageArray(999, field_names[1], uninterpretedOption_); + } + extensionWriter.WriteUntil(536870912, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasDeprecated) { + size += pb::CodedOutputStream.ComputeBoolSize(33, Deprecated); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + size += pb::CodedOutputStream.ComputeMessageSize(999, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ServiceOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServiceOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServiceOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServiceOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServiceOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServiceOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServiceOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServiceOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServiceOptions MakeReadOnly() { + uninterpretedOption_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServiceOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServiceOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServiceOptions result; + + private ServiceOptions PrepareBuilder() { + if (resultIsReadOnly) { + ServiceOptions original = result; + result = new ServiceOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServiceOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Descriptor; } + } + + public override ServiceOptions DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; } + } + + public override ServiceOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServiceOptions) { + return MergeFrom((ServiceOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServiceOptions other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasDeprecated) { + Deprecated = other.Deprecated; + } + if (other.uninterpretedOption_.Count != 0) { + result.uninterpretedOption_.Add(other.uninterpretedOption_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serviceOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serviceOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 264: { + result.hasDeprecated = input.ReadBool(ref result.deprecated_); + break; + } + case 7994: { + input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasDeprecated { + get { return result.hasDeprecated; } + } + public bool Deprecated { + get { return result.Deprecated; } + set { SetDeprecated(value); } + } + public Builder SetDeprecated(bool value) { + PrepareBuilder(); + result.hasDeprecated = true; + result.deprecated_ = value; + return this; + } + public Builder ClearDeprecated() { + PrepareBuilder(); + result.hasDeprecated = false; + result.deprecated_ = false; + return this; + } + + public pbc::IPopsicleList UninterpretedOptionList { + get { return PrepareBuilder().uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return result.UninterpretedOptionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return result.GetUninterpretedOption(index); + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_[index] = value; + return this; + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_[index] = builderForValue.Build(); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_.Add(value); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { + PrepareBuilder(); + result.uninterpretedOption_.Add(values); + return this; + } + public Builder ClearUninterpretedOption() { + PrepareBuilder(); + result.uninterpretedOption_.Clear(); + return this; + } + } + static ServiceOptions() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class MethodOptions : pb::ExtendableMessage { + private MethodOptions() { } + private static readonly MethodOptions defaultInstance = new MethodOptions().MakeReadOnly(); + private static readonly string[] _methodOptionsFieldNames = new string[] { "deprecated", "uninterpreted_option" }; + private static readonly uint[] _methodOptionsFieldTags = new uint[] { 264, 7994 }; + public static MethodOptions DefaultInstance { + get { return defaultInstance; } + } + + public override MethodOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MethodOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__FieldAccessorTable; } + } + + public const int DeprecatedFieldNumber = 33; + private bool hasDeprecated; + private bool deprecated_; + public bool HasDeprecated { + get { return hasDeprecated; } + } + public bool Deprecated { + get { return deprecated_; } + } + + public const int UninterpretedOptionFieldNumber = 999; + private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); + public scg::IList UninterpretedOptionList { + get { return uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return uninterpretedOption_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return uninterpretedOption_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _methodOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasDeprecated) { + output.WriteBool(33, field_names[0], Deprecated); + } + if (uninterpretedOption_.Count > 0) { + output.WriteMessageArray(999, field_names[1], uninterpretedOption_); + } + extensionWriter.WriteUntil(536870912, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasDeprecated) { + size += pb::CodedOutputStream.ComputeBoolSize(33, Deprecated); + } + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { + size += pb::CodedOutputStream.ComputeMessageSize(999, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static MethodOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MethodOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MethodOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MethodOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MethodOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MethodOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MethodOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MethodOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MethodOptions MakeReadOnly() { + uninterpretedOption_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MethodOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MethodOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MethodOptions result; + + private MethodOptions PrepareBuilder() { + if (resultIsReadOnly) { + MethodOptions original = result; + result = new MethodOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MethodOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Descriptor; } + } + + public override MethodOptions DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; } + } + + public override MethodOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MethodOptions) { + return MergeFrom((MethodOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MethodOptions other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasDeprecated) { + Deprecated = other.Deprecated; + } + if (other.uninterpretedOption_.Count != 0) { + result.uninterpretedOption_.Add(other.uninterpretedOption_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_methodOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _methodOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 264: { + result.hasDeprecated = input.ReadBool(ref result.deprecated_); + break; + } + case 7994: { + input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasDeprecated { + get { return result.hasDeprecated; } + } + public bool Deprecated { + get { return result.Deprecated; } + set { SetDeprecated(value); } + } + public Builder SetDeprecated(bool value) { + PrepareBuilder(); + result.hasDeprecated = true; + result.deprecated_ = value; + return this; + } + public Builder ClearDeprecated() { + PrepareBuilder(); + result.hasDeprecated = false; + result.deprecated_ = false; + return this; + } + + public pbc::IPopsicleList UninterpretedOptionList { + get { return PrepareBuilder().uninterpretedOption_; } + } + public int UninterpretedOptionCount { + get { return result.UninterpretedOptionCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { + return result.GetUninterpretedOption(index); + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_[index] = value; + return this; + } + public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_[index] = builderForValue.Build(); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.uninterpretedOption_.Add(value); + return this; + } + public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.uninterpretedOption_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { + PrepareBuilder(); + result.uninterpretedOption_.Add(values); + return this; + } + public Builder ClearUninterpretedOption() { + PrepareBuilder(); + result.uninterpretedOption_.Clear(); + return this; + } + } + static MethodOptions() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class UninterpretedOption : pb::GeneratedMessage { + private UninterpretedOption() { } + private static readonly UninterpretedOption defaultInstance = new UninterpretedOption().MakeReadOnly(); + private static readonly string[] _uninterpretedOptionFieldNames = new string[] { "aggregate_value", "double_value", "identifier_value", "name", "negative_int_value", "positive_int_value", "string_value" }; + private static readonly uint[] _uninterpretedOptionFieldTags = new uint[] { 66, 49, 26, 18, 40, 32, 58 }; + public static UninterpretedOption DefaultInstance { + get { return defaultInstance; } + } + + public override UninterpretedOption DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UninterpretedOption ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NamePart : pb::GeneratedMessage { + private NamePart() { } + private static readonly NamePart defaultInstance = new NamePart().MakeReadOnly(); + private static readonly string[] _namePartFieldNames = new string[] { "is_extension", "name_part" }; + private static readonly uint[] _namePartFieldTags = new uint[] { 16, 10 }; + public static NamePart DefaultInstance { + get { return defaultInstance; } + } + + public override NamePart DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NamePart ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; } + } + + public const int NamePart_FieldNumber = 1; + private bool hasNamePart_; + private string namePart_ = ""; + public bool HasNamePart_ { + get { return hasNamePart_; } + } + public string NamePart_ { + get { return namePart_; } + } + + public const int IsExtensionFieldNumber = 2; + private bool hasIsExtension; + private bool isExtension_; + public bool HasIsExtension { + get { return hasIsExtension; } + } + public bool IsExtension { + get { return isExtension_; } + } + + public override bool IsInitialized { + get { + if (!hasNamePart_) return false; + if (!hasIsExtension) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _namePartFieldNames; + if (hasNamePart_) { + output.WriteString(1, field_names[1], NamePart_); + } + if (hasIsExtension) { + output.WriteBool(2, field_names[0], IsExtension); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasNamePart_) { + size += pb::CodedOutputStream.ComputeStringSize(1, NamePart_); + } + if (hasIsExtension) { + size += pb::CodedOutputStream.ComputeBoolSize(2, IsExtension); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NamePart ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NamePart ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NamePart ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NamePart ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NamePart ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NamePart ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NamePart ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NamePart ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NamePart ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NamePart ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NamePart MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NamePart prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NamePart cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NamePart result; + + private NamePart PrepareBuilder() { + if (resultIsReadOnly) { + NamePart original = result; + result = new NamePart(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NamePart MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Descriptor; } + } + + public override NamePart DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance; } + } + + public override NamePart BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NamePart) { + return MergeFrom((NamePart) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NamePart other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasNamePart_) { + NamePart_ = other.NamePart_; + } + if (other.HasIsExtension) { + IsExtension = other.IsExtension; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_namePartFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _namePartFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasNamePart_ = input.ReadString(ref result.namePart_); + break; + } + case 16: { + result.hasIsExtension = input.ReadBool(ref result.isExtension_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasNamePart_ { + get { return result.hasNamePart_; } + } + public string NamePart_ { + get { return result.NamePart_; } + set { SetNamePart_(value); } + } + public Builder SetNamePart_(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNamePart_ = true; + result.namePart_ = value; + return this; + } + public Builder ClearNamePart_() { + PrepareBuilder(); + result.hasNamePart_ = false; + result.namePart_ = ""; + return this; + } + + public bool HasIsExtension { + get { return result.hasIsExtension; } + } + public bool IsExtension { + get { return result.IsExtension; } + set { SetIsExtension(value); } + } + public Builder SetIsExtension(bool value) { + PrepareBuilder(); + result.hasIsExtension = true; + result.isExtension_ = value; + return this; + } + public Builder ClearIsExtension() { + PrepareBuilder(); + result.hasIsExtension = false; + result.isExtension_ = false; + return this; + } + } + static NamePart() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + } + #endregion + + public const int NameFieldNumber = 2; + private pbc::PopsicleList name_ = new pbc::PopsicleList(); + public scg::IList NameList { + get { return name_; } + } + public int NameCount { + get { return name_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { + return name_[index]; + } + + public const int IdentifierValueFieldNumber = 3; + private bool hasIdentifierValue; + private string identifierValue_ = ""; + public bool HasIdentifierValue { + get { return hasIdentifierValue; } + } + public string IdentifierValue { + get { return identifierValue_; } + } + + public const int PositiveIntValueFieldNumber = 4; + private bool hasPositiveIntValue; + private ulong positiveIntValue_; + public bool HasPositiveIntValue { + get { return hasPositiveIntValue; } + } + [global::System.CLSCompliant(false)] + public ulong PositiveIntValue { + get { return positiveIntValue_; } + } + + public const int NegativeIntValueFieldNumber = 5; + private bool hasNegativeIntValue; + private long negativeIntValue_; + public bool HasNegativeIntValue { + get { return hasNegativeIntValue; } + } + public long NegativeIntValue { + get { return negativeIntValue_; } + } + + public const int DoubleValueFieldNumber = 6; + private bool hasDoubleValue; + private double doubleValue_; + public bool HasDoubleValue { + get { return hasDoubleValue; } + } + public double DoubleValue { + get { return doubleValue_; } + } + + public const int StringValueFieldNumber = 7; + private bool hasStringValue; + private pb::ByteString stringValue_ = pb::ByteString.Empty; + public bool HasStringValue { + get { return hasStringValue; } + } + public pb::ByteString StringValue { + get { return stringValue_; } + } + + public const int AggregateValueFieldNumber = 8; + private bool hasAggregateValue; + private string aggregateValue_ = ""; + public bool HasAggregateValue { + get { return hasAggregateValue; } + } + public string AggregateValue { + get { return aggregateValue_; } + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _uninterpretedOptionFieldNames; + if (name_.Count > 0) { + output.WriteMessageArray(2, field_names[3], name_); + } + if (hasIdentifierValue) { + output.WriteString(3, field_names[2], IdentifierValue); + } + if (hasPositiveIntValue) { + output.WriteUInt64(4, field_names[5], PositiveIntValue); + } + if (hasNegativeIntValue) { + output.WriteInt64(5, field_names[4], NegativeIntValue); + } + if (hasDoubleValue) { + output.WriteDouble(6, field_names[1], DoubleValue); + } + if (hasStringValue) { + output.WriteBytes(7, field_names[6], StringValue); + } + if (hasAggregateValue) { + output.WriteString(8, field_names[0], AggregateValue); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + if (hasIdentifierValue) { + size += pb::CodedOutputStream.ComputeStringSize(3, IdentifierValue); + } + if (hasPositiveIntValue) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, PositiveIntValue); + } + if (hasNegativeIntValue) { + size += pb::CodedOutputStream.ComputeInt64Size(5, NegativeIntValue); + } + if (hasDoubleValue) { + size += pb::CodedOutputStream.ComputeDoubleSize(6, DoubleValue); + } + if (hasStringValue) { + size += pb::CodedOutputStream.ComputeBytesSize(7, StringValue); + } + if (hasAggregateValue) { + size += pb::CodedOutputStream.ComputeStringSize(8, AggregateValue); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static UninterpretedOption ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UninterpretedOption ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UninterpretedOption ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UninterpretedOption ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UninterpretedOption ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UninterpretedOption ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UninterpretedOption ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UninterpretedOption ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UninterpretedOption MakeReadOnly() { + name_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UninterpretedOption prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UninterpretedOption cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UninterpretedOption result; + + private UninterpretedOption PrepareBuilder() { + if (resultIsReadOnly) { + UninterpretedOption original = result; + result = new UninterpretedOption(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UninterpretedOption MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Descriptor; } + } + + public override UninterpretedOption DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance; } + } + + public override UninterpretedOption BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UninterpretedOption) { + return MergeFrom((UninterpretedOption) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UninterpretedOption other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance) return this; + PrepareBuilder(); + if (other.name_.Count != 0) { + result.name_.Add(other.name_); + } + if (other.HasIdentifierValue) { + IdentifierValue = other.IdentifierValue; + } + if (other.HasPositiveIntValue) { + PositiveIntValue = other.PositiveIntValue; + } + if (other.HasNegativeIntValue) { + NegativeIntValue = other.NegativeIntValue; + } + if (other.HasDoubleValue) { + DoubleValue = other.DoubleValue; + } + if (other.HasStringValue) { + StringValue = other.StringValue; + } + if (other.HasAggregateValue) { + AggregateValue = other.AggregateValue; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_uninterpretedOptionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _uninterpretedOptionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.name_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance, extensionRegistry); + break; + } + case 26: { + result.hasIdentifierValue = input.ReadString(ref result.identifierValue_); + break; + } + case 32: { + result.hasPositiveIntValue = input.ReadUInt64(ref result.positiveIntValue_); + break; + } + case 40: { + result.hasNegativeIntValue = input.ReadInt64(ref result.negativeIntValue_); + break; + } + case 49: { + result.hasDoubleValue = input.ReadDouble(ref result.doubleValue_); + break; + } + case 58: { + result.hasStringValue = input.ReadBytes(ref result.stringValue_); + break; + } + case 66: { + result.hasAggregateValue = input.ReadString(ref result.aggregateValue_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList NameList { + get { return PrepareBuilder().name_; } + } + public int NameCount { + get { return result.NameCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { + return result.GetName(index); + } + public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.name_[index] = value; + return this; + } + public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.name_[index] = builderForValue.Build(); + return this; + } + public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.name_.Add(value); + return this; + } + public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.name_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeName(scg::IEnumerable values) { + PrepareBuilder(); + result.name_.Add(values); + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.name_.Clear(); + return this; + } + + public bool HasIdentifierValue { + get { return result.hasIdentifierValue; } + } + public string IdentifierValue { + get { return result.IdentifierValue; } + set { SetIdentifierValue(value); } + } + public Builder SetIdentifierValue(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIdentifierValue = true; + result.identifierValue_ = value; + return this; + } + public Builder ClearIdentifierValue() { + PrepareBuilder(); + result.hasIdentifierValue = false; + result.identifierValue_ = ""; + return this; + } + + public bool HasPositiveIntValue { + get { return result.hasPositiveIntValue; } + } + [global::System.CLSCompliant(false)] + public ulong PositiveIntValue { + get { return result.PositiveIntValue; } + set { SetPositiveIntValue(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetPositiveIntValue(ulong value) { + PrepareBuilder(); + result.hasPositiveIntValue = true; + result.positiveIntValue_ = value; + return this; + } + public Builder ClearPositiveIntValue() { + PrepareBuilder(); + result.hasPositiveIntValue = false; + result.positiveIntValue_ = 0UL; + return this; + } + + public bool HasNegativeIntValue { + get { return result.hasNegativeIntValue; } + } + public long NegativeIntValue { + get { return result.NegativeIntValue; } + set { SetNegativeIntValue(value); } + } + public Builder SetNegativeIntValue(long value) { + PrepareBuilder(); + result.hasNegativeIntValue = true; + result.negativeIntValue_ = value; + return this; + } + public Builder ClearNegativeIntValue() { + PrepareBuilder(); + result.hasNegativeIntValue = false; + result.negativeIntValue_ = 0L; + return this; + } + + public bool HasDoubleValue { + get { return result.hasDoubleValue; } + } + public double DoubleValue { + get { return result.DoubleValue; } + set { SetDoubleValue(value); } + } + public Builder SetDoubleValue(double value) { + PrepareBuilder(); + result.hasDoubleValue = true; + result.doubleValue_ = value; + return this; + } + public Builder ClearDoubleValue() { + PrepareBuilder(); + result.hasDoubleValue = false; + result.doubleValue_ = 0D; + return this; + } + + public bool HasStringValue { + get { return result.hasStringValue; } + } + public pb::ByteString StringValue { + get { return result.StringValue; } + set { SetStringValue(value); } + } + public Builder SetStringValue(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStringValue = true; + result.stringValue_ = value; + return this; + } + public Builder ClearStringValue() { + PrepareBuilder(); + result.hasStringValue = false; + result.stringValue_ = pb::ByteString.Empty; + return this; + } + + public bool HasAggregateValue { + get { return result.hasAggregateValue; } + } + public string AggregateValue { + get { return result.AggregateValue; } + set { SetAggregateValue(value); } + } + public Builder SetAggregateValue(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAggregateValue = true; + result.aggregateValue_ = value; + return this; + } + public Builder ClearAggregateValue() { + PrepareBuilder(); + result.hasAggregateValue = false; + result.aggregateValue_ = ""; + return this; + } + } + static UninterpretedOption() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SourceCodeInfo : pb::GeneratedMessage { + private SourceCodeInfo() { } + private static readonly SourceCodeInfo defaultInstance = new SourceCodeInfo().MakeReadOnly(); + private static readonly string[] _sourceCodeInfoFieldNames = new string[] { "location" }; + private static readonly uint[] _sourceCodeInfoFieldTags = new uint[] { 10 }; + public static SourceCodeInfo DefaultInstance { + get { return defaultInstance; } + } + + public override SourceCodeInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SourceCodeInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Location : pb::GeneratedMessage { + private Location() { } + private static readonly Location defaultInstance = new Location().MakeReadOnly(); + private static readonly string[] _locationFieldNames = new string[] { "leading_comments", "leading_detached_comments", "path", "span", "trailing_comments" }; + private static readonly uint[] _locationFieldTags = new uint[] { 26, 50, 10, 18, 34 }; + public static Location DefaultInstance { + get { return defaultInstance; } + } + + public override Location DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Location ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; } + } + + public const int PathFieldNumber = 1; + private int pathMemoizedSerializedSize; + private pbc::PopsicleList path_ = new pbc::PopsicleList(); + public scg::IList PathList { + get { return pbc::Lists.AsReadOnly(path_); } + } + public int PathCount { + get { return path_.Count; } + } + public int GetPath(int index) { + return path_[index]; + } + + public const int SpanFieldNumber = 2; + private int spanMemoizedSerializedSize; + private pbc::PopsicleList span_ = new pbc::PopsicleList(); + public scg::IList SpanList { + get { return pbc::Lists.AsReadOnly(span_); } + } + public int SpanCount { + get { return span_.Count; } + } + public int GetSpan(int index) { + return span_[index]; + } + + public const int LeadingCommentsFieldNumber = 3; + private bool hasLeadingComments; + private string leadingComments_ = ""; + public bool HasLeadingComments { + get { return hasLeadingComments; } + } + public string LeadingComments { + get { return leadingComments_; } + } + + public const int TrailingCommentsFieldNumber = 4; + private bool hasTrailingComments; + private string trailingComments_ = ""; + public bool HasTrailingComments { + get { return hasTrailingComments; } + } + public string TrailingComments { + get { return trailingComments_; } + } + + public const int LeadingDetachedCommentsFieldNumber = 6; + private pbc::PopsicleList leadingDetachedComments_ = new pbc::PopsicleList(); + public scg::IList LeadingDetachedCommentsList { + get { return pbc::Lists.AsReadOnly(leadingDetachedComments_); } + } + public int LeadingDetachedCommentsCount { + get { return leadingDetachedComments_.Count; } + } + public string GetLeadingDetachedComments(int index) { + return leadingDetachedComments_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _locationFieldNames; + if (path_.Count > 0) { + output.WritePackedInt32Array(1, field_names[2], pathMemoizedSerializedSize, path_); + } + if (span_.Count > 0) { + output.WritePackedInt32Array(2, field_names[3], spanMemoizedSerializedSize, span_); + } + if (hasLeadingComments) { + output.WriteString(3, field_names[0], LeadingComments); + } + if (hasTrailingComments) { + output.WriteString(4, field_names[4], TrailingComments); + } + if (leadingDetachedComments_.Count > 0) { + output.WriteStringArray(6, field_names[1], leadingDetachedComments_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + foreach (int element in PathList) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + if (path_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + pathMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + foreach (int element in SpanList) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + if (span_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + spanMemoizedSerializedSize = dataSize; + } + if (hasLeadingComments) { + size += pb::CodedOutputStream.ComputeStringSize(3, LeadingComments); + } + if (hasTrailingComments) { + size += pb::CodedOutputStream.ComputeStringSize(4, TrailingComments); + } + { + int dataSize = 0; + foreach (string element in LeadingDetachedCommentsList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * leadingDetachedComments_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Location ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Location ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Location ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Location ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Location ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Location ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Location ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Location ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Location ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Location ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Location MakeReadOnly() { + path_.MakeReadOnly(); + span_.MakeReadOnly(); + leadingDetachedComments_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Location prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Location cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Location result; + + private Location PrepareBuilder() { + if (resultIsReadOnly) { + Location original = result; + result = new Location(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Location MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Descriptor; } + } + + public override Location DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance; } + } + + public override Location BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Location) { + return MergeFrom((Location) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Location other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance) return this; + PrepareBuilder(); + if (other.path_.Count != 0) { + result.path_.Add(other.path_); + } + if (other.span_.Count != 0) { + result.span_.Add(other.span_); + } + if (other.HasLeadingComments) { + LeadingComments = other.LeadingComments; + } + if (other.HasTrailingComments) { + TrailingComments = other.TrailingComments; + } + if (other.leadingDetachedComments_.Count != 0) { + result.leadingDetachedComments_.Add(other.leadingDetachedComments_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_locationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _locationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: + case 8: { + input.ReadInt32Array(tag, field_name, result.path_); + break; + } + case 18: + case 16: { + input.ReadInt32Array(tag, field_name, result.span_); + break; + } + case 26: { + result.hasLeadingComments = input.ReadString(ref result.leadingComments_); + break; + } + case 34: { + result.hasTrailingComments = input.ReadString(ref result.trailingComments_); + break; + } + case 50: { + input.ReadStringArray(tag, field_name, result.leadingDetachedComments_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PathList { + get { return PrepareBuilder().path_; } + } + public int PathCount { + get { return result.PathCount; } + } + public int GetPath(int index) { + return result.GetPath(index); + } + public Builder SetPath(int index, int value) { + PrepareBuilder(); + result.path_[index] = value; + return this; + } + public Builder AddPath(int value) { + PrepareBuilder(); + result.path_.Add(value); + return this; + } + public Builder AddRangePath(scg::IEnumerable values) { + PrepareBuilder(); + result.path_.Add(values); + return this; + } + public Builder ClearPath() { + PrepareBuilder(); + result.path_.Clear(); + return this; + } + + public pbc::IPopsicleList SpanList { + get { return PrepareBuilder().span_; } + } + public int SpanCount { + get { return result.SpanCount; } + } + public int GetSpan(int index) { + return result.GetSpan(index); + } + public Builder SetSpan(int index, int value) { + PrepareBuilder(); + result.span_[index] = value; + return this; + } + public Builder AddSpan(int value) { + PrepareBuilder(); + result.span_.Add(value); + return this; + } + public Builder AddRangeSpan(scg::IEnumerable values) { + PrepareBuilder(); + result.span_.Add(values); + return this; + } + public Builder ClearSpan() { + PrepareBuilder(); + result.span_.Clear(); + return this; + } + + public bool HasLeadingComments { + get { return result.hasLeadingComments; } + } + public string LeadingComments { + get { return result.LeadingComments; } + set { SetLeadingComments(value); } + } + public Builder SetLeadingComments(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasLeadingComments = true; + result.leadingComments_ = value; + return this; + } + public Builder ClearLeadingComments() { + PrepareBuilder(); + result.hasLeadingComments = false; + result.leadingComments_ = ""; + return this; + } + + public bool HasTrailingComments { + get { return result.hasTrailingComments; } + } + public string TrailingComments { + get { return result.TrailingComments; } + set { SetTrailingComments(value); } + } + public Builder SetTrailingComments(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTrailingComments = true; + result.trailingComments_ = value; + return this; + } + public Builder ClearTrailingComments() { + PrepareBuilder(); + result.hasTrailingComments = false; + result.trailingComments_ = ""; + return this; + } + + public pbc::IPopsicleList LeadingDetachedCommentsList { + get { return PrepareBuilder().leadingDetachedComments_; } + } + public int LeadingDetachedCommentsCount { + get { return result.LeadingDetachedCommentsCount; } + } + public string GetLeadingDetachedComments(int index) { + return result.GetLeadingDetachedComments(index); + } + public Builder SetLeadingDetachedComments(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.leadingDetachedComments_[index] = value; + return this; + } + public Builder AddLeadingDetachedComments(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.leadingDetachedComments_.Add(value); + return this; + } + public Builder AddRangeLeadingDetachedComments(scg::IEnumerable values) { + PrepareBuilder(); + result.leadingDetachedComments_.Add(values); + return this; + } + public Builder ClearLeadingDetachedComments() { + PrepareBuilder(); + result.leadingDetachedComments_.Clear(); + return this; + } + } + static Location() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + } + #endregion + + public const int LocationFieldNumber = 1; + private pbc::PopsicleList location_ = new pbc::PopsicleList(); + public scg::IList LocationList { + get { return location_; } + } + public int LocationCount { + get { return location_.Count; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location GetLocation(int index) { + return location_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _sourceCodeInfoFieldNames; + if (location_.Count > 0) { + output.WriteMessageArray(1, field_names[0], location_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location element in LocationList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SourceCodeInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SourceCodeInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SourceCodeInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SourceCodeInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SourceCodeInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SourceCodeInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SourceCodeInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SourceCodeInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SourceCodeInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SourceCodeInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SourceCodeInfo MakeReadOnly() { + location_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SourceCodeInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SourceCodeInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SourceCodeInfo result; + + private SourceCodeInfo PrepareBuilder() { + if (resultIsReadOnly) { + SourceCodeInfo original = result; + result = new SourceCodeInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SourceCodeInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Descriptor; } + } + + public override SourceCodeInfo DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance; } + } + + public override SourceCodeInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SourceCodeInfo) { + return MergeFrom((SourceCodeInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SourceCodeInfo other) { + if (other == global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.location_.Count != 0) { + result.location_.Add(other.location_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sourceCodeInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sourceCodeInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.location_, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList LocationList { + get { return PrepareBuilder().location_; } + } + public int LocationCount { + get { return result.LocationCount; } + } + public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location GetLocation(int index) { + return result.GetLocation(index); + } + public Builder SetLocation(int index, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.location_[index] = value; + return this; + } + public Builder SetLocation(int index, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.location_[index] = builderForValue.Build(); + return this; + } + public Builder AddLocation(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.location_.Add(value); + return this; + } + public Builder AddLocation(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.location_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeLocation(scg::IEnumerable values) { + PrepareBuilder(); + result.location_.Add(values); + return this; + } + public Builder ClearLocation() { + PrepareBuilder(); + result.location_.Clear(); + return this; + } + } + static SourceCodeInfo() { + object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs b/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs index ae819801..30718709 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs @@ -50,14 +50,15 @@ namespace Google.ProtocolBuffers.Descriptors private readonly IDictionary enumValuesByNumber = new Dictionary(); - private readonly DescriptorPool[] dependencies; + private readonly HashSet dependencies; internal DescriptorPool(FileDescriptor[] dependencyFiles) { - dependencies = new DescriptorPool[dependencyFiles.Length]; + dependencies = new HashSet(); for (int i = 0; i < dependencyFiles.Length; i++) { - dependencies[i] = dependencyFiles[i].DescriptorPool; + dependencies.Add(dependencyFiles[i]); + ImportPublicDependencies(dependencyFiles[i]); } foreach (FileDescriptor dependency in dependencyFiles) @@ -66,6 +67,17 @@ namespace Google.ProtocolBuffers.Descriptors } } + private void ImportPublicDependencies(FileDescriptor file) + { + foreach (FileDescriptor dependency in file.PublicDependencies) + { + if (dependencies.Add(dependency)) + { + ImportPublicDependencies(dependency); + } + } + } + /// /// Finds a symbol of the given name within the pool. /// @@ -83,9 +95,9 @@ namespace Google.ProtocolBuffers.Descriptors return descriptor; } - foreach (DescriptorPool dependency in dependencies) + foreach (FileDescriptor dependency in dependencies) { - dependency.descriptorsByName.TryGetValue(fullName, out result); + dependency.DescriptorPool.descriptorsByName.TryGetValue(fullName, out result); descriptor = result as T; if (descriptor != null) { diff --git a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs index 6d17ae2a..98de5435 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs @@ -51,7 +51,6 @@ namespace Google.ProtocolBuffers.Descriptors private FieldType fieldType; private MappedType mappedType; - private CSharpFieldOptions csharpFieldOptions; private readonly object optionsLock = new object(); internal FieldDescriptor(FieldDescriptorProto proto, FileDescriptor file, @@ -101,38 +100,6 @@ namespace Google.ProtocolBuffers.Descriptors file.DescriptorPool.AddSymbol(this); } - private CSharpFieldOptions BuildOrFakeCSharpOptions() - { - // TODO(jonskeet): Check if we could use FileDescriptorProto.Descriptor.Name - interesting bootstrap issues - if (File.Proto.Name == "google/protobuf/csharp_options.proto") - { - if (Name == "csharp_field_options") - { - return new CSharpFieldOptions.Builder {PropertyName = "CSharpFieldOptions"}.Build(); - } - if (Name == "csharp_file_options") - { - return new CSharpFieldOptions.Builder {PropertyName = "CSharpFileOptions"}.Build(); - } - } - CSharpFieldOptions.Builder builder = CSharpFieldOptions.CreateBuilder(); - if (Proto.Options.HasExtension(DescriptorProtos.CSharpOptions.CSharpFieldOptions)) - { - builder.MergeFrom(Proto.Options.GetExtension(DescriptorProtos.CSharpOptions.CSharpFieldOptions)); - } - if (!builder.HasPropertyName) - { - string fieldName = FieldType == FieldType.Group ? MessageType.Name : Name; - string propertyName = NameHelpers.UnderscoresToPascalCase(fieldName); - if (propertyName == ContainingType.Name) - { - propertyName += "_"; - } - builder.PropertyName = propertyName; - } - return builder.Build(); - } - /// /// Maps a field type as included in the .proto file to a FieldType. /// @@ -286,26 +253,7 @@ namespace Google.ProtocolBuffers.Descriptors { get { return containingType; } } - - /// - /// Returns the C#-specific options for this field descriptor. This will always be - /// completely filled in. - /// - public CSharpFieldOptions CSharpOptions - { - get - { - lock (optionsLock) - { - if (csharpFieldOptions == null) - { - csharpFieldOptions = BuildOrFakeCSharpOptions(); - } - } - return csharpFieldOptions; - } - } - + /// /// For extensions defined nested within message types, gets /// the outer type. Not valid for non-extension fields. diff --git a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs index d7075e35..354e99a3 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs @@ -51,16 +51,17 @@ namespace Google.ProtocolBuffers.Descriptors private readonly IList services; private readonly IList extensions; private readonly IList dependencies; + private readonly IList publicDependencies; private readonly DescriptorPool pool; - private CSharpFileOptions csharpFileOptions; - private readonly object optionsLock = new object(); - private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool) + private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies) { this.pool = pool; this.proto = proto; this.dependencies = new ReadOnlyCollection((FileDescriptor[]) dependencies.Clone()); + publicDependencies = DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies); + pool.AddPackage(Package, this); messageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageTypeList, @@ -80,94 +81,46 @@ namespace Google.ProtocolBuffers.Descriptors new FieldDescriptor(field, this, null, index, true)); } - /// - /// Allows a file descriptor to be configured with a set of external options, e.g. from the - /// command-line arguments to protogen. + /// Extracts public dependencies from direct dependencies. This is a static method despite its + /// first parameter, as the value we're in the middle of constructing is only used for exceptions. /// - public void ConfigureWithDefaultOptions(CSharpFileOptions options) - { - csharpFileOptions = BuildOrFakeWithDefaultOptions(options); - } - - static readonly char[] PathSeperators = new char[] { '/', '\\' }; - private CSharpFileOptions BuildOrFakeWithDefaultOptions(CSharpFileOptions defaultOptions) + private static IList DeterminePublicDependencies(FileDescriptor @this, FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies) { - // Fix for being able to relocate these files to any directory structure - if (proto.Package == "google.protobuf") - { - int ixslash = proto.Name.LastIndexOfAny(PathSeperators); - string filename = ixslash < 0 ? proto.Name : proto.Name.Substring(ixslash + 1); - // TODO(jonskeet): Check if we could use FileDescriptorProto.Descriptor.Name - interesting bootstrap issues) - if (filename == "descriptor.proto") - { - return new CSharpFileOptions.Builder - { - Namespace = "Google.ProtocolBuffers.DescriptorProtos", - UmbrellaClassname = "DescriptorProtoFile", - NestClasses = false, - MultipleFiles = false, - PublicClasses = true, - OutputDirectory = defaultOptions.OutputDirectory, - IgnoreGoogleProtobuf = defaultOptions.IgnoreGoogleProtobuf - }.Build(); - } - if (filename == "csharp_options.proto") - { - return new CSharpFileOptions.Builder - { - Namespace = "Google.ProtocolBuffers.DescriptorProtos", - UmbrellaClassname = "CSharpOptions", - NestClasses = false, - MultipleFiles = false, - PublicClasses = true, - OutputDirectory = defaultOptions.OutputDirectory, - IgnoreGoogleProtobuf = defaultOptions.IgnoreGoogleProtobuf - }.Build(); - } - } - CSharpFileOptions.Builder builder = defaultOptions.ToBuilder(); - if (proto.Options.HasExtension(DescriptorProtos.CSharpOptions.CSharpFileOptions)) - { - builder.MergeFrom(proto.Options.GetExtension(DescriptorProtos.CSharpOptions.CSharpFileOptions)); - } - if (!builder.HasNamespace) - { - builder.Namespace = Package; - } - if (!builder.HasUmbrellaClassname) + var nameToFileMap = new Dictionary(); + foreach (var file in dependencies) { - int lastSlash = Name.LastIndexOf('/'); - string baseName = Name.Substring(lastSlash + 1); - builder.UmbrellaClassname = NameHelpers.UnderscoresToPascalCase(NameHelpers.StripProto(baseName)); + nameToFileMap[file.Name] = file; } - - // Auto-fix for name collision by placing umbrella class into a new namespace. This - // still won't fix the collisions with nesting enabled; however, you have to turn that on explicitly anyway. - if (!builder.NestClasses && !builder.HasUmbrellaNamespace) + var publicDependencies = new List(); + for (int i = 0; i < proto.PublicDependencyCount; i++) { - bool collision = false; - foreach (IDescriptor d in MessageTypes) - { - collision |= d.Name == builder.UmbrellaClassname; - } - foreach (IDescriptor d in Services) + int index = proto.PublicDependencyList[i]; + if (index < 0 || index >= proto.DependencyCount) { - collision |= d.Name == builder.UmbrellaClassname; + throw new DescriptorValidationException(@this, "Invalid public dependency index."); } - foreach (IDescriptor d in EnumTypes) + string name = proto.DependencyList[index]; + FileDescriptor file = nameToFileMap[name]; + if (file == null) { - collision |= d.Name == builder.UmbrellaClassname; + if (!allowUnknownDependencies) + { + throw new DescriptorValidationException(@this, "Invalid public dependency: " + name); + } + // Ignore unknown dependencies. } - if (collision) + else { - builder.UmbrellaNamespace = "Proto"; + publicDependencies.Add(file); } } - - return builder.Build(); + return new ReadOnlyCollection(publicDependencies); } + + static readonly char[] PathSeperators = new char[] { '/', '\\' }; + /// /// The descriptor in its protocol message representation. /// @@ -184,25 +137,6 @@ namespace Google.ProtocolBuffers.Descriptors get { return proto.Options; } } - /// - /// Returns the C#-specific options for this file descriptor. This will always be - /// completely filled in. - /// - public CSharpFileOptions CSharpOptions - { - get - { - lock (optionsLock) - { - if (csharpFileOptions == null) - { - csharpFileOptions = BuildOrFakeWithDefaultOptions(CSharpFileOptions.DefaultInstance); - } - } - return csharpFileOptions; - } - } - /// /// The file name. /// @@ -260,6 +194,14 @@ namespace Google.ProtocolBuffers.Descriptors get { return dependencies; } } + /// + /// Unmodifiable list of this file's public dependencies (public imports). + /// + public IList PublicDependencies + { + get { return publicDependencies; } + } + /// /// Implementation of IDescriptor.FullName - just returns the same as Name. /// @@ -330,6 +272,22 @@ namespace Google.ProtocolBuffers.Descriptors /// a valid descriptor. This can occur for a number of reasons, such as a field /// having an undefined type or because two messages were defined with the same name. public static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies) + { + return BuildFrom(proto, dependencies, false); + } + + /// + /// Builds a FileDescriptor from its protocol buffer representation. + /// + /// The protocol message form of the FileDescriptor. + /// FileDescriptors corresponding to all of the + /// file's dependencies, in the exact order listed in the .proto file. May be null, + /// in which case it is treated as an empty array. + /// Whether unknown dependencies are ignored (true) or cause an exception to be thrown (false). + /// If is not + /// a valid descriptor. This can occur for a number of reasons, such as a field + /// having an undefined type or because two messages were defined with the same name. + private static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies) { // Building descriptors involves two steps: translating and linking. // In the translation step (implemented by FileDescriptor's @@ -346,23 +304,25 @@ namespace Google.ProtocolBuffers.Descriptors } DescriptorPool pool = new DescriptorPool(dependencies); - FileDescriptor result = new FileDescriptor(proto, dependencies, pool); - - if (dependencies.Length != proto.DependencyCount) - { - throw new DescriptorValidationException(result, - "Dependencies passed to FileDescriptor.BuildFrom() don't match " + - "those listed in the FileDescriptorProto."); - } - for (int i = 0; i < proto.DependencyCount; i++) - { - if (dependencies[i].Name != proto.DependencyList[i]) - { - throw new DescriptorValidationException(result, - "Dependencies passed to FileDescriptor.BuildFrom() don't match " + - "those listed in the FileDescriptorProto."); - } - } + FileDescriptor result = new FileDescriptor(proto, dependencies, pool, allowUnknownDependencies); + + // TODO(jonskeet): Reinstate these checks, or get rid of them entirely. They aren't in the Java code, + // and fail for the CustomOptions test right now. (We get "descriptor.proto" vs "google/protobuf/descriptor.proto".) + //if (dependencies.Length != proto.DependencyCount) + //{ + // throw new DescriptorValidationException(result, + // "Dependencies passed to FileDescriptor.BuildFrom() don't match " + + // "those listed in the FileDescriptorProto."); + //} + //for (int i = 0; i < proto.DependencyCount; i++) + //{ + // if (dependencies[i].Name != proto.DependencyList[i]) + // { + // throw new DescriptorValidationException(result, + // "Dependencies passed to FileDescriptor.BuildFrom() don't match " + + // "those listed in the FileDescriptorProto."); + // } + //} result.CrossLink(); return result; @@ -434,7 +394,9 @@ namespace Google.ProtocolBuffers.Descriptors FileDescriptor result; try { - result = BuildFrom(proto, dependencies); + // When building descriptors for generated code, we allow unknown + // dependencies by default. + result = BuildFrom(proto, dependencies, true); } catch (DescriptorValidationException e) { @@ -494,5 +456,10 @@ namespace Google.ProtocolBuffers.Descriptors extensions[i].ReplaceProto(proto.GetExtension(i)); } } + + public override string ToString() + { + return "FileDescriptor for " + proto.Name; + } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs index d438c0ff..5b29849c 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs @@ -158,25 +158,6 @@ namespace Google.ProtocolBuffers.Descriptors return File.DescriptorPool.FindFieldByNumber(this, number); } - /// - /// Finds a field by its property name, as it would be generated by protogen. - /// - /// The property name within this message type. - /// The field's descriptor, or null if not found. - public FieldDescriptor FindFieldByPropertyName(string propertyName) - { - // For reasonably short messages, this will be more efficient than a dictionary - // lookup. It also means we don't need to do things lazily with locks etc. - foreach (FieldDescriptor field in Fields) - { - if (field.CSharpOptions.PropertyName == propertyName) - { - return field; - } - } - return null; - } - /// /// Finds a nested descriptor by name. The is valid for fields, nested /// message types and enums. diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj index fe1f04ac..4bb38de1 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -68,7 +68,6 @@ - -- cgit v1.2.3 From ce66c5f1b99fe36b5b91e8b59cc75ce8a4e9cba5 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 28 Apr 2015 15:06:59 +0100 Subject: Updated set of unit tests and unit test protos. This commit includes changes to the C#-specific protos, and rebuilt versions of the "stock" protos. The stock protos have been locally updated to have a specific C# namespace, but this is expected to change soon, so hasn't been committed. Four areas are currently not tested: 1) Serialization - we may restore this at some point, possibly optionally. 2) Services - currently nothing is generated for this; will need to see how it interacts with GRPC 3) Fields beginning with _{digit} - see https://github.com/google/protobuf/issues/308 4) Fields with names which conflict with the declaring type in nasty ways - see https://github.com/google/protobuf/issues/309 --- csharp/protos/extest/unittest_extras.proto | 37 - csharp/protos/extest/unittest_extras_full.proto | 13 +- csharp/protos/extest/unittest_extras_lite.proto | 14 +- csharp/protos/extest/unittest_extras_xmltest.proto | 7 +- .../protos/extest/unittest_generic_services.proto | 35 +- csharp/protos/extest/unittest_issues.proto | 36 +- .../ProtocolBuffers.Test/AbstractMessageTest.cs | 8 +- .../Compatibility/CompatibilityTests.cs | 2 +- csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs | 116 +- .../ProtocolBuffers.Test/ExtendableMessageTest.cs | 244 +- .../ProtocolBuffers.Test/GeneratedMessageTest.cs | 42 +- .../ProtocolBuffers.Test.csproj | 34 +- .../src/ProtocolBuffers.Test/ReflectionTester.cs | 6 +- .../src/ProtocolBuffers.Test/SerializableTest.cs | 33 +- csharp/src/ProtocolBuffers.Test/ServiceTest.cs | 262 - .../ProtocolBuffers.Test/TestProtos/GoogleSize.cs | 4569 +++ .../ProtocolBuffers.Test/TestProtos/GoogleSpeed.cs | 6634 ++++ .../TestProtos/UnitTestCSharpOptionsProtoFile.cs | 426 - .../TestProtos/UnitTestCustomOptionsProtoFile.cs | 6411 ---- .../UnitTestEmbedOptimizeForProtoFile.cs | 442 - .../TestProtos/UnitTestEmptyProtoFile.cs | 50 - .../TestProtos/UnitTestExtrasIssuesProtoFile.cs | 3443 -- .../TestProtos/UnitTestExtrasProtoFile.cs | 401 - .../TestProtos/UnitTestGenericServices.cs | 260 - .../TestProtos/UnitTestGoogleSizeProtoFile.cs | 4573 --- .../TestProtos/UnitTestGoogleSpeedProtoFile.cs | 6638 ---- .../TestProtos/UnitTestImportLiteProtoFile.cs | 308 - .../TestProtos/UnitTestImportProtoFile.cs | 346 - .../TestProtos/UnitTestMessageSetProtoFile.cs | 1826 - .../UnitTestNoGenericServicesProtoFile.cs | 368 - .../TestProtos/UnitTestOptimizeForProtoFile.cs | 659 - .../TestProtos/UnitTestProtoFile.cs | 21602 ----------- .../TestProtos/UnitTestRpcInterop.cs | 1467 - .../UnitTestXmlSerializerTestProtoFile.cs | 2292 -- .../ProtocolBuffers.Test/TestProtos/Unittest.cs | 33513 +++++++++++++++++ .../TestProtos/UnittestCustomOptions.cs | 7549 ++++ .../TestProtos/UnittestDropUnknownFields.cs | 791 + .../TestProtos/UnittestEnormousDescriptor.cs | 36189 +++++++++++++++++++ .../TestProtos/UnittestExtrasXmltest.cs | 2277 ++ .../TestProtos/UnittestImport.cs | 347 + .../TestProtos/UnittestImportPublic.cs | 333 + .../TestProtos/UnittestIssues.cs | 2311 ++ .../TestProtos/UnittestMset.cs | 1824 + .../TestProtos/UnittestNoFieldPresence.cs | 4065 +++ .../TestProtos/UnittestOptimizeFor.cs | 719 + .../TestProtos/UnittestPreserveUnknownEnum.cs | 1320 + .../TestProtos/UnittestPreserveUnknownEnum2.cs | 684 + .../TestProtos/UnknownEnumTest.cs | 809 + .../ProtocolBuffers.Test/TestRpcForMimeTypes.cs | 386 - .../src/ProtocolBuffers.Test/TestRpcGenerator.cs | 171 - csharp/src/ProtocolBuffers.Test/TestUtil.cs | 1399 +- .../ProtocolBuffers.Test/TestWriterFormatJson.cs | 46 +- .../ProtocolBuffers.Test/TestWriterFormatXml.cs | 20 +- .../ProtocolBuffers.Test/UnknownFieldSetTest.cs | 4 +- csharp/src/ProtocolBuffers.Test/WireFormatTest.cs | 8 +- .../AbstractBuilderLiteTest.cs | 18 +- .../ExtendableBuilderLiteTest.cs | 132 +- .../ExtendableMessageLiteTest.cs | 378 +- .../ProtocolBuffersLite.Test/InteropLiteTest.cs | 18 +- csharp/src/ProtocolBuffersLite.Test/LiteTest.cs | 20 +- .../MissingFieldAndExtensionTest.cs | 28 +- .../ProtocolBuffersLite.Test.csproj | 15 +- .../ProtocolBuffersLiteMixed.Test.csproj | 17 +- .../SerializableLiteTest.cs | 2 + .../src/ProtocolBuffersLite.Test/TestLiteByApi.cs | 4 +- .../TestProtos/UnitTestExtrasFullProtoFile.cs | 2144 -- .../TestProtos/UnitTestExtrasLiteProtoFile.cs | 4226 --- .../TestProtos/UnitTestImportLiteProtoFile.cs | 308 - .../TestProtos/UnitTestImportProtoFile.cs | 346 - .../UnitTestLiteImportNonLiteProtoFile.cs | 324 - .../TestProtos/UnitTestLiteProtoFile.cs | 8948 ----- .../TestProtos/UnitTestProtoFile.cs | 21602 ----------- .../TestProtos/UnitTestRpcInteropLite.cs | 1395 - .../TestProtos/Unittest.cs | 33513 +++++++++++++++++ .../TestProtos/UnittestExtrasFull.cs | 2141 ++ .../TestProtos/UnittestExtrasLite.cs | 4209 +++ .../TestProtos/UnittestExtrasXmltest.cs | 2277 ++ .../TestProtos/UnittestImport.cs | 347 + .../TestProtos/UnittestImportLite.cs | 309 + .../TestProtos/UnittestImportPublic.cs | 333 + .../TestProtos/UnittestImportPublicLite.cs | 300 + .../TestProtos/UnittestIssues.cs | 3437 ++ .../TestProtos/UnittestLite.cs | 12460 +++++++ .../TestProtos/UnittestLiteImportsNonlite.cs | 325 + 84 files changed, 164903 insertions(+), 93042 deletions(-) delete mode 100644 csharp/protos/extest/unittest_extras.proto delete mode 100644 csharp/src/ProtocolBuffers.Test/ServiceTest.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSize.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSpeed.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestEmptyProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasIssuesProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestGenericServices.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/Unittest.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestCustomOptions.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestEnormousDescriptor.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestExtrasXmltest.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImport.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublic.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestMset.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestOptimizeFor.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum2.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnknownEnumTest.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestRpcGenerator.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasFullProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/Unittest.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasFull.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasLite.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasXmltest.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImport.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportLite.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportPublic.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportPublicLite.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestIssues.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestLite.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestLiteImportsNonlite.cs (limited to 'csharp/src') diff --git a/csharp/protos/extest/unittest_extras.proto b/csharp/protos/extest/unittest_extras.proto deleted file mode 100644 index 91f10fbd..00000000 --- a/csharp/protos/extest/unittest_extras.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasProtoFile"; -option (google.protobuf.csharp_file_options).add_serializable = true; - -package protobuf_unittest_extra; - -option java_package = "com.google.protobuf"; - -message TestUnpackedExtensions { - extensions 1 to max; -} - -extend TestUnpackedExtensions { - repeated int32 unpacked_int32_extension = 90; - repeated int64 unpacked_int64_extension = 91; - repeated uint32 unpacked_uint32_extension = 92; - repeated uint64 unpacked_uint64_extension = 93; - repeated sint32 unpacked_sint32_extension = 94; - repeated sint64 unpacked_sint64_extension = 95; - repeated fixed32 unpacked_fixed32_extension = 96; - repeated fixed64 unpacked_fixed64_extension = 97; - repeated sfixed32 unpacked_sfixed32_extension = 98; - repeated sfixed64 unpacked_sfixed64_extension = 99; - repeated float unpacked_float_extension = 100; - repeated double unpacked_double_extension = 101; - repeated bool unpacked_bool_extension = 102; - repeated UnpackedExtensionsForeignEnum unpacked_enum_extension = 103; -} - -enum UnpackedExtensionsForeignEnum { - FOREIGN_FOO = 4; - FOREIGN_BAR = 5; - FOREIGN_BAZ = 6; -} diff --git a/csharp/protos/extest/unittest_extras_full.proto b/csharp/protos/extest/unittest_extras_full.proto index a334bbf1..1b546053 100644 --- a/csharp/protos/extest/unittest_extras_full.proto +++ b/csharp/protos/extest/unittest_extras_full.proto @@ -1,13 +1,9 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasFullProtoFile"; +syntax = "proto2"; package protobuf_unittest_extra; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; option optimize_for = CODE_SIZE; - option java_package = "com.google.protobuf"; message TestInteropPerson { @@ -45,7 +41,10 @@ message TestInteropEmployeeId { } extend TestInteropPerson { - required TestInteropEmployeeId employee_id = 126; + // Note: changed from required to optional, as required fields are not + // permitted in extensions. (The fact that this was allowed in protogen + // before was almost certainly a bug.) + optional TestInteropEmployeeId employee_id = 126; } message TestMissingFieldsA { diff --git a/csharp/protos/extest/unittest_extras_lite.proto b/csharp/protos/extest/unittest_extras_lite.proto index ea1bcd25..0c242d2f 100644 --- a/csharp/protos/extest/unittest_extras_lite.proto +++ b/csharp/protos/extest/unittest_extras_lite.proto @@ -1,14 +1,9 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasLiteProtoFile"; -option (google.protobuf.csharp_file_options).add_serializable = true; +syntax = "proto2"; package protobuf_unittest_extra; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; option optimize_for = LITE_RUNTIME; - option java_package = "com.google.protobuf"; message TestRequiredLite { @@ -58,7 +53,10 @@ message TestInteropEmployeeIdLite { } extend TestInteropPersonLite { - required TestInteropEmployeeIdLite employee_id_lite = 126; + // Note: changed from required to optional, as required fields are not + // permitted in extensions. (The fact that this was allowed in protogen + // before was almost certainly a bug.) + optional TestInteropEmployeeIdLite employee_id_lite = 126; } /* Removed from unittest_lite.proto and added back here */ diff --git a/csharp/protos/extest/unittest_extras_xmltest.proto b/csharp/protos/extest/unittest_extras_xmltest.proto index ab8088a7..fae36165 100644 --- a/csharp/protos/extest/unittest_extras_xmltest.proto +++ b/csharp/protos/extest/unittest_extras_xmltest.proto @@ -1,7 +1,6 @@ -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestXmlSerializerTestProtoFile"; -option (google.protobuf.csharp_file_options).add_serializable = true; +syntax = "proto2"; + +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; package protobuf_unittest_extra; diff --git a/csharp/protos/extest/unittest_generic_services.proto b/csharp/protos/extest/unittest_generic_services.proto index 3fe2e8eb..4e68ff0f 100644 --- a/csharp/protos/extest/unittest_generic_services.proto +++ b/csharp/protos/extest/unittest_generic_services.proto @@ -1,29 +1,30 @@ +syntax = "proto2"; + // Additional options required for C# generation. File from copyright // line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; import "google/protobuf/unittest.proto"; import "google/protobuf/unittest_custom_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGenericServices"; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + +// option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; + +// We don't put this in a package within proto2 because we need to make sure +// that the generated code doesn't depend on being in the proto2 namespace. +package protobuf_unittest; -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - option optimize_for = SPEED; service TestGenericService { rpc Foo(FooRequest) returns (FooResponse); rpc Bar(BarRequest) returns (BarResponse); } - -service TestGenericServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - + +service TestGenericServiceWithCustomOptions { + option (service_opt1) = -9876543210; + + rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { + option (method_opt1) = METHODOPT1_VAL2; + } +} + diff --git a/csharp/protos/extest/unittest_issues.proto b/csharp/protos/extest/unittest_issues.proto index cb803791..97249dff 100644 --- a/csharp/protos/extest/unittest_issues.proto +++ b/csharp/protos/extest/unittest_issues.proto @@ -1,10 +1,10 @@ +syntax = "proto2"; + // These proto descriptors have at one time been reported as an issue or defect. // They are kept here to replicate the issue, and continue to verify the fix. -import "google/protobuf/csharp_options.proto"; // Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified -option (google.protobuf.csharp_file_options).namespace = "UnitTest.Issues.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasIssuesProtoFile"; +option csharp_namespace = "UnitTest.Issues.TestProtos"; package unittest_issues; option optimize_for = SPEED; @@ -67,24 +67,28 @@ service TestGenericService { rpc Bar(TestBasicNoFields) returns (TestBasicMessage); } */ -// Issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 + +// Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 +// New issue 309: https://github.com/google/protobuf/issues/309 -message A { - optional int32 _A = 1; -} +// message A { +// optional int32 _A = 1; +// } -message B { - optional int32 B_ = 1; -} +// message B { +// optional int32 B_ = 1; +// } -message AB { - optional int32 a_b = 1; -} +//message AB { +// optional int32 a_b = 1; +//} // Similar issue with numeric names -message NumberField { - optional int32 _01 = 1; -} +// Java code failed too, so probably best for this to be a restriction. +// See https://github.com/google/protobuf/issues/308 +// message NumberField { +// optional int32 _01 = 1; +// } // Issue 28: Circular message dependencies result in null defaults for DefaultInstance diff --git a/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs b/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs index 02793aeb..54f400c3 100644 --- a/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs @@ -132,8 +132,8 @@ namespace Google.ProtocolBuffers { byte[] bytes = TestUtil.GetPackedSet().ToByteArray(); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestProtoFile.RegisterAllExtensions(registry); - UnitTestExtrasProtoFile.RegisterAllExtensions(registry); + Unittest.RegisterAllExtensions(registry); + UnittestImport.RegisterAllExtensions(registry); TestUnpackedExtensions message = TestUnpackedExtensions.ParseFrom(bytes, registry); TestUtil.AssertUnpackedExtensionsSet(message); } @@ -143,7 +143,7 @@ namespace Google.ProtocolBuffers { byte[] bytes = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray(); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestProtoFile.RegisterAllExtensions(registry); + Unittest.RegisterAllExtensions(registry); TestPackedExtensions message = TestPackedExtensions.ParseFrom(bytes, registry); TestUtil.AssertPackedExtensionsSet(message); } @@ -250,7 +250,7 @@ namespace Google.ProtocolBuffers TestAllTypes d = TestAllTypes.CreateBuilder(c).AddRepeatedString("y").Build(); TestAllExtensions e = TestUtil.GetAllExtensionsSet(); TestAllExtensions f = TestAllExtensions.CreateBuilder(e) - .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 999).Build(); + .AddExtension(Unittest.RepeatedInt32Extension, 999).Build(); CheckEqualsIsConsistent(a); CheckEqualsIsConsistent(b); diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs index 20189617..5befe96f 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs @@ -7,7 +7,7 @@ namespace Google.ProtocolBuffers.Compatibility { /// /// This abstract base implements several tests to ensure that well-known messages can be written - /// and read to/from various formats without loosing data. Implementations overload the two serailization + /// and read to/from various formats without losing data. Implementations overload the two serailization /// methods to provide the tests with the means to read and write for a given format. /// public abstract class CompatibilityTests diff --git a/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs b/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs index ca10c621..e74236fb 100644 --- a/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs +++ b/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs @@ -51,7 +51,7 @@ namespace Google.ProtocolBuffers [TestMethod] public void FileDescriptor() { - FileDescriptor file = UnitTestProtoFile.Descriptor; + FileDescriptor file = Unittest.Descriptor; Assert.AreEqual("google/protobuf/unittest.proto", file.Name); Assert.AreEqual("protobuf_unittest", file.Package); @@ -59,9 +59,13 @@ namespace Google.ProtocolBuffers Assert.AreEqual("UnittestProto", file.Options.JavaOuterClassname); Assert.AreEqual("google/protobuf/unittest.proto", file.Proto.Name); -// TODO(jonskeet): Either change to expect 2 dependencies, or don't emit them. -// Assert.AreEqual(2, file.Dependencies.Count); - Assert.AreEqual(UnitTestImportProtoFile.Descriptor, file.Dependencies[1]); + // unittest.proto doesn't have any public imports, but unittest_import.proto does. + Assert.AreEqual(0, file.PublicDependencies.Count); + Assert.AreEqual(1, UnittestImport.Descriptor.PublicDependencies.Count); + Assert.AreEqual(UnittestImportPublic.Descriptor, UnittestImport.Descriptor.PublicDependencies[0]); + + Assert.AreEqual(1, file.Dependencies.Count); + Assert.AreEqual(UnittestImport.Descriptor, file.Dependencies[0]); MessageDescriptor messageType = TestAllTypes.Descriptor; Assert.AreEqual(messageType, file.MessageTypes[0]); @@ -76,33 +80,19 @@ namespace Google.ProtocolBuffers Assert.AreEqual(file.EnumTypes[0], file.FindTypeByName("ForeignEnum")); Assert.IsNull(file.FindTypeByName("NoSuchType")); Assert.IsNull(file.FindTypeByName("protobuf_unittest.ForeignEnum")); - Assert.AreEqual(1, UnitTestImportProtoFile.Descriptor.EnumTypes.Count); - Assert.AreEqual("ImportEnum", UnitTestImportProtoFile.Descriptor.EnumTypes[0].Name); + Assert.AreEqual(1, UnittestImport.Descriptor.EnumTypes.Count); + Assert.AreEqual("ImportEnum", UnittestImport.Descriptor.EnumTypes[0].Name); for (int i = 0; i < file.EnumTypes.Count; i++) { Assert.AreEqual(i, file.EnumTypes[i].Index); } - ServiceDescriptor service = TestGenericService.Descriptor; - Assert.AreEqual(service, UnitTestGenericServices.Descriptor.Services[0]); - Assert.AreEqual(service, - UnitTestGenericServices.Descriptor.FindTypeByName("TestGenericService")); - Assert.IsNull(UnitTestGenericServices.Descriptor.FindTypeByName("NoSuchType")); - Assert.IsNull( - UnitTestGenericServices.Descriptor.FindTypeByName( - "protobuf_unittest.TestGenericService")); - Assert.AreEqual(0, UnitTestImportProtoFile.Descriptor.Services.Count); - for (int i = 0; i < file.Services.Count; i++) - { - Assert.AreEqual(i, file.Services[i].Index); - } - - FieldDescriptor extension = UnitTestProtoFile.OptionalInt32Extension.Descriptor; + FieldDescriptor extension = Unittest.OptionalInt32Extension.Descriptor; Assert.AreEqual(extension, file.Extensions[0]); Assert.AreEqual(extension, file.FindTypeByName("optional_int32_extension")); Assert.IsNull(file.FindTypeByName("no_such_ext")); Assert.IsNull(file.FindTypeByName("protobuf_unittest.optional_int32_extension")); - Assert.AreEqual(0, UnitTestImportProtoFile.Descriptor.Extensions.Count); + Assert.AreEqual(0, UnittestImport.Descriptor.Extensions.Count); for (int i = 0; i < file.Extensions.Count; i++) { Assert.AreEqual(i, file.Extensions[i].Index); @@ -117,14 +107,14 @@ namespace Google.ProtocolBuffers Assert.AreEqual("TestAllTypes", messageType.Name); Assert.AreEqual("protobuf_unittest.TestAllTypes", messageType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, messageType.File); + Assert.AreEqual(Unittest.Descriptor, messageType.File); Assert.IsNull(messageType.ContainingType); Assert.AreEqual(DescriptorProtos.MessageOptions.DefaultInstance, messageType.Options); Assert.AreEqual("TestAllTypes", messageType.Proto.Name); Assert.AreEqual("NestedMessage", nestedType.Name); Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedMessage", nestedType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, nestedType.File); + Assert.AreEqual(Unittest.Descriptor, nestedType.File); Assert.AreEqual(messageType, nestedType.ContainingType); FieldDescriptor field = messageType.Fields[0]; @@ -162,7 +152,7 @@ namespace Google.ProtocolBuffers FieldDescriptor enumField = messageType.FindDescriptor("optional_nested_enum"); FieldDescriptor messageField = messageType.FindDescriptor("optional_foreign_message"); FieldDescriptor cordField = messageType.FindDescriptor("optional_cord"); - FieldDescriptor extension = UnitTestProtoFile.OptionalInt32Extension.Descriptor; + FieldDescriptor extension = Unittest.OptionalInt32Extension.Descriptor; FieldDescriptor nestedExtension = TestRequired.Single.Descriptor; Assert.AreEqual("optional_int32", primitiveField.Name); @@ -170,7 +160,7 @@ namespace Google.ProtocolBuffers primitiveField.FullName); Assert.AreEqual(1, primitiveField.FieldNumber); Assert.AreEqual(messageType, primitiveField.ContainingType); - Assert.AreEqual(UnitTestProtoFile.Descriptor, primitiveField.File); + Assert.AreEqual(Unittest.Descriptor, primitiveField.File); Assert.AreEqual(FieldType.Int32, primitiveField.FieldType); Assert.AreEqual(MappedType.Int32, primitiveField.MappedType); Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance, primitiveField.Options); @@ -180,7 +170,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual("optional_nested_enum", enumField.Name); Assert.AreEqual(FieldType.Enum, enumField.FieldType); Assert.AreEqual(MappedType.Enum, enumField.MappedType); - // Assert.AreEqual(TestAllTypes.Types.NestedEnum.Descriptor, enumField.EnumType); + // Assert.AreEqual(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType); Assert.AreEqual("optional_foreign_message", messageField.Name); Assert.AreEqual(FieldType.Message, messageField.FieldType); @@ -196,7 +186,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual("protobuf_unittest.optional_int32_extension", extension.FullName); Assert.AreEqual(1, extension.FieldNumber); Assert.AreEqual(TestAllExtensions.Descriptor, extension.ContainingType); - Assert.AreEqual(UnitTestProtoFile.Descriptor, extension.File); + Assert.AreEqual(Unittest.Descriptor, extension.File); Assert.AreEqual(FieldType.Int32, extension.FieldType); Assert.AreEqual(MappedType.Int32, extension.MappedType); Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance, @@ -249,12 +239,12 @@ namespace Google.ProtocolBuffers public void EnumDescriptor() { // Note: this test is a bit different to the Java version because there's no static way of getting to the descriptor - EnumDescriptor enumType = UnitTestProtoFile.Descriptor.FindTypeByName("ForeignEnum"); + EnumDescriptor enumType = Unittest.Descriptor.FindTypeByName("ForeignEnum"); EnumDescriptor nestedType = TestAllTypes.Descriptor.FindDescriptor("NestedEnum"); Assert.AreEqual("ForeignEnum", enumType.Name); Assert.AreEqual("protobuf_unittest.ForeignEnum", enumType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, enumType.File); + Assert.AreEqual(Unittest.Descriptor, enumType.File); Assert.IsNull(enumType.ContainingType); Assert.AreEqual(DescriptorProtos.EnumOptions.DefaultInstance, enumType.Options); @@ -262,7 +252,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual("NestedEnum", nestedType.Name); Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedEnum", nestedType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, nestedType.File); + Assert.AreEqual(Unittest.Descriptor, nestedType.File); Assert.AreEqual(TestAllTypes.Descriptor, nestedType.ContainingType); EnumValueDescriptor value = enumType.FindValueByName("FOREIGN_FOO"); @@ -277,74 +267,22 @@ namespace Google.ProtocolBuffers Assert.AreEqual(i, enumType.Values[i].Index); } } - - [TestMethod] - public void ServiceDescriptor() - { - ServiceDescriptor service = TestGenericService.Descriptor; - - Assert.AreEqual("TestGenericService", service.Name); - Assert.AreEqual("protobuf_unittest.TestGenericService", service.FullName); - Assert.AreEqual(UnitTestGenericServices.Descriptor, service.File); - - Assert.AreEqual(2, service.Methods.Count); - - MethodDescriptor fooMethod = service.Methods[0]; - Assert.AreEqual("Foo", fooMethod.Name); - Assert.AreEqual(FooRequest.Descriptor, fooMethod.InputType); - Assert.AreEqual(FooResponse.Descriptor, fooMethod.OutputType); - Assert.AreEqual(fooMethod, service.FindMethodByName("Foo")); - - MethodDescriptor barMethod = service.Methods[1]; - Assert.AreEqual("Bar", barMethod.Name); - Assert.AreEqual(BarRequest.Descriptor, barMethod.InputType); - Assert.AreEqual(BarResponse.Descriptor, barMethod.OutputType); - Assert.AreEqual(barMethod, service.FindMethodByName("Bar")); - - Assert.IsNull(service.FindMethodByName("NoSuchMethod")); - - for (int i = 0; i < service.Methods.Count; i++) - { - Assert.AreEqual(i, service.Methods[i].Index); - } - } + [TestMethod] public void CustomOptions() { MessageDescriptor descriptor = TestMessageWithCustomOptions.Descriptor; - Assert.IsTrue(descriptor.Options.HasExtension(UnitTestCustomOptionsProtoFile.MessageOpt1)); - Assert.AreEqual(-56, descriptor.Options.GetExtension(UnitTestCustomOptionsProtoFile.MessageOpt1)); + Assert.IsTrue(descriptor.Options.HasExtension(UnittestCustomOptions.MessageOpt1)); + Assert.AreEqual(-56, descriptor.Options.GetExtension(UnittestCustomOptions.MessageOpt1)); FieldDescriptor field = descriptor.FindFieldByName("field1"); Assert.IsNotNull(field); - Assert.IsTrue(field.Options.HasExtension(UnitTestCustomOptionsProtoFile.FieldOpt1)); - Assert.AreEqual(8765432109uL, field.Options.GetExtension(UnitTestCustomOptionsProtoFile.FieldOpt1)); - - // TODO: Write out enum descriptors - /* - EnumDescriptor enumType = TestMessageWithCustomOptions.Types. - UnittestCustomOptions.TestMessageWithCustomOptions.AnEnum.getDescriptor(); - - Assert.IsTrue( - enumType.getOptions().hasExtension(UnittestCustomOptions.enumOpt1)); - Assert.AreEqual(Integer.valueOf(-789), - enumType.getOptions().getExtension(UnittestCustomOptions.enumOpt1)); - */ - - ServiceDescriptor service = TestGenericServiceWithCustomOptions.Descriptor; - - Assert.IsTrue(service.Options.HasExtension(UnitTestCustomOptionsProtoFile.ServiceOpt1)); - Assert.AreEqual(-9876543210L, service.Options.GetExtension(UnitTestCustomOptionsProtoFile.ServiceOpt1)); - - MethodDescriptor method = service.FindMethodByName("Foo"); - Assert.IsNotNull(method); - - Assert.IsTrue(method.Options.HasExtension(UnitTestCustomOptionsProtoFile.MethodOpt1)); - Assert.AreEqual(MethodOpt1.METHODOPT1_VAL2, - method.Options.GetExtension(UnitTestCustomOptionsProtoFile.MethodOpt1)); + Assert.IsTrue(field.Options.HasExtension(UnittestCustomOptions.FieldOpt1)); + Assert.AreEqual(8765432109uL, field.Options.GetExtension(UnittestCustomOptions.FieldOpt1)); + } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs b/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs index 68f37c3c..4e0bf8e6 100644 --- a/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs @@ -48,7 +48,7 @@ namespace Google.ProtocolBuffers [TestMethod, ExpectedException(typeof(ArgumentException))] public void ExtensionWriterInvalidExtension() { - TestPackedExtensions.CreateBuilder()[UnitTestProtoFile.OptionalForeignMessageExtension.Descriptor] = + TestPackedExtensions.CreateBuilder()[Unittest.OptionalForeignMessageExtension.Descriptor] = ForeignMessage.DefaultInstance; } @@ -56,73 +56,73 @@ namespace Google.ProtocolBuffers public void ExtensionWriterTest() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder() - .SetExtension(UnitTestProtoFile.DefaultBoolExtension, true) - .SetExtension(UnitTestProtoFile.DefaultBytesExtension, ByteString.CopyFromUtf8("123")) - .SetExtension(UnitTestProtoFile.DefaultCordExtension, "123") - .SetExtension(UnitTestProtoFile.DefaultDoubleExtension, 123) - .SetExtension(UnitTestProtoFile.DefaultFixed32Extension, 123u) - .SetExtension(UnitTestProtoFile.DefaultFixed64Extension, 123u) - .SetExtension(UnitTestProtoFile.DefaultFloatExtension, 123) - .SetExtension(UnitTestProtoFile.DefaultForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) - .SetExtension(UnitTestProtoFile.DefaultImportEnumExtension, ImportEnum.IMPORT_BAZ) - .SetExtension(UnitTestProtoFile.DefaultInt32Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultInt64Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) - .SetExtension(UnitTestProtoFile.DefaultSfixed32Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultSfixed64Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultSint32Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultSint64Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultStringExtension, "123") - .SetExtension(UnitTestProtoFile.DefaultStringPieceExtension, "123") - .SetExtension(UnitTestProtoFile.DefaultUint32Extension, 123u) - .SetExtension(UnitTestProtoFile.DefaultUint64Extension, 123u) + .SetExtension(Unittest.DefaultBoolExtension, true) + .SetExtension(Unittest.DefaultBytesExtension, ByteString.CopyFromUtf8("123")) + .SetExtension(Unittest.DefaultCordExtension, "123") + .SetExtension(Unittest.DefaultDoubleExtension, 123) + .SetExtension(Unittest.DefaultFixed32Extension, 123u) + .SetExtension(Unittest.DefaultFixed64Extension, 123u) + .SetExtension(Unittest.DefaultFloatExtension, 123) + .SetExtension(Unittest.DefaultForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) + .SetExtension(Unittest.DefaultImportEnumExtension, ImportEnum.IMPORT_BAZ) + .SetExtension(Unittest.DefaultInt32Extension, 123) + .SetExtension(Unittest.DefaultInt64Extension, 123) + .SetExtension(Unittest.DefaultNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) + .SetExtension(Unittest.DefaultSfixed32Extension, 123) + .SetExtension(Unittest.DefaultSfixed64Extension, 123) + .SetExtension(Unittest.DefaultSint32Extension, 123) + .SetExtension(Unittest.DefaultSint64Extension, 123) + .SetExtension(Unittest.DefaultStringExtension, "123") + .SetExtension(Unittest.DefaultStringPieceExtension, "123") + .SetExtension(Unittest.DefaultUint32Extension, 123u) + .SetExtension(Unittest.DefaultUint64Extension, 123u) //Optional - .SetExtension(UnitTestProtoFile.OptionalBoolExtension, true) - .SetExtension(UnitTestProtoFile.OptionalBytesExtension, ByteString.CopyFromUtf8("123")) - .SetExtension(UnitTestProtoFile.OptionalCordExtension, "123") - .SetExtension(UnitTestProtoFile.OptionalDoubleExtension, 123) - .SetExtension(UnitTestProtoFile.OptionalFixed32Extension, 123u) - .SetExtension(UnitTestProtoFile.OptionalFixed64Extension, 123u) - .SetExtension(UnitTestProtoFile.OptionalFloatExtension, 123) - .SetExtension(UnitTestProtoFile.OptionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) - .SetExtension(UnitTestProtoFile.OptionalImportEnumExtension, ImportEnum.IMPORT_BAZ) - .SetExtension(UnitTestProtoFile.OptionalInt32Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalInt64Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) - .SetExtension(UnitTestProtoFile.OptionalSfixed32Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalSfixed64Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalSint32Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalSint64Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalStringExtension, "123") - .SetExtension(UnitTestProtoFile.OptionalStringPieceExtension, "123") - .SetExtension(UnitTestProtoFile.OptionalUint32Extension, 123u) - .SetExtension(UnitTestProtoFile.OptionalUint64Extension, 123u) + .SetExtension(Unittest.OptionalBoolExtension, true) + .SetExtension(Unittest.OptionalBytesExtension, ByteString.CopyFromUtf8("123")) + .SetExtension(Unittest.OptionalCordExtension, "123") + .SetExtension(Unittest.OptionalDoubleExtension, 123) + .SetExtension(Unittest.OptionalFixed32Extension, 123u) + .SetExtension(Unittest.OptionalFixed64Extension, 123u) + .SetExtension(Unittest.OptionalFloatExtension, 123) + .SetExtension(Unittest.OptionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) + .SetExtension(Unittest.OptionalImportEnumExtension, ImportEnum.IMPORT_BAZ) + .SetExtension(Unittest.OptionalInt32Extension, 123) + .SetExtension(Unittest.OptionalInt64Extension, 123) + .SetExtension(Unittest.OptionalNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) + .SetExtension(Unittest.OptionalSfixed32Extension, 123) + .SetExtension(Unittest.OptionalSfixed64Extension, 123) + .SetExtension(Unittest.OptionalSint32Extension, 123) + .SetExtension(Unittest.OptionalSint64Extension, 123) + .SetExtension(Unittest.OptionalStringExtension, "123") + .SetExtension(Unittest.OptionalStringPieceExtension, "123") + .SetExtension(Unittest.OptionalUint32Extension, 123u) + .SetExtension(Unittest.OptionalUint64Extension, 123u) //Repeated - .AddExtension(UnitTestProtoFile.RepeatedBoolExtension, true) - .AddExtension(UnitTestProtoFile.RepeatedBytesExtension, ByteString.CopyFromUtf8("123")) - .AddExtension(UnitTestProtoFile.RepeatedCordExtension, "123") - .AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 123) - .AddExtension(UnitTestProtoFile.RepeatedFixed32Extension, 123u) - .AddExtension(UnitTestProtoFile.RepeatedFixed64Extension, 123u) - .AddExtension(UnitTestProtoFile.RepeatedFloatExtension, 123) - .AddExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) - .AddExtension(UnitTestProtoFile.RepeatedImportEnumExtension, ImportEnum.IMPORT_BAZ) - .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedInt64Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) - .AddExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedSint32Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedSint64Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedStringExtension, "123") - .AddExtension(UnitTestProtoFile.RepeatedStringPieceExtension, "123") - .AddExtension(UnitTestProtoFile.RepeatedUint32Extension, 123u) - .AddExtension(UnitTestProtoFile.RepeatedUint64Extension, 123u) + .AddExtension(Unittest.RepeatedBoolExtension, true) + .AddExtension(Unittest.RepeatedBytesExtension, ByteString.CopyFromUtf8("123")) + .AddExtension(Unittest.RepeatedCordExtension, "123") + .AddExtension(Unittest.RepeatedDoubleExtension, 123) + .AddExtension(Unittest.RepeatedFixed32Extension, 123u) + .AddExtension(Unittest.RepeatedFixed64Extension, 123u) + .AddExtension(Unittest.RepeatedFloatExtension, 123) + .AddExtension(Unittest.RepeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) + .AddExtension(Unittest.RepeatedImportEnumExtension, ImportEnum.IMPORT_BAZ) + .AddExtension(Unittest.RepeatedInt32Extension, 123) + .AddExtension(Unittest.RepeatedInt64Extension, 123) + .AddExtension(Unittest.RepeatedNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) + .AddExtension(Unittest.RepeatedSfixed32Extension, 123) + .AddExtension(Unittest.RepeatedSfixed64Extension, 123) + .AddExtension(Unittest.RepeatedSint32Extension, 123) + .AddExtension(Unittest.RepeatedSint64Extension, 123) + .AddExtension(Unittest.RepeatedStringExtension, "123") + .AddExtension(Unittest.RepeatedStringPieceExtension, "123") + .AddExtension(Unittest.RepeatedUint32Extension, 123u) + .AddExtension(Unittest.RepeatedUint64Extension, 123u) ; TestAllExtensions msg = builder.Build(); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestProtoFile.RegisterAllExtensions(registry); + Unittest.RegisterAllExtensions(registry); TestAllExtensions.Builder copyBuilder = TestAllExtensions.CreateBuilder().MergeFrom(msg.ToByteArray(), registry); @@ -130,73 +130,73 @@ namespace Google.ProtocolBuffers TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual(true, copy.GetExtension(UnitTestProtoFile.DefaultBoolExtension)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnitTestProtoFile.DefaultBytesExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.DefaultCordExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultDoubleExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultFixed32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultFixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultFloatExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(UnitTestProtoFile.DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(UnitTestProtoFile.DefaultImportEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultInt32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultInt64Extension)); + Assert.AreEqual(true, copy.GetExtension(Unittest.DefaultBoolExtension)); + Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(Unittest.DefaultBytesExtension)); + Assert.AreEqual("123", copy.GetExtension(Unittest.DefaultCordExtension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultDoubleExtension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultFixed32Extension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultFixed64Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultFloatExtension)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(Unittest.DefaultForeignEnumExtension)); + Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.DefaultImportEnumExtension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultInt32Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultInt64Extension)); Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestProtoFile.DefaultNestedEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSfixed32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSfixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSint32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSint64Extension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.DefaultStringExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.DefaultStringPieceExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultUint32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultUint64Extension)); + copy.GetExtension(Unittest.DefaultNestedEnumExtension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSfixed32Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSfixed64Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSint32Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSint64Extension)); + Assert.AreEqual("123", copy.GetExtension(Unittest.DefaultStringExtension)); + Assert.AreEqual("123", copy.GetExtension(Unittest.DefaultStringPieceExtension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultUint32Extension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultUint64Extension)); - Assert.AreEqual(true, copy.GetExtension(UnitTestProtoFile.OptionalBoolExtension)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnitTestProtoFile.OptionalBytesExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.OptionalCordExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalDoubleExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalFixed32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalFixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalFloatExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(UnitTestProtoFile.OptionalForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(UnitTestProtoFile.OptionalImportEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalInt64Extension)); + Assert.AreEqual(true, copy.GetExtension(Unittest.OptionalBoolExtension)); + Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(Unittest.OptionalBytesExtension)); + Assert.AreEqual("123", copy.GetExtension(Unittest.OptionalCordExtension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalDoubleExtension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalFixed32Extension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalFixed64Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalFloatExtension)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(Unittest.OptionalForeignEnumExtension)); + Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.OptionalImportEnumExtension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalInt32Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalInt64Extension)); Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSfixed32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSfixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSint32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSint64Extension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.OptionalStringExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.OptionalStringPieceExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalUint32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalUint64Extension)); + copy.GetExtension(Unittest.OptionalNestedEnumExtension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSfixed32Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSfixed64Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSint32Extension)); + Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSint64Extension)); + Assert.AreEqual("123", copy.GetExtension(Unittest.OptionalStringExtension)); + Assert.AreEqual("123", copy.GetExtension(Unittest.OptionalStringPieceExtension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalUint32Extension)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalUint64Extension)); - Assert.AreEqual(true, copy.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 0)); + Assert.AreEqual(true, copy.GetExtension(Unittest.RepeatedBoolExtension, 0)); Assert.AreEqual(ByteString.CopyFromUtf8("123"), - copy.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 0)); + copy.GetExtension(Unittest.RepeatedBytesExtension, 0)); + Assert.AreEqual("123", copy.GetExtension(Unittest.RepeatedCordExtension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedDoubleExtension, 0)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedFixed32Extension, 0)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedFixed64Extension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedFloatExtension, 0)); Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, - copy.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 0)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 0)); + copy.GetExtension(Unittest.RepeatedForeignEnumExtension, 0)); + Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.RepeatedImportEnumExtension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedInt32Extension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedInt64Extension, 0)); Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 0)); + copy.GetExtension(Unittest.RepeatedNestedEnumExtension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSint32Extension, 0)); + Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSint64Extension, 0)); + Assert.AreEqual("123", copy.GetExtension(Unittest.RepeatedStringExtension, 0)); + Assert.AreEqual("123", copy.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedUint32Extension, 0)); + Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedUint64Extension, 0)); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs b/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs index b04fb399..0e8b9807 100644 --- a/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs @@ -398,24 +398,24 @@ namespace Google.ProtocolBuffers { // ClearExtension() is not actually used in TestUtil, so try it manually. Assert.IsFalse(TestAllExtensions.CreateBuilder() - .SetExtension(UnitTestProtoFile.OptionalInt32Extension, 1) - .ClearExtension(UnitTestProtoFile.OptionalInt32Extension) - .HasExtension(UnitTestProtoFile.OptionalInt32Extension)); + .SetExtension(Unittest.OptionalInt32Extension, 1) + .ClearExtension(Unittest.OptionalInt32Extension) + .HasExtension(Unittest.OptionalInt32Extension)); Assert.AreEqual(0, TestAllExtensions.CreateBuilder() - .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 1) - .ClearExtension(UnitTestProtoFile.RepeatedInt32Extension) - .GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension)); + .AddExtension(Unittest.RepeatedInt32Extension, 1) + .ClearExtension(Unittest.RepeatedInt32Extension) + .GetExtensionCount(Unittest.RepeatedInt32Extension)); } [TestMethod] public void ExtensionMergeFrom() { TestAllExtensions original = TestAllExtensions.CreateBuilder() - .SetExtension(UnitTestProtoFile.OptionalInt32Extension, 1).Build(); + .SetExtension(Unittest.OptionalInt32Extension, 1).Build(); TestAllExtensions merged = TestAllExtensions.CreateBuilder().MergeFrom(original).Build(); - Assert.IsTrue((merged.HasExtension(UnitTestProtoFile.OptionalInt32Extension))); - Assert.AreEqual(1, (int) merged.GetExtension(UnitTestProtoFile.OptionalInt32Extension)); + Assert.IsTrue((merged.HasExtension(Unittest.OptionalInt32Extension))); + Assert.AreEqual(1, (int) merged.GetExtension(Unittest.OptionalInt32Extension)); } /* Removed multiple files option for the moment @@ -430,13 +430,13 @@ namespace Google.ProtocolBuffers .Build(); Assert.AreEqual(message, MessageWithNoOuter.ParseFrom(message.ToByteString())); - Assert.AreEqual(MultiFileProto.Descriptor, MessageWithNoOuter.Descriptor.File); + Assert.AreEqual(MultiFileProto.DescriptorProtoFile, MessageWithNoOuter.DescriptorProtoFile.File); - FieldDescriptor field = MessageWithNoOuter.Descriptor.FindDescriptor("foreign_enum"); - Assert.AreEqual(MultiFileProto.Descriptor.FindTypeByName("EnumWithNoOuter") + FieldDescriptor field = MessageWithNoOuter.DescriptorProtoFile.FindDescriptor("foreign_enum"); + Assert.AreEqual(MultiFileProto.DescriptorProtoFile.FindTypeByName("EnumWithNoOuter") .FindValueByNumber((int)EnumWithNoOuter.BAR), message[field]); - Assert.AreEqual(MultiFileProto.Descriptor, ServiceWithNoOuter.Descriptor.File); + Assert.AreEqual(MultiFileProto.DescriptorProtoFile, ServiceWithNoOuter.DescriptorProtoFile.File); Assert.IsFalse(TestAllExtensions.DefaultInstance.HasExtension(MultiFileProto.ExtensionWithOuter)); }*/ @@ -512,14 +512,14 @@ namespace Google.ProtocolBuffers { Assert.AreEqual(TestRequired.SingleFieldNumber, 1000); Assert.AreEqual(TestRequired.MultiFieldNumber, 1001); - Assert.AreEqual(UnitTestProtoFile.OptionalInt32ExtensionFieldNumber, 1); - Assert.AreEqual(UnitTestProtoFile.OptionalGroupExtensionFieldNumber, 16); - Assert.AreEqual(UnitTestProtoFile.OptionalNestedMessageExtensionFieldNumber, 18); - Assert.AreEqual(UnitTestProtoFile.OptionalNestedEnumExtensionFieldNumber, 21); - Assert.AreEqual(UnitTestProtoFile.RepeatedInt32ExtensionFieldNumber, 31); - Assert.AreEqual(UnitTestProtoFile.RepeatedGroupExtensionFieldNumber, 46); - Assert.AreEqual(UnitTestProtoFile.RepeatedNestedMessageExtensionFieldNumber, 48); - Assert.AreEqual(UnitTestProtoFile.RepeatedNestedEnumExtensionFieldNumber, 51); + Assert.AreEqual(Unittest.OptionalInt32ExtensionFieldNumber, 1); + Assert.AreEqual(Unittest.OptionalGroupExtensionFieldNumber, 16); + Assert.AreEqual(Unittest.OptionalNestedMessageExtensionFieldNumber, 18); + Assert.AreEqual(Unittest.OptionalNestedEnumExtensionFieldNumber, 21); + Assert.AreEqual(Unittest.RepeatedInt32ExtensionFieldNumber, 31); + Assert.AreEqual(Unittest.RepeatedGroupExtensionFieldNumber, 46); + Assert.AreEqual(Unittest.RepeatedNestedMessageExtensionFieldNumber, 48); + Assert.AreEqual(Unittest.RepeatedNestedEnumExtensionFieldNumber, 51); } [TestMethod] diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index 0dcdd1e6..b11b1ad8 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -82,9 +82,20 @@ - + + + + + + + + + + + + + - @@ -102,26 +113,8 @@ - - - - - - - - - - - - - - - - - - @@ -160,6 +153,7 @@ + - - - - - - bin\CF20\Debug - obj\CF20\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - true - - - bin\CF20\Release - obj\CF20\Release\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - true - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/CF35.csproj b/csharp/csproj_templates/CF35.csproj deleted file mode 100644 index eae866f0..00000000 --- a/csharp/csproj_templates/CF35.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - v3.5 - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - - - - - bin\CF35\Debug - obj\CF35\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION - true - - - bin\CF35\Release - obj\CF35\Release\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION - true - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/NET20.csproj b/csharp/csproj_templates/NET20.csproj deleted file mode 100644 index f9e93920..00000000 --- a/csharp/csproj_templates/NET20.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - CLIENTPROFILE - NET20 - v2.0 - - - bin\NET20\Debug - obj\NET20\Debug\ - $(DefineConstants);NOEXTENSIONS - - - bin\NET20\Release - obj\NET20\Release\ - $(DefineConstants);NOEXTENSIONS - - \ No newline at end of file diff --git a/csharp/csproj_templates/NET35.csproj b/csharp/csproj_templates/NET35.csproj deleted file mode 100644 index 80ef69aa..00000000 --- a/csharp/csproj_templates/NET35.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - CLIENTPROFILE - NET35 - v3.5 - - - bin\NET35\Debug - obj\NET35\Debug\ - $(DefineConstants) - - - bin\NET35\Release - obj\NET35\Release\ - $(DefineConstants) - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/NET40.csproj b/csharp/csproj_templates/NET40.csproj deleted file mode 100644 index 691845a6..00000000 --- a/csharp/csproj_templates/NET40.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - CLIENTPROFILE - NET40 - v4.0 - - - bin\NET40\Debug - obj\NET40\Debug\ - $(DefineConstants) - - - bin\NET40\Release - obj\NET40\Release\ - $(DefineConstants) - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/PL40.csproj b/csharp/csproj_templates/PL40.csproj deleted file mode 100644 index 2618a79f..00000000 --- a/csharp/csproj_templates/PL40.csproj +++ /dev/null @@ -1,51 +0,0 @@ - - - 10.0 - PORTABLE_LIBRARY - PL40 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - v4.0 - Profile1 - - - bin\PL40\Debug - obj\PL40\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - - - bin\PL40\Release - obj\PL40\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - - - - - - - - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/SL20.csproj b/csharp/csproj_templates/SL20.csproj deleted file mode 100644 index 0abb104b..00000000 --- a/csharp/csproj_templates/SL20.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - SILVERLIGHT - SL20 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - v2.0 - false - false - false - - - bin\SL20\Debug - obj\SL20\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - true - - - bin\SL20\Release - obj\SL20\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - true - - - - - - - - - - OfflineApplication - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/SL30.csproj b/csharp/csproj_templates/SL30.csproj deleted file mode 100644 index 82ea9a8e..00000000 --- a/csharp/csproj_templates/SL30.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - SILVERLIGHT - SL30 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - v3.5 - false - false - false - - - bin\SL30\Debug - obj\SL30\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - bin\SL30\Release - obj\SL30\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - - - - - - - - - - - OfflineApplication - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/SL40.csproj b/csharp/csproj_templates/SL40.csproj deleted file mode 100644 index 8a38e3d2..00000000 --- a/csharp/csproj_templates/SL40.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - SILVERLIGHT - SL40 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - v4.0 - false - false - false - $(TargetFrameworkVersion) - - - bin\SL40\Debug - obj\SL40\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - bin\SL40\Release - obj\SL40\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - - - - - - - - - - - OfflineApplication - - - - - \ No newline at end of file diff --git a/csharp/csproj_templates/SLTest.targets b/csharp/csproj_templates/SLTest.targets deleted file mode 100644 index 29da2399..00000000 --- a/csharp/csproj_templates/SLTest.targets +++ /dev/null @@ -1,34 +0,0 @@ - - - - true - true - true - $(AssemblyName).xap - Properties\AppManifest.xml - $(RootNamespace).App - TestPage.html - true - $(TargetFrameworkVersion) - Properties\OutOfBrowserSettings.xml - true - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - \ No newline at end of file diff --git a/csharp/protos/benchmarks/google_size.proto b/csharp/protos/benchmarks/google_size.proto deleted file mode 100644 index 1442ca23..00000000 --- a/csharp/protos/benchmarks/google_size.proto +++ /dev/null @@ -1,140 +0,0 @@ -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.ProtoBench"; -option (google.protobuf.csharp_file_options).umbrella_classname = "GoogleSizeProtoFile"; - -package benchmarks; - -option java_outer_classname = "GoogleSize"; -option optimize_for = CODE_SIZE; - -message SizeMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SizeMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SizeMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SizeMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SizeMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SizeMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/csharp/protos/benchmarks/google_speed.proto b/csharp/protos/benchmarks/google_speed.proto deleted file mode 100644 index 269eba80..00000000 --- a/csharp/protos/benchmarks/google_speed.proto +++ /dev/null @@ -1,140 +0,0 @@ -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.ProtoBench"; -option (google.protobuf.csharp_file_options).umbrella_classname = "GoogleSpeedProtoFile"; - -package benchmarks; - -option java_outer_classname = "GoogleSpeed"; -option optimize_for = SPEED; - -message SpeedMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SpeedMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SpeedMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SpeedMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SpeedMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SpeedMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/csharp/protos/google/protobuf/compiler/plugin.proto b/csharp/protos/google/protobuf/compiler/plugin.proto deleted file mode 100644 index 866fba11..00000000 --- a/csharp/protos/google/protobuf/compiler/plugin.proto +++ /dev/null @@ -1,147 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to -// change. -// -// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is -// just a program that reads a CodeGeneratorRequest from stdin and writes a -// CodeGeneratorResponse to stdout. -// -// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead -// of dealing with the raw protocol defined here. -// -// A plugin executable needs only to be placed somewhere in the path. The -// plugin should be named "protoc-gen-$NAME", and will then be used when the -// flag "--${NAME}_out" is passed to protoc. - -package google.protobuf.compiler; -option java_package = "com.google.protobuf.compiler"; -option java_outer_classname = "PluginProtos"; - -import "google/protobuf/descriptor.proto"; - -// An encoded CodeGeneratorRequest is written to the plugin's stdin. -message CodeGeneratorRequest { - // The .proto files that were explicitly listed on the command-line. The - // code generator should generate code only for these files. Each file's - // descriptor will be included in proto_file, below. - repeated string file_to_generate = 1; - - // The generator parameter passed on the command-line. - optional string parameter = 2; - - // FileDescriptorProtos for all files in files_to_generate and everything - // they import. The files will appear in topological order, so each file - // appears before any file that imports it. - // - // protoc guarantees that all proto_files will be written after - // the fields above, even though this is not technically guaranteed by the - // protobuf wire format. This theoretically could allow a plugin to stream - // in the FileDescriptorProtos and handle them one by one rather than read - // the entire set into memory at once. However, as of this writing, this - // is not similarly optimized on protoc's end -- it will store all fields in - // memory at once before sending them to the plugin. - repeated FileDescriptorProto proto_file = 15; -} - -// The plugin writes an encoded CodeGeneratorResponse to stdout. -message CodeGeneratorResponse { - // Error message. If non-empty, code generation failed. The plugin process - // should exit with status code zero even if it reports an error in this way. - // - // This should be used to indicate errors in .proto files which prevent the - // code generator from generating correct code. Errors which indicate a - // problem in protoc itself -- such as the input CodeGeneratorRequest being - // unparseable -- should be reported by writing a message to stderr and - // exiting with a non-zero status code. - optional string error = 1; - - // Represents a single generated file. - message File { - // The file name, relative to the output directory. The name must not - // contain "." or ".." components and must be relative, not be absolute (so, - // the file cannot lie outside the output directory). "/" must be used as - // the path separator, not "\". - // - // If the name is omitted, the content will be appended to the previous - // file. This allows the generator to break large files into small chunks, - // and allows the generated text to be streamed back to protoc so that large - // files need not reside completely in memory at one time. Note that as of - // this writing protoc does not optimize for this -- it will read the entire - // CodeGeneratorResponse before writing files to disk. - optional string name = 1; - - // If non-empty, indicates that the named file should already exist, and the - // content here is to be inserted into that file at a defined insertion - // point. This feature allows a code generator to extend the output - // produced by another code generator. The original generator may provide - // insertion points by placing special annotations in the file that look - // like: - // @@protoc_insertion_point(NAME) - // The annotation can have arbitrary text before and after it on the line, - // which allows it to be placed in a comment. NAME should be replaced with - // an identifier naming the point -- this is what other generators will use - // as the insertion_point. Code inserted at this point will be placed - // immediately above the line containing the insertion point (thus multiple - // insertions to the same point will come out in the order they were added). - // The double-@ is intended to make it unlikely that the generated code - // could contain things that look like insertion points by accident. - // - // For example, the C++ code generator places the following line in the - // .pb.h files that it generates: - // // @@protoc_insertion_point(namespace_scope) - // This line appears within the scope of the file's package namespace, but - // outside of any particular class. Another plugin can then specify the - // insertion_point "namespace_scope" to generate additional classes or - // other declarations that should be placed in this scope. - // - // Note that if the line containing the insertion point begins with - // whitespace, the same whitespace will be added to every line of the - // inserted text. This is useful for languages like Python, where - // indentation matters. In these languages, the insertion point comment - // should be indented the same amount as any inserted code will need to be - // in order to work correctly in that context. - // - // The code generator that generates the initial file and the one which - // inserts into it must both run as part of a single invocation of protoc. - // Code generators are executed in the order in which they appear on the - // command line. - // - // If |insertion_point| is present, |name| must also be present. - optional string insertion_point = 2; - - // The file contents. - optional string content = 15; - } - repeated File file = 15; -} diff --git a/csharp/protos/google/protobuf/csharp_options.proto b/csharp/protos/google/protobuf/csharp_options.proto deleted file mode 100644 index f09b96aa..00000000 --- a/csharp/protos/google/protobuf/csharp_options.proto +++ /dev/null @@ -1,115 +0,0 @@ -// Extra options for C# generator - -import "google/protobuf/descriptor.proto"; - -package google.protobuf; - -message CSharpFileOptions { - - // Namespace for generated classes; defaults to the package. - optional string namespace = 1; - - // Name of the "umbrella" class used for metadata about all - // the messages within this file. Default is based on the name - // of the file. - optional string umbrella_classname = 2; - - // Whether classes should be public (true) or internal (false) - optional bool public_classes = 3 [default = true]; - - // Whether to generate a single file for everything within the - // .proto file (false), or one file per message (true). - // This option is not currently honored; please log a feature - // request if you really want it. - optional bool multiple_files = 4; - - // Whether to nest messages within a single umbrella class (true) - // or create the umbrella class as a peer, with messages as - // top-level classes in the namespace (false) - optional bool nest_classes = 5; - - // Generate appropriate support for Code Contracts - // (Ongoing; support should improve over time) - optional bool code_contracts = 6; - - // Create subdirectories for namespaces, e.g. namespace "Foo.Bar" - // would generate files within [output directory]/Foo/Bar - optional bool expand_namespace_directories = 7; - - // Generate attributes indicating non-CLS-compliance - optional bool cls_compliance = 8 [default = true]; - - // Generate messages/builders with the [Serializable] attribute - optional bool add_serializable = 9 [default = false]; - - // Generates a private ctor for Message types - optional bool generate_private_ctor = 10 [default = true]; - - // The extension that should be appended to the umbrella_classname when creating files. - optional string file_extension = 221 [default = ".cs"]; - - // A nested namespace for the umbrella class. Helpful for name collisions caused by - // umbrella_classname conflicting with an existing type. This will be automatically - // set to 'Proto' if a collision is detected with types being generated. This value - // is ignored when nest_classes == true - optional string umbrella_namespace = 222; - - // The output path for the source file(s) generated - optional string output_directory = 223 [default = "."]; - - // Will ignore the type generations and remove dependencies for the descriptor proto - // files that declare their package to be "google.protobuf" - optional bool ignore_google_protobuf = 224 [default = false]; - - // Controls how services are generated, GENERIC is the deprecated original implementation - // INTERFACE generates service interfaces only, RPCINTEROP generates interfaces and - // implementations using the included Windows RPC interop libarary. - optional CSharpServiceType service_generator_type = 225 [default = NONE]; - - // Used to add the System.Runtime.CompilerServices.CompilerGeneratedAttribute and - // System.CodeDom.Compiler.GeneratedCodeAttribute attributes to generated code. - optional bool generated_code_attributes = 226 [default = false]; -} - -enum CSharpServiceType { - // Services are ignored by the generator - NONE = 0; - // Generates the original Java generic service implementations - GENERIC = 1; - // Generates an interface for the service and nothing else - INTERFACE = 2; - // Generates an interface for the service and client/server wrappers for the interface - IRPCDISPATCH = 3; -} - -extend FileOptions { - optional CSharpFileOptions csharp_file_options = 1000; -} - -extend FieldOptions { - optional CSharpFieldOptions csharp_field_options = 1000; -} - -message CSharpFieldOptions { - // Provides the ability to override the name of the property - // generated for this field. This is applied to all properties - // and methods to do with this field, including HasFoo, FooCount, - // FooList etc. - optional string property_name = 1; -} - -message CSharpServiceOptions { - optional string interface_id = 1; -} - -extend ServiceOptions { - optional CSharpServiceOptions csharp_service_options = 1000; -} - -message CSharpMethodOptions { - optional int32 dispatch_id = 1; -} - -extend MethodOptions { - optional CSharpMethodOptions csharp_method_options = 1000; -} \ No newline at end of file diff --git a/csharp/protos/google/protobuf/descriptor.proto b/csharp/protos/google/protobuf/descriptor.proto deleted file mode 100644 index 233f8794..00000000 --- a/csharp/protos/google/protobuf/descriptor.proto +++ /dev/null @@ -1,533 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - - -package google.protobuf; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field whithout harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; - optional int32 end = 2; - } - repeated ExtensionRange extension_range = 5; - - optional MessageOptions options = 7; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - TYPE_INT64 = 3; // Not ZigZag encoded. Negative numbers - // take 10 bytes. Use TYPE_SINT64 if negative - // values are likely. - TYPE_UINT64 = 4; - TYPE_INT32 = 5; // Not ZigZag encoded. Negative numbers - // take 10 bytes. Use TYPE_SINT32 if negative - // values are likely. - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; // Tag-delimited aggregate. - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - // TODO(sanjay): Should we add LABEL_MAP? - }; - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be either TYPE_ENUM or TYPE_MESSAGE. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - optional FieldOptions options = 8; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; -} - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail kenton@google.com to reserve extension -// numbers. Simply tell me how many you need and I'll send you back a -// set of numbers to use -- there's no need to explain how you intend to -// use them. If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - optional string java_outer_classname = 8; - - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; - - // If set true, then the Java code generator will generate equals() and - // hashCode() methods for all messages defined in the .proto file. This is - // purely a speed optimization, as the AbstractMessage base class includes - // reflection-based implementations of these methods. - optional bool java_generate_equals_and_hash = 20 [default=false]; - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default=SPEED]; - - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of proto2. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. - optional bool packed = 2; - - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; - - // EXPERIMENTAL. DO NOT USE. - // For "map" fields, the name of the field in the enclosed type that - // is the key for this map. For example, suppose we have: - // message Item { - // required string name = 1; - // required string value = 2; - // } - // message Config { - // repeated Item items = 1 [experimental_map_key="name"]; - // } - // In this situation, the map key for Item will be set to "name". - // TODO: Fully-implement this, then remove the "experimental_" prefix. - optional string experimental_map_key = 9; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; - - // TODO(kenton): Record comments appearing before and after the - // declaration. - } -} diff --git a/csharp/protos/google/protobuf/unittest.proto b/csharp/protos/google/protobuf/unittest.proto deleted file mode 100644 index 7f05cf80..00000000 --- a/csharp/protos/google/protobuf/unittest.proto +++ /dev/null @@ -1,636 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file we will use for unit testing. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; // auto-added - -import "google/protobuf/unittest_import.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do "using namespace unittest = protobuf_unittest". -package protobuf_unittest; - -// Protos optimized for SPEED use a strict superset of the generated code -// of equivalent ones optimized for CODE_SIZE, so we should optimize all our -// tests for speed unless explicitly testing code size optimization. -option optimize_for = SPEED; - -option java_outer_classname = "UnittestProto"; - -// This proto includes every type of field in both singular and repeated -// forms. -message TestAllTypes { - message NestedMessage { - // The field name "b" fails to compile in proto1 because it conflicts with - // a local variable named "b" in one of the generated methods. Doh. - // This file needs to compile in proto1 to test backwards-compatibility. - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessage optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessage optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR ]; - optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum = 83 [default = IMPORT_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message TestDeprecatedFields { - optional int32 deprecated_int32 = 1 [deprecated=true]; -} - -// Define these after TestAllTypes to make sure the compiler can handle -// that. -message ForeignMessage { - optional int32 c = 1; -} - -enum ForeignEnum { - FOREIGN_FOO = 4; - FOREIGN_BAR = 5; - FOREIGN_BAZ = 6; -} - -message TestAllExtensions { - extensions 1 to max; -} - -extend TestAllExtensions { - // Singular - optional int32 optional_int32_extension = 1; - optional int64 optional_int64_extension = 2; - optional uint32 optional_uint32_extension = 3; - optional uint64 optional_uint64_extension = 4; - optional sint32 optional_sint32_extension = 5; - optional sint64 optional_sint64_extension = 6; - optional fixed32 optional_fixed32_extension = 7; - optional fixed64 optional_fixed64_extension = 8; - optional sfixed32 optional_sfixed32_extension = 9; - optional sfixed64 optional_sfixed64_extension = 10; - optional float optional_float_extension = 11; - optional double optional_double_extension = 12; - optional bool optional_bool_extension = 13; - optional string optional_string_extension = 14; - optional bytes optional_bytes_extension = 15; - - optional group OptionalGroup_extension = 16 { - optional int32 a = 17; - } - - optional TestAllTypes.NestedMessage optional_nested_message_extension = 18; - optional ForeignMessage optional_foreign_message_extension = 19; - optional protobuf_unittest_import.ImportMessage - optional_import_message_extension = 20; - - optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21; - optional ForeignEnum optional_foreign_enum_extension = 22; - optional protobuf_unittest_import.ImportEnum - optional_import_enum_extension = 23; - - optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE]; - optional string optional_cord_extension = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32_extension = 31; - repeated int64 repeated_int64_extension = 32; - repeated uint32 repeated_uint32_extension = 33; - repeated uint64 repeated_uint64_extension = 34; - repeated sint32 repeated_sint32_extension = 35; - repeated sint64 repeated_sint64_extension = 36; - repeated fixed32 repeated_fixed32_extension = 37; - repeated fixed64 repeated_fixed64_extension = 38; - repeated sfixed32 repeated_sfixed32_extension = 39; - repeated sfixed64 repeated_sfixed64_extension = 40; - repeated float repeated_float_extension = 41; - repeated double repeated_double_extension = 42; - repeated bool repeated_bool_extension = 43; - repeated string repeated_string_extension = 44; - repeated bytes repeated_bytes_extension = 45; - - repeated group RepeatedGroup_extension = 46 { - optional int32 a = 47; - } - - repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48; - repeated ForeignMessage repeated_foreign_message_extension = 49; - repeated protobuf_unittest_import.ImportMessage - repeated_import_message_extension = 50; - - repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51; - repeated ForeignEnum repeated_foreign_enum_extension = 52; - repeated protobuf_unittest_import.ImportEnum - repeated_import_enum_extension = 53; - - repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord_extension = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32_extension = 61 [default = 41 ]; - optional int64 default_int64_extension = 62 [default = 42 ]; - optional uint32 default_uint32_extension = 63 [default = 43 ]; - optional uint64 default_uint64_extension = 64 [default = 44 ]; - optional sint32 default_sint32_extension = 65 [default = -45 ]; - optional sint64 default_sint64_extension = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension = 70 [default = -50 ]; - optional float default_float_extension = 71 [default = 51.5 ]; - optional double default_double_extension = 72 [default = 52e3 ]; - optional bool default_bool_extension = 73 [default = true ]; - optional string default_string_extension = 74 [default = "hello"]; - optional bytes default_bytes_extension = 75 [default = "world"]; - - optional TestAllTypes.NestedEnum - default_nested_enum_extension = 81 [default = BAR]; - optional ForeignEnum - default_foreign_enum_extension = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum_extension = 83 [default = IMPORT_BAR]; - - optional string default_string_piece_extension = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension = 85 [ctype=CORD, default="123"]; -} - -message TestNestedExtension { - extend TestAllExtensions { - // Check for bug where string extensions declared in tested scope did not - // compile. - optional string test = 1002 [default="test"]; - } -} - -// We have separate messages for testing required fields because it's -// annoying to have to fill in required fields in TestProto in order to -// do anything with it. Note that we don't need to test every type of -// required filed because the code output is basically identical to -// optional fields for all types. -message TestRequired { - required int32 a = 1; - optional int32 dummy2 = 2; - required int32 b = 3; - - extend TestAllExtensions { - optional TestRequired single = 1000; - repeated TestRequired multi = 1001; - } - - // Pad the field count to 32 so that we can test that IsInitialized() - // properly checks multiple elements of has_bits_. - optional int32 dummy4 = 4; - optional int32 dummy5 = 5; - optional int32 dummy6 = 6; - optional int32 dummy7 = 7; - optional int32 dummy8 = 8; - optional int32 dummy9 = 9; - optional int32 dummy10 = 10; - optional int32 dummy11 = 11; - optional int32 dummy12 = 12; - optional int32 dummy13 = 13; - optional int32 dummy14 = 14; - optional int32 dummy15 = 15; - optional int32 dummy16 = 16; - optional int32 dummy17 = 17; - optional int32 dummy18 = 18; - optional int32 dummy19 = 19; - optional int32 dummy20 = 20; - optional int32 dummy21 = 21; - optional int32 dummy22 = 22; - optional int32 dummy23 = 23; - optional int32 dummy24 = 24; - optional int32 dummy25 = 25; - optional int32 dummy26 = 26; - optional int32 dummy27 = 27; - optional int32 dummy28 = 28; - optional int32 dummy29 = 29; - optional int32 dummy30 = 30; - optional int32 dummy31 = 31; - optional int32 dummy32 = 32; - - required int32 c = 33; -} - -message TestRequiredForeign { - optional TestRequired optional_message = 1; - repeated TestRequired repeated_message = 2; - optional int32 dummy = 3; -} - -// Test that we can use NestedMessage from outside TestAllTypes. -message TestForeignNested { - optional TestAllTypes.NestedMessage foreign_nested = 1; -} - -// TestEmptyMessage is used to test unknown field support. -message TestEmptyMessage { -} - -// Like above, but declare all field numbers as potential extensions. No -// actual extensions should ever be defined for this type. -message TestEmptyMessageWithExtensions { - extensions 1 to max; -} - -message TestMultipleExtensionRanges { - extensions 42; - extensions 4143 to 4243; - extensions 65536 to max; -} - -// Test that really large tag numbers don't break anything. -message TestReallyLargeTagNumber { - // The largest possible tag number is 2^28 - 1, since the wire format uses - // three bits to communicate wire type. - optional int32 a = 1; - optional int32 bb = 268435455; -} - -message TestRecursiveMessage { - optional TestRecursiveMessage a = 1; - optional int32 i = 2; -} - -// Test that mutual recursion works. -message TestMutualRecursionA { - optional TestMutualRecursionB bb = 1; -} - -message TestMutualRecursionB { - optional TestMutualRecursionA a = 1; - optional int32 optional_int32 = 2; -} - -// Test that groups have disjoint field numbers from their siblings and -// parents. This is NOT possible in proto1; only proto2. When attempting -// to compile with proto1, this will emit an error; so we only include it -// in protobuf_unittest_proto. -message TestDupFieldNumber { // NO_PROTO1 - optional int32 a = 1; // NO_PROTO1 - optional group Foo = 2 { optional int32 a = 1; } // NO_PROTO1 - optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1 -} // NO_PROTO1 - - -// Needed for a Python test. -message TestNestedMessageHasBits { - message NestedMessage { - repeated int32 nestedmessage_repeated_int32 = 1; - repeated ForeignMessage nestedmessage_repeated_foreignmessage = 2; - } - optional NestedMessage optional_nested_message = 1; -} - - -// Test an enum that has multiple values with the same number. -enum TestEnumWithDupValue { - FOO1 = 1; - BAR1 = 2; - BAZ = 3; - FOO2 = 1; - BAR2 = 2; -} - -// Test an enum with large, unordered values. -enum TestSparseEnum { - SPARSE_A = 123; - SPARSE_B = 62374; - SPARSE_C = 12589234; - SPARSE_D = -15; - SPARSE_E = -53452; - SPARSE_F = 0; - SPARSE_G = 2; -} - -// Test message with CamelCase field names. This violates Protocol Buffer -// standard style. -message TestCamelCaseFieldNames { - optional int32 PrimitiveField = 1; - optional string StringField = 2; - optional ForeignEnum EnumField = 3; - optional ForeignMessage MessageField = 4; - optional string StringPieceField = 5 [ctype=STRING_PIECE]; - optional string CordField = 6 [ctype=CORD]; - - repeated int32 RepeatedPrimitiveField = 7; - repeated string RepeatedStringField = 8; - repeated ForeignEnum RepeatedEnumField = 9; - repeated ForeignMessage RepeatedMessageField = 10; - repeated string RepeatedStringPieceField = 11 [ctype=STRING_PIECE]; - repeated string RepeatedCordField = 12 [ctype=CORD]; -} - - -// We list fields out of order, to ensure that we're using field number and not -// field index to determine serialization order. -message TestFieldOrderings { - optional string my_string = 11; - extensions 2 to 10; - optional int64 my_int = 1; - extensions 12 to 100; - optional float my_float = 101; -} - - -extend TestFieldOrderings { - optional string my_extension_string = 50; - optional int32 my_extension_int = 5; -} - - -message TestExtremeDefaultValues { - optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"]; - optional uint32 large_uint32 = 2 [default = 0xFFFFFFFF]; - optional uint64 large_uint64 = 3 [default = 0xFFFFFFFFFFFFFFFF]; - optional int32 small_int32 = 4 [default = -0x7FFFFFFF]; - optional int64 small_int64 = 5 [default = -0x7FFFFFFFFFFFFFFF]; - - // The default value here is UTF-8 for "\u1234". (We could also just type - // the UTF-8 text directly into this text file rather than escape it, but - // lots of people use editors that would be confused by this.) - optional string utf8_string = 6 [default = "\341\210\264"]; - - // Tests for single-precision floating-point values. - optional float zero_float = 7 [default = 0]; - optional float one_float = 8 [default = 1]; - optional float small_float = 9 [default = 1.5]; - optional float negative_one_float = 10 [default = -1]; - optional float negative_float = 11 [default = -1.5]; - // Using exponents - optional float large_float = 12 [default = 2E8]; - optional float small_negative_float = 13 [default = -8e-28]; - - // Text for nonfinite floating-point values. - optional double inf_double = 14 [default = inf]; - optional double neg_inf_double = 15 [default = -inf]; - optional double nan_double = 16 [default = nan]; - optional float inf_float = 17 [default = inf]; - optional float neg_inf_float = 18 [default = -inf]; - optional float nan_float = 19 [default = nan]; - - // Tests for C++ trigraphs. - // Trigraphs should be escaped in C++ generated files, but they should not be - // escaped for other languages. - // Note that in .proto file, "\?" is a valid way to escape ? in string - // literals. - optional string cpp_trigraph = 20 [default = "? \? ?? \?? \??? ??/ ?\?-"]; -} - -message SparseEnumMessage { - optional TestSparseEnum sparse_enum = 1; -} - -// Test String and Bytes: string is for valid UTF-8 strings -message OneString { - optional string data = 1; -} - -message OneBytes { - optional bytes data = 1; -} - -// Test messages for packed fields - -message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; -} - -// A message with the same fields as TestPackedTypes, but without packing. Used -// to test packed <-> unpacked wire compatibility. -message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; -} - -message TestPackedExtensions { - extensions 1 to max; -} - -extend TestPackedExtensions { - repeated int32 packed_int32_extension = 90 [packed = true]; - repeated int64 packed_int64_extension = 91 [packed = true]; - repeated uint32 packed_uint32_extension = 92 [packed = true]; - repeated uint64 packed_uint64_extension = 93 [packed = true]; - repeated sint32 packed_sint32_extension = 94 [packed = true]; - repeated sint64 packed_sint64_extension = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension = 99 [packed = true]; - repeated float packed_float_extension = 100 [packed = true]; - repeated double packed_double_extension = 101 [packed = true]; - repeated bool packed_bool_extension = 102 [packed = true]; - repeated ForeignEnum packed_enum_extension = 103 [packed = true]; -} - -// Used by ExtensionSetTest/DynamicExtensions. The test actually builds -// a set of extensions to TestAllExtensions dynamically, based on the fields -// of this message type. -message TestDynamicExtensions { - enum DynamicEnumType { - DYNAMIC_FOO = 2200; - DYNAMIC_BAR = 2201; - DYNAMIC_BAZ = 2202; - } - message DynamicMessageType { - optional int32 dynamic_field = 2100; - } - - optional fixed32 scalar_extension = 2000; - optional ForeignEnum enum_extension = 2001; - optional DynamicEnumType dynamic_enum_extension = 2002; - - optional ForeignMessage message_extension = 2003; - optional DynamicMessageType dynamic_message_extension = 2004; - - repeated string repeated_extension = 2005; - repeated sint32 packed_extension = 2006 [packed = true]; -} - -message TestRepeatedScalarDifferentTagSizes { - // Parsing repeated fixed size values used to fail. This message needs to be - // used in order to get a tag of the right size; all of the repeated fields - // in TestAllTypes didn't trigger the check. - repeated fixed32 repeated_fixed32 = 12; - // Check for a varint type, just for good measure. - repeated int32 repeated_int32 = 13; - - // These have two-byte tags. - repeated fixed64 repeated_fixed64 = 2046; - repeated int64 repeated_int64 = 2047; - - // Three byte tags. - repeated float repeated_float = 262142; - repeated uint64 repeated_uint64 = 262143; -} - - -// Test that RPC services work. -message FooRequest {} -message FooResponse {} - -service TestService { - rpc Foo(FooRequest) returns (FooResponse); - rpc Bar(BarRequest) returns (BarResponse); -} - - -message BarRequest {} -message BarResponse {} diff --git a/csharp/protos/google/protobuf/unittest_csharp_options.proto b/csharp/protos/google/protobuf/unittest_csharp_options.proto deleted file mode 100644 index 37693292..00000000 --- a/csharp/protos/google/protobuf/unittest_csharp_options.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: jonskeet@google.com (Jon Skeet) -// -// A proto file for unit testing the custom C# options - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestCSharpOptionsProtoFile"; -//option (google.protobuf.csharp_file_options).nest_classes = true; - -package protobuf_unittest; - -message OptionsMessage { - - // Will be left as Normal - optional string normal = 1; - - // Will be converted to OptionsMessage_ - optional string options_message = 2; - - // Will be converted to CustomName - optional string customized = 3 [(google.protobuf.csharp_field_options).property_name = "CustomName"]; -} diff --git a/csharp/protos/google/protobuf/unittest_custom_options.proto b/csharp/protos/google/protobuf/unittest_custom_options.proto deleted file mode 100644 index 201fb32a..00000000 --- a/csharp/protos/google/protobuf/unittest_custom_options.proto +++ /dev/null @@ -1,372 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestCustomOptionsProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: benjy@google.com (Benjy Weinberger) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file used to test the "custom options" feature of proto2. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; - -// A custom file option (defined below). -option (file_opt1) = 9876543210; - -import "google/protobuf/descriptor.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - - -// Some simple test custom options of various types. - -extend google.protobuf.FileOptions { - optional uint64 file_opt1 = 7736974; -} - -extend google.protobuf.MessageOptions { - optional int32 message_opt1 = 7739036; -} - -extend google.protobuf.FieldOptions { - optional fixed64 field_opt1 = 7740936; - // This is useful for testing that we correctly register default values for - // extension options. - optional int32 field_opt2 = 7753913 [default=42]; -} - -extend google.protobuf.EnumOptions { - optional sfixed32 enum_opt1 = 7753576; -} - -extend google.protobuf.EnumValueOptions { - optional int32 enum_value_opt1 = 1560678; -} - -extend google.protobuf.ServiceOptions { - optional sint64 service_opt1 = 7887650; -} - -enum MethodOpt1 { - METHODOPT1_VAL1 = 1; - METHODOPT1_VAL2 = 2; -} - -extend google.protobuf.MethodOptions { - optional MethodOpt1 method_opt1 = 7890860; -} - -// A test message with custom options at all possible locations (and also some -// regular options, to make sure they interact nicely). -message TestMessageWithCustomOptions { - option message_set_wire_format = false; - - option (message_opt1) = -56; - - optional string field1 = 1 [ctype=CORD, - (field_opt1)=8765432109]; - - enum AnEnum { - option (enum_opt1) = -789; - - ANENUM_VAL1 = 1; - ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; - } -} - - -// A test RPC service with custom options at all possible locations (and also -// some regular options, to make sure they interact nicely). -message CustomOptionFooRequest { -} - -message CustomOptionFooResponse { -} - -service TestServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - - - -// Options of every possible field type, so we can test them all exhaustively. - -message DummyMessageContainingEnum { - enum TestEnumType { - TEST_OPTION_ENUM_TYPE1 = 22; - TEST_OPTION_ENUM_TYPE2 = -23; - } -} - -message DummyMessageInvalidAsOptionType { -} - -extend google.protobuf.MessageOptions { - optional bool bool_opt = 7706090; - optional int32 int32_opt = 7705709; - optional int64 int64_opt = 7705542; - optional uint32 uint32_opt = 7704880; - optional uint64 uint64_opt = 7702367; - optional sint32 sint32_opt = 7701568; - optional sint64 sint64_opt = 7700863; - optional fixed32 fixed32_opt = 7700307; - optional fixed64 fixed64_opt = 7700194; - optional sfixed32 sfixed32_opt = 7698645; - optional sfixed64 sfixed64_opt = 7685475; - optional float float_opt = 7675390; - optional double double_opt = 7673293; - optional string string_opt = 7673285; - optional bytes bytes_opt = 7673238; - optional DummyMessageContainingEnum.TestEnumType enum_opt = 7673233; - optional DummyMessageInvalidAsOptionType message_type_opt = 7665967; -} - -message CustomOptionMinIntegerValues { - option (bool_opt) = false; - option (int32_opt) = -0x80000000; - option (int64_opt) = -0x8000000000000000; - option (uint32_opt) = 0; - option (uint64_opt) = 0; - option (sint32_opt) = -0x80000000; - option (sint64_opt) = -0x8000000000000000; - option (fixed32_opt) = 0; - option (fixed64_opt) = 0; - option (sfixed32_opt) = -0x80000000; - option (sfixed64_opt) = -0x8000000000000000; -} - -message CustomOptionMaxIntegerValues { - option (bool_opt) = true; - option (int32_opt) = 0x7FFFFFFF; - option (int64_opt) = 0x7FFFFFFFFFFFFFFF; - option (uint32_opt) = 0xFFFFFFFF; - option (uint64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sint32_opt) = 0x7FFFFFFF; - option (sint64_opt) = 0x7FFFFFFFFFFFFFFF; - option (fixed32_opt) = 0xFFFFFFFF; - option (fixed64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sfixed32_opt) = 0x7FFFFFFF; - option (sfixed64_opt) = 0x7FFFFFFFFFFFFFFF; -} - -message CustomOptionOtherValues { - option (int32_opt) = -100; // To test sign-extension. - option (float_opt) = 12.3456789; - option (double_opt) = 1.234567890123456789; - option (string_opt) = "Hello, \"World\""; - option (bytes_opt) = "Hello\0World"; - option (enum_opt) = TEST_OPTION_ENUM_TYPE2; -} - -message SettingRealsFromPositiveInts { - option (float_opt) = 12; - option (double_opt) = 154; -} - -message SettingRealsFromNegativeInts { - option (float_opt) = -12; - option (double_opt) = -154; -} - -// Options of complex message types, themselves combined and extended in -// various ways. - -message ComplexOptionType1 { - optional int32 foo = 1; - optional int32 foo2 = 2; - optional int32 foo3 = 3; - - extensions 100 to max; -} - -message ComplexOptionType2 { - optional ComplexOptionType1 bar = 1; - optional int32 baz = 2; - - message ComplexOptionType4 { - optional int32 waldo = 1; - - extend google.protobuf.MessageOptions { - optional ComplexOptionType4 complex_opt4 = 7633546; - } - } - - optional ComplexOptionType4 fred = 3; - - extensions 100 to max; -} - -message ComplexOptionType3 { - optional int32 qux = 1; - - optional group ComplexOptionType5 = 2 { - optional int32 plugh = 3; - } -} - -extend ComplexOptionType1 { - optional int32 quux = 7663707; - optional ComplexOptionType3 corge = 7663442; -} - -extend ComplexOptionType2 { - optional int32 grault = 7650927; - optional ComplexOptionType1 garply = 7649992; -} - -extend google.protobuf.MessageOptions { - optional protobuf_unittest.ComplexOptionType1 complex_opt1 = 7646756; - optional ComplexOptionType2 complex_opt2 = 7636949; - optional ComplexOptionType3 complex_opt3 = 7636463; - optional group ComplexOpt6 = 7595468 { - optional int32 xyzzy = 7593951; - } -} - -// Note that we try various different ways of naming the same extension. -message VariousComplexOptions { - option (.protobuf_unittest.complex_opt1).foo = 42; - option (protobuf_unittest.complex_opt1).(.protobuf_unittest.quux) = 324; - option (.protobuf_unittest.complex_opt1).(protobuf_unittest.corge).qux = 876; - option (complex_opt2).baz = 987; - option (complex_opt2).(grault) = 654; - option (complex_opt2).bar.foo = 743; - option (complex_opt2).bar.(quux) = 1999; - option (complex_opt2).bar.(protobuf_unittest.corge).qux = 2008; - option (complex_opt2).(garply).foo = 741; - option (complex_opt2).(garply).(.protobuf_unittest.quux) = 1998; - option (complex_opt2).(protobuf_unittest.garply).(corge).qux = 2121; - option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971; - option (complex_opt2).fred.waldo = 321; - option (protobuf_unittest.complex_opt3).qux = 9; - option (complex_opt3).complexoptiontype5.plugh = 22; - option (complexopt6).xyzzy = 24; -} - -// ------------------------------------------------------ -// Definitions for testing aggregate option parsing. -// See descriptor_unittest.cc. - -message AggregateMessageSet { - option message_set_wire_format = true; - extensions 4 to max; -} - -message AggregateMessageSetElement { - extend AggregateMessageSet { - optional AggregateMessageSetElement message_set_extension = 15447542; - } - optional string s = 1; -} - -// A helper type used to test aggregate option parsing -message Aggregate { - optional int32 i = 1; - optional string s = 2; - - // A nested object - optional Aggregate sub = 3; - - // To test the parsing of extensions inside aggregate values - optional google.protobuf.FileOptions file = 4; - extend google.protobuf.FileOptions { - optional Aggregate nested = 15476903; - } - - // An embedded message set - optional AggregateMessageSet mset = 5; -} - -// Allow Aggregate to be used as an option at all possible locations -// in the .proto grammer. -extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; } -extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; } -extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; } -extend google.protobuf.EnumOptions { optional Aggregate enumopt_renamed = 15483218; } -extend google.protobuf.EnumValueOptions { optional Aggregate enumvalopt = 15486921; } -extend google.protobuf.ServiceOptions { optional Aggregate serviceopt = 15497145; } -extend google.protobuf.MethodOptions { optional Aggregate methodopt = 15512713; } - -// Try using AggregateOption at different points in the proto grammar -option (fileopt) = { - s: 'FileAnnotation' - // Also test the handling of comments - /* of both types */ i: 100 - - sub { s: 'NestedFileAnnotation' } - - // Include a google.protobuf.FileOptions and recursively extend it with - // another fileopt. - file { - [protobuf_unittest.fileopt] { - s:'FileExtensionAnnotation' - } - } - - // A message set inside an option value - mset { - [protobuf_unittest.AggregateMessageSetElement.message_set_extension] { - s: 'EmbeddedMessageSetElement' - } - } -}; - -message AggregateMessage { - option (msgopt) = { i:101 s:'MessageAnnotation' }; - optional int32 fieldname = 1 [(fieldopt) = { s:'FieldAnnotation' }]; -} - -service AggregateService { - option (serviceopt) = { s:'ServiceAnnotation' }; - rpc Method (AggregateMessage) returns (AggregateMessage) { - option (methodopt) = { s:'MethodAnnotation' }; - } -} - -enum AggregateEnum { - option (enumopt_renamed) = { s:'EnumAnnotation' }; - VALUE = 1 [(enumvalopt) = { s:'EnumValueAnnotation' }]; -} diff --git a/csharp/protos/google/protobuf/unittest_embed_optimize_for.proto b/csharp/protos/google/protobuf/unittest_embed_optimize_for.proto deleted file mode 100644 index 56255385..00000000 --- a/csharp/protos/google/protobuf/unittest_embed_optimize_for.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestEmbedOptimizeForProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which imports a proto file that uses optimize_for = CODE_SIZE. - -import "google/protobuf/unittest_optimize_for.proto"; - -package protobuf_unittest; - -// We optimize for speed here, but we are importing a proto that is optimized -// for code size. -option optimize_for = SPEED; - -message TestEmbedOptimizedForSize { - // Test that embedding a message which has optimize_for = CODE_SIZE into - // one optimized for speed works. - optional TestOptimizedForSize optional_message = 1; - repeated TestOptimizedForSize repeated_message = 2; -} diff --git a/csharp/protos/google/protobuf/unittest_empty.proto b/csharp/protos/google/protobuf/unittest_empty.proto deleted file mode 100644 index f6b532a8..00000000 --- a/csharp/protos/google/protobuf/unittest_empty.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestEmptyProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file intentionally left blank. (At one point this wouldn't compile -// correctly.) - diff --git a/csharp/protos/google/protobuf/unittest_enormous_descriptor.proto b/csharp/protos/google/protobuf/unittest_enormous_descriptor.proto deleted file mode 100644 index fa97778e..00000000 --- a/csharp/protos/google/protobuf/unittest_enormous_descriptor.proto +++ /dev/null @@ -1,1052 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestEnormousDescriptorProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file that has an extremely large descriptor. Used to test that -// descriptors over 64k don't break the string literal length limit in Java. - - -package google.protobuf; -option java_package = "com.google.protobuf"; - -// Avoid generating insanely long methods. -option optimize_for = CODE_SIZE; - -message TestEnormousDescriptor { - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1 = 1 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_2 = 2 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_3 = 3 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_4 = 4 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_5 = 5 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_6 = 6 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_7 = 7 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_8 = 8 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_9 = 9 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_10 = 10 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_11 = 11 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_12 = 12 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_13 = 13 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_14 = 14 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_15 = 15 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_16 = 16 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_17 = 17 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_18 = 18 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_19 = 19 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_20 = 20 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_21 = 21 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_22 = 22 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_23 = 23 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_24 = 24 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_25 = 25 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_26 = 26 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_27 = 27 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_28 = 28 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_29 = 29 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_30 = 30 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_31 = 31 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_32 = 32 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_33 = 33 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_34 = 34 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_35 = 35 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_36 = 36 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_37 = 37 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_38 = 38 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_39 = 39 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_40 = 40 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_41 = 41 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_42 = 42 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_43 = 43 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_44 = 44 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_45 = 45 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_46 = 46 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_47 = 47 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_48 = 48 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_49 = 49 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_50 = 50 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_51 = 51 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_52 = 52 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_53 = 53 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_54 = 54 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_55 = 55 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_56 = 56 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_57 = 57 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_58 = 58 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_59 = 59 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_60 = 60 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_61 = 61 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_62 = 62 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_63 = 63 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_64 = 64 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_65 = 65 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_66 = 66 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_67 = 67 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_68 = 68 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_69 = 69 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_70 = 70 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_71 = 71 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_72 = 72 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_73 = 73 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_74 = 74 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_75 = 75 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_76 = 76 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_77 = 77 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_78 = 78 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_79 = 79 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_80 = 80 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_81 = 81 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_82 = 82 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_83 = 83 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_84 = 84 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_85 = 85 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_86 = 86 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_87 = 87 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_88 = 88 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_89 = 89 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_90 = 90 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_91 = 91 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_92 = 92 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_93 = 93 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_94 = 94 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_95 = 95 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_96 = 96 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_97 = 97 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_98 = 98 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_99 = 99 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_100 = 100 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_101 = 101 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_102 = 102 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_103 = 103 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_104 = 104 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_105 = 105 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_106 = 106 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_107 = 107 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_108 = 108 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_109 = 109 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_110 = 110 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_111 = 111 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_112 = 112 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_113 = 113 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_114 = 114 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_115 = 115 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_116 = 116 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_117 = 117 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_118 = 118 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_119 = 119 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_120 = 120 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_121 = 121 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_122 = 122 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_123 = 123 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_124 = 124 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_125 = 125 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_126 = 126 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_127 = 127 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_128 = 128 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_129 = 129 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_130 = 130 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_131 = 131 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_132 = 132 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_133 = 133 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_134 = 134 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_135 = 135 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_136 = 136 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_137 = 137 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_138 = 138 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_139 = 139 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_140 = 140 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_141 = 141 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_142 = 142 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_143 = 143 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_144 = 144 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_145 = 145 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_146 = 146 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_147 = 147 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_148 = 148 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_149 = 149 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_150 = 150 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_151 = 151 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_152 = 152 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_153 = 153 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_154 = 154 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_155 = 155 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_156 = 156 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_157 = 157 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_158 = 158 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_159 = 159 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_160 = 160 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_161 = 161 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_162 = 162 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_163 = 163 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_164 = 164 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_165 = 165 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_166 = 166 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_167 = 167 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_168 = 168 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_169 = 169 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_170 = 170 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_171 = 171 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_172 = 172 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_173 = 173 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_174 = 174 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_175 = 175 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_176 = 176 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_177 = 177 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_178 = 178 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_179 = 179 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_180 = 180 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_181 = 181 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_182 = 182 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_183 = 183 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_184 = 184 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_185 = 185 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_186 = 186 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_187 = 187 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_188 = 188 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_189 = 189 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_190 = 190 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_191 = 191 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_192 = 192 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_193 = 193 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_194 = 194 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_195 = 195 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_196 = 196 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_197 = 197 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_198 = 198 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_199 = 199 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_200 = 200 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_201 = 201 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_202 = 202 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_203 = 203 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_204 = 204 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_205 = 205 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_206 = 206 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_207 = 207 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_208 = 208 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_209 = 209 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_210 = 210 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_211 = 211 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_212 = 212 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_213 = 213 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_214 = 214 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_215 = 215 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_216 = 216 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_217 = 217 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_218 = 218 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_219 = 219 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_220 = 220 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_221 = 221 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_222 = 222 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_223 = 223 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_224 = 224 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_225 = 225 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_226 = 226 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_227 = 227 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_228 = 228 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_229 = 229 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_230 = 230 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_231 = 231 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_232 = 232 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_233 = 233 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_234 = 234 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_235 = 235 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_236 = 236 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_237 = 237 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_238 = 238 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_239 = 239 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_240 = 240 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_241 = 241 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_242 = 242 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_243 = 243 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_244 = 244 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_245 = 245 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_246 = 246 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_247 = 247 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_248 = 248 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_249 = 249 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_250 = 250 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_251 = 251 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_252 = 252 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_253 = 253 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_254 = 254 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_255 = 255 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_256 = 256 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_257 = 257 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_258 = 258 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_259 = 259 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_260 = 260 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_261 = 261 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_262 = 262 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_263 = 263 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_264 = 264 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_265 = 265 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_266 = 266 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_267 = 267 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_268 = 268 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_269 = 269 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_270 = 270 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_271 = 271 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_272 = 272 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_273 = 273 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_274 = 274 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_275 = 275 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_276 = 276 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_277 = 277 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_278 = 278 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_279 = 279 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_280 = 280 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_281 = 281 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_282 = 282 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_283 = 283 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_284 = 284 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_285 = 285 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_286 = 286 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_287 = 287 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_288 = 288 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_289 = 289 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_290 = 290 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_291 = 291 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_292 = 292 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_293 = 293 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_294 = 294 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_295 = 295 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_296 = 296 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_297 = 297 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_298 = 298 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_299 = 299 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_300 = 300 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_301 = 301 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_302 = 302 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_303 = 303 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_304 = 304 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_305 = 305 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_306 = 306 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_307 = 307 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_308 = 308 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_309 = 309 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_310 = 310 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_311 = 311 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_312 = 312 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_313 = 313 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_314 = 314 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_315 = 315 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_316 = 316 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_317 = 317 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_318 = 318 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_319 = 319 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_320 = 320 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_321 = 321 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_322 = 322 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_323 = 323 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_324 = 324 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_325 = 325 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_326 = 326 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_327 = 327 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_328 = 328 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_329 = 329 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_330 = 330 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_331 = 331 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_332 = 332 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_333 = 333 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_334 = 334 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_335 = 335 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_336 = 336 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_337 = 337 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_338 = 338 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_339 = 339 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_340 = 340 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_341 = 341 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_342 = 342 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_343 = 343 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_344 = 344 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_345 = 345 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_346 = 346 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_347 = 347 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_348 = 348 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_349 = 349 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_350 = 350 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_351 = 351 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_352 = 352 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_353 = 353 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_354 = 354 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_355 = 355 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_356 = 356 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_357 = 357 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_358 = 358 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_359 = 359 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_360 = 360 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_361 = 361 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_362 = 362 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_363 = 363 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_364 = 364 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_365 = 365 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_366 = 366 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_367 = 367 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_368 = 368 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_369 = 369 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_370 = 370 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_371 = 371 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_372 = 372 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_373 = 373 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_374 = 374 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_375 = 375 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_376 = 376 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_377 = 377 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_378 = 378 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_379 = 379 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_380 = 380 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_381 = 381 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_382 = 382 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_383 = 383 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_384 = 384 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_385 = 385 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_386 = 386 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_387 = 387 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_388 = 388 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_389 = 389 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_390 = 390 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_391 = 391 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_392 = 392 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_393 = 393 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_394 = 394 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_395 = 395 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_396 = 396 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_397 = 397 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_398 = 398 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_399 = 399 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_400 = 400 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_401 = 401 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_402 = 402 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_403 = 403 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_404 = 404 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_405 = 405 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_406 = 406 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_407 = 407 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_408 = 408 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_409 = 409 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_410 = 410 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_411 = 411 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_412 = 412 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_413 = 413 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_414 = 414 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_415 = 415 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_416 = 416 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_417 = 417 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_418 = 418 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_419 = 419 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_420 = 420 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_421 = 421 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_422 = 422 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_423 = 423 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_424 = 424 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_425 = 425 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_426 = 426 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_427 = 427 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_428 = 428 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_429 = 429 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_430 = 430 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_431 = 431 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_432 = 432 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_433 = 433 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_434 = 434 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_435 = 435 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_436 = 436 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_437 = 437 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_438 = 438 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_439 = 439 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_440 = 440 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_441 = 441 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_442 = 442 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_443 = 443 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_444 = 444 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_445 = 445 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_446 = 446 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_447 = 447 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_448 = 448 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_449 = 449 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_450 = 450 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_451 = 451 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_452 = 452 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_453 = 453 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_454 = 454 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_455 = 455 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_456 = 456 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_457 = 457 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_458 = 458 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_459 = 459 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_460 = 460 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_461 = 461 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_462 = 462 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_463 = 463 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_464 = 464 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_465 = 465 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_466 = 466 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_467 = 467 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_468 = 468 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_469 = 469 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_470 = 470 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_471 = 471 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_472 = 472 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_473 = 473 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_474 = 474 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_475 = 475 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_476 = 476 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_477 = 477 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_478 = 478 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_479 = 479 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_480 = 480 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_481 = 481 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_482 = 482 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_483 = 483 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_484 = 484 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_485 = 485 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_486 = 486 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_487 = 487 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_488 = 488 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_489 = 489 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_490 = 490 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_491 = 491 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_492 = 492 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_493 = 493 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_494 = 494 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_495 = 495 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_496 = 496 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_497 = 497 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_498 = 498 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_499 = 499 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_500 = 500 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_501 = 501 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_502 = 502 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_503 = 503 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_504 = 504 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_505 = 505 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_506 = 506 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_507 = 507 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_508 = 508 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_509 = 509 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_510 = 510 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_511 = 511 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_512 = 512 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_513 = 513 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_514 = 514 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_515 = 515 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_516 = 516 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_517 = 517 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_518 = 518 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_519 = 519 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_520 = 520 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_521 = 521 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_522 = 522 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_523 = 523 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_524 = 524 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_525 = 525 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_526 = 526 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_527 = 527 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_528 = 528 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_529 = 529 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_530 = 530 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_531 = 531 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_532 = 532 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_533 = 533 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_534 = 534 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_535 = 535 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_536 = 536 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_537 = 537 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_538 = 538 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_539 = 539 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_540 = 540 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_541 = 541 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_542 = 542 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_543 = 543 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_544 = 544 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_545 = 545 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_546 = 546 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_547 = 547 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_548 = 548 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_549 = 549 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_550 = 550 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_551 = 551 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_552 = 552 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_553 = 553 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_554 = 554 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_555 = 555 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_556 = 556 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_557 = 557 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_558 = 558 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_559 = 559 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_560 = 560 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_561 = 561 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_562 = 562 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_563 = 563 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_564 = 564 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_565 = 565 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_566 = 566 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_567 = 567 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_568 = 568 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_569 = 569 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_570 = 570 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_571 = 571 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_572 = 572 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_573 = 573 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_574 = 574 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_575 = 575 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_576 = 576 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_577 = 577 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_578 = 578 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_579 = 579 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_580 = 580 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_581 = 581 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_582 = 582 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_583 = 583 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_584 = 584 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_585 = 585 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_586 = 586 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_587 = 587 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_588 = 588 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_589 = 589 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_590 = 590 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_591 = 591 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_592 = 592 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_593 = 593 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_594 = 594 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_595 = 595 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_596 = 596 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_597 = 597 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_598 = 598 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_599 = 599 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_600 = 600 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_601 = 601 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_602 = 602 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_603 = 603 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_604 = 604 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_605 = 605 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_606 = 606 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_607 = 607 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_608 = 608 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_609 = 609 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_610 = 610 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_611 = 611 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_612 = 612 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_613 = 613 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_614 = 614 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_615 = 615 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_616 = 616 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_617 = 617 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_618 = 618 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_619 = 619 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_620 = 620 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_621 = 621 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_622 = 622 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_623 = 623 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_624 = 624 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_625 = 625 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_626 = 626 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_627 = 627 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_628 = 628 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_629 = 629 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_630 = 630 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_631 = 631 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_632 = 632 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_633 = 633 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_634 = 634 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_635 = 635 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_636 = 636 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_637 = 637 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_638 = 638 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_639 = 639 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_640 = 640 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_641 = 641 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_642 = 642 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_643 = 643 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_644 = 644 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_645 = 645 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_646 = 646 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_647 = 647 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_648 = 648 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_649 = 649 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_650 = 650 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_651 = 651 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_652 = 652 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_653 = 653 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_654 = 654 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_655 = 655 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_656 = 656 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_657 = 657 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_658 = 658 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_659 = 659 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_660 = 660 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_661 = 661 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_662 = 662 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_663 = 663 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_664 = 664 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_665 = 665 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_666 = 666 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_667 = 667 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_668 = 668 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_669 = 669 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_670 = 670 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_671 = 671 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_672 = 672 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_673 = 673 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_674 = 674 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_675 = 675 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_676 = 676 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_677 = 677 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_678 = 678 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_679 = 679 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_680 = 680 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_681 = 681 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_682 = 682 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_683 = 683 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_684 = 684 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_685 = 685 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_686 = 686 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_687 = 687 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_688 = 688 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_689 = 689 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_690 = 690 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_691 = 691 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_692 = 692 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_693 = 693 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_694 = 694 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_695 = 695 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_696 = 696 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_697 = 697 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_698 = 698 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_699 = 699 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_700 = 700 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_701 = 701 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_702 = 702 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_703 = 703 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_704 = 704 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_705 = 705 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_706 = 706 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_707 = 707 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_708 = 708 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_709 = 709 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_710 = 710 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_711 = 711 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_712 = 712 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_713 = 713 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_714 = 714 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_715 = 715 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_716 = 716 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_717 = 717 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_718 = 718 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_719 = 719 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_720 = 720 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_721 = 721 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_722 = 722 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_723 = 723 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_724 = 724 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_725 = 725 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_726 = 726 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_727 = 727 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_728 = 728 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_729 = 729 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_730 = 730 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_731 = 731 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_732 = 732 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_733 = 733 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_734 = 734 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_735 = 735 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_736 = 736 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_737 = 737 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_738 = 738 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_739 = 739 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_740 = 740 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_741 = 741 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_742 = 742 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_743 = 743 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_744 = 744 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_745 = 745 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_746 = 746 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_747 = 747 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_748 = 748 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_749 = 749 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_750 = 750 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_751 = 751 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_752 = 752 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_753 = 753 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_754 = 754 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_755 = 755 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_756 = 756 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_757 = 757 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_758 = 758 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_759 = 759 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_760 = 760 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_761 = 761 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_762 = 762 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_763 = 763 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_764 = 764 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_765 = 765 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_766 = 766 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_767 = 767 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_768 = 768 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_769 = 769 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_770 = 770 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_771 = 771 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_772 = 772 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_773 = 773 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_774 = 774 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_775 = 775 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_776 = 776 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_777 = 777 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_778 = 778 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_779 = 779 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_780 = 780 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_781 = 781 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_782 = 782 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_783 = 783 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_784 = 784 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_785 = 785 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_786 = 786 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_787 = 787 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_788 = 788 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_789 = 789 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_790 = 790 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_791 = 791 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_792 = 792 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_793 = 793 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_794 = 794 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_795 = 795 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_796 = 796 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_797 = 797 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_798 = 798 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_799 = 799 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_800 = 800 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_801 = 801 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_802 = 802 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_803 = 803 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_804 = 804 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_805 = 805 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_806 = 806 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_807 = 807 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_808 = 808 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_809 = 809 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_810 = 810 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_811 = 811 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_812 = 812 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_813 = 813 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_814 = 814 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_815 = 815 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_816 = 816 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_817 = 817 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_818 = 818 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_819 = 819 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_820 = 820 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_821 = 821 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_822 = 822 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_823 = 823 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_824 = 824 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_825 = 825 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_826 = 826 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_827 = 827 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_828 = 828 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_829 = 829 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_830 = 830 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_831 = 831 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_832 = 832 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_833 = 833 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_834 = 834 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_835 = 835 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_836 = 836 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_837 = 837 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_838 = 838 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_839 = 839 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_840 = 840 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_841 = 841 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_842 = 842 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_843 = 843 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_844 = 844 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_845 = 845 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_846 = 846 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_847 = 847 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_848 = 848 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_849 = 849 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_850 = 850 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_851 = 851 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_852 = 852 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_853 = 853 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_854 = 854 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_855 = 855 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_856 = 856 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_857 = 857 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_858 = 858 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_859 = 859 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_860 = 860 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_861 = 861 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_862 = 862 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_863 = 863 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_864 = 864 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_865 = 865 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_866 = 866 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_867 = 867 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_868 = 868 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_869 = 869 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_870 = 870 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_871 = 871 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_872 = 872 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_873 = 873 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_874 = 874 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_875 = 875 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_876 = 876 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_877 = 877 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_878 = 878 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_879 = 879 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_880 = 880 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_881 = 881 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_882 = 882 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_883 = 883 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_884 = 884 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_885 = 885 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_886 = 886 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_887 = 887 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_888 = 888 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_889 = 889 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_890 = 890 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_891 = 891 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_892 = 892 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_893 = 893 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_894 = 894 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_895 = 895 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_896 = 896 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_897 = 897 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_898 = 898 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_899 = 899 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_900 = 900 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_901 = 901 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_902 = 902 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_903 = 903 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_904 = 904 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_905 = 905 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_906 = 906 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_907 = 907 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_908 = 908 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_909 = 909 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_910 = 910 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_911 = 911 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_912 = 912 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_913 = 913 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_914 = 914 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_915 = 915 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_916 = 916 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_917 = 917 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_918 = 918 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_919 = 919 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_920 = 920 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_921 = 921 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_922 = 922 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_923 = 923 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_924 = 924 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_925 = 925 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_926 = 926 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_927 = 927 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_928 = 928 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_929 = 929 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_930 = 930 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_931 = 931 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_932 = 932 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_933 = 933 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_934 = 934 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_935 = 935 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_936 = 936 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_937 = 937 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_938 = 938 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_939 = 939 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_940 = 940 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_941 = 941 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_942 = 942 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_943 = 943 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_944 = 944 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_945 = 945 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_946 = 946 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_947 = 947 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_948 = 948 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_949 = 949 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_950 = 950 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_951 = 951 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_952 = 952 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_953 = 953 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_954 = 954 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_955 = 955 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_956 = 956 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_957 = 957 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_958 = 958 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_959 = 959 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_960 = 960 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_961 = 961 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_962 = 962 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_963 = 963 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_964 = 964 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_965 = 965 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_966 = 966 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_967 = 967 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_968 = 968 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_969 = 969 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_970 = 970 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_971 = 971 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_972 = 972 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_973 = 973 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_974 = 974 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_975 = 975 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_976 = 976 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_977 = 977 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_978 = 978 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_979 = 979 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_980 = 980 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_981 = 981 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_982 = 982 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_983 = 983 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_984 = 984 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_985 = 985 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_986 = 986 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_987 = 987 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_988 = 988 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_989 = 989 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_990 = 990 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_991 = 991 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_992 = 992 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_993 = 993 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_994 = 994 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_995 = 995 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_996 = 996 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_997 = 997 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_998 = 998 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_999 = 999 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000 = 1000 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; -} diff --git a/csharp/protos/google/protobuf/unittest_import.proto b/csharp/protos/google/protobuf/unittest_import.proto deleted file mode 100644 index aa68c864..00000000 --- a/csharp/protos/google/protobuf/unittest_import.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestImportProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which is imported by unittest.proto to test importing. - - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do -// "using namespace unittest_import = protobuf_unittest_import". -package protobuf_unittest_import; - -option optimize_for = SPEED; - -// Excercise the java_package option. -option java_package = "com.google.protobuf.test"; - -// Do not set a java_outer_classname here to verify that Proto2 works without -// one. - -message ImportMessage { - optional int32 d = 1; -} - -enum ImportEnum { - IMPORT_FOO = 7; - IMPORT_BAR = 8; - IMPORT_BAZ = 9; -} - diff --git a/csharp/protos/google/protobuf/unittest_import_lite.proto b/csharp/protos/google/protobuf/unittest_import_lite.proto deleted file mode 100644 index d8755d0e..00000000 --- a/csharp/protos/google/protobuf/unittest_import_lite.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestImportLiteProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. - -package protobuf_unittest_import; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -message ImportMessageLite { - optional int32 d = 1; -} - -enum ImportEnumLite { - IMPORT_LITE_FOO = 7; - IMPORT_LITE_BAR = 8; - IMPORT_LITE_BAZ = 9; -} diff --git a/csharp/protos/google/protobuf/unittest_lite.proto b/csharp/protos/google/protobuf/unittest_lite.proto deleted file mode 100644 index 823fa1dd..00000000 --- a/csharp/protos/google/protobuf/unittest_lite.proto +++ /dev/null @@ -1,318 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestLiteProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest.proto but with optimize_for = LITE_RUNTIME. - -package protobuf_unittest; - -import "google/protobuf/unittest_import_lite.proto"; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -// Same as TestAllTypes but with the lite runtime. -message TestAllTypesLite { - message NestedMessage { - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessageLite optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnumLite optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessageLite repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnumLite repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR]; - optional ForeignEnumLite default_foreign_enum = 82 - [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message ForeignMessageLite { - optional int32 c = 1; -} - -enum ForeignEnumLite { - FOREIGN_LITE_FOO = 4; - FOREIGN_LITE_BAR = 5; - FOREIGN_LITE_BAZ = 6; -} - -message TestPackedTypesLite { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnumLite packed_enum = 103 [packed = true]; -} - -message TestAllExtensionsLite { - extensions 1 to max; -} - -extend TestAllExtensionsLite { - // Singular - optional int32 optional_int32_extension_lite = 1; - optional int64 optional_int64_extension_lite = 2; - optional uint32 optional_uint32_extension_lite = 3; - optional uint64 optional_uint64_extension_lite = 4; - optional sint32 optional_sint32_extension_lite = 5; - optional sint64 optional_sint64_extension_lite = 6; - optional fixed32 optional_fixed32_extension_lite = 7; - optional fixed64 optional_fixed64_extension_lite = 8; - optional sfixed32 optional_sfixed32_extension_lite = 9; - optional sfixed64 optional_sfixed64_extension_lite = 10; - optional float optional_float_extension_lite = 11; - optional double optional_double_extension_lite = 12; - optional bool optional_bool_extension_lite = 13; - optional string optional_string_extension_lite = 14; - optional bytes optional_bytes_extension_lite = 15; - - optional group OptionalGroup_extension_lite = 16 { - optional int32 a = 17; - } - - optional TestAllTypesLite.NestedMessage optional_nested_message_extension_lite - = 18; - optional ForeignMessageLite optional_foreign_message_extension_lite = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message_extension_lite = 20; - - optional TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; - optional ForeignEnumLite optional_foreign_enum_extension_lite = 22; - optional protobuf_unittest_import.ImportEnumLite - optional_import_enum_extension_lite = 23; - - optional string optional_string_piece_extension_lite = 24 - [ctype=STRING_PIECE]; - optional string optional_cord_extension_lite = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32_extension_lite = 31; - repeated int64 repeated_int64_extension_lite = 32; - repeated uint32 repeated_uint32_extension_lite = 33; - repeated uint64 repeated_uint64_extension_lite = 34; - repeated sint32 repeated_sint32_extension_lite = 35; - repeated sint64 repeated_sint64_extension_lite = 36; - repeated fixed32 repeated_fixed32_extension_lite = 37; - repeated fixed64 repeated_fixed64_extension_lite = 38; - repeated sfixed32 repeated_sfixed32_extension_lite = 39; - repeated sfixed64 repeated_sfixed64_extension_lite = 40; - repeated float repeated_float_extension_lite = 41; - repeated double repeated_double_extension_lite = 42; - repeated bool repeated_bool_extension_lite = 43; - repeated string repeated_string_extension_lite = 44; - repeated bytes repeated_bytes_extension_lite = 45; - - repeated group RepeatedGroup_extension_lite = 46 { - optional int32 a = 47; - } - - repeated TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite - = 48; - repeated ForeignMessageLite repeated_foreign_message_extension_lite = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message_extension_lite = 50; - - repeated TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; - repeated ForeignEnumLite repeated_foreign_enum_extension_lite = 52; - repeated protobuf_unittest_import.ImportEnumLite - repeated_import_enum_extension_lite = 53; - - repeated string repeated_string_piece_extension_lite = 54 - [ctype=STRING_PIECE]; - repeated string repeated_cord_extension_lite = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32_extension_lite = 61 [default = 41 ]; - optional int64 default_int64_extension_lite = 62 [default = 42 ]; - optional uint32 default_uint32_extension_lite = 63 [default = 43 ]; - optional uint64 default_uint64_extension_lite = 64 [default = 44 ]; - optional sint32 default_sint32_extension_lite = 65 [default = -45 ]; - optional sint64 default_sint64_extension_lite = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension_lite = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension_lite = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50 ]; - optional float default_float_extension_lite = 71 [default = 51.5 ]; - optional double default_double_extension_lite = 72 [default = 52e3 ]; - optional bool default_bool_extension_lite = 73 [default = true ]; - optional string default_string_extension_lite = 74 [default = "hello"]; - optional bytes default_bytes_extension_lite = 75 [default = "world"]; - - optional TestAllTypesLite.NestedEnum - default_nested_enum_extension_lite = 81 [default = BAR]; - optional ForeignEnumLite - default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece_extension_lite = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension_lite = 85 [ctype=CORD, default="123"]; -} - -message TestPackedExtensionsLite { - extensions 1 to max; -} - -extend TestPackedExtensionsLite { - repeated int32 packed_int32_extension_lite = 90 [packed = true]; - repeated int64 packed_int64_extension_lite = 91 [packed = true]; - repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; - repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; - repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; - repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; - repeated float packed_float_extension_lite = 100 [packed = true]; - repeated double packed_double_extension_lite = 101 [packed = true]; - repeated bool packed_bool_extension_lite = 102 [packed = true]; - repeated ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; -} - -message TestNestedExtensionLite { - extend TestAllExtensionsLite { - optional int32 nested_extension = 12345; - } -} - -// Test that deprecated fields work. We only verify that they compile (at one -// point this failed). -message TestDeprecatedLite { - optional int32 deprecated_field = 1 [deprecated = true]; -} diff --git a/csharp/protos/google/protobuf/unittest_lite_imports_nonlite.proto b/csharp/protos/google/protobuf/unittest_lite_imports_nonlite.proto deleted file mode 100644 index 8f18f4d6..00000000 --- a/csharp/protos/google/protobuf/unittest_lite_imports_nonlite.proto +++ /dev/null @@ -1,49 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestLiteImportNonLiteProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// Tests that a "lite" message can import a regular message. - -package protobuf_unittest; - -import "google/protobuf/unittest.proto"; - -option optimize_for = LITE_RUNTIME; - -message TestLiteImportsNonlite { - optional TestAllTypes message = 1; -} diff --git a/csharp/protos/google/protobuf/unittest_mset.proto b/csharp/protos/google/protobuf/unittest_mset.proto deleted file mode 100644 index 8c74ef4b..00000000 --- a/csharp/protos/google/protobuf/unittest_mset.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestMessageSetProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file contains messages for testing message_set_wire_format. - -package protobuf_unittest; - -option optimize_for = SPEED; - -// A message with message_set_wire_format. -message TestMessageSet { - option message_set_wire_format = true; - extensions 4 to max; -} - -message TestMessageSetContainer { - optional TestMessageSet message_set = 1; -} - -message TestMessageSetExtension1 { - extend TestMessageSet { - optional TestMessageSetExtension1 message_set_extension = 1545008; - } - optional int32 i = 15; -} - -message TestMessageSetExtension2 { - extend TestMessageSet { - optional TestMessageSetExtension2 message_set_extension = 1547769; - } - optional string str = 25; -} - -// MessageSet wire format is equivalent to this. -message RawMessageSet { - repeated group Item = 1 { - required int32 type_id = 2; - required bytes message = 3; - } -} - diff --git a/csharp/protos/google/protobuf/unittest_no_generic_services.proto b/csharp/protos/google/protobuf/unittest_no_generic_services.proto deleted file mode 100644 index 5ab533bf..00000000 --- a/csharp/protos/google/protobuf/unittest_no_generic_services.proto +++ /dev/null @@ -1,58 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos.NoGenericService"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestNoGenericServicesProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -package google.protobuf.no_generic_services_test; - -// *_generic_services are false by default. - -message TestMessage { - optional int32 a = 1; - extensions 1000 to max; -} - -enum TestEnum { - FOO = 1; -} - -extend TestMessage { - optional int32 test_extension = 1000; -} - -service TestService { - rpc Foo(TestMessage) returns(TestMessage); -} diff --git a/csharp/protos/google/protobuf/unittest_optimize_for.proto b/csharp/protos/google/protobuf/unittest_optimize_for.proto deleted file mode 100644 index 99efad64..00000000 --- a/csharp/protos/google/protobuf/unittest_optimize_for.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestOptimizeForProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which uses optimize_for = CODE_SIZE. - -import "google/protobuf/unittest.proto"; - -package protobuf_unittest; - -option optimize_for = CODE_SIZE; - -message TestOptimizedForSize { - optional int32 i = 1; - optional ForeignMessage msg = 19; - - extensions 1000 to max; - - extend TestOptimizedForSize { - optional int32 test_extension = 1234; - optional TestRequiredOptimizedForSize test_extension2 = 1235; - } -} - -message TestRequiredOptimizedForSize { - required int32 x = 1; -} - -message TestOptionalOptimizedForSize { - optional TestRequiredOptimizedForSize o = 1; -} diff --git a/csharp/protos/google/test/google_size.proto b/csharp/protos/google/test/google_size.proto deleted file mode 100644 index 2e777df2..00000000 --- a/csharp/protos/google/test/google_size.proto +++ /dev/null @@ -1,140 +0,0 @@ -package unittest_google_size; - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGoogleSizeProtoFile"; - -option java_outer_classname = "GoogleSize"; -option optimize_for = CODE_SIZE; - -message SizeMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SizeMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SizeMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SizeMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SizeMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SizeMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/csharp/protos/google/test/google_speed.proto b/csharp/protos/google/test/google_speed.proto deleted file mode 100644 index eef2a07e..00000000 --- a/csharp/protos/google/test/google_speed.proto +++ /dev/null @@ -1,140 +0,0 @@ -package unittest_google_speed; - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGoogleSpeedProtoFile"; - -option java_outer_classname = "GoogleSpeed"; -option optimize_for = SPEED; - -message SpeedMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SpeedMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SpeedMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SpeedMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SpeedMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SpeedMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/csharp/protos/npp.language.xml b/csharp/protos/npp.language.xml deleted file mode 100644 index c6122180..00000000 --- a/csharp/protos/npp.language.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - [00]00 - { - } - = - 1option 1package 1import 2; 0// - message enum service extend - required optional repeated extensions to rpc returns - double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes - - - - - - - - - - - - - - - - - - - - diff --git a/csharp/protos/tutorial/addressbook.proto b/csharp/protos/tutorial/addressbook.proto deleted file mode 100644 index 5abe35ce..00000000 --- a/csharp/protos/tutorial/addressbook.proto +++ /dev/null @@ -1,31 +0,0 @@ -package tutorial; - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.Examples.AddressBook"; -option (google.protobuf.csharp_file_options).umbrella_classname = "AddressBookProtos"; - -option optimize_for = SPEED; - -message Person { - required string name = 1; - required int32 id = 2; // Unique ID number for this person. - optional string email = 3; - - enum PhoneType { - MOBILE = 0; - HOME = 1; - WORK = 2; - } - - message PhoneNumber { - required string number = 1; - optional PhoneType type = 2 [default = HOME]; - } - - repeated PhoneNumber phone = 4; -} - -// Our address book file is just one of these. -message AddressBook { - repeated Person person = 1; -} diff --git a/csharp/src/ProtoGen.Test/DependencyResolutionTest.cs b/csharp/src/ProtoGen.Test/DependencyResolutionTest.cs deleted file mode 100644 index 47c6f1a1..00000000 --- a/csharp/src/ProtoGen.Test/DependencyResolutionTest.cs +++ /dev/null @@ -1,150 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; -using NUnit.Framework; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Tests for the dependency resolution in Generator. - /// - [TestFixture] - public class DependencyResolutionTest - { - [Test] - public void TwoDistinctFiles() - { - FileDescriptorProto first = new FileDescriptorProto.Builder {Name = "First"}.Build(); - FileDescriptorProto second = new FileDescriptorProto.Builder {Name = "Second"}.Build(); - var set = new List { first, second }; - - IList converted = Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.AreEqual(2, converted.Count); - Assert.AreEqual("First", converted[0].Name); - Assert.AreEqual(0, converted[0].Dependencies.Count); - Assert.AreEqual("Second", converted[1].Name); - Assert.AreEqual(0, converted[1].Dependencies.Count); - } - - [Test] - public void FirstDependsOnSecond() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"Second"}}.Build(); - FileDescriptorProto second = new FileDescriptorProto.Builder {Name = "Second"}.Build(); - var set = new List { first, second }; - IList converted = Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.AreEqual(2, converted.Count); - Assert.AreEqual("First", converted[0].Name); - Assert.AreEqual(1, converted[0].Dependencies.Count); - Assert.AreEqual(converted[1], converted[0].Dependencies[0]); - Assert.AreEqual("Second", converted[1].Name); - Assert.AreEqual(0, converted[1].Dependencies.Count); - } - - [Test] - public void SecondDependsOnFirst() - { - FileDescriptorProto first = new FileDescriptorProto.Builder {Name = "First"}.Build(); - FileDescriptorProto second = - new FileDescriptorProto.Builder {Name = "Second", DependencyList = {"First"}}.Build(); - var set = new List { first, second }; - IList converted = Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.AreEqual(2, converted.Count); - Assert.AreEqual("First", converted[0].Name); - Assert.AreEqual(0, converted[0].Dependencies.Count); - Assert.AreEqual("Second", converted[1].Name); - Assert.AreEqual(1, converted[1].Dependencies.Count); - Assert.AreEqual(converted[0], converted[1].Dependencies[0]); - } - - [Test] - public void CircularDependency() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"Second"}}.Build(); - FileDescriptorProto second = - new FileDescriptorProto.Builder {Name = "Second", DependencyList = {"First"}}.Build(); - var set = new List { first, second }; - try - { - Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.Fail("Expected exception"); - } - catch (DependencyResolutionException) - { - // Expected - } - } - - [Test] - public void MissingDependency() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"Second"}}.Build(); - var set = new List { first }; - try - { - Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.Fail("Expected exception"); - } - catch (DependencyResolutionException) - { - // Expected - } - } - - [Test] - public void SelfDependency() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"First"}}.Build(); - var set = new List { first }; - try - { - Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.Fail("Expected exception"); - } - catch (DependencyResolutionException) - { - // Expected - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen.Test/Properties/AssemblyInfo.cs b/csharp/src/ProtoGen.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 0b632bce..00000000 --- a/csharp/src/ProtoGen.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtoGen.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtoGen.Test")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/csharp/src/ProtoGen.Test/ProtoGen.Test.csproj b/csharp/src/ProtoGen.Test/ProtoGen.Test.csproj deleted file mode 100644 index 81f84796..00000000 --- a/csharp/src/ProtoGen.Test/ProtoGen.Test.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {C268DA4C-4004-47DA-AF23-44C983281A68} - Library - Properties - Google.ProtocolBuffers.ProtoGen - Google.ProtocolBuffers.ProtoGen.Test - v3.5 - 512 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - {250ADE34-82FD-4BAE-86D5-985FBE589C4A} - ProtoGen - - - - - protoc.exe - PreserveNewest - - - - - google\protobuf\csharp_options.proto - PreserveNewest - - - google\protobuf\descriptor.proto - PreserveNewest - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtoGen.Test/ProtocGenCsUnittests.cs b/csharp/src/ProtoGen.Test/ProtocGenCsUnittests.cs deleted file mode 100644 index 8ee56de5..00000000 --- a/csharp/src/ProtoGen.Test/ProtocGenCsUnittests.cs +++ /dev/null @@ -1,683 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Text; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Tests protoc-gen-cs plugin. - /// - [TestFixture] - [Category("Preprocessor")] - public partial class ProtocGenCsUnittests - { - private static readonly string TempPath = Path.Combine(Path.GetTempPath(), "protoc-gen-cs.Test"); - - private const string DefaultProto = - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}"; - - #region TestFixture SetUp/TearDown - - private static readonly string OriginalWorkingDirectory = Environment.CurrentDirectory; - - private StringBuilder buffer = new StringBuilder(); - - [TestFixtureSetUp] - public virtual void Setup() - { - Teardown(); - Directory.CreateDirectory(TempPath); - Environment.CurrentDirectory = TempPath; - this.buffer.Length = 0; - } - - [TestFixtureTearDown] - public virtual void Teardown() - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - if (Directory.Exists(TempPath)) - { - Directory.Delete(TempPath, true); - } - } - - #endregion - - #region Helper Methods RunProtoGen / RunCsc - - private void RunProtoc(int expect, string protoFile, params string[] args) - { - string protoPath = string.Format("-I. -I\"{0}\"", OriginalWorkingDirectory); - string plugin = string.Format("--plugin=\"{0}\"", Path.Combine(OriginalWorkingDirectory, "protoc-gen-cs.exe")); - string csOut = args.Length == 0 ? "--cs_out=." : string.Format("--cs_out=\"{0}:.\"", string.Join(" ", args)); - // Start the child process. - Process p = new Process(); - // Redirect the output stream of the child process. - p.StartInfo.CreateNoWindow = true; - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardError = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.WorkingDirectory = TempPath; - p.StartInfo.FileName = Path.Combine(OriginalWorkingDirectory, "protoc.exe"); - p.StartInfo.Arguments = string.Join(" ", new string[] { plugin, csOut, protoPath, protoFile }); - p.Start(); - // Read the output stream first and then wait. - buffer.AppendLine(string.Format("{0}> \"{1}\" {2}", p.StartInfo.WorkingDirectory, p.StartInfo.FileName, p.StartInfo.Arguments)); - buffer.AppendLine(p.StandardError.ReadToEnd()); - buffer.AppendLine(p.StandardOutput.ReadToEnd()); - p.WaitForExit(); - Assert.AreEqual(expect, p.ExitCode, this.buffer.ToString()); - } - - private Assembly RunCsc(int expect, params string[] sources) - { - using (TempFile tempDll = new TempFile(String.Empty)) - { - tempDll.ChangeExtension(".dll"); - List args = new List(); - args.Add("/nologo"); - args.Add("/target:library"); - args.Add("/debug-"); - args.Add(String.Format(@"""/out:{0}""", tempDll.TempPath)); - args.Add("/r:System.dll"); - args.Add(String.Format(@"""/r:{0}""", - typeof(Google.ProtocolBuffers.DescriptorProtos.DescriptorProto).Assembly. - Location)); - args.AddRange(sources); - - string exe = Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), - "csc.exe"); - ProcessStartInfo psi = new ProcessStartInfo(exe); - psi.WorkingDirectory = TempPath; - psi.CreateNoWindow = true; - psi.UseShellExecute = false; - psi.RedirectStandardOutput = true; - psi.RedirectStandardError = true; - psi.Arguments = string.Join(" ", args.ToArray()); - Process p = Process.Start(psi); - buffer.AppendLine(string.Format("{0}> \"{1}\" {2}", p.StartInfo.WorkingDirectory, p.StartInfo.FileName, p.StartInfo.Arguments)); - buffer.AppendLine(p.StandardError.ReadToEnd()); - buffer.AppendLine(p.StandardOutput.ReadToEnd()); - p.WaitForExit(); - Assert.AreEqual(expect, p.ExitCode, this.buffer.ToString()); - - Assembly asm = null; - if (p.ExitCode == 0) - { - byte[] allbytes = File.ReadAllBytes(tempDll.TempPath); - asm = Assembly.Load(allbytes); - - foreach (Type t in asm.GetTypes()) - { - Debug.WriteLine(t.FullName, asm.FullName); - } - } - return asm; - } - } - - #endregion - - // ******************************************************************* - // The following tests excercise options for protogen.exe - // ******************************************************************* - - [Test] - public void TestProtoFile() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithConflictingType() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - RunProtoc(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test, true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-namespace=MyNewNamespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaClassName() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach("MyUmbrellaClassname.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "/umbrella_classname=MyUmbrellaClassname"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrellaClassname", true, true); - } - } - - [Test] - public void TestProtoFileWithNestedClass() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-nest_classes=true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExpandedNsDirectories() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"nunit\simple\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-expand_namespace_directories=true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNewExtension() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".Generated.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-file_extension=.Generated.cs"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-umbrella_namespace=MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrella.Namespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithIgnoredUmbrellaNamespaceDueToNesting() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-nest_classes=true", "-umbrella_namespace=MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExplicitEmptyUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - //Forces the umbrella class to not use a namespace even if a collision with a type is detected. - RunProtoc(0, proto.TempPath, "-umbrella_namespace="); - //error CS0441: 'nunit.simple.TestProtoFileWithExplicitEmptyUmbrellaNamespace': a class cannot be both static and sealed - RunCsc(1, source.TempPath); - } - } - - [Test] - public void TestProtoFileWithNewOutputFolder() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"generated-code\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(1, proto.TempPath, "-output_directory=generated-code"); - Directory.CreateDirectory("generated-code"); - RunProtoc(0, proto.TempPath, "-output_directory=generated-code"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileAndIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - RunProtoc(0, proto.TempPath); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithoutIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //Without the option this fails due to being unable to resolve google/protobuf descriptors - RunProtoc(0, proto.TempPath); - } - } - - // ******************************************************************* - // The following tests excercise options for protoc.exe - // ******************************************************************* - - [Test] - public void TestProtoFileWithIncludeImports() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //if you specify the protoc option --include_imports this should build three source files - RunProtoc(0, proto.TempPath); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - //you can (and should) simply omit the inclusion of the extra source files in your project - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - //Seems the --proto_path or -I option is non-functional for me. Maybe others have luck? - [Test] - public void TestProtoFileInDifferentDirectory() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - RunProtoc(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - // ******************************************************************* - // Handling of mutliple input files - // ******************************************************************* - - [Test] - public void TestMultipleProtoFiles() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - RunProtoc(0, proto1.TempPath); - RunProtoc(0, proto2.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestOneProtoFileWithBufferFile() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - //build the proto buffer for MyMessage - RunProtoc(0, proto1.TempPath); - //build the MyMessageList proto-buffer and generate code by including MyMessage.pb - RunProtoc(0, proto2.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestProtoFileWithService() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoc(0, proto.TempPath, "-nest_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - [Test] - public void TestProtoFileWithServiceInternal() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoc(0, proto.TempPath, "-nest_classes=false", "-public_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - private static void CopyInGoogleProtoFiles() - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen.Test/TempFile.cs b/csharp/src/ProtoGen.Test/TempFile.cs deleted file mode 100644 index 74a183f5..00000000 --- a/csharp/src/ProtoGen.Test/TempFile.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class ProtoFile : TempFile - { - public ProtoFile(string filename, string contents) - : base(filename, contents) - { - } - } - - internal class TempFile : IDisposable - { - private string tempFile; - - public static TempFile Attach(string path) - { - return new TempFile(path, null); - } - - protected TempFile(string filename, string contents) - { - tempFile = filename; - if (contents != null) - { - File.WriteAllText(tempFile, contents, new UTF8Encoding(false)); - } - } - - public TempFile(string contents) - : this(Path.GetTempFileName(), contents) - { - } - - public string TempPath - { - get { return tempFile; } - } - - public void ChangeExtension(string ext) - { - string newFile = Path.ChangeExtension(tempFile, ext); - File.Move(tempFile, newFile); - tempFile = newFile; - } - - public void Dispose() - { - if (File.Exists(tempFile)) - { - File.Delete(tempFile); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen.Test/TestPreprocessing.cs b/csharp/src/ProtoGen.Test/TestPreprocessing.cs deleted file mode 100644 index 8b3b0663..00000000 --- a/csharp/src/ProtoGen.Test/TestPreprocessing.cs +++ /dev/null @@ -1,733 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using NUnit.Framework; - -namespace Google.ProtocolBuffers.ProtoGen -{ - [TestFixture] - [Category("Preprocessor")] - public partial class TestPreprocessing - { - private static readonly string TempPath = Path.Combine(Path.GetTempPath(), "proto-gen-test"); - - private const string DefaultProto = - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}"; - - #region TestFixture SetUp/TearDown - - private static readonly string OriginalWorkingDirectory = Environment.CurrentDirectory; - - [TestFixtureSetUp] - public virtual void Setup() - { - Teardown(); - Directory.CreateDirectory(TempPath); - Environment.CurrentDirectory = TempPath; - } - - [TestFixtureTearDown] - public virtual void Teardown() - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - if (Directory.Exists(TempPath)) - { - Directory.Delete(TempPath, true); - } - } - - #endregion - - #region Helper Methods RunProtoGen / RunCsc - - private void RunProtoGen(int expect, params string[] args) - { - TextWriter tout = Console.Out, terr = Console.Error; - StringWriter temp = new StringWriter(); - Console.SetOut(temp); - Console.SetError(temp); - try - { - Assert.AreEqual(expect, ProgramPreprocess.Run(args), "ProtoGen Failed: {0}", temp); - } - finally - { - Console.SetOut(tout); - Console.SetError(terr); - } - } - - private Assembly RunCsc(int expect, params string[] sources) - { - using (TempFile tempDll = new TempFile(String.Empty)) - { - tempDll.ChangeExtension(".dll"); - List args = new List(); - args.Add("/nologo"); - args.Add("/target:library"); - args.Add("/debug-"); - args.Add(String.Format(@"""/out:{0}""", tempDll.TempPath)); - args.Add("/r:System.dll"); - args.Add(String.Format(@"""/r:{0}""", - typeof(Google.ProtocolBuffers.DescriptorProtos.DescriptorProto).Assembly. - Location)); - args.AddRange(sources); - - string exe = Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), - "csc.exe"); - ProcessStartInfo psi = new ProcessStartInfo(exe); - psi.CreateNoWindow = true; - psi.UseShellExecute = false; - psi.RedirectStandardOutput = true; - psi.RedirectStandardError = true; - psi.Arguments = string.Join(" ", args.ToArray()); - Process p = Process.Start(psi); - p.WaitForExit(); - string errorText = p.StandardOutput.ReadToEnd() + p.StandardError.ReadToEnd(); - Assert.AreEqual(expect, p.ExitCode, "CSC.exe Failed: {0}", errorText); - - Assembly asm = null; - if (p.ExitCode == 0) - { - byte[] allbytes = File.ReadAllBytes(tempDll.TempPath); - asm = Assembly.Load(allbytes); - - foreach (Type t in asm.GetTypes()) - { - Debug.WriteLine(t.FullName, asm.FullName); - } - } - return asm; - } - } - - #endregion - - // ******************************************************************* - // The following tests excercise options for protogen.exe - // ******************************************************************* - - [Test] - public void TestProtoFile() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithConflictingType() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - RunProtoGen(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test, true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-namespace:MyNewNamespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaClassName() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach("MyUmbrellaClassname.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "/umbrella_classname=MyUmbrellaClassname"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrellaClassname", true, true); - } - } - - [Test] - public void TestProtoFileWithNestedClass() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-nest_classes:true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExpandedNsDirectories() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"nunit\simple\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-expand_namespace_directories:true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNewExtension() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".Generated.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-file_extension:.Generated.cs"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-umbrella_namespace:MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrella.Namespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithIgnoredUmbrellaNamespaceDueToNesting() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-nest_classes:true", "-umbrella_namespace:MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExplicitEmptyUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - //Forces the umbrella class to not use a namespace even if a collision with a type is detected. - RunProtoGen(0, proto.TempPath, "-umbrella_namespace:"); - //error CS0441: 'nunit.simple.TestProtoFileWithExplicitEmptyUmbrellaNamespace': a class cannot be both static and sealed - RunCsc(1, source.TempPath); - } - } - - [Test] - public void TestProtoFileWithNewOutputFolder() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"generated-code\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(1, proto.TempPath, "-output_directory:generated-code"); - Directory.CreateDirectory("generated-code"); - RunProtoGen(0, proto.TempPath, "-output_directory:generated-code"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileAndIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithoutIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //Without the option this fails due to being unable to resolve google/protobuf descriptors - RunProtoGen(1, proto.TempPath, "-ignore_google_protobuf:false"); - } - } - - // ******************************************************************* - // The following tests excercise options for protoc.exe - // ******************************************************************* - - [Test] - public void TestProtoFileWithIncludeImports() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //if you specify the protoc option --include_imports this should build three source files - RunProtoGen(0, proto.TempPath, "--include_imports"); - Assert.AreEqual(3, Directory.GetFiles(TempPath, "*.cs").Length); - - //you can (and should) simply omit the inclusion of the extra source files in your project - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithIncludeImportsAndIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //Even with --include_imports, if you provide -ignore_google_protobuf:true you only get the one source file - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true", "--include_imports"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - //you can (and should) simply omit the inclusion of the extra source files in your project - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileKeepingTheProtoBuffer() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile protobuf = TempFile.Attach(test + ".pb")) - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - RunProtoGen(0, proto.TempPath, "--descriptor_set_out=" + protobuf.TempPath); - Assert.IsTrue(File.Exists(protobuf.TempPath), "Missing: " + protobuf.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - //Seems the --proto_path or -I option is non-functional for me. Maybe others have luck? - [Test] - public void TestProtoFileInDifferentDirectory() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - RunProtoGen(0, proto.TempPath, "--proto_path=" + TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - // ******************************************************************* - // Handling of mutliple input files - // ******************************************************************* - - [Test] - public void TestMultipleProtoFiles() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - RunProtoGen(0, proto1.TempPath, proto2.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestOneProtoFileWithBufferFile() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using (TempFile protobuf = TempFile.Attach("MyMessage.pb")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - //build the proto buffer for MyMessage - RunProtoGen(0, proto1.TempPath, "--descriptor_set_out=" + protobuf.TempPath); - //build the MyMessageList proto-buffer and generate code by including MyMessage.pb - RunProtoGen(0, proto2.TempPath, protobuf.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestProtoFileWithService() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true", "-nest_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - [Test] - public void TestProtoFileWithServiceInternal() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true", "-nest_classes=false", "-public_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - private static void CopyInGoogleProtoFiles() - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen.Test/protoc-gen-cs.Test.csproj b/csharp/src/ProtoGen.Test/protoc-gen-cs.Test.csproj deleted file mode 100644 index 2e816115..00000000 --- a/csharp/src/ProtoGen.Test/protoc-gen-cs.Test.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6} - Library - Properties - Google.ProtocolBuffers.ProtoGen - protoc-gen-cs.Test - v3.5 - 512 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - - - - - - - - - - {6908bdce-d925-43f3-94ac-a531e6df2591} - ProtocolBuffers - - - {250ade34-82fd-4bae-86d5-985fbe589c4b} - protoc-gen-cs - - - - - protoc.exe - PreserveNewest - - - - - google\protobuf\csharp_options.proto - PreserveNewest - - - google\protobuf\descriptor.proto - PreserveNewest - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtoGen/DependencyResolutionException.cs b/csharp/src/ProtoGen/DependencyResolutionException.cs deleted file mode 100644 index aef192e0..00000000 --- a/csharp/src/ProtoGen/DependencyResolutionException.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Exception thrown when dependencies within a descriptor set can't be resolved. - /// - public sealed class DependencyResolutionException : Exception - { - public DependencyResolutionException(string message) : base(message) - { - } - - public DependencyResolutionException(string format, params object[] args) - : base(string.Format(format, args)) - { - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/DescriptorUtil.cs b/csharp/src/ProtoGen/DescriptorUtil.cs deleted file mode 100644 index 0666bb93..00000000 --- a/csharp/src/ProtoGen/DescriptorUtil.cs +++ /dev/null @@ -1,106 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Utility class for determining namespaces etc. - /// - internal static class DescriptorUtil - { - internal static string GetFullUmbrellaClassName(IDescriptor descriptor) - { - CSharpFileOptions options = descriptor.File.CSharpOptions; - string result = options.Namespace; - if (result != "") - { - result += '.'; - } - result += GetQualifiedUmbrellaClassName(options); - return "global::" + result; - } - - /// - /// Evaluates the options and returns the qualified name of the umbrella class - /// relative to the descriptor type's namespace. Basically concatenates the - /// UmbrellaNamespace + UmbrellaClassname fields. - /// - internal static string GetQualifiedUmbrellaClassName(CSharpFileOptions options) - { - string fullName = options.UmbrellaClassname; - if (!options.NestClasses && options.UmbrellaNamespace != "") - { - fullName = String.Format("{0}.{1}", options.UmbrellaNamespace, options.UmbrellaClassname); - } - return fullName; - } - - internal static string GetMappedTypeName(MappedType type) - { - switch (type) - { - case MappedType.Int32: - return "int"; - case MappedType.Int64: - return "long"; - case MappedType.UInt32: - return "uint"; - case MappedType.UInt64: - return "ulong"; - case MappedType.Single: - return "float"; - case MappedType.Double: - return "double"; - case MappedType.Boolean: - return "bool"; - case MappedType.String: - return "string"; - case MappedType.ByteString: - return "pb::ByteString"; - case MappedType.Enum: - return null; - case MappedType.Message: - return null; - default: - throw new ArgumentOutOfRangeException("Unknown mapped type " + type); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/EnumFieldGenerator.cs b/csharp/src/ProtoGen/EnumFieldGenerator.cs deleted file mode 100644 index 8d70bc67..00000000 --- a/csharp/src/ProtoGen/EnumFieldGenerator.cs +++ /dev/null @@ -1,148 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class EnumFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal EnumFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private bool has{0};", PropertyName); - writer.WriteLine("private {0} {1}_ = {2};", TypeName, Name, DefaultValue); - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_; }}", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return result.has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); - writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = false;", PropertyName); - writer.WriteLine(" result.{0}_ = {1};", Name, DefaultValue); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.Has{0}) {{", PropertyName); - writer.WriteLine(" {0} = other.{0};", PropertyName); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - // Nothing to do here for enum types - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("object unknown;"); - writer.WriteLine("if(input.ReadEnum(ref result.{0}_, out unknown)) {{", Name); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine("} else if(unknown is int) {"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields == null) {"); // First unknown field - create builder now - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - writer.WriteLine(" unknownFields.MergeVarintField({0}, (ulong)(int)unknown);", Number); - } - writer.WriteLine("}"); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" output.WriteEnum({0}, field_names[{2}], (int) {1}, {1});", Number, PropertyName, - FieldOrdinal); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.ComputeEnumSize({0}, (int) {1});", Number, PropertyName); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("if (has{0}) hash ^= {1}_.GetHashCode();", PropertyName, Name); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if (has{0} != other.has{0} || (has{0} && !{1}_.Equals(other.{1}_))) return false;", - PropertyName, Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", has{1}, {2}_, writer);", Descriptor.Name, PropertyName, Name); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/EnumGenerator.cs b/csharp/src/ProtoGen/EnumGenerator.cs deleted file mode 100644 index a6ed45d1..00000000 --- a/csharp/src/ProtoGen/EnumGenerator.cs +++ /dev/null @@ -1,62 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class EnumGenerator : SourceGeneratorBase, ISourceGenerator - { - internal EnumGenerator(EnumDescriptor descriptor) : base(descriptor) - { - } - - // TODO(jonskeet): Write out enum descriptors? Can be retrieved from file... - public void Generate(TextGenerator writer) - { - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} enum {1} {{", ClassAccessLevel, Descriptor.Name); - writer.Indent(); - foreach (EnumValueDescriptor value in Descriptor.Values) - { - writer.WriteLine("{0} = {1},", value.Name, value.Number); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/ExtensionGenerator.cs b/csharp/src/ProtoGen/ExtensionGenerator.cs deleted file mode 100644 index a862a7a0..00000000 --- a/csharp/src/ProtoGen/ExtensionGenerator.cs +++ /dev/null @@ -1,183 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class ExtensionGenerator : FieldGeneratorBase, ISourceGenerator - { - private readonly string extends; - private readonly string scope; - private readonly string type; - private readonly string name; - - internal ExtensionGenerator(FieldDescriptor descriptor) - : base(descriptor, 0) - { - if (Descriptor.ExtensionScope != null) - { - scope = GetClassName(Descriptor.ExtensionScope); - } - else - { - scope = DescriptorUtil.GetFullUmbrellaClassName(Descriptor.File); - } - switch (Descriptor.MappedType) - { - case MappedType.Message: - type = GetClassName(Descriptor.MessageType); - break; - case MappedType.Enum: - type = GetClassName(Descriptor.EnumType); - break; - default: - type = DescriptorUtil.GetMappedTypeName(Descriptor.MappedType); - break; - } - extends = GetClassName(Descriptor.ContainingType); - name = Descriptor.CSharpOptions.PropertyName; - } - - public void Generate(TextGenerator writer) - { - if (Descriptor.File.CSharpOptions.ClsCompliance && GetFieldConstantName(Descriptor).StartsWith("_")) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - - writer.WriteLine("public const int {0} = {1};", GetFieldConstantName(Descriptor), Descriptor.FieldNumber); - - if (UseLiteRuntime) - { - if (Descriptor.MappedType == MappedType.Message && Descriptor.MessageType.Options.MessageSetWireFormat) - { - throw new ArgumentException( - "option message_set_wire_format = true; is not supported in Lite runtime extensions."); - } - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("{0} static pb::{4}<{1}, {2}> {3};", ClassAccessLevel, extends, type, name, - Descriptor.IsRepeated ? "GeneratedRepeatExtensionLite" : "GeneratedExtensionLite"); - } - else if (Descriptor.IsRepeated) - { - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("{0} static pb::GeneratedExtensionBase> {2};", ClassAccessLevel, type, - name); - } - else - { - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("{0} static pb::GeneratedExtensionBase<{1}> {2};", ClassAccessLevel, type, name); - } - } - - internal void GenerateStaticVariableInitializers(TextGenerator writer) - { - if (UseLiteRuntime) - { - writer.WriteLine("{0}.{1} = ", scope, name); - writer.Indent(); - writer.WriteLine("new pb::{0}<{1}, {2}>(", - Descriptor.IsRepeated ? "GeneratedRepeatExtensionLite" : "GeneratedExtensionLite", - extends, type); - writer.Indent(); - writer.WriteLine("\"{0}\",", Descriptor.FullName); - writer.WriteLine("{0}.DefaultInstance,", extends); - if (!Descriptor.IsRepeated) - { - writer.WriteLine("{0},", - Descriptor.HasDefaultValue - ? DefaultValue - : IsNullableType ? "null" : "default(" + type + ")"); - } - writer.WriteLine("{0},", - (Descriptor.MappedType == MappedType.Message) ? type + ".DefaultInstance" : "null"); - writer.WriteLine("{0},", - (Descriptor.MappedType == MappedType.Enum) ? "new EnumLiteMap<" + type + ">()" : "null"); - writer.WriteLine("{0}.{1}FieldNumber,", scope, name); - writer.Write("pbd::FieldType.{0}", Descriptor.FieldType); - if (Descriptor.IsRepeated) - { - writer.WriteLine(","); - writer.Write(Descriptor.IsPacked ? "true" : "false"); - } - writer.Outdent(); - writer.WriteLine(");"); - writer.Outdent(); - } - else if (Descriptor.IsRepeated) - { - writer.WriteLine( - "{0}.{1} = pb::GeneratedRepeatExtension<{2}>.CreateInstance({0}.Descriptor.Extensions[{3}]);", scope, - name, type, Descriptor.Index); - } - else - { - writer.WriteLine( - "{0}.{1} = pb::GeneratedSingleExtension<{2}>.CreateInstance({0}.Descriptor.Extensions[{3}]);", scope, - name, type, Descriptor.Index); - } - } - - internal void GenerateExtensionRegistrationCode(TextGenerator writer) - { - writer.WriteLine("registry.Add({0}.{1});", scope, name); - } - - public override void WriteHash(TextGenerator writer) - { - } - - public override void WriteEquals(TextGenerator writer) - { - } - - public override void WriteToString(TextGenerator writer) - { - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/FieldGeneratorBase.cs b/csharp/src/ProtoGen/FieldGeneratorBase.cs deleted file mode 100644 index 93aee6ca..00000000 --- a/csharp/src/ProtoGen/FieldGeneratorBase.cs +++ /dev/null @@ -1,389 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Globalization; -using System.Text; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal abstract class FieldGeneratorBase : SourceGeneratorBase - { - private readonly int _fieldOrdinal; - - protected FieldGeneratorBase(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor) - { - _fieldOrdinal = fieldOrdinal; - } - - public abstract void WriteHash(TextGenerator writer); - public abstract void WriteEquals(TextGenerator writer); - public abstract void WriteToString(TextGenerator writer); - - public int FieldOrdinal - { - get { return _fieldOrdinal; } - } - - private static bool AllPrintableAscii(string text) - { - foreach (char c in text) - { - if (c < 0x20 || c > 0x7e) - { - return false; - } - } - return true; - } - - /// - /// This returns true if the field has a non-default default value. For instance this returns - /// false for numerics with a default of zero '0', or booleans with a default of false. - /// - protected bool HasDefaultValue - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.Float: - case FieldType.Double: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.SFixed32: - case FieldType.SFixed64: - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Fixed32: - case FieldType.Fixed64: - { - IConvertible value = (IConvertible) Descriptor.DefaultValue; - return value.ToString(CultureInfo.InvariantCulture) != "0"; - } - case FieldType.Bool: - return ((bool) Descriptor.DefaultValue) == true; - default: - return true; - } - } - } - - /// Copy exists in ExtensionGenerator.cs - protected string DefaultValue - { - get - { - string suffix = ""; - switch (Descriptor.FieldType) - { - case FieldType.Float: - suffix = "F"; - break; - case FieldType.Double: - suffix = "D"; - break; - case FieldType.Int64: - suffix = "L"; - break; - case FieldType.UInt64: - suffix = "UL"; - break; - } - switch (Descriptor.FieldType) - { - case FieldType.Float: - case FieldType.Double: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.SFixed32: - case FieldType.SFixed64: - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Fixed32: - case FieldType.Fixed64: - { - // The simple Object.ToString converts using the current culture. - // We want to always use the invariant culture so it's predictable. - IConvertible value = (IConvertible) Descriptor.DefaultValue; - //a few things that must be handled explicitly - if (Descriptor.FieldType == FieldType.Double && value is double) - { - if (double.IsNaN((double) value)) - { - return "double.NaN"; - } - if (double.IsPositiveInfinity((double) value)) - { - return "double.PositiveInfinity"; - } - if (double.IsNegativeInfinity((double) value)) - { - return "double.NegativeInfinity"; - } - } - else if (Descriptor.FieldType == FieldType.Float && value is float) - { - if (float.IsNaN((float) value)) - { - return "float.NaN"; - } - if (float.IsPositiveInfinity((float) value)) - { - return "float.PositiveInfinity"; - } - if (float.IsNegativeInfinity((float) value)) - { - return "float.NegativeInfinity"; - } - } - return value.ToString(CultureInfo.InvariantCulture) + suffix; - } - case FieldType.Bool: - return (bool) Descriptor.DefaultValue ? "true" : "false"; - - case FieldType.Bytes: - if (!Descriptor.HasDefaultValue) - { - return "pb::ByteString.Empty"; - } - if (UseLiteRuntime && Descriptor.DefaultValue is ByteString) - { - string temp = (((ByteString) Descriptor.DefaultValue).ToBase64()); - return String.Format("pb::ByteString.FromBase64(\"{0}\")", temp); - } - return string.Format("(pb::ByteString) {0}.Descriptor.Fields[{1}].DefaultValue", - GetClassName(Descriptor.ContainingType), Descriptor.Index); - case FieldType.String: - if (AllPrintableAscii(Descriptor.Proto.DefaultValue)) - { - // All chars are ASCII and printable. In this case we only - // need to escape quotes and backslashes. - return "\"" + Descriptor.Proto.DefaultValue - .Replace("\\", "\\\\") - .Replace("'", "\\'") - .Replace("\"", "\\\"") - + "\""; - } - if (UseLiteRuntime && Descriptor.DefaultValue is String) - { - string temp = Convert.ToBase64String( - Encoding.UTF8.GetBytes((String) Descriptor.DefaultValue)); - return String.Format("pb::ByteString.FromBase64(\"{0}\").ToStringUtf8()", temp); - } - return string.Format("(string) {0}.Descriptor.Fields[{1}].DefaultValue", - GetClassName(Descriptor.ContainingType), Descriptor.Index); - case FieldType.Enum: - return TypeName + "." + ((EnumValueDescriptor) Descriptor.DefaultValue).Name; - case FieldType.Message: - case FieldType.Group: - return TypeName + ".DefaultInstance"; - default: - throw new InvalidOperationException("Invalid field descriptor type"); - } - } - } - - protected string PropertyName - { - get { return Descriptor.CSharpOptions.PropertyName; } - } - - protected string Name - { - get { return NameHelpers.UnderscoresToCamelCase(GetFieldName(Descriptor)); } - } - - protected int Number - { - get { return Descriptor.FieldNumber; } - } - - protected void AddNullCheck(TextGenerator writer) - { - AddNullCheck(writer, "value"); - } - - protected void AddNullCheck(TextGenerator writer, string name) - { - if (IsNullableType) - { - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull({0}, \"{0}\");", name); - } - } - - protected void AddPublicMemberAttributes(TextGenerator writer) - { - AddDeprecatedFlag(writer); - AddClsComplianceCheck(writer); - } - - protected void AddClsComplianceCheck(TextGenerator writer) - { - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - } - - protected bool IsObsolete { get { return Descriptor.Options.Deprecated; } } - - /// - /// Writes [global::System.ObsoleteAttribute()] if the member is obsolete - /// - protected void AddDeprecatedFlag(TextGenerator writer) - { - if (IsObsolete) - { - writer.WriteLine("[global::System.ObsoleteAttribute()]"); - } - } - - /// - /// For encodings with fixed sizes, returns that size in bytes. Otherwise - /// returns -1. TODO(jonskeet): Make this less ugly. - /// - protected int FixedSize - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.Enum: - case FieldType.Bytes: - case FieldType.String: - case FieldType.Message: - case FieldType.Group: - return -1; - case FieldType.Float: - return WireFormat.FloatSize; - case FieldType.SFixed32: - return WireFormat.SFixed32Size; - case FieldType.Fixed32: - return WireFormat.Fixed32Size; - case FieldType.Double: - return WireFormat.DoubleSize; - case FieldType.SFixed64: - return WireFormat.SFixed64Size; - case FieldType.Fixed64: - return WireFormat.Fixed64Size; - case FieldType.Bool: - return WireFormat.BoolSize; - default: - throw new InvalidOperationException("Invalid field descriptor type"); - } - } - } - - protected bool IsNullableType - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.Float: - case FieldType.Double: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.SFixed32: - case FieldType.SFixed64: - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Fixed32: - case FieldType.Fixed64: - case FieldType.Bool: - case FieldType.Enum: - return false; - case FieldType.Bytes: - case FieldType.String: - case FieldType.Message: - case FieldType.Group: - return true; - default: - throw new InvalidOperationException("Invalid field descriptor type"); - } - } - } - - protected string TypeName - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.Enum: - return GetClassName(Descriptor.EnumType); - case FieldType.Message: - case FieldType.Group: - return GetClassName(Descriptor.MessageType); - default: - return DescriptorUtil.GetMappedTypeName(Descriptor.MappedType); - } - } - } - - protected string MessageOrGroup - { - get { return Descriptor.FieldType == FieldType.Group ? "Group" : "Message"; } - } - - /// - /// Returns the type name as used in CodedInputStream method names: SFixed32, UInt32 etc. - /// - protected string CapitalizedTypeName - { - get - { - // Our enum names match perfectly. How serendipitous. - return Descriptor.FieldType.ToString(); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/Generator.cs b/csharp/src/ProtoGen/Generator.cs deleted file mode 100644 index bc481ec0..00000000 --- a/csharp/src/ProtoGen/Generator.cs +++ /dev/null @@ -1,267 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Compiler.PluginProto; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Code generator for protocol buffers. Only C# is supported at the moment. - /// - public sealed class Generator - { - private readonly GeneratorOptions options; - - private Generator(GeneratorOptions options) - { - options.Validate(); - this.options = options; - } - - /// - /// Returns a generator configured with the specified options. - /// - public static Generator CreateGenerator(GeneratorOptions options) - { - return new Generator(options); - } - - public void Generate(CodeGeneratorRequest request, CodeGeneratorResponse.Builder response) - { - IList descriptors = ConvertDescriptors(options.FileOptions, request.ProtoFileList); - - // Combine with options from command line - foreach (FileDescriptor descriptor in descriptors) - { - descriptor.ConfigureWithDefaultOptions(options.FileOptions); - } - - bool duplicates = false; - Dictionary names = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (FileDescriptor descriptor in descriptors) - { - string file = GetOutputFile(descriptor, false); - if (names.ContainsKey(file)) - { - duplicates = true; - break; - } - names.Add(file, true); - } - - //ROK - Changed to dictionary from HashSet to allow 2.0 compile - var filesToGenerate = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (var item in request.FileToGenerateList) - { - filesToGenerate[item] = null; - } - foreach (FileDescriptor descriptor in descriptors) - { - // Optionally exclude descriptors in google.protobuf - if (descriptor.CSharpOptions.IgnoreGoogleProtobuf && descriptor.Package == "google.protobuf") - { - continue; - } - if (filesToGenerate.ContainsKey(descriptor.Name)) - { - Generate(descriptor, duplicates, response); - } - } - } - - /// - /// Generates code for a particular file. All dependencies must - /// already have been resolved. - /// - private void Generate(FileDescriptor descriptor, bool duplicates, CodeGeneratorResponse.Builder response) - { - var code = new StringBuilder(); - var ucg = new UmbrellaClassGenerator(descriptor); - using (StringWriter textWriter = new StringWriter(code)) - { - TextGenerator writer = new TextGenerator(textWriter, options.LineBreak); - ucg.Generate(writer); - } - response.AddFile(new CodeGeneratorResponse.Types.File.Builder - { - Name = GetOutputFile(descriptor, duplicates), - Content = code.ToString(), - }.Build()); - } - - private string GetOutputFile(FileDescriptor descriptor, bool duplicates) - { - CSharpFileOptions fileOptions = descriptor.CSharpOptions; - - string filename = descriptor.CSharpOptions.UmbrellaClassname + descriptor.CSharpOptions.FileExtension; - if (duplicates) - { - string namepart; - if (String.IsNullOrEmpty(descriptor.Name) || String.IsNullOrEmpty(namepart = Path.GetFileNameWithoutExtension(descriptor.Name))) - throw new ApplicationException("Duplicate UmbrellaClassname options created a file name collision."); - - filename = namepart + descriptor.CSharpOptions.FileExtension; - } - - string outputDirectory = descriptor.CSharpOptions.OutputDirectory; - if (fileOptions.ExpandNamespaceDirectories) - { - string package = fileOptions.Namespace; - if (!string.IsNullOrEmpty(package)) - { - string[] bits = package.Split('.'); - foreach (string bit in bits) - { - outputDirectory = Path.Combine(outputDirectory, bit); - } - } - } - - // As the directory can be explicitly specified in options, we need to make sure it exists - Directory.CreateDirectory(outputDirectory); - return Path.Combine(outputDirectory, filename); - } - - /// - /// Resolves any dependencies and converts FileDescriptorProtos into FileDescriptors. - /// The list returned is in the same order as the protos are listed in the descriptor set. - /// Note: this method is internal rather than private to allow testing. - /// - /// Not all dependencies could be resolved. - public static IList ConvertDescriptors(CSharpFileOptions options, - IList fileList) - { - FileDescriptor[] converted = new FileDescriptor[fileList.Count]; - - Dictionary convertedMap = new Dictionary(); - - int totalConverted = 0; - - bool madeProgress = true; - while (madeProgress && totalConverted < converted.Length) - { - madeProgress = false; - for (int i = 0; i < converted.Length; i++) - { - if (converted[i] != null) - { - // Already done this one - continue; - } - FileDescriptorProto candidate = fileList[i]; - FileDescriptor[] dependencies = new FileDescriptor[candidate.DependencyList.Count]; - - - CSharpFileOptions.Builder builder = options.ToBuilder(); - if (candidate.Options.HasExtension(CSharpOptions.CSharpFileOptions)) - { - builder.MergeFrom( - candidate.Options.GetExtension(CSharpOptions.CSharpFileOptions)); - } - CSharpFileOptions localOptions = builder.Build(); - - bool foundAllDependencies = true; - for (int j = 0; j < dependencies.Length; j++) - { - if (!convertedMap.TryGetValue(candidate.DependencyList[j], out dependencies[j])) - { - // We can auto-magically resolve these since we already have their description - // This way if the file is only referencing options it does not need to be built with the - // --include_imports definition. - if (localOptions.IgnoreGoogleProtobuf && - (candidate.DependencyList[j] == "google/protobuf/csharp_options.proto")) - { - dependencies[j] = CSharpOptions.Descriptor; - continue; - } - if (localOptions.IgnoreGoogleProtobuf && - (candidate.DependencyList[j] == "google/protobuf/descriptor.proto")) - { - dependencies[j] = DescriptorProtoFile.Descriptor; - continue; - } - foundAllDependencies = false; - break; - } - } - if (!foundAllDependencies) - { - continue; - } - madeProgress = true; - totalConverted++; - converted[i] = FileDescriptor.BuildFrom(candidate, dependencies); - convertedMap[candidate.Name] = converted[i]; - } - } - if (!madeProgress) - { - StringBuilder remaining = new StringBuilder(); - for (int i = 0; i < converted.Length; i++) - { - if (converted[i] == null) - { - if (remaining.Length != 0) - { - remaining.Append(", "); - } - FileDescriptorProto failure = fileList[i]; - remaining.Append(failure.Name); - remaining.Append(":"); - foreach (string dependency in failure.DependencyList) - { - if (!convertedMap.ContainsKey(dependency)) - { - remaining.Append(" "); - remaining.Append(dependency); - } - } - remaining.Append(";"); - } - } - throw new DependencyResolutionException("Unable to resolve all dependencies: " + remaining); - } - return Lists.AsReadOnly(converted); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/GeneratorOptions.cs b/csharp/src/ProtoGen/GeneratorOptions.cs deleted file mode 100644 index ec500d82..00000000 --- a/csharp/src/ProtoGen/GeneratorOptions.cs +++ /dev/null @@ -1,330 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text.RegularExpressions; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// All the configuration required for the generator - where to generate - /// output files, the location of input files etc. While this isn't immutable - /// in practice, the contents shouldn't be changed after being passed to - /// the generator. - /// - public sealed class GeneratorOptions - { - private static Dictionary LineBreaks = - new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - {"Windows", "\r\n"}, - {"Unix", "\n"}, - {"Default", Environment.NewLine} - }; - - public IList InputFiles { get; set; } - - public GeneratorOptions() - { - LineBreak = Environment.NewLine; - } - - /// - /// Attempts to validate the options, but doesn't throw an exception if they're invalid. - /// Instead, when this method returns false, the output variable will contain a collection - /// of reasons for the validation failure. - /// - /// Variable to receive a list of reasons in case of validation failure. - /// true if the options are valid; false otherwise - public bool TryValidate(out IList reasons) - { - List tmpReasons = new List(); - - ParseArguments(tmpReasons); - - // Output directory validation - if (string.IsNullOrEmpty(FileOptions.OutputDirectory)) - { - tmpReasons.Add("No output directory specified"); - } - else - { - if (!Directory.Exists(FileOptions.OutputDirectory)) - { - tmpReasons.Add("Specified output directory (" + FileOptions.OutputDirectory + " doesn't exist."); - } - } - - // Input file validation (just in terms of presence) - if (InputFiles == null || InputFiles.Count == 0) - { - tmpReasons.Add("No input files specified"); - } - else - { - foreach (string input in InputFiles) - { - FileInfo fi = new FileInfo(input); - if (!fi.Exists) - { - tmpReasons.Add("Input file " + input + " doesn't exist."); - } - } - } - - if (tmpReasons.Count != 0) - { - reasons = tmpReasons; - return false; - } - - reasons = null; - return true; - } - - /// - /// Validates that all the options have been set and are valid, - /// throwing an exception if they haven't. - /// - /// The options are invalid. - public void Validate() - { - IList reasons; - if (!TryValidate(out reasons)) - { - throw new InvalidOptionsException(reasons); - } - } - - // Raw arguments, used to provide defaults for proto file options - public IList Arguments { get; set; } - - [Obsolete("Please use GeneratorOptions.FileOptions.OutputDirectory instead")] - public string OutputDirectory - { - get { return FileOptions.OutputDirectory; } - set - { - CSharpFileOptions.Builder bld = FileOptions.ToBuilder(); - bld.OutputDirectory = value; - FileOptions = bld.Build(); - } - } - - private static readonly Regex ArgMatch = new Regex(@"^[-/](?[\w_]+?)[:=](?.*)$"); - private CSharpFileOptions fileOptions; - - public CSharpFileOptions FileOptions - { - get { return fileOptions ?? (fileOptions = CSharpFileOptions.DefaultInstance); } - set { fileOptions = value; } - } - - public string LineBreak { get; set; } - - private void ParseArguments(IList tmpReasons) - { - bool doHelp = Arguments.Count == 0; - - InputFiles = new List(); - CSharpFileOptions.Builder builder = FileOptions.ToBuilder(); - Dictionary fields = - new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (FieldDescriptor fld in builder.DescriptorForType.Fields) - { - fields.Add(fld.Name, fld); - } - - foreach (string argument in Arguments) - { - if (StringComparer.OrdinalIgnoreCase.Equals("-help", argument) || - StringComparer.OrdinalIgnoreCase.Equals("/help", argument) || - StringComparer.OrdinalIgnoreCase.Equals("-?", argument) || - StringComparer.OrdinalIgnoreCase.Equals("/?", argument)) - { - doHelp = true; - break; - } - - Match m = ArgMatch.Match(argument); - if (m.Success) - { - FieldDescriptor fld; - string name = m.Groups["name"].Value; - string value = m.Groups["value"].Value; - - if (fields.TryGetValue(name, out fld)) - { - object obj; - if (TryCoerceType(value, fld, out obj, tmpReasons)) - { - builder[fld] = obj; - } - } - else if (name == "line_break") - { - string tmp; - if (LineBreaks.TryGetValue(value, out tmp)) - { - LineBreak = tmp; - } - else - { - tmpReasons.Add("Invalid value for 'line_break': " + value + "."); - } - } - else if (!File.Exists(argument)) - { - doHelp = true; - tmpReasons.Add("Unknown argument '" + name + "'."); - } - else - { - InputFiles.Add(argument); - } - } - else - { - InputFiles.Add(argument); - } - } - - if (doHelp || InputFiles.Count == 0) - { - tmpReasons.Add("Arguments:"); - foreach (KeyValuePair field in fields) - { - tmpReasons.Add(String.Format("-{0}=[{1}]", field.Key, field.Value.FieldType)); - } - tmpReasons.Add("-line_break=[" + string.Join("|", new List(LineBreaks.Keys).ToArray()) + "]"); - tmpReasons.Add("followed by one or more file paths."); - } - else - { - FileOptions = builder.Build(); - } - } - - private static bool TryCoerceType(string text, FieldDescriptor field, out object value, IList tmpReasons) - { - value = null; - - switch (field.FieldType) - { - case FieldType.Int32: - case FieldType.SInt32: - case FieldType.SFixed32: - value = Int32.Parse(text); - break; - - case FieldType.Int64: - case FieldType.SInt64: - case FieldType.SFixed64: - value = Int64.Parse(text); - break; - - case FieldType.UInt32: - case FieldType.Fixed32: - value = UInt32.Parse(text); - break; - - case FieldType.UInt64: - case FieldType.Fixed64: - value = UInt64.Parse(text); - break; - - case FieldType.Float: - value = float.Parse(text); - break; - - case FieldType.Double: - value = Double.Parse(text); - break; - - case FieldType.Bool: - value = Boolean.Parse(text); - break; - - case FieldType.String: - value = text; - break; - - case FieldType.Enum: - { - EnumDescriptor enumType = field.EnumType; - - int number; - if (int.TryParse(text, out number)) - { - value = enumType.FindValueByNumber(number); - if (value == null) - { - tmpReasons.Add( - "Enum type \"" + enumType.FullName + - "\" has no value with number " + number + "."); - return false; - } - } - else - { - value = enumType.FindValueByName(text); - if (value == null) - { - tmpReasons.Add( - "Enum type \"" + enumType.FullName + - "\" has no value named \"" + text + "\"."); - return false; - } - } - - break; - } - - case FieldType.Bytes: - case FieldType.Message: - case FieldType.Group: - tmpReasons.Add("Unhandled field type " + field.FieldType.ToString() + "."); - return false; - } - - return true; - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/Helpers.cs b/csharp/src/ProtoGen/Helpers.cs deleted file mode 100644 index 3c001150..00000000 --- a/csharp/src/ProtoGen/Helpers.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Helpers to resolve class names etc. - /// - internal static class Helpers - { - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/IFieldSourceGenerator.cs b/csharp/src/ProtoGen/IFieldSourceGenerator.cs deleted file mode 100644 index f53ae5e4..00000000 --- a/csharp/src/ProtoGen/IFieldSourceGenerator.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal interface IFieldSourceGenerator - { - void GenerateMembers(TextGenerator writer); - void GenerateBuilderMembers(TextGenerator writer); - void GenerateMergingCode(TextGenerator writer); - void GenerateBuildingCode(TextGenerator writer); - void GenerateParsingCode(TextGenerator writer); - void GenerateSerializationCode(TextGenerator writer); - void GenerateSerializedSizeCode(TextGenerator writer); - - void WriteHash(TextGenerator writer); - void WriteEquals(TextGenerator writer); - void WriteToString(TextGenerator writer); - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/ISourceGenerator.cs b/csharp/src/ProtoGen/ISourceGenerator.cs deleted file mode 100644 index 452d854a..00000000 --- a/csharp/src/ProtoGen/ISourceGenerator.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal interface ISourceGenerator - { - void Generate(TextGenerator writer); - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/InvalidOptionsException.cs b/csharp/src/ProtoGen/InvalidOptionsException.cs deleted file mode 100644 index fb698495..00000000 --- a/csharp/src/ProtoGen/InvalidOptionsException.cs +++ /dev/null @@ -1,77 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using Google.ProtocolBuffers.Collections; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Exception thrown to indicate that the options passed were invalid. - /// - public sealed class InvalidOptionsException : Exception - { - private readonly IList reasons; - - /// - /// An immutable list of reasons why the options were invalid. - /// - public IList Reasons - { - get { return reasons; } - } - - public InvalidOptionsException(IList reasons) - : base(BuildMessage(reasons)) - { - this.reasons = Lists.AsReadOnly(reasons); - } - - private static string BuildMessage(IEnumerable reasons) - { - StringBuilder builder = new StringBuilder("Invalid options:"); - builder.AppendLine(); - foreach (string reason in reasons) - { - builder.Append(" "); - builder.AppendLine(reason); - } - return builder.ToString(); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/MessageFieldGenerator.cs b/csharp/src/ProtoGen/MessageFieldGenerator.cs deleted file mode 100644 index 25b58a60..00000000 --- a/csharp/src/ProtoGen/MessageFieldGenerator.cs +++ /dev/null @@ -1,174 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class MessageFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal MessageFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private bool has{0};", PropertyName); - writer.WriteLine("private {0} {1}_;", TypeName, Name); - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_ ?? {1}; }}", Name, DefaultValue); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return result.has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); - writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}({1}.Builder builderForValue) {{", PropertyName, TypeName); - AddNullCheck(writer, "builderForValue"); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = builderForValue.Build();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Merge{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" if (result.has{0} &&", PropertyName); - writer.WriteLine(" result.{0}_ != {1}) {{", Name, DefaultValue); - writer.WriteLine(" result.{0}_ = {1}.CreateBuilder(result.{0}_).MergeFrom(value).BuildPartial();", Name, - TypeName); - writer.WriteLine(" } else {"); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" }"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = false;", PropertyName); - writer.WriteLine(" result.{0}_ = null;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.Has{0}) {{", PropertyName); - writer.WriteLine(" Merge{0}(other.{0});", PropertyName); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - // Nothing to do for singular fields - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("{0}.Builder subBuilder = {0}.CreateBuilder();", TypeName); - writer.WriteLine("if (result.has{0}) {{", PropertyName); - writer.WriteLine(" subBuilder.MergeFrom({0});", PropertyName); - writer.WriteLine("}"); - if (Descriptor.FieldType == FieldType.Group) - { - writer.WriteLine("input.ReadGroup({0}, subBuilder, extensionRegistry);", Number); - } - else - { - writer.WriteLine("input.ReadMessage(subBuilder, extensionRegistry);"); - } - writer.WriteLine("{0} = subBuilder.BuildPartial();", PropertyName); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" output.Write{0}({1}, field_names[{3}], {2});", MessageOrGroup, Number, PropertyName, - FieldOrdinal); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.Compute{0}Size({1}, {2});", - MessageOrGroup, Number, PropertyName); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("if (has{0}) hash ^= {1}_.GetHashCode();", PropertyName, Name); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if (has{0} != other.has{0} || (has{0} && !{1}_.Equals(other.{1}_))) return false;", - PropertyName, Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{2}\", has{0}, {1}_, writer);", PropertyName, Name, - Descriptor.FieldType == FieldType.Group ? Descriptor.MessageType.Name : Descriptor.Name); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/MessageGenerator.cs b/csharp/src/ProtoGen/MessageGenerator.cs deleted file mode 100644 index e7ed1e86..00000000 --- a/csharp/src/ProtoGen/MessageGenerator.cs +++ /dev/null @@ -1,893 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class MessageGenerator : SourceGeneratorBase, ISourceGenerator - { - private string[] _fieldNames; - - internal MessageGenerator(MessageDescriptor descriptor) : base(descriptor) - { - } - - private string ClassName - { - get { return Descriptor.Name; } - } - - private string FullClassName - { - get { return GetClassName(Descriptor); } - } - - /// - /// Get an identifier that uniquely identifies this type within the file. - /// This is used to declare static variables related to this type at the - /// outermost file scope. - /// - private static string GetUniqueFileScopeIdentifier(IDescriptor descriptor) - { - return "static_" + descriptor.FullName.Replace(".", "_"); - } - - internal void GenerateStaticVariables(TextGenerator writer) - { - // Because descriptor.proto (Google.ProtocolBuffers.DescriptorProtos) is - // used in the construction of descriptors, we have a tricky bootstrapping - // problem. To help control static initialization order, we make sure all - // descriptors and other static data that depends on them are members of - // the proto-descriptor class. This way, they will be initialized in - // a deterministic order. - - string identifier = GetUniqueFileScopeIdentifier(Descriptor); - - if (!UseLiteRuntime) - { - // The descriptor for this type. - string access = Descriptor.File.CSharpOptions.NestClasses ? "private" : "internal"; - writer.WriteLine("{0} static pbd::MessageDescriptor internal__{1}__Descriptor;", access, identifier); - writer.WriteLine( - "{0} static pb::FieldAccess.FieldAccessorTable<{1}, {1}.Builder> internal__{2}__FieldAccessorTable;", - access, FullClassName, identifier); - } - // Generate static members for all nested types. - foreach (MessageDescriptor nestedMessage in Descriptor.NestedTypes) - { - new MessageGenerator(nestedMessage).GenerateStaticVariables(writer); - } - } - - internal void GenerateStaticVariableInitializers(TextGenerator writer) - { - string identifier = GetUniqueFileScopeIdentifier(Descriptor); - - if (!UseLiteRuntime) - { - writer.Write("internal__{0}__Descriptor = ", identifier); - if (Descriptor.ContainingType == null) - { - writer.WriteLine("Descriptor.MessageTypes[{0}];", Descriptor.Index); - } - else - { - writer.WriteLine("internal__{0}__Descriptor.NestedTypes[{1}];", - GetUniqueFileScopeIdentifier(Descriptor.ContainingType), Descriptor.Index); - } - - writer.WriteLine("internal__{0}__FieldAccessorTable = ", identifier); - writer.WriteLine( - " new pb::FieldAccess.FieldAccessorTable<{1}, {1}.Builder>(internal__{0}__Descriptor,", - identifier, FullClassName); - writer.Print(" new string[] { "); - foreach (FieldDescriptor field in Descriptor.Fields) - { - writer.Write("\"{0}\", ", field.CSharpOptions.PropertyName); - } - writer.WriteLine("});"); - } - - // Generate static member initializers for all nested types. - foreach (MessageDescriptor nestedMessage in Descriptor.NestedTypes) - { - new MessageGenerator(nestedMessage).GenerateStaticVariableInitializers(writer); - } - - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateStaticVariableInitializers(writer); - } - } - - public string[] FieldNames - { - get - { - if (_fieldNames == null) - { - List names = new List(); - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - names.Add(fieldDescriptor.Name); - } - //if you change this, the search must also change in GenerateBuilderParsingMethods - names.Sort(StringComparer.Ordinal); - _fieldNames = names.ToArray(); - } - return _fieldNames; - } - } - - internal int FieldOrdinal(FieldDescriptor field) - { - return Array.BinarySearch(FieldNames, field.Name, StringComparer.Ordinal); - } - - private IFieldSourceGenerator CreateFieldGenerator(FieldDescriptor fieldDescriptor) - { - return SourceGenerators.CreateFieldGenerator(fieldDescriptor, FieldOrdinal(fieldDescriptor)); - } - - public void Generate(TextGenerator writer) - { - if (Descriptor.File.CSharpOptions.AddSerializable) - { - writer.WriteLine("[global::System.SerializableAttribute()]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} sealed partial class {1} : pb::{2}Message{3}<{1}, {1}.Builder> {{", - ClassAccessLevel, ClassName, - Descriptor.Proto.ExtensionRangeCount > 0 ? "Extendable" : "Generated", - RuntimeSuffix); - writer.Indent(); - if (Descriptor.File.CSharpOptions.GeneratePrivateCtor) - { - writer.WriteLine("private {0}() {{ }}", ClassName); - } - // Must call MakeReadOnly() to make sure all lists are made read-only - writer.WriteLine("private static readonly {0} defaultInstance = new {0}().MakeReadOnly();", ClassName); - - if (OptimizeSpeed) - { - writer.WriteLine("private static readonly string[] _{0}FieldNames = new string[] {{ {2}{1}{2} }};", - NameHelpers.UnderscoresToCamelCase(ClassName), String.Join("\", \"", FieldNames), - FieldNames.Length > 0 ? "\"" : ""); - List tags = new List(); - foreach (string name in FieldNames) - { - tags.Add(WireFormat.MakeTag(Descriptor.FindFieldByName(name)).ToString()); - } - - writer.WriteLine("private static readonly uint[] _{0}FieldTags = new uint[] {{ {1} }};", - NameHelpers.UnderscoresToCamelCase(ClassName), String.Join(", ", tags.ToArray())); - } - writer.WriteLine("public static {0} DefaultInstance {{", ClassName); - writer.WriteLine(" get { return defaultInstance; }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override {0} DefaultInstanceForType {{", ClassName); - writer.WriteLine(" get { return DefaultInstance; }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("protected override {0} ThisMessage {{", ClassName); - writer.WriteLine(" get { return this; }"); - writer.WriteLine("}"); - writer.WriteLine(); - if (!UseLiteRuntime) - { - writer.WriteLine("public static pbd::MessageDescriptor Descriptor {"); - writer.WriteLine(" get {{ return {0}.internal__{1}__Descriptor; }}", - DescriptorUtil.GetFullUmbrellaClassName(Descriptor), - GetUniqueFileScopeIdentifier(Descriptor)); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine( - "protected override pb::FieldAccess.FieldAccessorTable<{0}, {0}.Builder> InternalFieldAccessors {{", - ClassName); - writer.WriteLine(" get {{ return {0}.internal__{1}__FieldAccessorTable; }}", - DescriptorUtil.GetFullUmbrellaClassName(Descriptor), - GetUniqueFileScopeIdentifier(Descriptor)); - writer.WriteLine("}"); - writer.WriteLine(); - } - - // Extensions don't need to go in an extra nested type - WriteChildren(writer, null, Descriptor.Extensions); - - if (Descriptor.EnumTypes.Count + Descriptor.NestedTypes.Count > 0) - { - writer.WriteLine("#region Nested types"); - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("public static partial class Types {"); - writer.Indent(); - WriteChildren(writer, null, Descriptor.EnumTypes); - WriteChildren(writer, null, Descriptor.NestedTypes); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - if (Descriptor.File.CSharpOptions.ClsCompliance && GetFieldConstantName(fieldDescriptor).StartsWith("_")) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - - // Rats: we lose the debug comment here :( - writer.WriteLine("public const int {0} = {1};", GetFieldConstantName(fieldDescriptor), - fieldDescriptor.FieldNumber); - CreateFieldGenerator(fieldDescriptor).GenerateMembers(writer); - writer.WriteLine(); - } - - if (OptimizeSpeed) - { - GenerateIsInitialized(writer); - GenerateMessageSerializationMethods(writer); - } - if (UseLiteRuntime) - { - GenerateLiteRuntimeMethods(writer); - } - - GenerateParseFromMethods(writer); - GenerateBuilder(writer); - - // Force the static initialization code for the file to run, since it may - // initialize static variables declared in this class. - writer.WriteLine("static {0}() {{", ClassName); - // We call object.ReferenceEquals() just to make it a valid statement on its own. - // Another option would be GetType(), but that causes problems in DescriptorProtoFile, - // where the bootstrapping is somewhat recursive - type initializers call - // each other, effectively. We temporarily see Descriptor as null. - writer.WriteLine(" object.ReferenceEquals({0}.Descriptor, null);", - DescriptorUtil.GetFullUmbrellaClassName(Descriptor)); - writer.WriteLine("}"); - - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateLiteRuntimeMethods(TextGenerator writer) - { - bool callbase = Descriptor.Proto.ExtensionRangeCount > 0; - writer.WriteLine("#region Lite runtime methods"); - writer.WriteLine("public override int GetHashCode() {"); - writer.Indent(); - writer.WriteLine("int hash = GetType().GetHashCode();"); - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - CreateFieldGenerator(fieldDescriptor).WriteHash(writer); - } - if (callbase) - { - writer.WriteLine("hash ^= base.GetHashCode();"); - } - writer.WriteLine("return hash;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public override bool Equals(object obj) {"); - writer.Indent(); - writer.WriteLine("{0} other = obj as {0};", ClassName); - writer.WriteLine("if (other == null) return false;"); - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - CreateFieldGenerator(fieldDescriptor).WriteEquals(writer); - } - if (callbase) - { - writer.WriteLine("if (!base.Equals(other)) return false;"); - } - writer.WriteLine("return true;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public override void PrintTo(global::System.IO.TextWriter writer) {"); - writer.Indent(); - List sorted = new List(Descriptor.Fields); - sorted.Sort( - new Comparison( - delegate(FieldDescriptor a, FieldDescriptor b) { return a.FieldNumber.CompareTo(b.FieldNumber); })); - foreach (FieldDescriptor fieldDescriptor in sorted) - { - CreateFieldGenerator(fieldDescriptor).WriteToString(writer); - } - if (callbase) - { - writer.WriteLine("base.PrintTo(writer);"); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - - private void GenerateMessageSerializationMethods(TextGenerator writer) - { - List sortedFields = new List(Descriptor.Fields); - sortedFields.Sort((f1, f2) => f1.FieldNumber.CompareTo(f2.FieldNumber)); - - List sortedExtensions = - new List(Descriptor.Proto.ExtensionRangeList); - sortedExtensions.Sort((r1, r2) => (r1.Start.CompareTo(r2.Start))); - - writer.WriteLine("public override void WriteTo(pb::ICodedOutputStream output) {"); - writer.Indent(); - // Make sure we've computed the serialized length, so that packed fields are generated correctly. - writer.WriteLine("CalcSerializedSize();"); - writer.WriteLine("string[] field_names = _{0}FieldNames;", NameHelpers.UnderscoresToCamelCase(ClassName)); - if (Descriptor.Proto.ExtensionRangeList.Count > 0) - { - writer.WriteLine( - "pb::ExtendableMessage{1}<{0}, {0}.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);", - ClassName, RuntimeSuffix); - } - - // Merge the fields and the extension ranges, both sorted by field number. - for (int i = 0, j = 0; i < Descriptor.Fields.Count || j < sortedExtensions.Count;) - { - if (i == Descriptor.Fields.Count) - { - GenerateSerializeOneExtensionRange(writer, sortedExtensions[j++]); - } - else if (j == sortedExtensions.Count) - { - GenerateSerializeOneField(writer, sortedFields[i++]); - } - else if (sortedFields[i].FieldNumber < sortedExtensions[j].Start) - { - GenerateSerializeOneField(writer, sortedFields[i++]); - } - else - { - GenerateSerializeOneExtensionRange(writer, sortedExtensions[j++]); - } - } - - if (!UseLiteRuntime) - { - if (Descriptor.Proto.Options.MessageSetWireFormat) - { - writer.WriteLine("UnknownFields.WriteAsMessageSetTo(output);"); - } - else - { - writer.WriteLine("UnknownFields.WriteTo(output);"); - } - } - - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("private int memoizedSerializedSize = -1;"); - writer.WriteLine("public override int SerializedSize {"); - writer.Indent(); - writer.WriteLine("get {"); - writer.Indent(); - writer.WriteLine("int size = memoizedSerializedSize;"); - writer.WriteLine("if (size != -1) return size;"); - writer.WriteLine("return CalcSerializedSize();"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("private int CalcSerializedSize() {"); - writer.Indent(); - writer.WriteLine("int size = memoizedSerializedSize;"); - writer.WriteLine("if (size != -1) return size;"); - writer.WriteLine(); - writer.WriteLine("size = 0;"); - foreach (FieldDescriptor field in Descriptor.Fields) - { - CreateFieldGenerator(field).GenerateSerializedSizeCode(writer); - } - if (Descriptor.Proto.ExtensionRangeCount > 0) - { - writer.WriteLine("size += ExtensionsSerializedSize;"); - } - - if (!UseLiteRuntime) - { - if (Descriptor.Options.MessageSetWireFormat) - { - writer.WriteLine("size += UnknownFields.SerializedSizeAsMessageSet;"); - } - else - { - writer.WriteLine("size += UnknownFields.SerializedSize;"); - } - } - writer.WriteLine("memoizedSerializedSize = size;"); - writer.WriteLine("return size;"); - writer.Outdent(); - writer.WriteLine("}"); - } - - private void GenerateSerializeOneField(TextGenerator writer, FieldDescriptor fieldDescriptor) - { - CreateFieldGenerator(fieldDescriptor).GenerateSerializationCode(writer); - } - - private static void GenerateSerializeOneExtensionRange(TextGenerator writer, - DescriptorProto.Types.ExtensionRange extensionRange) - { - writer.WriteLine("extensionWriter.WriteUntil({0}, output);", extensionRange.End); - } - - private void GenerateParseFromMethods(TextGenerator writer) - { - // Note: These are separate from GenerateMessageSerializationMethods() - // because they need to be generated even for messages that are optimized - // for code size. - - writer.WriteLine("public static {0} ParseFrom(pb::ByteString data) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(byte[] data) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(global::System.IO.Stream input) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseDelimitedFrom(global::System.IO.Stream input) {{", ClassName); - writer.WriteLine(" return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(pb::ICodedInputStream input) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - } - - /// - /// Returns whether or not the specified message type has any required fields. - /// If it doesn't, calls to check for initialization can be optimised. - /// TODO(jonskeet): Move this into MessageDescriptor? - /// - private static bool HasRequiredFields(MessageDescriptor descriptor, - Dictionary alreadySeen) - { - if (alreadySeen.ContainsKey(descriptor)) - { - // The type is already in cache. This means that either: - // a. The type has no required fields. - // b. We are in the midst of checking if the type has required fields, - // somewhere up the stack. In this case, we know that if the type - // has any required fields, they'll be found when we return to it, - // and the whole call to HasRequiredFields() will return true. - // Therefore, we don't have to check if this type has required fields - // here. - return false; - } - alreadySeen[descriptor] = descriptor; // Value is irrelevant - - // If the type has extensions, an extension with message type could contain - // required fields, so we have to be conservative and assume such an - // extension exists. - if (descriptor.Extensions.Count > 0) - { - return true; - } - - foreach (FieldDescriptor field in descriptor.Fields) - { - if (field.IsRequired) - { - return true; - } - // Message or group - if (field.MappedType == MappedType.Message) - { - if (HasRequiredFields(field.MessageType, alreadySeen)) - { - return true; - } - } - } - return false; - } - - private void GenerateBuilder(TextGenerator writer) - { - writer.WriteLine("private {0} MakeReadOnly() {{", ClassName); - writer.Indent(); - foreach (FieldDescriptor field in Descriptor.Fields) - { - CreateFieldGenerator(field).GenerateBuildingCode(writer); - } - writer.WriteLine("return this;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public static Builder CreateBuilder() { return new Builder(); }"); - writer.WriteLine("public override Builder ToBuilder() { return CreateBuilder(this); }"); - writer.WriteLine("public override Builder CreateBuilderForType() { return new Builder(); }"); - writer.WriteLine("public static Builder CreateBuilder({0} prototype) {{", ClassName); - writer.WriteLine(" return new Builder(prototype);"); - writer.WriteLine("}"); - writer.WriteLine(); - if (Descriptor.File.CSharpOptions.AddSerializable) - { - writer.WriteLine("[global::System.SerializableAttribute()]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} sealed partial class Builder : pb::{2}Builder{3}<{1}, Builder> {{", - ClassAccessLevel, ClassName, - Descriptor.Proto.ExtensionRangeCount > 0 ? "Extendable" : "Generated", RuntimeSuffix); - writer.Indent(); - writer.WriteLine("protected override Builder ThisBuilder {"); - writer.WriteLine(" get { return this; }"); - writer.WriteLine("}"); - GenerateCommonBuilderMethods(writer); - if (OptimizeSpeed) - { - GenerateBuilderParsingMethods(writer); - } - foreach (FieldDescriptor field in Descriptor.Fields) - { - writer.WriteLine(); - // No field comment :( - CreateFieldGenerator(field).GenerateBuilderMembers(writer); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - private void GenerateCommonBuilderMethods(TextGenerator writer) - { - //default constructor - writer.WriteLine("public Builder() {"); - //Durring static initialization of message, DefaultInstance is expected to return null. - writer.WriteLine(" result = DefaultInstance;"); - writer.WriteLine(" resultIsReadOnly = true;"); - writer.WriteLine("}"); - //clone constructor - writer.WriteLine("internal Builder({0} cloneFrom) {{", ClassName); - writer.WriteLine(" result = cloneFrom;"); - writer.WriteLine(" resultIsReadOnly = true;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("private bool resultIsReadOnly;"); - writer.WriteLine("private {0} result;", ClassName); - writer.WriteLine(); - writer.WriteLine("private {0} PrepareBuilder() {{", ClassName); - writer.WriteLine(" if (resultIsReadOnly) {"); - writer.WriteLine(" {0} original = result;", ClassName); - writer.WriteLine(" result = new {0}();", ClassName); - writer.WriteLine(" resultIsReadOnly = false;"); - writer.WriteLine(" MergeFrom(original);"); - writer.WriteLine(" }"); - writer.WriteLine(" return result;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override bool IsInitialized {"); - writer.WriteLine(" get { return result.IsInitialized; }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("protected override {0} MessageBeingBuilt {{", ClassName); - writer.WriteLine(" get { return PrepareBuilder(); }"); - writer.WriteLine("}"); - writer.WriteLine(); - //Not actually expecting that DefaultInstance would ever be null here; however, we will ensure it does not break - writer.WriteLine("public override Builder Clear() {"); - writer.WriteLine(" result = DefaultInstance;", ClassName); - writer.WriteLine(" resultIsReadOnly = true;"); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override Builder Clone() {"); - writer.WriteLine(" if (resultIsReadOnly) {"); - writer.WriteLine(" return new Builder(result);"); - writer.WriteLine(" } else {"); - writer.WriteLine(" return new Builder().MergeFrom(result);"); - writer.WriteLine(" }"); - writer.WriteLine("}"); - writer.WriteLine(); - if (!UseLiteRuntime) - { - writer.WriteLine("public override pbd::MessageDescriptor DescriptorForType {"); - writer.WriteLine(" get {{ return {0}.Descriptor; }}", FullClassName); - writer.WriteLine("}"); - writer.WriteLine(); - } - writer.WriteLine("public override {0} DefaultInstanceForType {{", ClassName); - writer.WriteLine(" get {{ return {0}.DefaultInstance; }}", FullClassName); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public override {0} BuildPartial() {{", ClassName); - writer.Indent(); - writer.WriteLine("if (resultIsReadOnly) {"); - writer.WriteLine(" return result;"); - writer.WriteLine("}"); - writer.WriteLine("resultIsReadOnly = true;"); - writer.WriteLine("return result.MakeReadOnly();"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - if (OptimizeSpeed) - { - writer.WriteLine("public override Builder MergeFrom(pb::IMessage{0} other) {{", RuntimeSuffix); - writer.WriteLine(" if (other is {0}) {{", ClassName); - writer.WriteLine(" return MergeFrom(({0}) other);", ClassName); - writer.WriteLine(" } else {"); - writer.WriteLine(" base.MergeFrom(other);"); - writer.WriteLine(" return this;"); - writer.WriteLine(" }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override Builder MergeFrom({0} other) {{", ClassName); - // Optimization: If other is the default instance, we know none of its - // fields are set so we can skip the merge. - writer.Indent(); - writer.WriteLine("if (other == {0}.DefaultInstance) return this;", FullClassName); - writer.WriteLine("PrepareBuilder();"); - foreach (FieldDescriptor field in Descriptor.Fields) - { - CreateFieldGenerator(field).GenerateMergingCode(writer); - } - // if message type has extensions - if (Descriptor.Proto.ExtensionRangeCount > 0) - { - writer.WriteLine(" this.MergeExtensionFields(other);"); - } - if (!UseLiteRuntime) - { - writer.WriteLine("this.MergeUnknownFields(other.UnknownFields);"); - } - writer.WriteLine("return this;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - } - - private void GenerateBuilderParsingMethods(TextGenerator writer) - { - List sortedFields = new List(Descriptor.Fields); - sortedFields.Sort((f1, f2) => f1.FieldNumber.CompareTo(f2.FieldNumber)); - - writer.WriteLine("public override Builder MergeFrom(pb::ICodedInputStream input) {"); - writer.WriteLine(" return MergeFrom(input, pb::ExtensionRegistry.Empty);"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine( - "public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {"); - writer.Indent(); - writer.WriteLine("PrepareBuilder();"); - if (!UseLiteRuntime) - { - writer.WriteLine("pb::UnknownFieldSet.Builder unknownFields = null;"); - } - writer.WriteLine("uint tag;"); - writer.WriteLine("string field_name;"); - writer.WriteLine("while (input.ReadTag(out tag, out field_name)) {"); - writer.Indent(); - writer.WriteLine("if(tag == 0 && field_name != null) {"); - writer.Indent(); - //if you change from StringComparer.Ordinal, the array sort in FieldNames { get; } must also change - writer.WriteLine( - "int field_ordinal = global::System.Array.BinarySearch(_{0}FieldNames, field_name, global::System.StringComparer.Ordinal);", - NameHelpers.UnderscoresToCamelCase(ClassName)); - writer.WriteLine("if(field_ordinal >= 0)"); - writer.WriteLine(" tag = _{0}FieldTags[field_ordinal];", NameHelpers.UnderscoresToCamelCase(ClassName)); - writer.WriteLine("else {"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields == null) {"); // First unknown field - create builder now - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - } - writer.WriteLine(" ParseUnknownField(input, {0}extensionRegistry, tag, field_name);", - UseLiteRuntime ? "" : "unknownFields, "); - writer.WriteLine(" continue;"); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - - writer.WriteLine("switch (tag) {"); - writer.Indent(); - writer.WriteLine("case 0: {"); // 0 signals EOF / limit reached - writer.WriteLine(" throw pb::InvalidProtocolBufferException.InvalidTag();"); - writer.WriteLine("}"); - writer.WriteLine("default: {"); - writer.WriteLine(" if (pb::WireFormat.IsEndGroupTag(tag)) {"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields != null) {"); - writer.WriteLine(" this.UnknownFields = unknownFields.Build();"); - writer.WriteLine(" }"); - } - writer.WriteLine(" return this;"); // it's an endgroup tag - writer.WriteLine(" }"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields == null) {"); // First unknown field - create builder now - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - } - writer.WriteLine(" ParseUnknownField(input, {0}extensionRegistry, tag, field_name);", - UseLiteRuntime ? "" : "unknownFields, "); - writer.WriteLine(" break;"); - writer.WriteLine("}"); - foreach (FieldDescriptor field in sortedFields) - { - WireFormat.WireType wt = WireFormat.GetWireType(field.FieldType); - uint tag = WireFormat.MakeTag(field.FieldNumber, wt); - - if (field.IsRepeated && - (wt == WireFormat.WireType.Varint || wt == WireFormat.WireType.Fixed32 || - wt == WireFormat.WireType.Fixed64)) - { - writer.WriteLine("case {0}:", - WireFormat.MakeTag(field.FieldNumber, WireFormat.WireType.LengthDelimited)); - } - - writer.WriteLine("case {0}: {{", tag); - writer.Indent(); - CreateFieldGenerator(field).GenerateParsingCode(writer); - writer.WriteLine("break;"); - writer.Outdent(); - writer.WriteLine("}"); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - if (!UseLiteRuntime) - { - writer.WriteLine("if (unknownFields != null) {"); - writer.WriteLine(" this.UnknownFields = unknownFields.Build();"); - writer.WriteLine("}"); - } - writer.WriteLine("return this;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateIsInitialized(TextGenerator writer) - { - writer.WriteLine("public override bool IsInitialized {"); - writer.Indent(); - writer.WriteLine("get {"); - writer.Indent(); - - // Check that all required fields in this message are set. - // TODO(kenton): We can optimize this when we switch to putting all the - // "has" fields into a single bitfield. - foreach (FieldDescriptor field in Descriptor.Fields) - { - if (field.IsRequired) - { - writer.WriteLine("if (!has{0}) return false;", field.CSharpOptions.PropertyName); - } - } - - // Now check that all embedded messages are initialized. - foreach (FieldDescriptor field in Descriptor.Fields) - { - if (field.FieldType != FieldType.Message || - !HasRequiredFields(field.MessageType, new Dictionary())) - { - continue; - } - string propertyName = NameHelpers.UnderscoresToPascalCase(GetFieldName(field)); - if (field.IsRepeated) - { - writer.WriteLine("foreach ({0} element in {1}List) {{", GetClassName(field.MessageType), - propertyName); - writer.WriteLine(" if (!element.IsInitialized) return false;"); - writer.WriteLine("}"); - } - else if (field.IsOptional) - { - writer.WriteLine("if (Has{0}) {{", propertyName); - writer.WriteLine(" if (!{0}.IsInitialized) return false;", propertyName); - writer.WriteLine("}"); - } - else - { - writer.WriteLine("if (!{0}.IsInitialized) return false;", propertyName); - } - } - - if (Descriptor.Proto.ExtensionRangeCount > 0) - { - writer.WriteLine("if (!ExtensionsAreInitialized) return false;"); - } - writer.WriteLine("return true;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - internal void GenerateExtensionRegistrationCode(TextGenerator writer) - { - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateExtensionRegistrationCode(writer); - } - foreach (MessageDescriptor nestedMessage in Descriptor.NestedTypes) - { - new MessageGenerator(nestedMessage).GenerateExtensionRegistrationCode(writer); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/PluginProtoFile.cs b/csharp/src/ProtoGen/PluginProtoFile.cs deleted file mode 100644 index e0fed5c3..00000000 --- a/csharp/src/ProtoGen/PluginProtoFile.cs +++ /dev/null @@ -1,1187 +0,0 @@ -// Generated by protoc-gen-cs, Version=2.4.1.521, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.Compiler.PluginProto { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Plugin { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_compiler_CodeGeneratorRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_compiler_CodeGeneratorResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Plugin() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVnb29nbGUvcHJvdG9idWYvY29tcGlsZXIvcGx1Z2luLnByb3RvEhhnb29n", - "bGUucHJvdG9idWYuY29tcGlsZXIaIGdvb2dsZS9wcm90b2J1Zi9kZXNjcmlw", - "dG9yLnByb3RvIn0KFENvZGVHZW5lcmF0b3JSZXF1ZXN0EhgKEGZpbGVfdG9f", - "Z2VuZXJhdGUYASADKAkSEQoJcGFyYW1ldGVyGAIgASgJEjgKCnByb3RvX2Zp", - "bGUYDyADKAsyJC5nb29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90", - "byKqAQoVQ29kZUdlbmVyYXRvclJlc3BvbnNlEg0KBWVycm9yGAEgASgJEkIK", - "BGZpbGUYDyADKAsyNC5nb29nbGUucHJvdG9idWYuY29tcGlsZXIuQ29kZUdl", - "bmVyYXRvclJlc3BvbnNlLkZpbGUaPgoERmlsZRIMCgRuYW1lGAEgASgJEhcK", - "D2luc2VydGlvbl9wb2ludBgCIAEoCRIPCgdjb250ZW50GA8gASgJQiwKHGNv", - "bS5nb29nbGUucHJvdG9idWYuY29tcGlsZXJCDFBsdWdpblByb3Rvcw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_compiler_CodeGeneratorRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor, - new string[] { "FileToGenerate", "Parameter", "ProtoFile", }); - internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_compiler_CodeGeneratorResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor, - new string[] { "Error", "File", }); - internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor = internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor, - new string[] { "Name", "InsertionPoint", "Content", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CodeGeneratorRequest : pb::GeneratedMessage { - private CodeGeneratorRequest() { } - private static readonly CodeGeneratorRequest defaultInstance = new CodeGeneratorRequest().MakeReadOnly(); - private static readonly string[] _codeGeneratorRequestFieldNames = new string[] { "file_to_generate", "parameter", "proto_file" }; - private static readonly uint[] _codeGeneratorRequestFieldTags = new uint[] { 10, 18, 122 }; - public static CodeGeneratorRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CodeGeneratorRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CodeGeneratorRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorRequest__FieldAccessorTable; } - } - - public const int FileToGenerateFieldNumber = 1; - private pbc::PopsicleList fileToGenerate_ = new pbc::PopsicleList(); - public scg::IList FileToGenerateList { - get { return pbc::Lists.AsReadOnly(fileToGenerate_); } - } - public int FileToGenerateCount { - get { return fileToGenerate_.Count; } - } - public string GetFileToGenerate(int index) { - return fileToGenerate_[index]; - } - - public const int ParameterFieldNumber = 2; - private bool hasParameter; - private string parameter_ = ""; - public bool HasParameter { - get { return hasParameter; } - } - public string Parameter { - get { return parameter_; } - } - - public const int ProtoFileFieldNumber = 15; - private pbc::PopsicleList protoFile_ = new pbc::PopsicleList(); - public scg::IList ProtoFileList { - get { return protoFile_; } - } - public int ProtoFileCount { - get { return protoFile_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetProtoFile(int index) { - return protoFile_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in ProtoFileList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _codeGeneratorRequestFieldNames; - if (fileToGenerate_.Count > 0) { - output.WriteStringArray(1, field_names[0], fileToGenerate_); - } - if (hasParameter) { - output.WriteString(2, field_names[1], Parameter); - } - if (protoFile_.Count > 0) { - output.WriteMessageArray(15, field_names[2], protoFile_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in FileToGenerateList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * fileToGenerate_.Count; - } - if (hasParameter) { - size += pb::CodedOutputStream.ComputeStringSize(2, Parameter); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in ProtoFileList) { - size += pb::CodedOutputStream.ComputeMessageSize(15, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CodeGeneratorRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CodeGeneratorRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CodeGeneratorRequest MakeReadOnly() { - fileToGenerate_.MakeReadOnly(); - protoFile_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CodeGeneratorRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CodeGeneratorRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CodeGeneratorRequest result; - - private CodeGeneratorRequest PrepareBuilder() { - if (resultIsReadOnly) { - CodeGeneratorRequest original = result; - result = new CodeGeneratorRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CodeGeneratorRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorRequest.Descriptor; } - } - - public override CodeGeneratorRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorRequest.DefaultInstance; } - } - - public override CodeGeneratorRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CodeGeneratorRequest) { - return MergeFrom((CodeGeneratorRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CodeGeneratorRequest other) { - if (other == global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.fileToGenerate_.Count != 0) { - result.fileToGenerate_.Add(other.fileToGenerate_); - } - if (other.HasParameter) { - Parameter = other.Parameter; - } - if (other.protoFile_.Count != 0) { - result.protoFile_.Add(other.protoFile_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_codeGeneratorRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _codeGeneratorRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadStringArray(tag, field_name, result.fileToGenerate_); - break; - } - case 18: { - result.hasParameter = input.ReadString(ref result.parameter_); - break; - } - case 122: { - input.ReadMessageArray(tag, field_name, result.protoFile_, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList FileToGenerateList { - get { return PrepareBuilder().fileToGenerate_; } - } - public int FileToGenerateCount { - get { return result.FileToGenerateCount; } - } - public string GetFileToGenerate(int index) { - return result.GetFileToGenerate(index); - } - public Builder SetFileToGenerate(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.fileToGenerate_[index] = value; - return this; - } - public Builder AddFileToGenerate(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.fileToGenerate_.Add(value); - return this; - } - public Builder AddRangeFileToGenerate(scg::IEnumerable values) { - PrepareBuilder(); - result.fileToGenerate_.Add(values); - return this; - } - public Builder ClearFileToGenerate() { - PrepareBuilder(); - result.fileToGenerate_.Clear(); - return this; - } - - public bool HasParameter { - get { return result.hasParameter; } - } - public string Parameter { - get { return result.Parameter; } - set { SetParameter(value); } - } - public Builder SetParameter(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasParameter = true; - result.parameter_ = value; - return this; - } - public Builder ClearParameter() { - PrepareBuilder(); - result.hasParameter = false; - result.parameter_ = ""; - return this; - } - - public pbc::IPopsicleList ProtoFileList { - get { return PrepareBuilder().protoFile_; } - } - public int ProtoFileCount { - get { return result.ProtoFileCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetProtoFile(int index) { - return result.GetProtoFile(index); - } - public Builder SetProtoFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.protoFile_[index] = value; - return this; - } - public Builder SetProtoFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.protoFile_[index] = builderForValue.Build(); - return this; - } - public Builder AddProtoFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.protoFile_.Add(value); - return this; - } - public Builder AddProtoFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.protoFile_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeProtoFile(scg::IEnumerable values) { - PrepareBuilder(); - result.protoFile_.Add(values); - return this; - } - public Builder ClearProtoFile() { - PrepareBuilder(); - result.protoFile_.Clear(); - return this; - } - } - static CodeGeneratorRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CodeGeneratorResponse : pb::GeneratedMessage { - private CodeGeneratorResponse() { } - private static readonly CodeGeneratorResponse defaultInstance = new CodeGeneratorResponse().MakeReadOnly(); - private static readonly string[] _codeGeneratorResponseFieldNames = new string[] { "error", "file" }; - private static readonly uint[] _codeGeneratorResponseFieldTags = new uint[] { 10, 122 }; - public static CodeGeneratorResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CodeGeneratorResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CodeGeneratorResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class File : pb::GeneratedMessage { - private File() { } - private static readonly File defaultInstance = new File().MakeReadOnly(); - private static readonly string[] _fileFieldNames = new string[] { "content", "insertion_point", "name" }; - private static readonly uint[] _fileFieldTags = new uint[] { 122, 18, 10 }; - public static File DefaultInstance { - get { return defaultInstance; } - } - - public override File DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override File ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int InsertionPointFieldNumber = 2; - private bool hasInsertionPoint; - private string insertionPoint_ = ""; - public bool HasInsertionPoint { - get { return hasInsertionPoint; } - } - public string InsertionPoint { - get { return insertionPoint_; } - } - - public const int ContentFieldNumber = 15; - private bool hasContent; - private string content_ = ""; - public bool HasContent { - get { return hasContent; } - } - public string Content { - get { return content_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _fileFieldNames; - if (hasName) { - output.WriteString(1, field_names[2], Name); - } - if (hasInsertionPoint) { - output.WriteString(2, field_names[1], InsertionPoint); - } - if (hasContent) { - output.WriteString(15, field_names[0], Content); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasInsertionPoint) { - size += pb::CodedOutputStream.ComputeStringSize(2, InsertionPoint); - } - if (hasContent) { - size += pb::CodedOutputStream.ComputeStringSize(15, Content); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static File ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static File ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static File ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static File ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static File ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static File ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static File ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static File ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static File ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static File ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private File MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(File prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(File cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private File result; - - private File PrepareBuilder() { - if (resultIsReadOnly) { - File original = result; - result = new File(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override File MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.Descriptor; } - } - - public override File DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.DefaultInstance; } - } - - public override File BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is File) { - return MergeFrom((File) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(File other) { - if (other == global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasInsertionPoint) { - InsertionPoint = other.InsertionPoint; - } - if (other.HasContent) { - Content = other.Content; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasInsertionPoint = input.ReadString(ref result.insertionPoint_); - break; - } - case 122: { - result.hasContent = input.ReadString(ref result.content_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasInsertionPoint { - get { return result.hasInsertionPoint; } - } - public string InsertionPoint { - get { return result.InsertionPoint; } - set { SetInsertionPoint(value); } - } - public Builder SetInsertionPoint(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasInsertionPoint = true; - result.insertionPoint_ = value; - return this; - } - public Builder ClearInsertionPoint() { - PrepareBuilder(); - result.hasInsertionPoint = false; - result.insertionPoint_ = ""; - return this; - } - - public bool HasContent { - get { return result.hasContent; } - } - public string Content { - get { return result.Content; } - set { SetContent(value); } - } - public Builder SetContent(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasContent = true; - result.content_ = value; - return this; - } - public Builder ClearContent() { - PrepareBuilder(); - result.hasContent = false; - result.content_ = ""; - return this; - } - } - static File() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.Descriptor, null); - } - } - - } - #endregion - - public const int ErrorFieldNumber = 1; - private bool hasError; - private string error_ = ""; - public bool HasError { - get { return hasError; } - } - public string Error { - get { return error_; } - } - - public const int FileFieldNumber = 15; - private pbc::PopsicleList file_ = new pbc::PopsicleList(); - public scg::IList FileList { - get { return file_; } - } - public int FileCount { - get { return file_.Count; } - } - public global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File GetFile(int index) { - return file_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _codeGeneratorResponseFieldNames; - if (hasError) { - output.WriteString(1, field_names[0], Error); - } - if (file_.Count > 0) { - output.WriteMessageArray(15, field_names[1], file_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasError) { - size += pb::CodedOutputStream.ComputeStringSize(1, Error); - } - foreach (global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File element in FileList) { - size += pb::CodedOutputStream.ComputeMessageSize(15, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CodeGeneratorResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CodeGeneratorResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CodeGeneratorResponse MakeReadOnly() { - file_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CodeGeneratorResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CodeGeneratorResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CodeGeneratorResponse result; - - private CodeGeneratorResponse PrepareBuilder() { - if (resultIsReadOnly) { - CodeGeneratorResponse original = result; - result = new CodeGeneratorResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CodeGeneratorResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Descriptor; } - } - - public override CodeGeneratorResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.DefaultInstance; } - } - - public override CodeGeneratorResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CodeGeneratorResponse) { - return MergeFrom((CodeGeneratorResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CodeGeneratorResponse other) { - if (other == global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasError) { - Error = other.Error; - } - if (other.file_.Count != 0) { - result.file_.Add(other.file_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_codeGeneratorResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _codeGeneratorResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasError = input.ReadString(ref result.error_); - break; - } - case 122: { - input.ReadMessageArray(tag, field_name, result.file_, global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasError { - get { return result.hasError; } - } - public string Error { - get { return result.Error; } - set { SetError(value); } - } - public Builder SetError(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasError = true; - result.error_ = value; - return this; - } - public Builder ClearError() { - PrepareBuilder(); - result.hasError = false; - result.error_ = ""; - return this; - } - - public pbc::IPopsicleList FileList { - get { return PrepareBuilder().file_; } - } - public int FileCount { - get { return result.FileCount; } - } - public global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File GetFile(int index) { - return result.GetFile(index); - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_[index] = value; - return this; - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_[index] = builderForValue.Build(); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_.Add(value); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFile(scg::IEnumerable values) { - PrepareBuilder(); - result.file_.Add(values); - return this; - } - public Builder ClearFile() { - PrepareBuilder(); - result.file_.Clear(); - return this; - } - } - static CodeGeneratorResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtoGen/PrimitiveFieldGenerator.cs b/csharp/src/ProtoGen/PrimitiveFieldGenerator.cs deleted file mode 100644 index 69e0d4d9..00000000 --- a/csharp/src/ProtoGen/PrimitiveFieldGenerator.cs +++ /dev/null @@ -1,140 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - // TODO(jonskeet): Refactor this. There's loads of common code here. - internal class PrimitiveFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal PrimitiveFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private bool has{0};", PropertyName); - writer.WriteLine("private {0} {1}_{2};", TypeName, Name, HasDefaultValue ? " = " + DefaultValue : ""); - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_; }}", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return result.has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); - writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = false;", PropertyName); - writer.WriteLine(" result.{0}_ = {1};", Name, DefaultValue); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.Has{0}) {{", PropertyName); - writer.WriteLine(" {0} = other.{0};", PropertyName); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - // Nothing to do here for primitive types - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("result.has{0} = input.Read{1}(ref result.{2}_);", PropertyName, CapitalizedTypeName, Name); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" output.Write{0}({1}, field_names[{3}], {2});", CapitalizedTypeName, Number, PropertyName, - FieldOrdinal); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.Compute{0}Size({1}, {2});", - CapitalizedTypeName, Number, PropertyName); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("if (has{0}) hash ^= {1}_.GetHashCode();", PropertyName, Name); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if (has{0} != other.has{0} || (has{0} && !{1}_.Equals(other.{1}_))) return false;", - PropertyName, Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", has{1}, {2}_, writer);", Descriptor.Name, PropertyName, Name); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/Program.cs b/csharp/src/ProtoGen/Program.cs deleted file mode 100644 index b11d32e0..00000000 --- a/csharp/src/ProtoGen/Program.cs +++ /dev/null @@ -1,105 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; -using System.Collections.Generic; -using Google.ProtocolBuffers.Compiler.PluginProto; -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Entry point for the Protocol Buffers generator. - /// - internal class Program - { - internal static int Main(string[] args) - { - try - { - // Hack to make sure everything's initialized - DescriptorProtoFile.Descriptor.ToString(); - GeneratorOptions options = new GeneratorOptions {Arguments = args}; - - IList validationFailures; - if (!options.TryValidate(out validationFailures)) - { - // We've already got the message-building logic in the exception... - InvalidOptionsException exception = new InvalidOptionsException(validationFailures); - Console.WriteLine(exception.Message); - return 1; - } - - var request = new CodeGeneratorRequest.Builder(); - foreach (string inputFile in options.InputFiles) - { - ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); - CSharpOptions.RegisterAllExtensions(extensionRegistry); - using (Stream inputStream = File.OpenRead(inputFile)) - { - var fileSet = FileDescriptorSet.ParseFrom(inputStream, extensionRegistry); - foreach (var fileProto in fileSet.FileList) - { - request.AddFileToGenerate(fileProto.Name); - request.AddProtoFile(fileProto); - } - } - } - - Generator generator = Generator.CreateGenerator(options); - var response = new CodeGeneratorResponse.Builder(); - generator.Generate(request.Build(), response); - if (response.HasError) - { - throw new Exception(response.Error); - } - foreach (var file in response.FileList) - { - File.WriteAllText(file.Name, file.Content); - } - return 0; - } - catch (Exception e) - { - Console.Error.WriteLine("Error: {0}", e.Message); - Console.Error.WriteLine(); - Console.Error.WriteLine("Detailed exception information: {0}", e); - return 1; - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/ProgramPreprocess.cs b/csharp/src/ProtoGen/ProgramPreprocess.cs deleted file mode 100644 index 343e1f2a..00000000 --- a/csharp/src/ProtoGen/ProgramPreprocess.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Preprocesses any input files with an extension of '.proto' by running protoc.exe. If arguments - /// are supplied with '--' prefix they are provided to protoc.exe, otherwise they are assumed to - /// be used for ProtoGen.exe which is run on the resulting output proto buffer. If the option - /// --descriptor_set_out= is specified the proto buffer file is kept, otherwise it will be removed - /// after code generation. - /// - public class ProgramPreprocess - { - private const string ProtocExecutable = "protoc.exe"; - private const string ProtocDirectoryArg = "--protoc_dir="; - - private static int Main(string[] args) - { - try - { - return Environment.ExitCode = Run(args); - } - catch (Exception ex) - { - Console.Error.WriteLine(ex); - return Environment.ExitCode = 2; - } - } - - public static int Run(params string[] args) - { - bool deleteFile = false; - string tempFile = null; - int result; - bool doHelp = args.Length == 0; - try - { - List protocArgs = new List(); - List protoGenArgs = new List(); - - string protocFile = GuessProtocFile(args); - - foreach (string arg in args) - { - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "/?"); - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "/help"); - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "-?"); - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "-help"); - - if (arg.StartsWith("--descriptor_set_out=")) - { - tempFile = arg.Substring("--descriptor_set_out=".Length); - protoGenArgs.Add(tempFile); - } - } - - if (doHelp) - { - Console.WriteLine(); - Console.WriteLine("PROTOC.exe: Use any of the following options that begin with '--':"); - Console.WriteLine(); - try - { - RunProtoc(protocFile, "--help"); - } - catch (Exception ex) - { - Console.Error.WriteLine(ex.Message); - } - Console.WriteLine(); - Console.WriteLine(); - Console.WriteLine( - "PROTOGEN.exe: The following options are used to specify defaults for code generation."); - Console.WriteLine(); - Program.Main(new string[0]); - Console.WriteLine(); - Console.WriteLine("The following option enables PROTOGEN.exe to find PROTOC.exe"); - Console.WriteLine("{0}", ProtocDirectoryArg); - return 0; - } - - string pathRoot = Environment.CurrentDirectory; - foreach(string arg in args) - { - if (arg.StartsWith("--proto_path=", StringComparison.InvariantCultureIgnoreCase)) - { - pathRoot = arg.Substring(13); - } - } - - foreach (string arg in args) - { - if (arg.StartsWith(ProtocDirectoryArg)) - { - // Handled earlier - continue; - } - if (arg.StartsWith("--")) - { - protocArgs.Add(arg); - } - else if ((File.Exists(arg) || File.Exists(Path.Combine(pathRoot, arg))) && - StringComparer.OrdinalIgnoreCase.Equals(".proto", Path.GetExtension(arg))) - { - if (tempFile == null) - { - deleteFile = true; - tempFile = Path.GetTempFileName(); - protocArgs.Add(String.Format("--descriptor_set_out={0}", tempFile)); - protoGenArgs.Add(tempFile); - } - string patharg = arg; - if (!File.Exists(patharg)) - { - patharg = Path.Combine(pathRoot, arg); - } - - protocArgs.Add(patharg); - } - else - { - protoGenArgs.Add(arg); - } - } - - if (tempFile != null) - { - result = RunProtoc(protocFile, protocArgs.ToArray()); - if (result != 0) - { - return result; - } - } - - result = Program.Main(protoGenArgs.ToArray()); - } - finally - { - if (deleteFile && tempFile != null && File.Exists(tempFile)) - { - File.Delete(tempFile); - } - } - return result; - } - - /// - /// Tries to work out where protoc is based on command line arguments, the current - /// directory, the directory containing protogen, and the path. - /// - /// The path to protoc.exe, or null if it can't be found. - private static string GuessProtocFile(params string[] args) - { - // Why oh why is this not in System.IO.Path or Environment...? - List searchPath = new List(); - foreach (string arg in args) - { - if (arg.StartsWith("--protoc_dir=")) - { - searchPath.Add(arg.Substring(ProtocDirectoryArg.Length)); - } - } - searchPath.Add(Environment.CurrentDirectory); - searchPath.Add(AppDomain.CurrentDomain.BaseDirectory); - searchPath.AddRange((Environment.GetEnvironmentVariable("PATH") ?? String.Empty).Split(Path.PathSeparator)); - - foreach (string path in searchPath) - { - string exeFile = Path.Combine(path, ProtocExecutable); - if (File.Exists(exeFile)) - { - return exeFile; - } - } - return null; - } - - private static int RunProtoc(string exeFile, params string[] args) - { - if (exeFile == null) - { - throw new FileNotFoundException( - "Unable to locate " + ProtocExecutable + - " make sure it is in the PATH, cwd, or exe dir, or use --protoc_dir=..."); - } - - ProcessStartInfo psi = new ProcessStartInfo(exeFile); - psi.Arguments = EscapeArguments(args); - psi.RedirectStandardError = true; - psi.RedirectStandardInput = false; - psi.RedirectStandardOutput = true; - psi.ErrorDialog = false; - psi.CreateNoWindow = true; - psi.UseShellExecute = false; - psi.WorkingDirectory = Environment.CurrentDirectory; - - Process process = Process.Start(psi); - if (process == null) - { - return 1; - } - - process.WaitForExit(); - - string tmp = process.StandardOutput.ReadToEnd(); - if (tmp.Trim().Length > 0) - { - Console.Out.WriteLine(tmp); - } - tmp = process.StandardError.ReadToEnd(); - if (tmp.Trim().Length > 0) - { - // Replace protoc output with something more amenable to Visual Studio. - var regexMsvs = new Regex(@"(.*)\((\d+)\).* column=(\d+)\s*:\s*(.*)"); - tmp = regexMsvs.Replace(tmp, "$1($2,$3): error CS9999: $4"); - var regexGcc = new Regex(@"(.*):(\d+):(\d+):\s*(.*)"); - tmp = regexGcc.Replace(tmp, "$1($2,$3): error CS9999: $4"); - Console.Error.WriteLine(tmp); - } - return process.ExitCode; - } - - /// - /// Quotes all arguments that contain whitespace, or begin with a quote and returns a single - /// argument string for use with Process.Start(). - /// - /// http://csharptest.net/?p=529 - /// A list of strings for arguments, may not contain null, '\0', '\r', or '\n' - /// The combined list of escaped/quoted strings - /// Raised when one of the arguments is null - /// Raised if an argument contains '\0', '\r', or '\n' - public static string EscapeArguments(params string[] args) - { - StringBuilder arguments = new StringBuilder(); - Regex invalidChar = new Regex("[\x00\x0a\x0d]");// these can not be escaped - Regex needsQuotes = new Regex(@"\s|""");// contains whitespace or two quote characters - Regex escapeQuote = new Regex(@"(\\*)(""|$)");// one or more '\' followed with a quote or end of string - for (int carg = 0; args != null && carg < args.Length; carg++) - { - if (args[carg] == null) - { - throw new ArgumentNullException("args[" + carg + "]"); - } - if (invalidChar.IsMatch(args[carg])) - { - throw new ArgumentOutOfRangeException("args[" + carg + "]"); - } - if (args[carg] == String.Empty) - { - arguments.Append("\"\""); - } - else if (!needsQuotes.IsMatch(args[carg])) { arguments.Append(args[carg]); } - else - { - arguments.Append('"'); - arguments.Append(escapeQuote.Replace(args[carg], - m => - m.Groups[1].Value + m.Groups[1].Value + - (m.Groups[2].Value == "\"" ? "\\\"" : "") - )); - arguments.Append('"'); - } - if (carg + 1 < args.Length) - { - arguments.Append(' '); - } - } - return arguments.ToString(); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/Properties/AssemblyInfo.cs b/csharp/src/ProtoGen/Properties/AssemblyInfo.cs deleted file mode 100644 index 565894f2..00000000 --- a/csharp/src/ProtoGen/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtoGen")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtoGen")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/csharp/src/ProtoGen/ProtoGen.csproj b/csharp/src/ProtoGen/ProtoGen.csproj deleted file mode 100644 index 2de44aec..00000000 --- a/csharp/src/ProtoGen/ProtoGen.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {250ADE34-82FD-4BAE-86D5-985FBE589C4A} - Exe - Properties - Google.ProtocolBuffers.ProtoGen - ProtoGen - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - Google.ProtocolBuffers.ProtoGen.ProgramPreprocess - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtoGen/ProtocGenCs.cs b/csharp/src/ProtoGen/ProtocGenCs.cs deleted file mode 100644 index 29264200..00000000 --- a/csharp/src/ProtoGen/ProtocGenCs.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Google.ProtocolBuffers.Compiler.PluginProto; -using Google.ProtocolBuffers.DescriptorProtos; -using System; -using System.Collections.Generic; - -// Usage example: -// protoc.exe -// --plugin=path\to\protoc-gen-cs.exe -// --cs_out="-generated_code_attributes=true umbrella_namespace=TutorialProto :." -// --proto_path=.\protos\ -// protos\tutorial\addressbook.proto - -namespace Google.ProtocolBuffers.ProtoGen -{ - public static class ProtocGenCs - { - internal static void Run(CodeGeneratorRequest request, CodeGeneratorResponse.Builder response) - { - var arguments = new List(); - foreach (var arg in request.Parameter.Split(' ')) - { - var timmedArg = (arg ?? "").Trim(); - if (!string.IsNullOrEmpty(timmedArg)) - { - arguments.Add(timmedArg); - } - } - // Adding fake input file to make TryValidate happy. - arguments.Add(System.Reflection.Assembly.GetExecutingAssembly().Location); - - GeneratorOptions options = new GeneratorOptions - { - Arguments = arguments - }; - IList validationFailures; - if (!options.TryValidate(out validationFailures)) - { - response.Error += new InvalidOptionsException(validationFailures).Message; - return; - } - - Generator generator = Generator.CreateGenerator(options); - generator.Generate(request, response); - } - - public static int Main(string[] args) - { - // Hack to make sure everything's initialized - DescriptorProtoFile.Descriptor.ToString(); - ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); - CSharpOptions.RegisterAllExtensions(extensionRegistry); - - CodeGeneratorRequest request; - var response = new CodeGeneratorResponse.Builder(); - try - { - using (var input = Console.OpenStandardInput()) - { - request = CodeGeneratorRequest.ParseFrom(input, extensionRegistry); - } - Run(request, response); - } - catch (Exception e) - { - response.Error += e.ToString(); - } - - using (var output = Console.OpenStandardOutput()) - { - response.Build().WriteTo(output); - output.Flush(); - } - return 0; - } - } -} diff --git a/csharp/src/ProtoGen/RepeatedEnumFieldGenerator.cs b/csharp/src/ProtoGen/RepeatedEnumFieldGenerator.cs deleted file mode 100644 index 8c9f17b8..00000000 --- a/csharp/src/ProtoGen/RepeatedEnumFieldGenerator.cs +++ /dev/null @@ -1,212 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class RepeatedEnumFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal RepeatedEnumFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - if (Descriptor.IsPacked && OptimizeSpeed) - { - writer.WriteLine("private int {0}MemoizedSerializedSize;", Name); - } - writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name); - AddDeprecatedFlag(writer); - writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return pbc::Lists.AsReadOnly({0}_); }}", Name); - writer.WriteLine("}"); - - // TODO(jonskeet): Redundant API calls? Possibly - include for portability though. Maybe create an option. - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return {0}_.Count; }}", Name); - writer.WriteLine("}"); - - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return {0}_[index];", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - // Note: We can return the original list here, because we make it unmodifiable when we build - // We return it via IPopsicleList so that collection initializers work more pleasantly. - AddDeprecatedFlag(writer); - writer.WriteLine("public pbc::IPopsicleList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return PrepareBuilder().{0}_; }}", Name); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return result.Get{0}(index);", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(values);", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Clear();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.{0}_.Count != 0) {{", Name); - writer.WriteLine(" result.{0}_.Add(other.{0}_);", Name); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - writer.WriteLine("{0}_.MakeReadOnly();", Name); - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("scg::ICollection unknownItems;"); - writer.WriteLine("input.ReadEnumArray<{0}>(tag, field_name, result.{1}_, out unknownItems);", TypeName, Name); - if (!UseLiteRuntime) - { - writer.WriteLine("if (unknownItems != null) {"); - writer.WriteLine(" if (unknownFields == null) {"); - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - writer.WriteLine(" foreach (object rawValue in unknownItems)"); - writer.WriteLine(" if (rawValue is int)"); - writer.WriteLine(" unknownFields.MergeVarintField({0}, (ulong)(int)rawValue);", Number); - writer.WriteLine("}"); - } - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - if (Descriptor.IsPacked) - { - writer.WriteLine( - "output.WritePackedEnumArray({0}, field_names[{2}], {1}MemoizedSerializedSize, {1}_);", Number, Name, - FieldOrdinal, Descriptor.FieldType); - } - else - { - writer.WriteLine("output.WriteEnumArray({0}, field_names[{2}], {1}_);", Number, Name, FieldOrdinal, - Descriptor.FieldType); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("{"); - writer.Indent(); - writer.WriteLine("int dataSize = 0;"); - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - writer.WriteLine("foreach ({0} element in {1}_) {{", TypeName, Name); - writer.WriteLine(" dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);"); - writer.WriteLine("}"); - writer.WriteLine("size += dataSize;"); - int tagSize = CodedOutputStream.ComputeTagSize(Descriptor.FieldNumber); - if (Descriptor.IsPacked) - { - writer.WriteLine("size += {0};", tagSize); - writer.WriteLine("size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);"); - } - else - { - writer.WriteLine("size += {0} * {1}_.Count;", tagSize, Name); - } - writer.Outdent(); - writer.WriteLine("}"); - // cache the data size for packed fields. - if (Descriptor.IsPacked) - { - writer.WriteLine("{0}MemoizedSerializedSize = dataSize;", Name); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("foreach({0} i in {1}_)", TypeName, Name); - writer.WriteLine(" hash ^= i.GetHashCode();"); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if({0}_.Count != other.{0}_.Count) return false;", Name); - writer.WriteLine("for(int ix=0; ix < {0}_.Count; ix++)", Name); - writer.WriteLine(" if(!{0}_[ix].Equals(other.{0}_[ix])) return false;", Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", {1}_, writer);", Descriptor.Name, Name); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/RepeatedMessageFieldGenerator.cs b/csharp/src/ProtoGen/RepeatedMessageFieldGenerator.cs deleted file mode 100644 index a9a0143c..00000000 --- a/csharp/src/ProtoGen/RepeatedMessageFieldGenerator.cs +++ /dev/null @@ -1,184 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class RepeatedMessageFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal RepeatedMessageFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name); - AddDeprecatedFlag(writer); - writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_; }}", Name); - writer.WriteLine("}"); - - // TODO(jonskeet): Redundant API calls? Possibly - include for portability though. Maybe create an option. - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return {0}_.Count; }}", Name); - writer.WriteLine("}"); - - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return {0}_[index];", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - // Note: We can return the original list here, because we make it unmodifiable when we build - // We return it via IPopsicleList so that collection initializers work more pleasantly. - AddDeprecatedFlag(writer); - writer.WriteLine("public pbc::IPopsicleList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return PrepareBuilder().{0}_; }}", Name); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return result.Get{0}(index);", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - // Extra overload for builder (just on messages) - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}(int index, {1}.Builder builderForValue) {{", PropertyName, TypeName); - AddNullCheck(writer, "builderForValue"); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = builderForValue.Build();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - // Extra overload for builder (just on messages) - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Add{0}({1}.Builder builderForValue) {{", PropertyName, TypeName); - AddNullCheck(writer, "builderForValue"); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(builderForValue.Build());", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(values);", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Clear();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.{0}_.Count != 0) {{", Name); - writer.WriteLine(" result.{0}_.Add(other.{0}_);", Name); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - writer.WriteLine("{0}_.MakeReadOnly();", Name); - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine( - "input.Read{0}Array(tag, field_name, result.{1}_, {2}.DefaultInstance, extensionRegistry);", - MessageOrGroup, Name, TypeName); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - writer.WriteLine("output.Write{0}Array({1}, field_names[{3}], {2}_);", MessageOrGroup, Number, Name, - FieldOrdinal, Descriptor.FieldType); - writer.Outdent(); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("foreach ({0} element in {1}List) {{", TypeName, PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.Compute{0}Size({1}, element);", MessageOrGroup, Number); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("foreach({0} i in {1}_)", TypeName, Name); - writer.WriteLine(" hash ^= i.GetHashCode();"); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if({0}_.Count != other.{0}_.Count) return false;", Name); - writer.WriteLine("for(int ix=0; ix < {0}_.Count; ix++)", Name); - writer.WriteLine(" if(!{0}_[ix].Equals(other.{0}_[ix])) return false;", Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", {1}_, writer);", - Descriptor.FieldType == FieldType.Group ? Descriptor.MessageType.Name : Descriptor.Name, - Name); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs b/csharp/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs deleted file mode 100644 index b795f3b6..00000000 --- a/csharp/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs +++ /dev/null @@ -1,207 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class RepeatedPrimitiveFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal RepeatedPrimitiveFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - if (Descriptor.IsPacked && OptimizeSpeed) - { - writer.WriteLine("private int {0}MemoizedSerializedSize;", Name); - } - writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name); - AddPublicMemberAttributes(writer); - writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return pbc::Lists.AsReadOnly({0}_); }}", Name); - writer.WriteLine("}"); - - // TODO(jonskeet): Redundant API calls? Possibly - include for portability though. Maybe create an option. - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return {0}_.Count; }}", Name); - writer.WriteLine("}"); - - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return {0}_[index];", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - // Note: We can return the original list here, because we make it unmodifiable when we build - // We return it via IPopsicleList so that collection initializers work more pleasantly. - AddPublicMemberAttributes(writer); - writer.WriteLine("public pbc::IPopsicleList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return PrepareBuilder().{0}_; }}", Name); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return result.Get{0}(index);", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(values);", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Clear();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.{0}_.Count != 0) {{", Name); - writer.WriteLine(" result.{0}_.Add(other.{0}_);", Name); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - writer.WriteLine("{0}_.MakeReadOnly();", Name); - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("input.Read{0}Array(tag, field_name, result.{1}_);", CapitalizedTypeName, Name, - Descriptor.FieldType); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - if (Descriptor.IsPacked) - { - writer.WriteLine("output.WritePacked{0}Array({1}, field_names[{3}], {2}MemoizedSerializedSize, {2}_);", - CapitalizedTypeName, Number, Name, FieldOrdinal, Descriptor.FieldType); - } - else - { - writer.WriteLine("output.Write{0}Array({1}, field_names[{3}], {2}_);", CapitalizedTypeName, Number, Name, - FieldOrdinal, Descriptor.FieldType); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("{"); - writer.Indent(); - writer.WriteLine("int dataSize = 0;"); - if (FixedSize == -1) - { - writer.WriteLine("foreach ({0} element in {1}List) {{", TypeName, PropertyName); - writer.WriteLine(" dataSize += pb::CodedOutputStream.Compute{0}SizeNoTag(element);", - CapitalizedTypeName, Number); - writer.WriteLine("}"); - } - else - { - writer.WriteLine("dataSize = {0} * {1}_.Count;", FixedSize, Name); - } - writer.WriteLine("size += dataSize;"); - int tagSize = CodedOutputStream.ComputeTagSize(Descriptor.FieldNumber); - if (Descriptor.IsPacked) - { - writer.WriteLine("if ({0}_.Count != 0) {{", Name); - writer.WriteLine(" size += {0} + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);", tagSize); - writer.WriteLine("}"); - } - else - { - writer.WriteLine("size += {0} * {1}_.Count;", tagSize, Name); - } - // cache the data size for packed fields. - if (Descriptor.IsPacked) - { - writer.WriteLine("{0}MemoizedSerializedSize = dataSize;", Name); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("foreach({0} i in {1}_)", TypeName, Name); - writer.WriteLine(" hash ^= i.GetHashCode();"); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if({0}_.Count != other.{0}_.Count) return false;", Name); - writer.WriteLine("for(int ix=0; ix < {0}_.Count; ix++)", Name); - writer.WriteLine(" if(!{0}_[ix].Equals(other.{0}_[ix])) return false;", Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", {1}_, writer);", Descriptor.Name, Name); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/ServiceGenerator.cs b/csharp/src/ProtoGen/ServiceGenerator.cs deleted file mode 100644 index a6b9eb28..00000000 --- a/csharp/src/ProtoGen/ServiceGenerator.cs +++ /dev/null @@ -1,190 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class GenericServiceGenerator : SourceGeneratorBase, ISourceGenerator - { - private enum RequestOrResponse - { - Request, - Response - } - - internal GenericServiceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public void Generate(TextGenerator writer) - { - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} abstract class {1} : pb::IService {{", ClassAccessLevel, Descriptor.Name); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("{0} abstract void {1}(", ClassAccessLevel, - NameHelpers.UnderscoresToPascalCase(method.Name)); - writer.WriteLine(" pb::IRpcController controller,"); - writer.WriteLine(" {0} request,", GetClassName(method.InputType)); - writer.WriteLine(" global::System.Action<{0}> done);", GetClassName(method.OutputType)); - } - - // Generate Descriptor and DescriptorForType. - writer.WriteLine(); - writer.WriteLine("{0} static pbd::ServiceDescriptor Descriptor {{", ClassAccessLevel); - writer.WriteLine(" get {{ return {0}.Descriptor.Services[{1}]; }}", - DescriptorUtil.GetQualifiedUmbrellaClassName(Descriptor.File.CSharpOptions), - Descriptor.Index); - writer.WriteLine("}"); - writer.WriteLine("public pbd::ServiceDescriptor DescriptorForType {"); - writer.WriteLine(" get { return Descriptor; }"); - writer.WriteLine("}"); - - GenerateCallMethod(writer); - GenerateGetPrototype(RequestOrResponse.Request, writer); - GenerateGetPrototype(RequestOrResponse.Response, writer); - GenerateStub(writer); - - writer.Outdent(); - writer.WriteLine("}"); - } - - private void GenerateCallMethod(TextGenerator writer) - { - writer.WriteLine(); - writer.WriteLine("public void CallMethod("); - writer.WriteLine(" pbd::MethodDescriptor method,"); - writer.WriteLine(" pb::IRpcController controller,"); - writer.WriteLine(" pb::IMessage request,"); - writer.WriteLine(" global::System.Action done) {"); - writer.Indent(); - writer.WriteLine("if (method.Service != Descriptor) {"); - writer.WriteLine(" throw new global::System.ArgumentException("); - writer.WriteLine(" \"Service.CallMethod() given method descriptor for wrong service type.\");"); - writer.WriteLine("}"); - writer.WriteLine("switch(method.Index) {"); - writer.Indent(); - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("case {0}:", method.Index); - writer.WriteLine(" this.{0}(controller, ({1}) request,", - NameHelpers.UnderscoresToPascalCase(method.Name), GetClassName(method.InputType)); - writer.WriteLine(" pb::RpcUtil.SpecializeCallback<{0}>(", GetClassName(method.OutputType)); - writer.WriteLine(" done));"); - writer.WriteLine(" return;"); - } - writer.WriteLine("default:"); - writer.WriteLine(" throw new global::System.InvalidOperationException(\"Can't get here.\");"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateGetPrototype(RequestOrResponse which, TextGenerator writer) - { - writer.WriteLine("public pb::IMessage Get{0}Prototype(pbd::MethodDescriptor method) {{", which); - writer.Indent(); - writer.WriteLine("if (method.Service != Descriptor) {"); - writer.WriteLine(" throw new global::System.ArgumentException("); - writer.WriteLine(" \"Service.Get{0}Prototype() given method descriptor for wrong service type.\");", - which); - writer.WriteLine("}"); - writer.WriteLine("switch(method.Index) {"); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("case {0}:", method.Index); - writer.WriteLine(" return {0}.DefaultInstance;", - GetClassName(which == RequestOrResponse.Request ? method.InputType : method.OutputType)); - } - writer.WriteLine("default:"); - writer.WriteLine(" throw new global::System.InvalidOperationException(\"Can't get here.\");"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateStub(TextGenerator writer) - { - writer.WriteLine("public static Stub CreateStub(pb::IRpcChannel channel) {"); - writer.WriteLine(" return new Stub(channel);"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} class Stub : {1} {{", ClassAccessLevel, GetClassName(Descriptor)); - writer.Indent(); - writer.WriteLine("internal Stub(pb::IRpcChannel channel) {"); - writer.WriteLine(" this.channel = channel;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("private readonly pb::IRpcChannel channel;"); - writer.WriteLine(); - writer.WriteLine("public pb::IRpcChannel Channel {"); - writer.WriteLine(" get { return channel; }"); - writer.WriteLine("}"); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine(); - writer.WriteLine("{0} override void {1}(", ClassAccessLevel, - NameHelpers.UnderscoresToPascalCase(method.Name)); - writer.WriteLine(" pb::IRpcController controller,"); - writer.WriteLine(" {0} request,", GetClassName(method.InputType)); - writer.WriteLine(" global::System.Action<{0}> done) {{", GetClassName(method.OutputType)); - writer.Indent(); - writer.WriteLine("channel.CallMethod(Descriptor.Methods[{0}],", method.Index); - writer.WriteLine(" controller, request, {0}.DefaultInstance,", GetClassName(method.OutputType)); - writer.WriteLine(" pb::RpcUtil.GeneralizeCallback<{0}, {0}.Builder>(done, {0}.DefaultInstance));", - GetClassName(method.OutputType)); - writer.Outdent(); - writer.WriteLine("}"); - } - writer.Outdent(); - writer.WriteLine("}"); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/ServiceInterfaceGenerator.cs b/csharp/src/ProtoGen/ServiceInterfaceGenerator.cs deleted file mode 100644 index 11e3d3d0..00000000 --- a/csharp/src/ProtoGen/ServiceInterfaceGenerator.cs +++ /dev/null @@ -1,300 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class ServiceGenerator : SourceGeneratorBase, ISourceGenerator - { - private readonly CSharpServiceType svcType; - private ISourceGenerator _generator; - - internal ServiceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - svcType = descriptor.File.CSharpOptions.ServiceGeneratorType; - switch (svcType) - { - case CSharpServiceType.NONE: - _generator = new NoServicesGenerator(descriptor); - break; - case CSharpServiceType.GENERIC: - _generator = new GenericServiceGenerator(descriptor); - break; - case CSharpServiceType.INTERFACE: - _generator = new ServiceInterfaceGenerator(descriptor); - break; - case CSharpServiceType.IRPCDISPATCH: - _generator = new RpcServiceGenerator(descriptor); - break; - default: - throw new ApplicationException("Unknown ServiceGeneratorType = " + svcType.ToString()); - } - } - - public void Generate(TextGenerator writer) - { - _generator.Generate(writer); - } - - private class NoServicesGenerator : SourceGeneratorBase, ISourceGenerator - { - public NoServicesGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public virtual void Generate(TextGenerator writer) - { - writer.WriteLine("/*"); - writer.WriteLine("* Service generation is now disabled by default, use the following option to enable:"); - writer.WriteLine("* option (google.protobuf.csharp_file_options).service_generator_type = GENERIC;"); - writer.WriteLine("*/"); - } - } - - private class ServiceInterfaceGenerator : SourceGeneratorBase, ISourceGenerator - { - public ServiceInterfaceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public virtual void Generate(TextGenerator writer) - { - CSharpServiceOptions options = Descriptor.Options.GetExtension(CSharpOptions.CsharpServiceOptions); - if (options != null && options.HasInterfaceId) - { - writer.WriteLine("[global::System.Runtime.InteropServices.GuidAttribute(\"{0}\")]", - new Guid(options.InterfaceId)); - } - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} partial interface I{1} {{", ClassAccessLevel, Descriptor.Name); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - CSharpMethodOptions mth = method.Options.GetExtension(CSharpOptions.CsharpMethodOptions); - if (mth.HasDispatchId) - { - writer.WriteLine("[global::System.Runtime.InteropServices.DispId({0})]", mth.DispatchId); - } - writer.WriteLine("{0} {1}({2} {3});", GetClassName(method.OutputType), - NameHelpers.UnderscoresToPascalCase(method.Name), GetClassName(method.InputType), - NameHelpers.UnderscoresToCamelCase(method.InputType.Name)); - } - - writer.Outdent(); - writer.WriteLine("}"); - } - } - - private class RpcServiceGenerator : ServiceInterfaceGenerator - { - public RpcServiceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public override void Generate(TextGenerator writer) - { - base.Generate(writer); - - writer.WriteLine(); - - // CLIENT Proxy - { - if (Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} partial class {1} : I{1}, pb::IRpcDispatch, global::System.IDisposable {{", - ClassAccessLevel, Descriptor.Name); - writer.Indent(); - writer.WriteLine("private readonly bool dispose;"); - writer.WriteLine("private readonly pb::IRpcDispatch dispatch;"); - - writer.WriteLine("public {0}(pb::IRpcDispatch dispatch) : this(dispatch, true) {{", Descriptor.Name); - writer.WriteLine("}"); - writer.WriteLine("public {0}(pb::IRpcDispatch dispatch, bool dispose) {{", Descriptor.Name); - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, \"dispatch\");"); - writer.WriteLine(" this.dispose = dispose && dispatch is global::System.IDisposable;"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public void Dispose() {"); - writer.WriteLine(" if (dispose) ((global::System.IDisposable)dispatch).Dispose();"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine( - "TMessage pb::IRpcDispatch.CallMethod(string method, pb::IMessageLite request, pb::IBuilderLite response) {"); - writer.WriteLine(" return dispatch.CallMethod(method, request, response);"); - writer.WriteLine("}"); - writer.WriteLine(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("public {0} {1}({2} {3}) {{", GetClassName(method.OutputType), - NameHelpers.UnderscoresToPascalCase(method.Name), - GetClassName(method.InputType), - NameHelpers.UnderscoresToCamelCase(method.InputType.Name)); - writer.WriteLine(" return dispatch.CallMethod(\"{0}\", {1}, {2}.CreateBuilder());", - method.Name, - NameHelpers.UnderscoresToCamelCase(method.InputType.Name), - GetClassName(method.OutputType) - ); - writer.WriteLine("}"); - writer.WriteLine(); - } - } - // SERVER - DISPATCH - { - if (Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("public partial class Dispatch : pb::IRpcDispatch, global::System.IDisposable {"); - writer.Indent(); - writer.WriteLine("private readonly bool dispose;"); - writer.WriteLine("private readonly I{0} implementation;", Descriptor.Name); - - writer.WriteLine("public Dispatch(I{0} implementation) : this(implementation, true) {{", - Descriptor.Name); - writer.WriteLine("}"); - writer.WriteLine("public Dispatch(I{0} implementation, bool dispose) {{", Descriptor.Name); - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");"); - writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public void Dispose() {"); - writer.WriteLine(" if (dispose) ((global::System.IDisposable)implementation).Dispose();"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine( - "public TMessage CallMethod(string methodName, pb::IMessageLite request, pb::IBuilderLite response)"); - writer.WriteLine(" where TMessage : pb::IMessageLite"); - writer.WriteLine(" where TBuilder : pb::IBuilderLite {"); - writer.Indent(); - writer.WriteLine("switch(methodName) {"); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine( - "case \"{0}\": return response.MergeFrom(implementation.{1}(({2})request)).Build();", - method.Name, NameHelpers.UnderscoresToPascalCase(method.Name), - GetClassName(method.InputType)); - } - writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name); - writer.Outdent(); - writer.WriteLine("}"); //end switch - writer.Outdent(); - writer.WriteLine("}"); //end invoke - writer.Outdent(); - writer.WriteLine("}"); //end server - } - // SERVER - STUB - { - if (Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine( - "public partial class ServerStub : pb::IRpcServerStub, global::System.IDisposable {"); - writer.Indent(); - writer.WriteLine("private readonly bool dispose;"); - writer.WriteLine("private readonly pb::IRpcDispatch implementation;", Descriptor.Name); - - writer.WriteLine("public ServerStub(I{0} implementation) : this(implementation, true) {{", - Descriptor.Name); - writer.WriteLine("}"); - writer.WriteLine( - "public ServerStub(I{0} implementation, bool dispose) : this(new Dispatch(implementation, dispose), dispose) {{", - Descriptor.Name); - writer.WriteLine("}"); - - writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) {"); - writer.WriteLine("}"); - writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation, bool dispose) {"); - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");"); - writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public void Dispose() {"); - writer.WriteLine(" if (dispose) ((global::System.IDisposable)implementation).Dispose();"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine( - "public pb::IMessageLite CallMethod(string methodName, pb::ICodedInputStream input, pb::ExtensionRegistry registry) {{", - Descriptor.Name); - writer.Indent(); - writer.WriteLine("switch(methodName) {"); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine( - "case \"{0}\": return implementation.CallMethod(methodName, {1}.ParseFrom(input, registry), {2}.CreateBuilder());", - method.Name, GetClassName(method.InputType), GetClassName(method.OutputType)); - } - writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name); - writer.Outdent(); - writer.WriteLine("}"); //end switch - writer.Outdent(); - writer.WriteLine("}"); //end invoke - writer.Outdent(); - writer.WriteLine("}"); //end server - } - - writer.Outdent(); - writer.WriteLine("}"); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/SourceGeneratorBase.cs b/csharp/src/ProtoGen/SourceGeneratorBase.cs deleted file mode 100644 index 535c6f73..00000000 --- a/csharp/src/ProtoGen/SourceGeneratorBase.cs +++ /dev/null @@ -1,167 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal abstract class SourceGeneratorBase where T : IDescriptor - { - private readonly T descriptor; - - protected readonly bool OptimizeSpeed; - protected readonly bool OptimizeSize; - protected readonly bool UseLiteRuntime; - protected readonly string RuntimeSuffix; - - protected SourceGeneratorBase(T descriptor) - { - this.descriptor = descriptor; - - OptimizeSize = descriptor.File.Options.OptimizeFor == - FileOptions.Types.OptimizeMode.CODE_SIZE; - OptimizeSpeed = descriptor.File.Options.OptimizeFor == - FileOptions.Types.OptimizeMode.SPEED; - UseLiteRuntime = descriptor.File.Options.OptimizeFor == - FileOptions.Types.OptimizeMode.LITE_RUNTIME; - //Lite runtime uses OptimizeSpeed code branches - OptimizeSpeed |= UseLiteRuntime; - RuntimeSuffix = UseLiteRuntime ? "Lite" : ""; - } - - protected T Descriptor - { - get { return descriptor; } - } - - internal static string GetClassName(IDescriptor descriptor) - { - return ToCSharpName(descriptor.FullName, descriptor.File); - } - - // Groups are hacky: The name of the field is just the lower-cased name - // of the group type. In C#, though, we would like to retain the original - // capitalization of the type name. - internal static string GetFieldName(FieldDescriptor descriptor) - { - if (descriptor.FieldType == FieldType.Group) - { - return descriptor.MessageType.Name; - } - else - { - return descriptor.Name; - } - } - - internal static string GetFieldConstantName(FieldDescriptor field) - { - return field.CSharpOptions.PropertyName + "FieldNumber"; - } - - private static string ToCSharpName(string name, FileDescriptor file) - { - string result = file.CSharpOptions.Namespace; - if (file.CSharpOptions.NestClasses) - { - if (result != "") - { - result += "."; - } - result += file.CSharpOptions.UmbrellaClassname; - } - if (result != "") - { - result += '.'; - } - string classname; - if (file.Package == "") - { - classname = name; - } - else - { - // Strip the proto package from full_name since we've replaced it with - // the C# namespace. - classname = name.Substring(file.Package.Length + 1); - } - result += classname.Replace(".", ".Types."); - return "global::" + result; - } - - protected string ClassAccessLevel - { - get { return descriptor.File.CSharpOptions.PublicClasses ? "public" : "internal"; } - } - - protected void WriteGeneratedCodeAttributes(TextGenerator writer) - { - if (descriptor.File.CSharpOptions.GeneratedCodeAttributes) - { - writer.WriteLine("[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]"); - writer.WriteLine("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{0}\", \"{1}\")]", - GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version); - } - } - - protected void WriteChildren(TextGenerator writer, string region, IEnumerable children) - where TChild : IDescriptor - { - // Copy the set of children; makes access easier - List copy = new List(children); - if (copy.Count == 0) - { - return; - } - - if (region != null) - { - writer.WriteLine("#region {0}", region); - } - foreach (TChild child in children) - { - SourceGenerators.CreateGenerator(child).Generate(writer); - } - if (region != null) - { - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/SourceGenerators.cs b/csharp/src/ProtoGen/SourceGenerators.cs deleted file mode 100644 index 38458f05..00000000 --- a/csharp/src/ProtoGen/SourceGenerators.cs +++ /dev/null @@ -1,87 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - public delegate TResult Func(T arg); - - internal static class SourceGenerators - { - private static readonly Dictionary> GeneratorFactories = - new Dictionary> - { - {typeof(FileDescriptor), descriptor => new UmbrellaClassGenerator((FileDescriptor) descriptor)}, - {typeof(EnumDescriptor), descriptor => new EnumGenerator((EnumDescriptor) descriptor)}, - {typeof(ServiceDescriptor), descriptor => new ServiceGenerator((ServiceDescriptor) descriptor)}, - {typeof(MessageDescriptor), descriptor => new MessageGenerator((MessageDescriptor) descriptor)}, - // For other fields, we have IFieldSourceGenerators. - {typeof(FieldDescriptor), descriptor => new ExtensionGenerator((FieldDescriptor) descriptor)} - }; - - public static IFieldSourceGenerator CreateFieldGenerator(FieldDescriptor field, int fieldOrdinal) - { - switch (field.MappedType) - { - case MappedType.Message: - return field.IsRepeated - ? (IFieldSourceGenerator) new RepeatedMessageFieldGenerator(field, fieldOrdinal) - : new MessageFieldGenerator(field, fieldOrdinal); - case MappedType.Enum: - return field.IsRepeated - ? (IFieldSourceGenerator) new RepeatedEnumFieldGenerator(field, fieldOrdinal) - : new EnumFieldGenerator(field, fieldOrdinal); - default: - return field.IsRepeated - ? (IFieldSourceGenerator) new RepeatedPrimitiveFieldGenerator(field, fieldOrdinal) - : new PrimitiveFieldGenerator(field, fieldOrdinal); - } - } - - public static ISourceGenerator CreateGenerator(T descriptor) where T : IDescriptor - { - Func factory; - if (!GeneratorFactories.TryGetValue(typeof(T), out factory)) - { - throw new ArgumentException("No generator registered for " + typeof(T).Name); - } - return factory(descriptor); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/UmbrellaClassGenerator.cs b/csharp/src/ProtoGen/UmbrellaClassGenerator.cs deleted file mode 100644 index d83b2dbd..00000000 --- a/csharp/src/ProtoGen/UmbrellaClassGenerator.cs +++ /dev/null @@ -1,294 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Generator for the class describing the .proto file in general, - /// containing things like the message descriptor. - /// - internal sealed class UmbrellaClassGenerator : SourceGeneratorBase, ISourceGenerator - { - internal UmbrellaClassGenerator(FileDescriptor descriptor) - : base(descriptor) - { - } - - // Recursively searches the given message to see if it contains any extensions. - private static bool UsesExtensions(IMessage message) - { - // We conservatively assume that unknown fields are extensions. - if (message.UnknownFields.FieldDictionary.Count > 0) - { - return true; - } - - foreach (KeyValuePair keyValue in message.AllFields) - { - FieldDescriptor field = keyValue.Key; - if (field.IsExtension) - { - return true; - } - if (field.MappedType == MappedType.Message) - { - if (field.IsRepeated) - { - foreach (IMessage subMessage in (IEnumerable) keyValue.Value) - { - if (UsesExtensions(subMessage)) - { - return true; - } - } - } - else - { - if (UsesExtensions((IMessage) keyValue.Value)) - { - return true; - } - } - } - } - return false; - } - - public void Generate(TextGenerator writer) - { - WriteIntroduction(writer); - WriteExtensionRegistration(writer); - WriteChildren(writer, "Extensions", Descriptor.Extensions); - writer.WriteLine("#region Static variables"); - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateStaticVariables(writer); - } - writer.WriteLine("#endregion"); - if (!UseLiteRuntime) - { - WriteDescriptor(writer); - } - else - { - WriteLiteExtensions(writer); - } - // The class declaration either gets closed before or after the children are written. - if (!Descriptor.CSharpOptions.NestClasses) - { - writer.Outdent(); - writer.WriteLine("}"); - - // Close the namespace around the umbrella class if defined - if (!Descriptor.CSharpOptions.NestClasses && Descriptor.CSharpOptions.UmbrellaNamespace != "") - { - writer.Outdent(); - writer.WriteLine("}"); - } - } - WriteChildren(writer, "Enums", Descriptor.EnumTypes); - WriteChildren(writer, "Messages", Descriptor.MessageTypes); - WriteChildren(writer, "Services", Descriptor.Services); - if (Descriptor.CSharpOptions.NestClasses) - { - writer.Outdent(); - writer.WriteLine("}"); - } - if (Descriptor.CSharpOptions.Namespace != "") - { - writer.Outdent(); - writer.WriteLine("}"); - } - writer.WriteLine(); - writer.WriteLine("#endregion Designer generated code"); - } - - private void WriteIntroduction(TextGenerator writer) - { - writer.WriteLine("// Generated by {0}. DO NOT EDIT!", this.GetType().Assembly.FullName); - writer.WriteLine("#pragma warning disable 1591, 0612, 3021"); - writer.WriteLine("#region Designer generated code"); - - writer.WriteLine(); - writer.WriteLine("using pb = global::Google.ProtocolBuffers;"); - writer.WriteLine("using pbc = global::Google.ProtocolBuffers.Collections;"); - writer.WriteLine("using pbd = global::Google.ProtocolBuffers.Descriptors;"); - writer.WriteLine("using scg = global::System.Collections.Generic;"); - - if (Descriptor.CSharpOptions.Namespace != "") - { - writer.WriteLine("namespace {0} {{", Descriptor.CSharpOptions.Namespace); - writer.Indent(); - writer.WriteLine(); - } - // Add the namespace around the umbrella class if defined - if (!Descriptor.CSharpOptions.NestClasses && Descriptor.CSharpOptions.UmbrellaNamespace != "") - { - writer.WriteLine("namespace {0} {{", Descriptor.CSharpOptions.UmbrellaNamespace); - writer.Indent(); - writer.WriteLine(); - } - - if (Descriptor.CSharpOptions.CodeContracts) - { - writer.WriteLine("[global::System.Diagnostics.Contracts.ContractVerificationAttribute(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} static partial class {1} {{", ClassAccessLevel, - Descriptor.CSharpOptions.UmbrellaClassname); - writer.WriteLine(); - writer.Indent(); - } - - private void WriteExtensionRegistration(TextGenerator writer) - { - writer.WriteLine("#region Extension registration"); - writer.WriteLine("public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {"); - writer.Indent(); - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateExtensionRegistrationCode(writer); - } - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateExtensionRegistrationCode(writer); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - } - - private void WriteDescriptor(TextGenerator writer) - { - writer.WriteLine("#region Descriptor"); - - writer.WriteLine("public static pbd::FileDescriptor Descriptor {"); - writer.WriteLine(" get { return descriptor; }"); - writer.WriteLine("}"); - writer.WriteLine("private static pbd::FileDescriptor descriptor;"); - writer.WriteLine(); - writer.WriteLine("static {0}() {{", Descriptor.CSharpOptions.UmbrellaClassname); - writer.Indent(); - writer.WriteLine("byte[] descriptorData = global::System.Convert.FromBase64String("); - writer.Indent(); - writer.Indent(); - writer.WriteLine("string.Concat("); - writer.Indent(); - // TODO(jonskeet): Consider a C#-escaping format here instead of just Base64. - byte[] bytes = Descriptor.Proto.ToByteArray(); - string base64 = Convert.ToBase64String(bytes); - - while (base64.Length > 60) - { - writer.WriteLine("\"{0}\", ", base64.Substring(0, 60)); - base64 = base64.Substring(60); - } - writer.Outdent(); - writer.WriteLine("\"{0}\"));", base64); - writer.Outdent(); - writer.Outdent(); - writer.WriteLine( - "pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {"); - writer.Indent(); - writer.WriteLine("descriptor = root;"); - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateStaticVariableInitializers(writer); - } - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateStaticVariableInitializers(writer); - } - - if (UsesExtensions(Descriptor.Proto)) - { - // Must construct an ExtensionRegistry containing all possible extensions - // and return it. - writer.WriteLine("pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();"); - writer.WriteLine("RegisterAllExtensions(registry);"); - foreach (FileDescriptor dependency in Descriptor.Dependencies) - { - writer.WriteLine("{0}.RegisterAllExtensions(registry);", - DescriptorUtil.GetFullUmbrellaClassName(dependency)); - } - writer.WriteLine("return registry;"); - } - else - { - writer.WriteLine("return null;"); - } - writer.Outdent(); - writer.WriteLine("};"); - - // ----------------------------------------------------------------- - // Invoke internalBuildGeneratedFileFrom() to build the file. - writer.WriteLine("pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,"); - writer.WriteLine(" new pbd::FileDescriptor[] {"); - foreach (FileDescriptor dependency in Descriptor.Dependencies) - { - writer.WriteLine(" {0}.Descriptor, ", DescriptorUtil.GetFullUmbrellaClassName(dependency)); - } - writer.WriteLine(" }, assigner);"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - - private void WriteLiteExtensions(TextGenerator writer) - { - writer.WriteLine("#region Extensions"); - writer.WriteLine("internal static readonly object Descriptor;"); - writer.WriteLine("static {0}() {{", Descriptor.CSharpOptions.UmbrellaClassname); - writer.Indent(); - writer.WriteLine("Descriptor = null;"); - - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateStaticVariableInitializers(writer); - } - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateStaticVariableInitializers(writer); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtoGen/app.config b/csharp/src/ProtoGen/app.config deleted file mode 100644 index 89b324bf..00000000 --- a/csharp/src/ProtoGen/app.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtoGen/protoc-gen-cs.csproj b/csharp/src/ProtoGen/protoc-gen-cs.csproj deleted file mode 100644 index fdc88cc2..00000000 --- a/csharp/src/ProtoGen/protoc-gen-cs.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {250ADE34-82FD-4BAE-86D5-985FBE589C4B} - Exe - Properties - Google.ProtocolBuffers.ProtoGen - protoc-gen-cs - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - Google.ProtocolBuffers.ProtoGen.ProtocGenCs - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391af-449c-4a39-986c-ad7f270f4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.CF20.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.CF20.csproj deleted file mode 100644 index bfadf166..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.CF20.csproj +++ /dev/null @@ -1,166 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.CF35.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.CF35.csproj deleted file mode 100644 index 72e35c17..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.CF35.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.NET20.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.NET20.csproj deleted file mode 100644 index 9bba7285..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.NET20.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.NET35.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.NET35.csproj deleted file mode 100644 index 6a79d921..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.NET35.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.NET40.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.NET40.csproj deleted file mode 100644 index 7495778e..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.NET40.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.PL40.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.PL40.csproj deleted file mode 100644 index 00ffddb8..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.PL40.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.SL20.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.SL20.csproj deleted file mode 100644 index 10fc8283..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.SL20.csproj +++ /dev/null @@ -1,169 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.SL30.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.SL30.csproj deleted file mode 100644 index 4fe571ca..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.SL30.csproj +++ /dev/null @@ -1,170 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.SL40.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.SL40.csproj deleted file mode 100644 index 3664e473..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.SL40.csproj +++ /dev/null @@ -1,171 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF20.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF20.csproj deleted file mode 100644 index 6cf373f2..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF20.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF35.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF35.csproj deleted file mode 100644 index dad00719..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF35.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET20.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET20.csproj deleted file mode 100644 index d5167768..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET20.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET35.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET35.csproj deleted file mode 100644 index d811fb58..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET35.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET40.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET40.csproj deleted file mode 100644 index ad3abc6c..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET40.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.PL40.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.PL40.csproj deleted file mode 100644 index 67f9093e..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.PL40.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL20.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL20.csproj deleted file mode 100644 index 1bbad180..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL20.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL30.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL30.csproj deleted file mode 100644 index ab0e809b..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL30.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL40.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL40.csproj deleted file mode 100644 index 42e5be18..00000000 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL40.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLibrary.CF20.sln b/csharp/src/ProtocolBuffersLibrary.CF20.sln deleted file mode 100644 index 7f1836fe..00000000 --- a/csharp/src/ProtocolBuffersLibrary.CF20.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.CF20.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.CF20.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.CF20.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.CF20.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.CF20.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.CF20.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.CF20.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.CF35.sln b/csharp/src/ProtocolBuffersLibrary.CF35.sln deleted file mode 100644 index d83e22c1..00000000 --- a/csharp/src/ProtocolBuffersLibrary.CF35.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.CF35.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.CF35.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.CF35.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.CF35.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.CF35.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.CF35.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.CF35.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.NET20.sln b/csharp/src/ProtocolBuffersLibrary.NET20.sln deleted file mode 100644 index 2de8ed21..00000000 --- a/csharp/src/ProtocolBuffersLibrary.NET20.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.NET20.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.NET20.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.NET20.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.NET20.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.NET20.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.NET20.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.NET20.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.NET35.sln b/csharp/src/ProtocolBuffersLibrary.NET35.sln deleted file mode 100644 index 639ab170..00000000 --- a/csharp/src/ProtocolBuffersLibrary.NET35.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.NET35.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.NET35.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.NET35.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.NET35.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.NET35.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.NET35.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.NET35.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.NET40.sln b/csharp/src/ProtocolBuffersLibrary.NET40.sln deleted file mode 100644 index 84926456..00000000 --- a/csharp/src/ProtocolBuffersLibrary.NET40.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.NET40.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.NET40.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.NET40.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.NET40.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.NET40.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.NET40.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.NET40.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.PL40.sln b/csharp/src/ProtocolBuffersLibrary.PL40.sln deleted file mode 100644 index aca83c2e..00000000 --- a/csharp/src/ProtocolBuffersLibrary.PL40.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.PL40.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.PL40.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.PL40.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.PL40.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.PL40.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.PL40.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.PL40.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.SL20.sln b/csharp/src/ProtocolBuffersLibrary.SL20.sln deleted file mode 100644 index bba4adad..00000000 --- a/csharp/src/ProtocolBuffersLibrary.SL20.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.SL20.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.SL20.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.SL20.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.SL20.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.SL20.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.SL20.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.SL20.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.SL30.sln b/csharp/src/ProtocolBuffersLibrary.SL30.sln deleted file mode 100644 index 080c22ea..00000000 --- a/csharp/src/ProtocolBuffersLibrary.SL30.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.SL30.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.SL30.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.SL30.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.SL30.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.SL30.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.SL30.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.SL30.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.SL40.sln b/csharp/src/ProtocolBuffersLibrary.SL40.sln deleted file mode 100644 index 01ea5748..00000000 --- a/csharp/src/ProtocolBuffersLibrary.SL40.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.SL40.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.SL40.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.SL40.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.SL40.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.SL40.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.SL40.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.SL40.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/csharp/src/UseVS2008.bat b/csharp/src/UseVS2008.bat deleted file mode 100644 index 4cf97381..00000000 --- a/csharp/src/UseVS2008.bat +++ /dev/null @@ -1,8 +0,0 @@ -@ECHO OFF -REM ---- Converts the solution to Visual Studio 2008 ---- -PUSHD %~dp0 -ECHO Microsoft Visual Studio Solution File, Format Version 10.00> Temp.sln -ECHO # Visual Studio 2008>> Temp.sln -type ProtocolBuffers.sln | FIND /V " Visual Studio " >> Temp.sln -move /Y Temp.sln ProtocolBuffers.sln -POPD diff --git a/csharp/src/UseVS2010.bat b/csharp/src/UseVS2010.bat deleted file mode 100644 index 376a08f7..00000000 --- a/csharp/src/UseVS2010.bat +++ /dev/null @@ -1,8 +0,0 @@ -@ECHO OFF -REM ---- Converts the solution to Visual Studio 2010 ---- -PUSHD %~dp0 -ECHO Microsoft Visual Studio Solution File, Format Version 11.00> Temp.sln -ECHO # Visual Studio 2010>> Temp.sln -type ProtocolBuffers.sln | FIND /V " Visual Studio " >> Temp.sln -move /Y Temp.sln ProtocolBuffers.sln -POPD -- cgit v1.2.3 From cc058e1118d35c8b2fd2298841c40f9303e6ce09 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 08:55:07 +0100 Subject: Remove RPC support. It is expected that third parties will generate service/RPC code themselves - see gRPC as an example. --- .../protos/extest/unittest_generic_services.proto | 30 ----- csharp/protos/extest/unittest_rpc_interop.proto | 41 ------- .../protos/extest/unittest_rpc_interop_lite.proto | 42 ------- .../ProtocolBuffers.Serialization/Extensions.cs | 28 ----- csharp/src/ProtocolBuffers/IRpcChannel.cs | 63 ----------- csharp/src/ProtocolBuffers/IRpcController.cs | 125 --------------------- csharp/src/ProtocolBuffers/IRpcDispatch.cs | 78 ------------- csharp/src/ProtocolBuffers/IService.cs | 102 ----------------- csharp/src/ProtocolBuffers/ProtocolBuffers.csproj | 5 - .../src/ProtocolBuffers/ProtocolBuffersLite.csproj | 1 - csharp/src/ProtocolBuffers/RpcUtil.cs | 79 ------------- 11 files changed, 594 deletions(-) delete mode 100644 csharp/protos/extest/unittest_generic_services.proto delete mode 100644 csharp/protos/extest/unittest_rpc_interop.proto delete mode 100644 csharp/protos/extest/unittest_rpc_interop_lite.proto delete mode 100644 csharp/src/ProtocolBuffers/IRpcChannel.cs delete mode 100644 csharp/src/ProtocolBuffers/IRpcController.cs delete mode 100644 csharp/src/ProtocolBuffers/IRpcDispatch.cs delete mode 100644 csharp/src/ProtocolBuffers/IService.cs delete mode 100644 csharp/src/ProtocolBuffers/RpcUtil.cs (limited to 'csharp/src') diff --git a/csharp/protos/extest/unittest_generic_services.proto b/csharp/protos/extest/unittest_generic_services.proto deleted file mode 100644 index 4e68ff0f..00000000 --- a/csharp/protos/extest/unittest_generic_services.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto2"; - -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/unittest.proto"; -import "google/protobuf/unittest_custom_options.proto"; - -option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; - -// option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - -option optimize_for = SPEED; - -service TestGenericService { - rpc Foo(FooRequest) returns (FooResponse); - rpc Bar(BarRequest) returns (BarResponse); -} - -service TestGenericServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - diff --git a/csharp/protos/extest/unittest_rpc_interop.proto b/csharp/protos/extest/unittest_rpc_interop.proto deleted file mode 100644 index dec5b872..00000000 --- a/csharp/protos/extest/unittest_rpc_interop.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestRpcInterop"; - -option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH; - -option optimize_for = SPEED; - -message SearchRequest { - repeated string Criteria = 1; -} - -message SearchResponse { - message ResultItem { - required string url = 1; - optional string name = 2; - } - - repeated ResultItem results = 1; -} - -message RefineSearchRequest { - repeated string Criteria = 1; - required SearchResponse previous_results = 2; -} - -service SearchService { - /* - Add this option to specify the GuidAttribute on the service interface - option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}"; - */ - rpc Search (SearchRequest) returns (SearchResponse) - /* - Add this option to specify the DispIdAttribute on the service interface - { option (google.protobuf.csharp_method_options).dispatch_id = 5; } - */ ; - - rpc RefineSearch (RefineSearchRequest) returns (SearchResponse); -} diff --git a/csharp/protos/extest/unittest_rpc_interop_lite.proto b/csharp/protos/extest/unittest_rpc_interop_lite.proto deleted file mode 100644 index 62d1c6a6..00000000 --- a/csharp/protos/extest/unittest_rpc_interop_lite.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestRpcInteropLite"; - -option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH; - -option optimize_for = LITE_RUNTIME; -package unittest_rpc_interop_lite; - -message SearchRequest { - repeated string Criteria = 1; -} - -message SearchResponse { - message ResultItem { - required string url = 1; - optional string name = 2; - } - - repeated ResultItem results = 1; -} - -message RefineSearchRequest { - repeated string Criteria = 1; - required SearchResponse previous_results = 2; -} - -service SearchService { - /* - Add this option to specify the GuidAttribute on the service interface - option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}"; - */ - rpc Search (SearchRequest) returns (SearchResponse) - /* - Add this option to specify the DispIdAttribute on the service interface - { option (google.protobuf.csharp_method_options).dispatch_id = 5; } - */ ; - - rpc RefineSearch (RefineSearchRequest) returns (SearchResponse); -} diff --git a/csharp/src/ProtocolBuffers.Serialization/Extensions.cs b/csharp/src/ProtocolBuffers.Serialization/Extensions.cs index 8aef0a9e..63ac98d8 100644 --- a/csharp/src/ProtocolBuffers.Serialization/Extensions.cs +++ b/csharp/src/ProtocolBuffers.Serialization/Extensions.cs @@ -180,34 +180,6 @@ namespace Google.ProtocolBuffers return builder; } - #endregion - #region IRpcServerStub Extensions - - /// - /// Used to implement a service endpoint on an HTTP server. This works with services generated with the - /// service_generator_type option set to IRPCDISPATCH. - /// - /// The service execution stub - /// The name of the method being invoked - /// optional arguments for the format reader/writer - /// The mime type for the input stream - /// The input stream - /// The mime type for the output stream - /// The output stream - public static void HttpCallMethod( -#if !NOEXTENSIONS - this -#endif - IRpcServerStub stub, string methodName, MessageFormatOptions options, - string contentType, Stream input, string responseType, Stream output) - { - ICodedInputStream codedInput = MessageFormatFactory.CreateInputStream(options, contentType, input); - codedInput.ReadMessageStart(); - IMessageLite response = stub.CallMethod(methodName, codedInput, options.ExtensionRegistry); - codedInput.ReadMessageEnd(); - WriteTo(response, options, responseType, output); - } - #endregion } } diff --git a/csharp/src/ProtocolBuffers/IRpcChannel.cs b/csharp/src/ProtocolBuffers/IRpcChannel.cs deleted file mode 100644 index 4ca24ea7..00000000 --- a/csharp/src/ProtocolBuffers/IRpcChannel.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Interface for an RPC channel. A channel represents a communication line to - /// a service (IService implementation) which can be used to call that service's - /// methods. The service may be running on another machine. Normally, you should - /// not call an IRpcChannel directly, but instead construct a stub wrapping it. - /// Generated service classes contain a CreateStub method for precisely this purpose. - /// - public interface IRpcChannel - { - /// - /// Calls the given method of the remote service. This method is similar - /// to with one important difference: the - /// caller decides the types of the IMessage objects, not the implementation. - /// The request may be of any type as long as request.Descriptor == method.InputType. - /// The response passed to the callback will be of the same type as - /// (which must be such that - /// responsePrototype.Descriptor == method.OutputType). - /// - void CallMethod(MethodDescriptor method, IRpcController controller, - IMessage request, IMessage responsePrototype, Action done); - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/IRpcController.cs b/csharp/src/ProtocolBuffers/IRpcController.cs deleted file mode 100644 index b155bec5..00000000 --- a/csharp/src/ProtocolBuffers/IRpcController.cs +++ /dev/null @@ -1,125 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers -{ - /// - /// Mediates a single method call. The primary purpose of the controller - /// is to provide a way to manipulate settings specific to the - /// RPC implementation and to find out about RPC-level errors. - /// - /// The methods provided by this interface are intended to be a "least - /// common denominator" set of features which we expect all implementations to - /// support. Specific implementations may provide more advanced features, - /// (e.g. deadline propagation). - /// - public interface IRpcController - { - #region Client side calls - - // These calls may be made from the client side only. Their results - // are undefined on the server side (may throw exceptions). - - /// - /// Resets the controller to its initial state so that it may be reused in - /// a new call. This can be called from the client side only. It must not - /// be called while an RPC is in progress. - /// - void Reset(); - - /// - /// After a call has finished, returns true if the call failed. The possible - /// reasons for failure depend on the RPC implementation. Failed must - /// only be called on the client side, and must not be called before a call has - /// finished. - /// - bool Failed { get; } - - /// - /// If Failed is true, ErrorText returns a human-readable description of the error. - /// - string ErrorText { get; } - - /// - /// Advises the RPC system that the caller desires that the RPC call be - /// canceled. The RPC system may cancel it immediately, may wait awhile and - /// then cancel it, or may not even cancel the call at all. If the call is - /// canceled, the "done" callback will still be called and the RpcController - /// will indicate that the call failed at that time. - /// - void StartCancel(); - - #endregion - - #region Server side calls - - // These calls may be made from the server side only. Their results - // are undefined on the client side (may throw exceptions). - - /// - /// Causes Failed to return true on the client side. - /// will be incorporated into the message returned by ErrorText. - /// If you find you need to return machine-readable information about - /// failures, you should incorporate it into your response protocol buffer - /// and should *not* call SetFailed. - /// - void SetFailed(string reason); - - /// - /// If true, indicates that the client canceled the RPC, so the server may as - /// well give up on replying to it. This method must be called on the server - /// side only. The server should still call the final "done" callback. - /// - bool IsCanceled(); - - /// - /// Requests that the given callback be called when the RPC is canceled. - /// The parameter passed to the callback will always be null. The callback will - /// be called exactly once. If the RPC completes without being canceled, the - /// callback will be called after completion. If the RPC has already been canceled - /// when NotifyOnCancel is called, the callback will be called immediately. - /// - /// NotifyOnCancel must be called no more than once per request. It must be - /// called on the server side only. - /// - /// - void NotifyOnCancel(Action callback); - - #endregion - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/IRpcDispatch.cs b/csharp/src/ProtocolBuffers/IRpcDispatch.cs deleted file mode 100644 index 524838e4..00000000 --- a/csharp/src/ProtocolBuffers/IRpcDispatch.cs +++ /dev/null @@ -1,78 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers -{ - /// - /// Provides an entry-point for transport listeners to call a specified method on a service - /// - public interface IRpcServerStub : IDisposable - { - /// - /// Calls the method identified by methodName and returns the message - /// - /// The method name on the service descriptor (case-sensitive) - /// The ICodedInputStream to deserialize the call parameter from - /// The extension registry to use when deserializing the call parameter - /// The message that was returned from the service's method - IMessageLite CallMethod(string methodName, ICodedInputStream input, ExtensionRegistry registry); - } - - /// - /// Used to forward an invocation of a service method to a transport sender implementation - /// - public interface IRpcDispatch - { - /// - /// Calls the service member on the endpoint connected. This is generally done by serializing - /// the message, sending the bytes over a transport, and then deserializing the call parameter - /// to invoke the service's actual implementation via IRpcServerStub. Once the call has - /// completed the result message is serialized and returned to the originating endpoint. - /// - /// The type of the response message - /// The type of of the response builder - /// The name of the method on the service - /// The message instance provided to the service call - /// The builder used to deserialize the response - /// The resulting message of the service call - TMessage CallMethod(string method, IMessageLite request, - IBuilderLite response) - where TMessage : IMessageLite - where TBuilder : IBuilderLite; - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/IService.cs b/csharp/src/ProtocolBuffers/IService.cs deleted file mode 100644 index 61af35c1..00000000 --- a/csharp/src/ProtocolBuffers/IService.cs +++ /dev/null @@ -1,102 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Base interface for protocol-buffer-based RPC services. Services themselves - /// are abstract classes (implemented either by servers or as stubs) but they - /// implement this itnerface. The methods of this interface can be used to call - /// the methods of the service without knowing its exact type at compile time - /// (analagous to the IMessage interface). - /// - public interface IService - { - /// - /// The ServiceDescriptor describing this service and its methods. - /// - ServiceDescriptor DescriptorForType { get; } - - /// - /// Call a method of the service specified by MethodDescriptor. This is - /// normally implemented as a simple switch that calls the standard - /// definitions of the service's methods. - /// - /// Preconditions - /// - /// method.Service == DescriptorForType - /// request is of the exact same class as the object returned by GetRequestPrototype(method) - /// controller is of the correct type for the RPC implementation being used by this service. - /// For stubs, the "correct type" depends on the IRpcChannel which the stub is using. Server-side - /// implementations are expected to accept whatever type of IRpcController the server-side RPC implementation - /// uses. - /// - /// - /// - /// Postconditions - /// - /// will be called when the method is complete. - /// This may before CallMethod returns or it may be at some point in the future. - /// The parameter to is the response. It will be of the - /// exact same type as would be returned by . - /// If the RPC failed, the parameter to will be null. - /// Further details about the failure can be found by querying . - /// - /// - /// - void CallMethod(MethodDescriptor method, IRpcController controller, - IMessage request, Action done); - - /// - /// CallMethod requires that the request passed in is of a particular implementation - /// of IMessage. This method gets the default instance of this type of a given method. - /// You can then call WeakCreateBuilderForType to create a builder to build an object which - /// you can then pass to CallMethod. - /// - IMessage GetRequestPrototype(MethodDescriptor method); - - /// - /// Like GetRequestPrototype, but returns a prototype of the response message. - /// This is generally not needed because the IService implementation contructs - /// the response message itself, but it may be useful in some cases to know ahead - /// of time what type of object will be returned. - /// - IMessage GetResponsePrototype(MethodDescriptor method); - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj index 4bb38de1..d9e50ec6 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -123,16 +123,11 @@ - - - - - diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj index 4037c2bf..fa765147 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj @@ -75,7 +75,6 @@ - diff --git a/csharp/src/ProtocolBuffers/RpcUtil.cs b/csharp/src/ProtocolBuffers/RpcUtil.cs deleted file mode 100644 index 4659d86a..00000000 --- a/csharp/src/ProtocolBuffers/RpcUtil.cs +++ /dev/null @@ -1,79 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers -{ - /// - /// Grab-bag of utility functions useful when dealing with RPCs. - /// - public static class RpcUtil - { - /// - /// Converts an Action[IMessage] to an Action[T]. - /// - public static Action SpecializeCallback(Action action) - where T : IMessage - { - return message => action(message); - } - - /// - /// Converts an Action[T] to an Action[IMessage]. - /// The generalized action will accept any message object which has - /// the same descriptor, and will convert it to the correct class - /// before calling the original action. However, if the generalized - /// callback is given a message with a different descriptor, an - /// exception will be thrown. - /// - public static Action GeneralizeCallback(Action action, - TMessage defaultInstance) - where TMessage : class, IMessage - where TBuilder : IBuilder - { - return message => - { - TMessage castMessage = message as TMessage; - if (castMessage == null) - { - castMessage = defaultInstance.CreateBuilderForType().MergeFrom(message).Build(); - } - action(castMessage); - }; - } - } -} \ No newline at end of file -- cgit v1.2.3 From f651f73a3c3356a93c4e3c131833ed8b5d93e2bc Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 09:18:19 +0100 Subject: Remove support for Serializable. This could potentially be added back in later, but its use is limited and it's a pain in terms of support in PCL environments. One use that has been highlighted is passing objects between AppDomains; we'd recommend passing a byte array explicitly and reparsing on the other side. --- .../ProtocolBuffers.Test.csproj | 2 - .../ProtocolBuffers.Test/SerializableAttribute.cs | 12 -- .../src/ProtocolBuffers.Test/SerializableTest.cs | 184 ------------------- csharp/src/ProtocolBuffers/CustomSerialization.cs | 201 --------------------- csharp/src/ProtocolBuffers/ProtocolBuffers.csproj | 1 - .../src/ProtocolBuffers/ProtocolBuffersLite.csproj | 1 - .../ProtocolBuffersLite.Test.csproj | 4 - .../ProtocolBuffersLiteMixed.Test.csproj | 3 - .../SerializableLiteTest.cs | 57 ------ 9 files changed, 465 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/SerializableTest.cs delete mode 100644 csharp/src/ProtocolBuffers/CustomSerialization.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index b11b1ad8..5702c011 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -81,7 +81,6 @@ - @@ -112,7 +111,6 @@ - diff --git a/csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs b/csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs deleted file mode 100644 index 0553762b..00000000 --- a/csharp/src/ProtocolBuffers.Test/SerializableAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -#if NOSERIALIZABLE && !COMPACT_FRAMEWORK - -namespace System -{ - [AttributeUsage(AttributeTargets.Class)] - public class SerializableAttribute : Attribute - { - public SerializableAttribute () : base() { } - } -} - -#endif diff --git a/csharp/src/ProtocolBuffers.Test/SerializableTest.cs b/csharp/src/ProtocolBuffers.Test/SerializableTest.cs deleted file mode 100644 index da5b0b51..00000000 --- a/csharp/src/ProtocolBuffers.Test/SerializableTest.cs +++ /dev/null @@ -1,184 +0,0 @@ -#if !NOSERIALIZABLE -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.Hosting; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.Text; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class SerializableTest - { - /// - /// Just keep it from even compiling if we these objects don't implement the expected interface. - /// - public static readonly ISerializable CompileTimeCheckSerializableMessage = TestXmlMessage.DefaultInstance; - public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestXmlMessage.Builder(); - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestPlainMessage() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .Build(); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - TestXmlMessage copy = (TestXmlMessage)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(message, copy); - } - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestMessageWithExtensions() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .SetExtension(UnittestExtrasXmltest.ExtensionText, " extension text value ! ") - .SetExtension(UnittestExtrasXmltest.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 100) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 101) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 102) - .SetExtension(UnittestExtrasXmltest.ExtensionEnum, EnumOptions.ONE) - .Build(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnittestExtrasXmltest.RegisterAllExtensions(registry); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - //you need to provide the extension registry as context to the serializer - BinaryFormatter bff = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, registry)); - TestXmlMessage copy = (TestXmlMessage)bff.Deserialize(ms); - - // And all extensions will be defined. - Assert.AreEqual(message, copy); - } - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestPlainBuilder() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - ; - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - TestXmlMessage.Builder copy = (TestXmlMessage.Builder)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(builder.Build(), copy.Build()); - } - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestBuilderWithExtensions() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .SetExtension(UnittestExtrasXmltest.ExtensionText, " extension text value ! ") - .SetExtension(UnittestExtrasXmltest.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 100) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 101) - .AddExtension(UnittestExtrasXmltest.ExtensionNumber, 102) - .SetExtension(UnittestExtrasXmltest.ExtensionEnum, EnumOptions.ONE) - ; - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnittestExtrasXmltest.RegisterAllExtensions(registry); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - //you need to provide the extension registry as context to the serializer - BinaryFormatter bff = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, registry)); - TestXmlMessage.Builder copy = (TestXmlMessage.Builder)bff.Deserialize(ms); - - // And all extensions will be defined. - Assert.AreEqual(builder.Build(), copy.Build()); - } - } -} -#endif \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/CustomSerialization.cs b/csharp/src/ProtocolBuffers/CustomSerialization.cs deleted file mode 100644 index ae9fca22..00000000 --- a/csharp/src/ProtocolBuffers/CustomSerialization.cs +++ /dev/null @@ -1,201 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion -/* - * This entire source file is not supported on some platform - */ -#if !NOSERIALIZABLE -using System; -using System.Security.Permissions; -using System.Runtime.Serialization; -using System.Security; - -namespace Google.ProtocolBuffers -{ - /* - * Specialized handing of *all* message types. Messages are serialized into a byte[] and stored - * into the SerializationInfo, and are then reconstituted by an IObjectReference class after - * deserialization. IDeserializationCallback is supported on both the Builder and Message. - */ - [Serializable] - partial class AbstractMessageLite : ISerializable - { - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.SetType(typeof(SerializationSurrogate)); - info.AddValue("message", ToByteArray()); - info.AddValue("initialized", IsInitialized); - } - - [Serializable] - private sealed class SerializationSurrogate : IObjectReference, ISerializable - { - static readonly TBuilder TemplateInstance = (TBuilder)Activator.CreateInstance(typeof(TBuilder)); - private readonly byte[] _message; - private readonly bool _initialized; - - private SerializationSurrogate(SerializationInfo info, StreamingContext context) - { - _message = (byte[])info.GetValue("message", typeof(byte[])); - _initialized = info.GetBoolean("initialized"); - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - object IObjectReference.GetRealObject(StreamingContext context) - { - ExtensionRegistry registry = context.Context as ExtensionRegistry; - TBuilder builder = TemplateInstance.DefaultInstanceForType.CreateBuilderForType(); - builder.MergeFrom(_message, registry ?? ExtensionRegistry.Empty); - - IDeserializationCallback callback = builder as IDeserializationCallback; - if(callback != null) - { - callback.OnDeserialization(context); - } - - TMessage message = _initialized ? builder.Build() : builder.BuildPartial(); - callback = message as IDeserializationCallback; - if (callback != null) - { - callback.OnDeserialization(context); - } - - return message; - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("message", _message); - } - } - } - - [Serializable] - partial class AbstractBuilderLite : ISerializable - { - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.SetType(typeof(SerializationSurrogate)); - info.AddValue("message", Clone().BuildPartial().ToByteArray()); - } - - [Serializable] - private sealed class SerializationSurrogate : IObjectReference, ISerializable - { - static readonly TBuilder TemplateInstance = (TBuilder)Activator.CreateInstance(typeof(TBuilder)); - private readonly byte[] _message; - - private SerializationSurrogate(SerializationInfo info, StreamingContext context) - { - _message = (byte[])info.GetValue("message", typeof(byte[])); - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - object IObjectReference.GetRealObject(StreamingContext context) - { - ExtensionRegistry registry = context.Context as ExtensionRegistry; - TBuilder builder = TemplateInstance.DefaultInstanceForType.CreateBuilderForType(); - builder.MergeFrom(_message, registry ?? ExtensionRegistry.Empty); - - IDeserializationCallback callback = builder as IDeserializationCallback; - if(callback != null) - { - callback.OnDeserialization(context); - } - - return builder; - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("message", _message); - } - } - } - - /* - * Spread some attribute love around, keeping this all here so we don't use conditional compliation - * in every one of these classes. If we introduce a new platform that also does not support this - * we can control it all from this source file. - */ - - [Serializable] - partial class GeneratedMessageLite { } - - [Serializable] - partial class ExtendableMessageLite { } - - [Serializable] - partial class AbstractMessage { } - - [Serializable] - partial class GeneratedMessage { } - - [Serializable] - partial class ExtendableMessage { } - - [Serializable] - partial class GeneratedBuilderLite { } - - [Serializable] - partial class ExtendableBuilderLite { } - - [Serializable] - partial class AbstractBuilder { } - - [Serializable] - partial class GeneratedBuilder { } - - [Serializable] - partial class ExtendableBuilder { } - - [Serializable] - partial class DynamicMessage - { - [Serializable] - partial class Builder { } - } -} -#endif \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj index d9e50ec6..5f6404a2 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -61,7 +61,6 @@ - diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj index fa765147..fc6e163f 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj @@ -61,7 +61,6 @@ - diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj index f4d5e83e..7701543c 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj @@ -72,15 +72,11 @@ Properties\AssemblyInfo.cs - - SerializableAttribute.cs - - diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj index a721d653..44b9a290 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj @@ -72,9 +72,6 @@ Properties\AssemblyInfo.cs - - SerializableAttribute.cs - diff --git a/csharp/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs deleted file mode 100644 index 992ec7e3..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -#if !NOSERIALIZABLE -using System.Collections.Generic; -using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.Text; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class SerializableLiteTest - { - /// - /// Just keep it from even compiling if we these objects don't implement the expected interface. - /// - public static readonly ISerializable CompileTimeCheckSerializableMessage = TestRequiredLite.DefaultInstance; - public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestRequiredLite.Builder(); - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestPlainMessage() - { - TestRequiredLite message = TestRequiredLite.CreateBuilder() - .SetD(42) - .BuildPartial(); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - TestRequiredLite copy = (TestRequiredLite)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(message, copy); - } - - [TestMethod] - [Ignore] // Serialization hasn't been reimplemented yet - public void TestPlainBuilder() - { - TestRequiredLite.Builder builder = TestRequiredLite.CreateBuilder() - .SetD(42) - ; - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - TestRequiredLite.Builder copy = (TestRequiredLite.Builder)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(builder.BuildPartial(), copy.BuildPartial()); - } - } -} -#endif \ No newline at end of file -- cgit v1.2.3 From 5e0189ab94a33568f9d270cce7706d97a17f0341 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 10:10:20 +0100 Subject: Update C# solution and AddressBook project. Move to a single solution file containing all of the C# projects, but no other solution folders - it's easier to edit those files outside VS than keep adding and removing them from the project. The AddressBook protos have been regenerated (with a change to the example proto which I haven't included in this change - I'll wait for us to decide exactly what we're doing with namespaces before changing protos outside the csharp directory. Note that now we've got Addressbook.cs which contains AddressBook and Addressbook classes. It's bad enough that we've got a class called AddressBook within a namespace of AddressBook (hard to get away from) but having things vary just by case is nasty. This is more evidence that an option for renaming the file and descriptor class would be welcome. (A single option can probably handle both.) --- csharp/src/AddressBook/AddressBook.csproj | 2 +- csharp/src/AddressBook/AddressBookProtos.cs | 1160 --------------------------- csharp/src/AddressBook/Addressbook.cs | 1158 ++++++++++++++++++++++++++ csharp/src/ProtocolBuffers.sln | 206 +---- csharp/src/ProtocolBuffersLibrary.sln | 55 -- 5 files changed, 1192 insertions(+), 1389 deletions(-) delete mode 100644 csharp/src/AddressBook/AddressBookProtos.cs create mode 100644 csharp/src/AddressBook/Addressbook.cs delete mode 100644 csharp/src/ProtocolBuffersLibrary.sln (limited to 'csharp/src') diff --git a/csharp/src/AddressBook/AddressBook.csproj b/csharp/src/AddressBook/AddressBook.csproj index 5d27ee7d..fe05ad6c 100644 --- a/csharp/src/AddressBook/AddressBook.csproj +++ b/csharp/src/AddressBook/AddressBook.csproj @@ -49,7 +49,7 @@ - + diff --git a/csharp/src/AddressBook/AddressBookProtos.cs b/csharp/src/AddressBook/AddressBookProtos.cs deleted file mode 100644 index 23276dd5..00000000 --- a/csharp/src/AddressBook/AddressBookProtos.cs +++ /dev/null @@ -1,1160 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.Examples.AddressBook { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class AddressBookProtos { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_tutorial_Person__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_tutorial_Person_PhoneNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_tutorial_AddressBook__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_AddressBook__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static AddressBookProtos() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chp0dXRvcmlhbC9hZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaJGdvb2ds", - "ZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90byLaAQoGUGVyc29uEgwK", - "BG5hbWUYASACKAkSCgoCaWQYAiACKAUSDQoFZW1haWwYAyABKAkSKwoFcGhv", - "bmUYBCADKAsyHC50dXRvcmlhbC5QZXJzb24uUGhvbmVOdW1iZXIaTQoLUGhv", - "bmVOdW1iZXISDgoGbnVtYmVyGAEgAigJEi4KBHR5cGUYAiABKA4yGi50dXRv", - "cmlhbC5QZXJzb24uUGhvbmVUeXBlOgRIT01FIisKCVBob25lVHlwZRIKCgZN", - "T0JJTEUQABIICgRIT01FEAESCAoEV09SSxACIi8KC0FkZHJlc3NCb29rEiAK", - "BnBlcnNvbhgBIAMoCzIQLnR1dG9yaWFsLlBlcnNvbkJFSAHCPkAKK0dvb2ds", - "ZS5Qcm90b2NvbEJ1ZmZlcnMuRXhhbXBsZXMuQWRkcmVzc0Jvb2sSEUFkZHJl", - "c3NCb29rUHJvdG9z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_tutorial_Person__Descriptor = Descriptor.MessageTypes[0]; - internal__static_tutorial_Person__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person__Descriptor, - new string[] { "Name", "Id", "Email", "Phone", }); - internal__static_tutorial_Person_PhoneNumber__Descriptor = internal__static_tutorial_Person__Descriptor.NestedTypes[0]; - internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person_PhoneNumber__Descriptor, - new string[] { "Number", "Type", }); - internal__static_tutorial_AddressBook__Descriptor = Descriptor.MessageTypes[1]; - internal__static_tutorial_AddressBook__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_AddressBook__Descriptor, - new string[] { "Person", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Person : pb::GeneratedMessage { - private Person() { } - private static readonly Person defaultInstance = new Person().MakeReadOnly(); - private static readonly string[] _personFieldNames = new string[] { "email", "id", "name", "phone" }; - private static readonly uint[] _personFieldTags = new uint[] { 26, 16, 10, 34 }; - public static Person DefaultInstance { - get { return defaultInstance; } - } - - public override Person DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Person ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum PhoneType { - MOBILE = 0, - HOME = 1, - WORK = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class PhoneNumber : pb::GeneratedMessage { - private PhoneNumber() { } - private static readonly PhoneNumber defaultInstance = new PhoneNumber().MakeReadOnly(); - private static readonly string[] _phoneNumberFieldNames = new string[] { "number", "type" }; - private static readonly uint[] _phoneNumberFieldTags = new uint[] { 10, 16 }; - public static PhoneNumber DefaultInstance { - get { return defaultInstance; } - } - - public override PhoneNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override PhoneNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person_PhoneNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private string number_ = ""; - public bool HasNumber { - get { return hasNumber; } - } - public string Number { - get { return number_; } - } - - public const int TypeFieldNumber = 2; - private bool hasType; - private global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME; - public bool HasType { - get { return hasType; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type { - get { return type_; } - } - - public override bool IsInitialized { - get { - if (!hasNumber) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _phoneNumberFieldNames; - if (hasNumber) { - output.WriteString(1, field_names[0], Number); - } - if (hasType) { - output.WriteEnum(2, field_names[1], (int) Type, Type); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeStringSize(1, Number); - } - if (hasType) { - size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static PhoneNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private PhoneNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PhoneNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(PhoneNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private PhoneNumber result; - - private PhoneNumber PrepareBuilder() { - if (resultIsReadOnly) { - PhoneNumber original = result; - result = new PhoneNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override PhoneNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Descriptor; } - } - - public override PhoneNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance; } - } - - public override PhoneNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PhoneNumber) { - return MergeFrom((PhoneNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PhoneNumber other) { - if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasType) { - Type = other.Type; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_phoneNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _phoneNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNumber = input.ReadString(ref result.number_); - break; - } - case 16: { - object unknown; - if(input.ReadEnum(ref result.type_, out unknown)) { - result.hasType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public string Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = ""; - return this; - } - - public bool HasType { - get { return result.hasType; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType value) { - PrepareBuilder(); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - PrepareBuilder(); - result.hasType = false; - result.type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME; - return this; - } - } - static PhoneNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int IdFieldNumber = 2; - private bool hasId; - private int id_; - public bool HasId { - get { return hasId; } - } - public int Id { - get { return id_; } - } - - public const int EmailFieldNumber = 3; - private bool hasEmail; - private string email_ = ""; - public bool HasEmail { - get { return hasEmail; } - } - public string Email { - get { return email_; } - } - - public const int PhoneFieldNumber = 4; - private pbc::PopsicleList phone_ = new pbc::PopsicleList(); - public scg::IList PhoneList { - get { return phone_; } - } - public int PhoneCount { - get { return phone_.Count; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) { - return phone_[index]; - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!hasId) return false; - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _personFieldNames; - if (hasName) { - output.WriteString(1, field_names[2], Name); - } - if (hasId) { - output.WriteInt32(2, field_names[1], Id); - } - if (hasEmail) { - output.WriteString(3, field_names[0], Email); - } - if (phone_.Count > 0) { - output.WriteMessageArray(4, field_names[3], phone_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasId) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Id); - } - if (hasEmail) { - size += pb::CodedOutputStream.ComputeStringSize(3, Email); - } - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Person ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Person ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Person ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Person ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Person ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Person ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Person ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Person ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Person ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Person ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Person MakeReadOnly() { - phone_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Person prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Person cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Person result; - - private Person PrepareBuilder() { - if (resultIsReadOnly) { - Person original = result; - result = new Person(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Person MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Descriptor; } - } - - public override Person DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance; } - } - - public override Person BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Person) { - return MergeFrom((Person) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Person other) { - if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasId) { - Id = other.Id; - } - if (other.HasEmail) { - Email = other.Email; - } - if (other.phone_.Count != 0) { - result.phone_.Add(other.phone_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_personFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _personFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 16: { - result.hasId = input.ReadInt32(ref result.id_); - break; - } - case 26: { - result.hasEmail = input.ReadString(ref result.email_); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.phone_, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasId { - get { return result.hasId; } - } - public int Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(int value) { - PrepareBuilder(); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - PrepareBuilder(); - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasEmail { - get { return result.hasEmail; } - } - public string Email { - get { return result.Email; } - set { SetEmail(value); } - } - public Builder SetEmail(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEmail = true; - result.email_ = value; - return this; - } - public Builder ClearEmail() { - PrepareBuilder(); - result.hasEmail = false; - result.email_ = ""; - return this; - } - - public pbc::IPopsicleList PhoneList { - get { return PrepareBuilder().phone_; } - } - public int PhoneCount { - get { return result.PhoneCount; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) { - return result.GetPhone(index); - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_[index] = value; - return this; - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_[index] = builderForValue.Build(); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_.Add(value); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePhone(scg::IEnumerable values) { - PrepareBuilder(); - result.phone_.Add(values); - return this; - } - public Builder ClearPhone() { - PrepareBuilder(); - result.phone_.Clear(); - return this; - } - } - static Person() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class AddressBook : pb::GeneratedMessage { - private AddressBook() { } - private static readonly AddressBook defaultInstance = new AddressBook().MakeReadOnly(); - private static readonly string[] _addressBookFieldNames = new string[] { "person" }; - private static readonly uint[] _addressBookFieldTags = new uint[] { 10 }; - public static AddressBook DefaultInstance { - get { return defaultInstance; } - } - - public override AddressBook DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override AddressBook ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_AddressBook__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_AddressBook__FieldAccessorTable; } - } - - public const int PersonFieldNumber = 1; - private pbc::PopsicleList person_ = new pbc::PopsicleList(); - public scg::IList PersonList { - get { return person_; } - } - public int PersonCount { - get { return person_.Count; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) { - return person_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _addressBookFieldNames; - if (person_.Count > 0) { - output.WriteMessageArray(1, field_names[0], person_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static AddressBook ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddressBook ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddressBook ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddressBook ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddressBook ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddressBook ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AddressBook ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddressBook ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private AddressBook MakeReadOnly() { - person_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AddressBook prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(AddressBook cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private AddressBook result; - - private AddressBook PrepareBuilder() { - if (resultIsReadOnly) { - AddressBook original = result; - result = new AddressBook(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override AddressBook MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.Descriptor; } - } - - public override AddressBook DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance; } - } - - public override AddressBook BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AddressBook) { - return MergeFrom((AddressBook) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AddressBook other) { - if (other == global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance) return this; - PrepareBuilder(); - if (other.person_.Count != 0) { - result.person_.Add(other.person_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_addressBookFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _addressBookFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.person_, global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList PersonList { - get { return PrepareBuilder().person_; } - } - public int PersonCount { - get { return result.PersonCount; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) { - return result.GetPerson(index); - } - public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.person_[index] = value; - return this; - } - public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.person_[index] = builderForValue.Build(); - return this; - } - public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.person_.Add(value); - return this; - } - public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.person_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePerson(scg::IEnumerable values) { - PrepareBuilder(); - result.person_.Add(values); - return this; - } - public Builder ClearPerson() { - PrepareBuilder(); - result.person_.Clear(); - return this; - } - } - static AddressBook() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs new file mode 100644 index 00000000..bc6199b1 --- /dev/null +++ b/csharp/src/AddressBook/Addressbook.cs @@ -0,0 +1,1158 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: addressbook.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace Google.ProtocolBuffers.Examples.AddressBook { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Addressbook { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_tutorial_Person__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_tutorial_Person_PhoneNumber__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_tutorial_AddressBook__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_AddressBook__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Addressbook() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi2gEKBlBlcnNvbhIMCgRu", + "YW1lGAEgAigJEgoKAmlkGAIgAigFEg0KBWVtYWlsGAMgASgJEisKBXBob25l", + "GAQgAygLMhwudHV0b3JpYWwuUGVyc29uLlBob25lTnVtYmVyGk0KC1Bob25l", + "TnVtYmVyEg4KBm51bWJlchgBIAIoCRIuCgR0eXBlGAIgASgOMhoudHV0b3Jp", + "YWwuUGVyc29uLlBob25lVHlwZToESE9NRSIrCglQaG9uZVR5cGUSCgoGTU9C", + "SUxFEAASCAoESE9NRRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZw", + "ZXJzb24YASADKAsyEC50dXRvcmlhbC5QZXJzb25CVwoUY29tLmV4YW1wbGUu", + "dHV0b3JpYWxCEUFkZHJlc3NCb29rUHJvdG9zqgIrR29vZ2xlLlByb3RvY29s", + "QnVmZmVycy5FeGFtcGxlcy5BZGRyZXNzQm9vaw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_tutorial_Person__Descriptor = Descriptor.MessageTypes[0]; + internal__static_tutorial_Person__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person__Descriptor, + new string[] { "Name", "Id", "Email", "Phone", }); + internal__static_tutorial_Person_PhoneNumber__Descriptor = internal__static_tutorial_Person__Descriptor.NestedTypes[0]; + internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person_PhoneNumber__Descriptor, + new string[] { "Number", "Type", }); + internal__static_tutorial_AddressBook__Descriptor = Descriptor.MessageTypes[1]; + internal__static_tutorial_AddressBook__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_AddressBook__Descriptor, + new string[] { "Person", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Person : pb::GeneratedMessage { + private Person() { } + private static readonly Person defaultInstance = new Person().MakeReadOnly(); + private static readonly string[] _personFieldNames = new string[] { "email", "id", "name", "phone" }; + private static readonly uint[] _personFieldTags = new uint[] { 26, 16, 10, 34 }; + public static Person DefaultInstance { + get { return defaultInstance; } + } + + public override Person DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Person ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.internal__static_tutorial_Person__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.internal__static_tutorial_Person__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum PhoneType { + MOBILE = 0, + HOME = 1, + WORK = 2, + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class PhoneNumber : pb::GeneratedMessage { + private PhoneNumber() { } + private static readonly PhoneNumber defaultInstance = new PhoneNumber().MakeReadOnly(); + private static readonly string[] _phoneNumberFieldNames = new string[] { "number", "type" }; + private static readonly uint[] _phoneNumberFieldTags = new uint[] { 10, 16 }; + public static PhoneNumber DefaultInstance { + get { return defaultInstance; } + } + + public override PhoneNumber DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PhoneNumber ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.internal__static_tutorial_Person_PhoneNumber__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; } + } + + public const int NumberFieldNumber = 1; + private bool hasNumber; + private string number_ = ""; + public bool HasNumber { + get { return hasNumber; } + } + public string Number { + get { return number_; } + } + + public const int TypeFieldNumber = 2; + private bool hasType; + private global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME; + public bool HasType { + get { return hasType; } + } + public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type { + get { return type_; } + } + + public override bool IsInitialized { + get { + if (!hasNumber) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _phoneNumberFieldNames; + if (hasNumber) { + output.WriteString(1, field_names[0], Number); + } + if (hasType) { + output.WriteEnum(2, field_names[1], (int) Type, Type); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasNumber) { + size += pb::CodedOutputStream.ComputeStringSize(1, Number); + } + if (hasType) { + size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static PhoneNumber ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PhoneNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PhoneNumber ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PhoneNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PhoneNumber ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PhoneNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PhoneNumber ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PhoneNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PhoneNumber MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PhoneNumber prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PhoneNumber cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PhoneNumber result; + + private PhoneNumber PrepareBuilder() { + if (resultIsReadOnly) { + PhoneNumber original = result; + result = new PhoneNumber(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PhoneNumber MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Descriptor; } + } + + public override PhoneNumber DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance; } + } + + public override PhoneNumber BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PhoneNumber) { + return MergeFrom((PhoneNumber) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PhoneNumber other) { + if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasNumber) { + Number = other.Number; + } + if (other.HasType) { + Type = other.Type; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_phoneNumberFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _phoneNumberFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasNumber = input.ReadString(ref result.number_); + break; + } + case 16: { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(2, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasNumber { + get { return result.hasNumber; } + } + public string Number { + get { return result.Number; } + set { SetNumber(value); } + } + public Builder SetNumber(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNumber = true; + result.number_ = value; + return this; + } + public Builder ClearNumber() { + PrepareBuilder(); + result.hasNumber = false; + result.number_ = ""; + return this; + } + + public bool HasType { + get { return result.hasType; } + } + public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME; + return this; + } + } + static PhoneNumber() { + object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.Descriptor, null); + } + } + + } + #endregion + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int IdFieldNumber = 2; + private bool hasId; + private int id_; + public bool HasId { + get { return hasId; } + } + public int Id { + get { return id_; } + } + + public const int EmailFieldNumber = 3; + private bool hasEmail; + private string email_ = ""; + public bool HasEmail { + get { return hasEmail; } + } + public string Email { + get { return email_; } + } + + public const int PhoneFieldNumber = 4; + private pbc::PopsicleList phone_ = new pbc::PopsicleList(); + public scg::IList PhoneList { + get { return phone_; } + } + public int PhoneCount { + get { return phone_.Count; } + } + public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) { + return phone_[index]; + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + if (!hasId) return false; + foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _personFieldNames; + if (hasName) { + output.WriteString(1, field_names[2], Name); + } + if (hasId) { + output.WriteInt32(2, field_names[1], Id); + } + if (hasEmail) { + output.WriteString(3, field_names[0], Email); + } + if (phone_.Count > 0) { + output.WriteMessageArray(4, field_names[3], phone_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasId) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Id); + } + if (hasEmail) { + size += pb::CodedOutputStream.ComputeStringSize(3, Email); + } + foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Person ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Person ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Person ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Person ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Person ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Person ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Person ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Person ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Person ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Person ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Person MakeReadOnly() { + phone_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Person prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Person cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Person result; + + private Person PrepareBuilder() { + if (resultIsReadOnly) { + Person original = result; + result = new Person(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Person MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Descriptor; } + } + + public override Person DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance; } + } + + public override Person BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Person) { + return MergeFrom((Person) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Person other) { + if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasEmail) { + Email = other.Email; + } + if (other.phone_.Count != 0) { + result.phone_.Add(other.phone_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_personFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _personFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 16: { + result.hasId = input.ReadInt32(ref result.id_); + break; + } + case 26: { + result.hasEmail = input.ReadString(ref result.email_); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.phone_, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasId { + get { return result.hasId; } + } + public int Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(int value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasEmail { + get { return result.hasEmail; } + } + public string Email { + get { return result.Email; } + set { SetEmail(value); } + } + public Builder SetEmail(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEmail = true; + result.email_ = value; + return this; + } + public Builder ClearEmail() { + PrepareBuilder(); + result.hasEmail = false; + result.email_ = ""; + return this; + } + + public pbc::IPopsicleList PhoneList { + get { return PrepareBuilder().phone_; } + } + public int PhoneCount { + get { return result.PhoneCount; } + } + public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) { + return result.GetPhone(index); + } + public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.phone_[index] = value; + return this; + } + public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.phone_[index] = builderForValue.Build(); + return this; + } + public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.phone_.Add(value); + return this; + } + public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.phone_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePhone(scg::IEnumerable values) { + PrepareBuilder(); + result.phone_.Add(values); + return this; + } + public Builder ClearPhone() { + PrepareBuilder(); + result.phone_.Clear(); + return this; + } + } + static Person() { + object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class AddressBook : pb::GeneratedMessage { + private AddressBook() { } + private static readonly AddressBook defaultInstance = new AddressBook().MakeReadOnly(); + private static readonly string[] _addressBookFieldNames = new string[] { "person" }; + private static readonly uint[] _addressBookFieldTags = new uint[] { 10 }; + public static AddressBook DefaultInstance { + get { return defaultInstance; } + } + + public override AddressBook DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AddressBook ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.internal__static_tutorial_AddressBook__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.internal__static_tutorial_AddressBook__FieldAccessorTable; } + } + + public const int PersonFieldNumber = 1; + private pbc::PopsicleList person_ = new pbc::PopsicleList(); + public scg::IList PersonList { + get { return person_; } + } + public int PersonCount { + get { return person_.Count; } + } + public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) { + return person_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _addressBookFieldNames; + if (person_.Count > 0) { + output.WriteMessageArray(1, field_names[0], person_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static AddressBook ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AddressBook ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AddressBook ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AddressBook ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AddressBook ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AddressBook ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AddressBook ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AddressBook ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AddressBook MakeReadOnly() { + person_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AddressBook prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AddressBook cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AddressBook result; + + private AddressBook PrepareBuilder() { + if (resultIsReadOnly) { + AddressBook original = result; + result = new AddressBook(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AddressBook MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.Descriptor; } + } + + public override AddressBook DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance; } + } + + public override AddressBook BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AddressBook) { + return MergeFrom((AddressBook) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AddressBook other) { + if (other == global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance) return this; + PrepareBuilder(); + if (other.person_.Count != 0) { + result.person_.Add(other.person_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_addressBookFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _addressBookFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.person_, global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PersonList { + get { return PrepareBuilder().person_; } + } + public int PersonCount { + get { return result.PersonCount; } + } + public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) { + return result.GetPerson(index); + } + public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.person_[index] = value; + return this; + } + public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.person_[index] = builderForValue.Build(); + return this; + } + public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.person_.Add(value); + return this; + } + public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.person_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePerson(scg::IEnumerable values) { + PrepareBuilder(); + result.person_.Add(values); + return this; + } + public Builder ClearPerson() { + PrepareBuilder(); + result.person_.Clear(); + return this; + } + } + static AddressBook() { + object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.Addressbook.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers.sln b/csharp/src/ProtocolBuffers.sln index 7741777b..5eb488cf 100644 --- a/csharp/src/ProtocolBuffers.sln +++ b/csharp/src/ProtocolBuffers.sln @@ -1,215 +1,75 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{1F896D5C-5FC2-4671-9216-781CB8187EC7}" - ProjectSection(SolutionItems) = preProject - ..\protos\tutorial\addressbook.proto = ..\protos\tutorial\addressbook.proto - ..\protos\google\protobuf\csharp_options.proto = ..\protos\google\protobuf\csharp_options.proto - ..\protos\google\protobuf\descriptor.proto = ..\protos\google\protobuf\descriptor.proto - ..\protos\google\protobuf\compiler\plugin.proto = ..\protos\google\protobuf\compiler\plugin.proto - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8D3015A-EA39-4F03-AEEC-3FF1F2087A12}" - ProjectSection(SolutionItems) = preProject - ..\protos\google\test\google_size.proto = ..\protos\google\test\google_size.proto - ..\protos\google\test\google_speed.proto = ..\protos\google\test\google_speed.proto - ..\protos\google\protobuf\unittest.proto = ..\protos\google\protobuf\unittest.proto - ..\protos\google\protobuf\unittest_csharp_options.proto = ..\protos\google\protobuf\unittest_csharp_options.proto - ..\protos\google\protobuf\unittest_custom_options.proto = ..\protos\google\protobuf\unittest_custom_options.proto - ..\protos\google\protobuf\unittest_embed_optimize_for.proto = ..\protos\google\protobuf\unittest_embed_optimize_for.proto - ..\protos\google\protobuf\unittest_empty.proto = ..\protos\google\protobuf\unittest_empty.proto - ..\protos\google\protobuf\unittest_enormous_descriptor.proto = ..\protos\google\protobuf\unittest_enormous_descriptor.proto - ..\protos\extest\unittest_extras.proto = ..\protos\extest\unittest_extras.proto - ..\protos\extest\unittest_extras_full.proto = ..\protos\extest\unittest_extras_full.proto - ..\protos\extest\unittest_extras_lite.proto = ..\protos\extest\unittest_extras_lite.proto - ..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto - ..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto - ..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto - ..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto - ..\protos\extest\unittest_issues.proto = ..\protos\extest\unittest_issues.proto - ..\protos\google\protobuf\unittest_lite.proto = ..\protos\google\protobuf\unittest_lite.proto - ..\protos\google\protobuf\unittest_lite_imports_nonlite.proto = ..\protos\google\protobuf\unittest_lite_imports_nonlite.proto - ..\protos\google\protobuf\unittest_mset.proto = ..\protos\google\protobuf\unittest_mset.proto - ..\protos\google\protobuf\unittest_no_generic_services.proto = ..\protos\google\protobuf\unittest_no_generic_services.proto - ..\protos\google\protobuf\unittest_optimize_for.proto = ..\protos\google\protobuf\unittest_optimize_for.proto - ..\protos\extest\unittest_rpc_interop.proto = ..\protos\extest\unittest_rpc_interop.proto - ..\protos\extest\unittest_rpc_interop_lite.proto = ..\protos\extest\unittest_rpc_interop_lite.proto - EndProjectSection -EndProject +# Visual Studio 14 +VisualStudioVersion = 14.0.22609.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoGen", "ProtoGen\ProtoGen.csproj", "{250ADE34-82FD-4BAE-86D5-985FBE589C4A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoGen.Test", "ProtoGen.Test\ProtoGen.Test.csproj", "{C268DA4C-4004-47DA-AF23-44C983281A68}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBook", "AddressBook\AddressBook.csproj", "{A31F5FB2-4FF3-432A-B35B-5CD203606311}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoMunge", "ProtoMunge\ProtoMunge.csproj", "{8F09AF72-3327-4FA7-BC09-070B80221AB9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoBench", "ProtoBench\ProtoBench.csproj", "{C7A4A435-2813-41C8-AA87-BD914BA5223D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoDump", "ProtoDump\ProtoDump.csproj", "{D7282E99-2DC3-405B-946F-177DB2FD2AE2}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950-AD27-42D7-88F8-94355AEC8225}" - ProjectSection(SolutionItems) = preProject - ..\build\build.bat = ..\build\build.bat - ..\build\build.csproj = ..\build\build.csproj - ..\build\BuildAll.bat = ..\build\BuildAll.bat - ..\build\Common.targets = ..\build\Common.targets - ..\build\GenerateProjects.bat = ..\build\GenerateProjects.bat - ..\build\GenerateSource.bat = ..\build\GenerateSource.bat - ..\build\Google.ProtocolBuffers.nuspec = ..\build\Google.ProtocolBuffers.nuspec - ..\build\Google.ProtocolBuffersLite.nuspec = ..\build\Google.ProtocolBuffersLite.nuspec - ..\build\publish.csproj = ..\build\publish.csproj - ..\build\PublishTool.bat = ..\build\PublishTool.bat - ..\build\RunBenchmarks.bat = ..\build\RunBenchmarks.bat - ..\build\target.csproj = ..\build\target.csproj - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C7B69674-7A51-4AC6-8674-0330BA742CE4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{75D5D25A-01A6-4594-957F-5993FB83F450}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{FA9F5250-FDDC-48B8-832E-96E0464A02E6}" - ProjectSection(SolutionItems) = preProject - ..\protos\benchmarks\google_size.proto = ..\protos\benchmarks\google_size.proto - ..\protos\benchmarks\google_speed.proto = ..\protos\benchmarks\google_speed.proto - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBook", "AddressBook\AddressBook.csproj", "{A31F5FB2-4FF3-432A-B35B-5CD203606311}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protoc-gen-cs", "ProtoGen\protoc-gen-cs.csproj", "{250ADE34-82FD-4BAE-86D5-985FBE589C4B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoDump", "ProtoDump\ProtoDump.csproj", "{D7282E99-2DC3-405B-946F-177DB2FD2AE2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protoc-gen-cs.Test", "ProtoGen.Test\protoc-gen-cs.Test.csproj", "{C1024C9C-8176-48C3-B547-B9F6DF6B80A6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoMunge", "ProtoMunge\ProtoMunge.csproj", "{8F09AF72-3327-4FA7-BC09-070B80221AB9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_Silverlight|Any CPU = Debug_Silverlight|Any CPU Debug|Any CPU = Debug|Any CPU - Release_Silverlight|Any CPU = Release_Silverlight|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.Build.0 = Release|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.Build.0 = Release|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.Build.0 = Release|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug_Silverlight|Any CPU.Build.0 = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release_Silverlight|Any CPU.Build.0 = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release|Any CPU.Build.0 = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug_Silverlight|Any CPU.Build.0 = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release_Silverlight|Any CPU.Build.0 = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release|Any CPU.Build.0 = Release|Any CPU + {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU + {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU + {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU + {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU + {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU + {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {C8D3015A-EA39-4F03-AEEC-3FF1F2087A12} = {1F896D5C-5FC2-4671-9216-781CB8187EC7} - {FA9F5250-FDDC-48B8-832E-96E0464A02E6} = {1F896D5C-5FC2-4671-9216-781CB8187EC7} - {C268DA4C-4004-47DA-AF23-44C983281A68} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {EE01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {EEFFED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {DD01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {A31F5FB2-4FF3-432A-B35B-5CD203606311} = {75D5D25A-01A6-4594-957F-5993FB83F450} - {C7A4A435-2813-41C8-AA87-BD914BA5223D} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} - {D7282E99-2DC3-405B-946F-177DB2FD2AE2} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} - {8F09AF72-3327-4FA7-BC09-070B80221AB9} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} - EndGlobalSection EndGlobal diff --git a/csharp/src/ProtocolBuffersLibrary.sln b/csharp/src/ProtocolBuffersLibrary.sln deleted file mode 100644 index c91314a0..00000000 --- a/csharp/src/ProtocolBuffersLibrary.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal -- cgit v1.2.3 From f015b860b74f1f7a5dc1a9fbf8b30daf7539d669 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 12:20:12 +0100 Subject: Remove CLS compliance from runtime code. We need to remove it from the generator too; I'll raise a github issue for that. --- .../AbstractReader.cs | 2 -- .../AbstractTextReader.cs | 2 -- .../AbstractTextWriter.cs | 2 -- .../AbstractWriter.cs | 4 --- .../DictionaryReader.cs | 2 -- .../DictionaryWriter.cs | 2 -- .../Properties/AssemblyInfo.cs | 2 -- .../Properties/AssemblyInfo.cs | 5 --- csharp/src/ProtocolBuffers/CodedInputStream.cs | 36 ---------------------- .../CodedOutputStream.ComputeSize.cs | 10 ------ csharp/src/ProtocolBuffers/CodedOutputStream.cs | 19 ------------ .../ProtocolBuffers/Descriptors/FieldDescriptor.cs | 10 ------ .../Descriptors/FieldMappingAttribute.cs | 1 - csharp/src/ProtocolBuffers/ExtendableBuilder.cs | 1 - .../src/ProtocolBuffers/ExtendableBuilderLite.cs | 1 - csharp/src/ProtocolBuffers/GeneratedBuilder.cs | 1 - csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs | 1 - csharp/src/ProtocolBuffers/ICodedInputStream.cs | 27 ---------------- csharp/src/ProtocolBuffers/ICodedOutputStream.cs | 8 +---- .../src/ProtocolBuffers/Properties/AssemblyInfo.cs | 2 -- csharp/src/ProtocolBuffers/TextFormat.cs | 2 -- csharp/src/ProtocolBuffers/UnknownField.cs | 3 -- csharp/src/ProtocolBuffers/UnknownFieldSet.cs | 2 -- csharp/src/ProtocolBuffers/WireFormat.cs | 7 ----- 24 files changed, 1 insertion(+), 151 deletions(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs index e198d0b0..99ecec88 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractReader.cs @@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt32 from the input /// - [CLSCompliant(false)] protected abstract bool Read(ref uint value); /// @@ -74,7 +73,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt64 from the input /// - [CLSCompliant(false)] protected abstract bool Read(ref ulong value); /// diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs index b40a560a..41578fab 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractTextReader.cs @@ -62,7 +62,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt32 from the input /// - [CLSCompliant(false)] protected override bool Read(ref uint value) { string text = null; @@ -91,7 +90,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt64 from the input /// - [CLSCompliant(false)] protected override bool Read(ref ulong value) { string text = null; diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs index 2c778dfc..e13cbbab 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs @@ -48,7 +48,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt32 value /// - [CLSCompliant(false)] protected override void Write(string field, uint value) { WriteAsText(field, XmlConvert.ToString(value), value); @@ -65,7 +64,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt64 value /// - [CLSCompliant(false)] protected override void Write(string field, ulong value) { WriteAsText(field, XmlConvert.ToString(value), value); diff --git a/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs b/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs index 2dc6b887..f4cfe3e1 100644 --- a/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs +++ b/csharp/src/ProtocolBuffers.Serialization/AbstractWriter.cs @@ -59,7 +59,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt32 value /// - [CLSCompliant(false)] protected abstract void Write(string field, UInt32 value); /// @@ -70,7 +69,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt64 value /// - [CLSCompliant(false)] protected abstract void Write(string field, UInt64 value); /// @@ -185,7 +183,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a numeric unknown field of wire type: Fixed32, Fixed64, or Variant /// - [CLSCompliant(false)] protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ulong value) { } @@ -193,7 +190,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes an unknown field, Expect WireType of GroupStart or LengthPrefix /// - [CLSCompliant(false)] protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ByteString value) { } diff --git a/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs b/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs index c460523c..971d0fee 100644 --- a/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs +++ b/csharp/src/ProtocolBuffers.Serialization/DictionaryReader.cs @@ -118,7 +118,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt32 from the input /// - [CLSCompliant(false)] protected override bool Read(ref uint value) { return GetValue(ref value); @@ -135,7 +134,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Returns true if it was able to read a UInt64 from the input /// - [CLSCompliant(false)] protected override bool Read(ref ulong value) { return GetValue(ref value); diff --git a/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs b/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs index 6d823301..8cc8ed6b 100644 --- a/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs +++ b/csharp/src/ProtocolBuffers.Serialization/DictionaryWriter.cs @@ -85,7 +85,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt32 value /// - [CLSCompliant(false)] protected override void Write(string field, uint value) { _output[field] = value; @@ -102,7 +101,6 @@ namespace Google.ProtocolBuffers.Serialization /// /// Writes a UInt64 value /// - [CLSCompliant(false)] protected override void Write(string field, ulong value) { _output[field] = value; diff --git a/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs index c6420b56..0ab58120 100644 --- a/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs @@ -63,5 +63,3 @@ using System.Runtime.CompilerServices; #if !NOFILEVERSION [assembly: AssemblyFileVersion("2.4.1.555")] #endif - -[assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs index b443ea3a..bfa1f05e 100644 --- a/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs @@ -28,8 +28,3 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("2.4.1.555")] [assembly: AssemblyVersion("2.4.1.555")] - -// We don't really need CLSCompliance, but if the assembly builds with no warnings, -// that means the generator is okay. - -[assembly: CLSCompliant(false)] \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/CodedInputStream.cs b/csharp/src/ProtocolBuffers/CodedInputStream.cs index 773e8c18..37774d01 100644 --- a/csharp/src/ProtocolBuffers/CodedInputStream.cs +++ b/csharp/src/ProtocolBuffers/CodedInputStream.cs @@ -186,7 +186,6 @@ namespace Google.ProtocolBuffers /// /// The last /// tag read was not the one specified - [CLSCompliant(false)] public void CheckLastTagWas(uint value) { if (lastTag != value) @@ -202,7 +201,6 @@ namespace Google.ProtocolBuffers /// /// Attempt to peek at the next field tag. /// - [CLSCompliant(false)] public bool PeekNextTag(out uint fieldTag, out string fieldName) { if (hasNextTag) @@ -226,7 +224,6 @@ namespace Google.ProtocolBuffers /// The 'tag' of the field (id * 8 + wire-format) /// Not Supported - For protobuffer streams, this parameter is always null /// true if the next fieldTag was read - [CLSCompliant(false)] public bool ReadTag(out uint fieldTag, out string fieldName) { fieldName = null; @@ -290,7 +287,6 @@ namespace Google.ProtocolBuffers /// /// Read a uint64 field from the stream. /// - [CLSCompliant(false)] public bool ReadUInt64(ref ulong value) { value = ReadRawVarint64(); @@ -318,7 +314,6 @@ namespace Google.ProtocolBuffers /// /// Read a fixed64 field from the stream. /// - [CLSCompliant(false)] public bool ReadFixed64(ref ulong value) { value = ReadRawLittleEndian64(); @@ -328,7 +323,6 @@ namespace Google.ProtocolBuffers /// /// Read a fixed32 field from the stream. /// - [CLSCompliant(false)] public bool ReadFixed32(ref uint value) { value = ReadRawLittleEndian32(); @@ -447,7 +441,6 @@ namespace Google.ProtocolBuffers /// /// Reads a uint32 field value from the stream. /// - [CLSCompliant(false)] public bool ReadUInt32(ref uint value) { value = ReadRawVarint32(); @@ -477,7 +470,6 @@ namespace Google.ProtocolBuffers /// then the ref value is set and it returns true. Otherwise the unknown output /// value is set and this method returns false. /// - [CLSCompliant(false)] public bool ReadEnum(ref T value, out object unknown) where T : struct, IComparable, IFormattable { @@ -593,7 +585,6 @@ namespace Google.ProtocolBuffers return false; } - [CLSCompliant(false)] public void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection list) { WireFormat.WireType normal = WireFormat.GetWireType(fieldType); @@ -627,7 +618,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadStringArray(uint fieldTag, string fieldName, ICollection list) { string tmp = null; @@ -638,7 +628,6 @@ namespace Google.ProtocolBuffers } while (ContinueArray(fieldTag)); } - [CLSCompliant(false)] public void ReadBytesArray(uint fieldTag, string fieldName, ICollection list) { ByteString tmp = null; @@ -649,7 +638,6 @@ namespace Google.ProtocolBuffers } while (ContinueArray(fieldTag)); } - [CLSCompliant(false)] public void ReadBoolArray(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -665,7 +653,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadInt32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -681,7 +668,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSInt32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -697,7 +683,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadUInt32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -713,7 +698,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadFixed32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -729,7 +713,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -745,7 +728,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadInt64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -761,7 +743,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSInt64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -777,7 +758,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadUInt64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -793,7 +773,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadFixed64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -809,7 +788,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -825,7 +803,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadDoubleArray(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -841,7 +818,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadFloatArray(uint fieldTag, string fieldName, ICollection list) { bool isPacked; @@ -857,7 +833,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown, IEnumLiteMap mapping) { @@ -908,7 +883,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown) where T : struct, IComparable, IFormattable @@ -960,7 +934,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void ReadMessageArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite { @@ -972,7 +945,6 @@ namespace Google.ProtocolBuffers } while (ContinueArray(fieldTag)); } - [CLSCompliant(false)] public void ReadGroupArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite { @@ -1217,7 +1189,6 @@ namespace Google.ProtocolBuffers /// That means we can check the size just once, then just read directly from the buffer /// without constant rechecking of the buffer length. /// - [CLSCompliant(false)] public uint ReadRawVarint32() { if (bufferPos + 5 > bufferSize) @@ -1283,7 +1254,6 @@ namespace Google.ProtocolBuffers /// /// /// - [CLSCompliant(false)] public static uint ReadRawVarint32(Stream input) { int result = 0; @@ -1320,7 +1290,6 @@ namespace Google.ProtocolBuffers /// /// Read a raw varint from the stream. /// - [CLSCompliant(false)] public ulong ReadRawVarint64() { int shift = 0; @@ -1341,7 +1310,6 @@ namespace Google.ProtocolBuffers /// /// Read a 32-bit little-endian integer from the stream. /// - [CLSCompliant(false)] public uint ReadRawLittleEndian32() { uint b1 = ReadRawByte(); @@ -1354,7 +1322,6 @@ namespace Google.ProtocolBuffers /// /// Read a 64-bit little-endian integer from the stream. /// - [CLSCompliant(false)] public ulong ReadRawLittleEndian64() { ulong b1 = ReadRawByte(); @@ -1380,7 +1347,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static int DecodeZigZag32(uint n) { return (int) (n >> 1) ^ -(int) (n & 1); @@ -1395,7 +1361,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static long DecodeZigZag64(ulong n) { return (long) (n >> 1) ^ -(long) (n & 1); @@ -1732,7 +1697,6 @@ namespace Google.ProtocolBuffers /// /// false if the tag is an end-group tag, in which case /// nothing is skipped. Otherwise, returns true. - [CLSCompliant(false)] public bool SkipField() { uint tag = lastTag; diff --git a/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs b/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs index ca6662a4..99d82fce 100644 --- a/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs +++ b/csharp/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs @@ -71,7 +71,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt64Size(int fieldNumber, ulong value) { return ComputeTagSize(fieldNumber) + ComputeRawVarint64Size(value); @@ -107,7 +106,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed64Size(int fieldNumber, ulong value) { return ComputeTagSize(fieldNumber) + LittleEndian64Size; @@ -117,7 +115,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed32Size(int fieldNumber, uint value) { return ComputeTagSize(fieldNumber) + LittleEndian32Size; @@ -189,7 +186,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt32Size(int fieldNumber, uint value) { return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size(value); @@ -263,7 +259,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt64SizeNoTag(ulong value) { return ComputeRawVarint64Size(value); @@ -299,7 +294,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed64 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed64SizeNoTag(ulong value) { return LittleEndian64Size; @@ -309,7 +303,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// fixed32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeFixed32SizeNoTag(uint value) { return LittleEndian32Size; @@ -378,7 +371,6 @@ namespace Google.ProtocolBuffers /// Compute the number of bytes that would be needed to encode a /// uint32 field, including the tag. /// - [CLSCompliant(false)] public static int ComputeUInt32SizeNoTag(uint value) { return ComputeRawVarint32Size(value); @@ -463,7 +455,6 @@ namespace Google.ProtocolBuffers /// /// Compute the number of bytes that would be needed to encode a varint. /// - [CLSCompliant(false)] public static int ComputeRawVarint32Size(uint value) { if ((value & (0xffffffff << 7)) == 0) @@ -488,7 +479,6 @@ namespace Google.ProtocolBuffers /// /// Compute the number of bytes that would be needed to encode a varint. /// - [CLSCompliant(false)] public static int ComputeRawVarint64Size(ulong value) { if ((value & (0xffffffffffffffffL << 7)) == 0) diff --git a/csharp/src/ProtocolBuffers/CodedOutputStream.cs b/csharp/src/ProtocolBuffers/CodedOutputStream.cs index d267b75e..c37fcc18 100644 --- a/csharp/src/ProtocolBuffers/CodedOutputStream.cs +++ b/csharp/src/ProtocolBuffers/CodedOutputStream.cs @@ -159,7 +159,6 @@ namespace Google.ProtocolBuffers WriteBytes(fieldNumber, null /*not used*/, value); } - [CLSCompliant(false)] public void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value) { if (wireType == WireFormat.WireType.Varint) @@ -273,7 +272,6 @@ namespace Google.ProtocolBuffers /// /// Writes a uint64 field value, including tag, to the stream. /// - [CLSCompliant(false)] public void WriteUInt64(int fieldNumber, string fieldName, ulong value) { WriteTag(fieldNumber, WireFormat.WireType.Varint); @@ -309,7 +307,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed64 field value, including tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed64(int fieldNumber, string fieldName, ulong value) { WriteTag(fieldNumber, WireFormat.WireType.Fixed64); @@ -319,7 +316,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed32 field value, including tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed32(int fieldNumber, string fieldName, uint value) { WriteTag(fieldNumber, WireFormat.WireType.Fixed32); @@ -381,7 +377,6 @@ namespace Google.ProtocolBuffers value.WriteRawBytesTo(this); } - [CLSCompliant(false)] public void WriteUInt32(int fieldNumber, string fieldName, uint value) { WriteTag(fieldNumber, WireFormat.WireType.Varint); @@ -541,7 +536,6 @@ namespace Google.ProtocolBuffers /// /// Writes a uint64 field value, without a tag, to the stream. /// - [CLSCompliant(false)] public void WriteUInt64NoTag(ulong value) { WriteRawVarint64(value); @@ -574,7 +568,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed64 field value, without a tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed64NoTag(ulong value) { WriteRawLittleEndian64(value); @@ -583,7 +576,6 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed32 field value, without a tag, to the stream. /// - [CLSCompliant(false)] public void WriteFixed32NoTag(uint value) { WriteRawLittleEndian32(value); @@ -638,7 +630,6 @@ namespace Google.ProtocolBuffers value.WriteRawBytesTo(this); } - [CLSCompliant(false)] public void WriteUInt32NoTag(uint value) { WriteRawVarint32(value); @@ -819,7 +810,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list) where T : struct, IComparable, IFormattable { @@ -1041,7 +1031,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WritePackedEnumArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) where T : struct, IComparable, IFormattable { @@ -1070,7 +1059,6 @@ namespace Google.ProtocolBuffers /// /// Encodes and writes a tag. /// - [CLSCompliant(false)] public void WriteTag(int fieldNumber, WireFormat.WireType type) { WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type)); @@ -1081,7 +1069,6 @@ namespace Google.ProtocolBuffers /// there's enough buffer space left to whizz through without checking /// for each byte; otherwise, we resort to calling WriteRawByte each time. /// - [CLSCompliant(false)] public void WriteRawVarint32(uint value) { while (value > 127 && position < limit) @@ -1104,7 +1091,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteRawVarint64(ulong value) { while (value > 127 && position < limit) @@ -1127,7 +1113,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteRawLittleEndian32(uint value) { if (position + 4 > limit) @@ -1146,7 +1131,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public void WriteRawLittleEndian64(ulong value) { if (position + 8 > limit) @@ -1183,7 +1167,6 @@ namespace Google.ProtocolBuffers buffer[position++] = value; } - [CLSCompliant(false)] public void WriteRawByte(uint value) { WriteRawByte((byte) value); @@ -1247,7 +1230,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static uint EncodeZigZag32(int n) { // Note: the right-shift must be arithmetic @@ -1263,7 +1245,6 @@ namespace Google.ProtocolBuffers /// sign-extended to 64 bits to be varint encoded, thus always taking /// 10 bytes on the wire.) /// - [CLSCompliant(false)] public static ulong EncodeZigZag64(long n) { return (ulong) ((n << 1) ^ (n >> 63)); diff --git a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs index 98de5435..076dc852 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs @@ -298,16 +298,6 @@ namespace Google.ProtocolBuffers.Descriptors get { return fieldType; } } - public bool IsCLSCompliant - { - get - { - return mappedType != MappedType.UInt32 && - mappedType != MappedType.UInt64 && - !NameHelpers.UnderscoresToPascalCase(Name).StartsWith("_"); - } - } - public int FieldNumber { get { return Proto.Number; } diff --git a/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs b/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs index fc58d046..752ecf66 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs @@ -40,7 +40,6 @@ namespace Google.ProtocolBuffers.Descriptors /// Defined specifically for the enumeration, /// this allows each field type to specify the mapped type and wire type. /// - [CLSCompliant(false)] [AttributeUsage(AttributeTargets.Field)] public sealed class FieldMappingAttribute : Attribute { diff --git a/csharp/src/ProtocolBuffers/ExtendableBuilder.cs b/csharp/src/ProtocolBuffers/ExtendableBuilder.cs index 111ff57e..62508e02 100644 --- a/csharp/src/ProtocolBuffers/ExtendableBuilder.cs +++ b/csharp/src/ProtocolBuffers/ExtendableBuilder.cs @@ -129,7 +129,6 @@ namespace Google.ProtocolBuffers /// Called by subclasses to parse an unknown field or an extension. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected override bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs b/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs index 2a71aa4a..7f97ccfb 100644 --- a/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs +++ b/csharp/src/ProtocolBuffers/ExtendableBuilderLite.cs @@ -132,7 +132,6 @@ namespace Google.ProtocolBuffers /// Called by subclasses to parse an unknown field or an extension. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected override bool ParseUnknownField(ICodedInputStream input, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/GeneratedBuilder.cs b/csharp/src/ProtocolBuffers/GeneratedBuilder.cs index fd6fe4d7..e60a4201 100644 --- a/csharp/src/ProtocolBuffers/GeneratedBuilder.cs +++ b/csharp/src/ProtocolBuffers/GeneratedBuilder.cs @@ -83,7 +83,6 @@ namespace Google.ProtocolBuffers /// Called by derived classes to parse an unknown field. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected virtual bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs b/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs index 4030e801..5783c987 100644 --- a/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs +++ b/csharp/src/ProtocolBuffers/GeneratedBuilderLite.cs @@ -65,7 +65,6 @@ namespace Google.ProtocolBuffers /// Called by derived classes to parse an unknown field. /// /// true unless the tag is an end-group tag - [CLSCompliant(false)] protected virtual bool ParseUnknownField(ICodedInputStream input, ExtensionRegistry extensionRegistry, uint tag, string fieldName) { diff --git a/csharp/src/ProtocolBuffers/ICodedInputStream.cs b/csharp/src/ProtocolBuffers/ICodedInputStream.cs index b39b602d..790274fb 100644 --- a/csharp/src/ProtocolBuffers/ICodedInputStream.cs +++ b/csharp/src/ProtocolBuffers/ICodedInputStream.cs @@ -78,7 +78,6 @@ namespace Google.ProtocolBuffers /// builders will always prefer the fieldTag over fieldName. /// /// - [CLSCompliant(false)] bool ReadTag(out uint fieldTag, out string fieldName); /// @@ -94,7 +93,6 @@ namespace Google.ProtocolBuffers /// /// Read a uint64 field from the stream. /// - [CLSCompliant(false)] bool ReadUInt64(ref ulong value); /// @@ -110,13 +108,11 @@ namespace Google.ProtocolBuffers /// /// Read a fixed64 field from the stream. /// - [CLSCompliant(false)] bool ReadFixed64(ref ulong value); /// /// Read a fixed32 field from the stream. /// - [CLSCompliant(false)] bool ReadFixed32(ref uint value); /// @@ -155,7 +151,6 @@ namespace Google.ProtocolBuffers /// /// Reads a uint32 field value from the stream. /// - [CLSCompliant(false)] bool ReadUInt32(ref uint value); /// @@ -169,7 +164,6 @@ namespace Google.ProtocolBuffers /// then the ref value is set and it returns true. Otherwise the unkown output /// value is set and this method returns false. /// - [CLSCompliant(false)] bool ReadEnum(ref T value, out object unknown) where T : struct, IComparable, IFormattable; @@ -197,14 +191,12 @@ namespace Google.ProtocolBuffers /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed and the /// type is numeric, it will read a packed array. /// - [CLSCompliant(false)] void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection list); /// /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will /// read a packed array. /// - [CLSCompliant(false)] void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown, IEnumLiteMap mapping); @@ -212,7 +204,6 @@ namespace Google.ProtocolBuffers /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will /// read a packed array. /// - [CLSCompliant(false)] void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown) where T : struct, IComparable, IFormattable; @@ -220,14 +211,12 @@ namespace Google.ProtocolBuffers /// Reads a set of messages using the as a template. T is not guaranteed to be /// the most derived type, it is only the type specifier for the collection. /// - [CLSCompliant(false)] void ReadMessageArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite; /// /// Reads a set of messages using the as a template. /// - [CLSCompliant(false)] void ReadGroupArray(uint fieldTag, string fieldName, ICollection list, T messageType, ExtensionRegistry registry) where T : IMessageLite; @@ -249,97 +238,81 @@ namespace Google.ProtocolBuffers /// /// false if the tag is an end-group tag, in which case /// nothing is skipped. Otherwise, returns true. - [CLSCompliant(false)] bool SkipField(); /// /// Reads one or more repeated string field values from the stream. /// - [CLSCompliant(false)] void ReadStringArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated ByteString field values from the stream. /// - [CLSCompliant(false)] void ReadBytesArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated boolean field values from the stream. /// - [CLSCompliant(false)] void ReadBoolArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Int32 field values from the stream. /// - [CLSCompliant(false)] void ReadInt32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SInt32 field values from the stream. /// - [CLSCompliant(false)] void ReadSInt32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated UInt32 field values from the stream. /// - [CLSCompliant(false)] void ReadUInt32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Fixed32 field values from the stream. /// - [CLSCompliant(false)] void ReadFixed32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SFixed32 field values from the stream. /// - [CLSCompliant(false)] void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Int64 field values from the stream. /// - [CLSCompliant(false)] void ReadInt64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SInt64 field values from the stream. /// - [CLSCompliant(false)] void ReadSInt64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated UInt64 field values from the stream. /// - [CLSCompliant(false)] void ReadUInt64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Fixed64 field values from the stream. /// - [CLSCompliant(false)] void ReadFixed64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated SFixed64 field values from the stream. /// - [CLSCompliant(false)] void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Double field values from the stream. /// - [CLSCompliant(false)] void ReadDoubleArray(uint fieldTag, string fieldName, ICollection list); /// /// Reads one or more repeated Float field values from the stream. /// - [CLSCompliant(false)] void ReadFloatArray(uint fieldTag, string fieldName, ICollection list); } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ICodedOutputStream.cs b/csharp/src/ProtocolBuffers/ICodedOutputStream.cs index 64c80653..77de60ca 100644 --- a/csharp/src/ProtocolBuffers/ICodedOutputStream.cs +++ b/csharp/src/ProtocolBuffers/ICodedOutputStream.cs @@ -85,7 +85,7 @@ namespace Google.ProtocolBuffers /// /// Writes an unknown field of a primitive type /// - [CLSCompliant(false)] + void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value); /// /// Writes an extension as a message-set group @@ -114,7 +114,6 @@ namespace Google.ProtocolBuffers /// /// Writes a uint64 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteUInt64(int fieldNumber, string fieldName, ulong value); /// @@ -130,13 +129,11 @@ namespace Google.ProtocolBuffers /// /// Writes a fixed64 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteFixed64(int fieldNumber, string fieldName, ulong value); /// /// Writes a fixed32 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteFixed32(int fieldNumber, string fieldName, uint value); /// @@ -167,7 +164,6 @@ namespace Google.ProtocolBuffers /// /// Writes a UInt32 field value, including tag, to the stream. /// - [CLSCompliant(false)] void WriteUInt32(int fieldNumber, string fieldName, uint value); /// @@ -290,7 +286,6 @@ namespace Google.ProtocolBuffers /// /// Writes a repeated enumeration value of type T, including tag(s), to the stream. /// - [CLSCompliant(false)] void WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list) where T : struct, IComparable, IFormattable; @@ -367,7 +362,6 @@ namespace Google.ProtocolBuffers /// /// Writes a packed repeated enumeration of type T, including tag and length, to the stream. /// - [CLSCompliant(false)] void WritePackedEnumArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) where T : struct, IComparable, IFormattable; } diff --git a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs index cbab444d..063f6666 100644 --- a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs @@ -65,8 +65,6 @@ using System.Security; [assembly: AssemblyFileVersion("2.4.1.555")] #endif -[assembly: CLSCompliant(true)] - #if CLIENTPROFILE // ROK - not defined in SL, CF, or PL [assembly: AllowPartiallyTrustedCallers] #endif diff --git a/csharp/src/ProtocolBuffers/TextFormat.cs b/csharp/src/ProtocolBuffers/TextFormat.cs index 747dce4e..951cdc0e 100644 --- a/csharp/src/ProtocolBuffers/TextFormat.cs +++ b/csharp/src/ProtocolBuffers/TextFormat.cs @@ -300,7 +300,6 @@ namespace Google.ProtocolBuffers } } - [CLSCompliant(false)] public static ulong ParseUInt64(string text) { return (ulong) ParseInteger(text, false, true); @@ -311,7 +310,6 @@ namespace Google.ProtocolBuffers return ParseInteger(text, true, true); } - [CLSCompliant(false)] public static uint ParseUInt32(string text) { return (uint) ParseInteger(text, false, false); diff --git a/csharp/src/ProtocolBuffers/UnknownField.cs b/csharp/src/ProtocolBuffers/UnknownField.cs index e03477fe..7650b9df 100644 --- a/csharp/src/ProtocolBuffers/UnknownField.cs +++ b/csharp/src/ProtocolBuffers/UnknownField.cs @@ -339,7 +339,6 @@ namespace Google.ProtocolBuffers /// /// Adds a varint value. /// - [CLSCompliant(false)] public Builder AddVarint(ulong value) { varintList = Add(varintList, value); @@ -349,7 +348,6 @@ namespace Google.ProtocolBuffers /// /// Adds a fixed32 value. /// - [CLSCompliant(false)] public Builder AddFixed32(uint value) { fixed32List = Add(fixed32List, value); @@ -359,7 +357,6 @@ namespace Google.ProtocolBuffers /// /// Adds a fixed64 value. /// - [CLSCompliant(false)] public Builder AddFixed64(ulong value) { fixed64List = Add(fixed64List, value); diff --git a/csharp/src/ProtocolBuffers/UnknownFieldSet.cs b/csharp/src/ProtocolBuffers/UnknownFieldSet.cs index 09ed680f..aee1b7c9 100644 --- a/csharp/src/ProtocolBuffers/UnknownFieldSet.cs +++ b/csharp/src/ProtocolBuffers/UnknownFieldSet.cs @@ -446,7 +446,6 @@ namespace Google.ProtocolBuffers /// The field's tag number, which was already parsed. /// The coded input stream containing the field /// false if the tag is an "end group" tag, true otherwise - [CLSCompliant(false)] public bool MergeFieldFrom(uint tag, ICodedInputStream input) { if (tag == 0) @@ -554,7 +553,6 @@ namespace Google.ProtocolBuffers /// value. This is used in particular when an unknown enum value is /// encountered. /// - [CLSCompliant(false)] public Builder MergeVarintField(int number, ulong value) { if (number == 0) diff --git a/csharp/src/ProtocolBuffers/WireFormat.cs b/csharp/src/ProtocolBuffers/WireFormat.cs index a03f1652..b9daa328 100644 --- a/csharp/src/ProtocolBuffers/WireFormat.cs +++ b/csharp/src/ProtocolBuffers/WireFormat.cs @@ -63,7 +63,6 @@ namespace Google.ProtocolBuffers #endregion - [CLSCompliant(false)] public enum WireType : uint { Varint = 0, @@ -95,13 +94,11 @@ namespace Google.ProtocolBuffers /// /// Given a tag value, determines the wire type (lower 3 bits). /// - [CLSCompliant(false)] public static WireType GetTagWireType(uint tag) { return (WireType) (tag & TagTypeMask); } - [CLSCompliant(false)] public static bool IsEndGroupTag(uint tag) { return (WireType) (tag & TagTypeMask) == WireType.EndGroup; @@ -110,7 +107,6 @@ namespace Google.ProtocolBuffers /// /// Given a tag value, determines the field number (the upper 29 bits). /// - [CLSCompliant(false)] public static int GetTagFieldNumber(uint tag) { return (int) tag >> TagTypeBits; @@ -120,14 +116,12 @@ namespace Google.ProtocolBuffers /// Makes a tag value given a field number and wire type. /// TODO(jonskeet): Should we just have a Tag structure? /// - [CLSCompliant(false)] public static uint MakeTag(int fieldNumber, WireType wireType) { return (uint) (fieldNumber << TagTypeBits) | (uint) wireType; } #if !LITE - [CLSCompliant(false)] public static uint MakeTag(FieldDescriptor field) { return MakeTag(field.FieldNumber, GetWireType(field)); @@ -148,7 +142,6 @@ namespace Google.ProtocolBuffers /// Converts a field type to its wire type. Done with a switch for the sake /// of speed - this is significantly faster than a dictionary lookup. /// - [CLSCompliant(false)] public static WireType GetWireType(FieldType fieldType) { switch (fieldType) -- cgit v1.2.3 From 0e916d09a3fa272399b38f09b5509e0e2445e7fb Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 12:22:35 +0100 Subject: Removing more C# project files. --- .../ProtocolBuffers.Serialization.CF20.csproj | 104 -------------------- .../ProtocolBuffers.Serialization.CF35.csproj | 104 -------------------- .../ProtocolBuffers.Serialization.NET20.csproj | 92 ------------------ .../ProtocolBuffers.Serialization.NET35.csproj | 92 ------------------ .../ProtocolBuffers.Serialization.NET40.csproj | 92 ------------------ .../ProtocolBuffers.Serialization.PL40.csproj | 95 ------------------ .../ProtocolBuffers.Serialization.SL20.csproj | 107 -------------------- .../ProtocolBuffers.Serialization.SL30.csproj | 107 -------------------- .../ProtocolBuffers.Serialization.SL40.csproj | 108 --------------------- .../ProtocolBuffersLite.Serialization.CF20.csproj | 104 -------------------- .../ProtocolBuffersLite.Serialization.CF35.csproj | 104 -------------------- .../ProtocolBuffersLite.Serialization.NET20.csproj | 92 ------------------ .../ProtocolBuffersLite.Serialization.NET35.csproj | 92 ------------------ .../ProtocolBuffersLite.Serialization.NET40.csproj | 92 ------------------ .../ProtocolBuffersLite.Serialization.PL40.csproj | 95 ------------------ .../ProtocolBuffersLite.Serialization.SL20.csproj | 107 -------------------- .../ProtocolBuffersLite.Serialization.SL30.csproj | 107 -------------------- .../ProtocolBuffersLite.Serialization.SL40.csproj | 108 --------------------- 18 files changed, 1802 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF35.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET35.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET40.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.PL40.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL30.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL40.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF35.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET35.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET40.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.PL40.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL30.csproj delete mode 100644 csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL40.csproj (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF20.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF20.csproj deleted file mode 100644 index 0639ec65..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF20.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF35.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF35.csproj deleted file mode 100644 index 22f381f9..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF35.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET20.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET20.csproj deleted file mode 100644 index dfeab79c..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET20.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET35.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET35.csproj deleted file mode 100644 index 4bed60d7..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET35.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET40.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET40.csproj deleted file mode 100644 index 80b76a0e..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET40.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.PL40.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.PL40.csproj deleted file mode 100644 index 60f87748..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.PL40.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL20.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL20.csproj deleted file mode 100644 index f8c4c097..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL20.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL30.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL30.csproj deleted file mode 100644 index 376c4936..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL30.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL40.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL40.csproj deleted file mode 100644 index dc675c47..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL40.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF20.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF20.csproj deleted file mode 100644 index b382dc3e..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF20.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF35.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF35.csproj deleted file mode 100644 index 558931d5..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF35.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET20.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET20.csproj deleted file mode 100644 index 1e145abe..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET20.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET35.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET35.csproj deleted file mode 100644 index 9fd744c5..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET35.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET40.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET40.csproj deleted file mode 100644 index 1254fdf2..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET40.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.PL40.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.PL40.csproj deleted file mode 100644 index c6fbb6a7..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.PL40.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL20.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL20.csproj deleted file mode 100644 index 9e891070..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL20.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL30.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL30.csproj deleted file mode 100644 index 6d3ac128..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL30.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL40.csproj b/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL40.csproj deleted file mode 100644 index 9b341632..00000000 --- a/csharp/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL40.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file -- cgit v1.2.3 From c5c9c6a7e05a44724bc4bc6192ff995b4398d559 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Wed, 29 Apr 2015 11:33:07 -0700 Subject: field presence Reflection and tests --- .../google/protobuf/field_presence_test.proto | 24 + .../src/ProtocolBuffers.Test/FieldPResenceTest.cs | 187 ++++ .../ProtocolBuffers.Test.csproj | 2 + .../TestProtos/FieldPresense.cs | 965 +++++++++++++++++++++ .../ProtocolBuffers/Descriptors/FileDescriptor.cs | 16 + .../FieldAccess/FieldAccessorTable.cs | 13 +- .../FieldAccess/SingleEnumAccessor.cs | 2 +- .../FieldAccess/SingleMessageAccessor.cs | 2 +- .../FieldAccess/SinglePrimitiveAccessor.cs | 24 +- 9 files changed, 1225 insertions(+), 10 deletions(-) create mode 100644 csharp/protos/google/protobuf/field_presence_test.proto create mode 100644 csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs (limited to 'csharp/src') diff --git a/csharp/protos/google/protobuf/field_presence_test.proto b/csharp/protos/google/protobuf/field_presence_test.proto new file mode 100644 index 00000000..43b4f04b --- /dev/null +++ b/csharp/protos/google/protobuf/field_presence_test.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package field_presence_test; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldPresenceTestProto"; +option java_generate_equals_and_hash = true; + +message TestAllTypes { + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + } + message NestedMessage { + optional int32 value = 1; + } + + optional int32 optional_int32 = 1; + optional string optional_string = 2; + optional bytes optional_bytes = 3; + optional NestedEnum optional_nested_enum = 4; + optional NestedMessage optional_nested_message = 5; +} diff --git a/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs b/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs new file mode 100644 index 00000000..7e5abbf2 --- /dev/null +++ b/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs @@ -0,0 +1,187 @@ +#region Copyright notice and license + +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// Author: jieluo@google.com (Jie Luo) +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Reflection; +using System.Collections.Generic; +using Google.ProtocolBuffers.Descriptors; +using Google.ProtocolBuffers.TestProtos; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Google.ProtocolBuffers +{ + [TestClass] + class FieldPresenceTest + { + private void CheckHasMethodRemoved(Type proto2Type, Type proto3Type, string name) + { + Assert.NotNull(proto2Type.GetProperty(name)); + Assert.NotNull(proto2Type.GetProperty("Has" + name)); + Assert.NotNull(proto3Type.GetProperty(name)); + Assert.Null(proto3Type.GetProperty("Has" + name)); + } + + [TestMethod] + public void TestHasMethod() + { + // Optional non-message fields don't have HasFoo method generated + Type proto2Type = typeof(TestAllTypes); + Type proto3Type = typeof(field_presence_test.TestAllTypes); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); + + proto2Type = typeof(TestAllTypes.Builder); + proto3Type = typeof(field_presence_test.TestAllTypes.Builder); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); + + // message fields still have the HasFoo method generated + Assert.False(field_presence_test.TestAllTypes.CreateBuilder().Build().HasOptionalNestedMessage); + Assert.False(field_presence_test.TestAllTypes.CreateBuilder().HasOptionalNestedMessage); + } + + [TestMethod] + public void TestFieldPresence() + { + // Optional non-message fields set to their default value are treated the same + // way as not set. + + // Serialization will ignore such fields. + field_presence_test.TestAllTypes.Builder builder = field_presence_test.TestAllTypes.CreateBuilder(); + builder.SetOptionalInt32(0); + builder.SetOptionalString(""); + builder.SetOptionalBytes(ByteString.Empty); + builder.SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.FOO); + field_presence_test.TestAllTypes message = builder.Build(); + Assert.AreEqual(0, message.SerializedSize); + + // Test merge + field_presence_test.TestAllTypes.Builder a = field_presence_test.TestAllTypes.CreateBuilder(); + a.SetOptionalInt32(1); + a.SetOptionalString("x"); + a.SetOptionalBytes(ByteString.CopyFromUtf8("y")); + a.SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.BAR); + a.MergeFrom(message); + field_presence_test.TestAllTypes messageA = a.Build(); + Assert.AreEqual(1, messageA.OptionalInt32); + Assert.AreEqual("x", messageA.OptionalString); + Assert.AreEqual(ByteString.CopyFromUtf8("y"), messageA.OptionalBytes); + Assert.AreEqual(field_presence_test.TestAllTypes.Types.NestedEnum.BAR, messageA.OptionalNestedEnum); + + // equals/hashCode should produce the same results + field_presence_test.TestAllTypes empty = field_presence_test.TestAllTypes.CreateBuilder().Build(); + Assert.True(empty.Equals(message)); + Assert.True(message.Equals(empty)); + Assert.AreEqual(empty.GetHashCode(), message.GetHashCode()); + } + + [TestMethod] + public void TestFieldPresenceReflection() + { + MessageDescriptor descriptor = field_presence_test.TestAllTypes.Descriptor; + FieldDescriptor optionalInt32Field = descriptor.FindFieldByName("optional_int32"); + FieldDescriptor optionalStringField = descriptor.FindFieldByName("optional_string"); + FieldDescriptor optionalBytesField = descriptor.FindFieldByName("optional_bytes"); + FieldDescriptor optionalNestedEnumField = descriptor.FindFieldByName("optional_nested_enum"); + + field_presence_test.TestAllTypes message = field_presence_test.TestAllTypes.CreateBuilder().Build(); + Assert.False(message.HasField(optionalInt32Field)); + Assert.False(message.HasField(optionalStringField)); + Assert.False(message.HasField(optionalBytesField)); + Assert.False(message.HasField(optionalNestedEnumField)); + + // Set to default value is seen as not present + message = field_presence_test.TestAllTypes.CreateBuilder() + .SetOptionalInt32(0) + .SetOptionalString("") + .SetOptionalBytes(ByteString.Empty) + .SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.FOO) + .Build(); + Assert.False(message.HasField(optionalInt32Field)); + Assert.False(message.HasField(optionalStringField)); + Assert.False(message.HasField(optionalBytesField)); + Assert.False(message.HasField(optionalNestedEnumField)); + Assert.AreEqual(0, message.AllFields.Count); + + // Set t0 non-defalut value is seen as present + message = field_presence_test.TestAllTypes.CreateBuilder() + .SetOptionalInt32(1) + .SetOptionalString("x") + .SetOptionalBytes(ByteString.CopyFromUtf8("y")) + .SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.BAR) + .Build(); + Assert.True(message.HasField(optionalInt32Field)); + Assert.True(message.HasField(optionalStringField)); + Assert.True(message.HasField(optionalBytesField)); + Assert.True(message.HasField(optionalNestedEnumField)); + Assert.AreEqual(4, message.AllFields.Count); + } + + [TestMethod] + public void TestMessageField() + { + field_presence_test.TestAllTypes.Builder builder = field_presence_test.TestAllTypes.CreateBuilder(); + Assert.False(builder.HasOptionalNestedMessage); + Assert.False(builder.Build().HasOptionalNestedMessage); + + // Unlike non-message fields, if we set default value to message field, the field + // shoule be seem as present. + builder.SetOptionalNestedMessage(field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance); + Assert.True(builder.HasOptionalNestedMessage); + Assert.True(builder.Build().HasOptionalNestedMessage); + + } + + [TestMethod] + public void TestSeralizeAndParese() + { + field_presence_test.TestAllTypes.Builder builder = field_presence_test.TestAllTypes.CreateBuilder(); + builder.SetOptionalInt32(1234); + builder.SetOptionalString("hello"); + builder.SetOptionalNestedMessage(field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance); + ByteString data = builder.Build().ToByteString(); + + field_presence_test.TestAllTypes message = field_presence_test.TestAllTypes.ParseFrom(data); + Assert.AreEqual(1234, message.OptionalInt32); + Assert.AreEqual("hello", message.OptionalString); + Assert.AreEqual(ByteString.Empty, message.OptionalBytes); + Assert.AreEqual(field_presence_test.TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); + Assert.True(message.HasOptionalNestedMessage); + Assert.AreEqual(0, message.OptionalNestedMessage.Value); + } + } +} diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index b11b1ad8..8a9a8002 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -71,6 +71,7 @@ + @@ -82,6 +83,7 @@ + diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs new file mode 100644 index 00000000..64f447f1 --- /dev/null +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs @@ -0,0 +1,965 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/google/protobuf/field_presence_test.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace field_presence_test +{ + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class FieldPresenceTest + { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) + { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_field_presence_test_TestAllTypes__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_field_presence_test_TestAllTypes__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor + { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static FieldPresenceTest() + { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu", + "cHJvdG8SE2ZpZWxkX3ByZXNlbmNlX3Rlc3QivgIKDFRlc3RBbGxUeXBlcxIW", + "Cg5vcHRpb25hbF9pbnQzMhgBIAEoBRIXCg9vcHRpb25hbF9zdHJpbmcYAiAB", + "KAkSFgoOb3B0aW9uYWxfYnl0ZXMYAyABKAwSSgoUb3B0aW9uYWxfbmVzdGVk", + "X2VudW0YBCABKA4yLC5maWVsZF9wcmVzZW5jZV90ZXN0LlRlc3RBbGxUeXBl", + "cy5OZXN0ZWRFbnVtElAKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGAUgASgL", + "Mi8uZmllbGRfcHJlc2VuY2VfdGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVz", + "c2FnZRoeCg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3Rl", + "ZEVudW0SBwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJCMAoTY29tLmdvb2ds", + "ZS5wcm90b2J1ZkIWRmllbGRQcmVzZW5jZVRlc3RQcm90b6ABAWIGcHJvdG8z")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) + { + descriptor = root; + internal__static_field_presence_test_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; + internal__static_field_presence_test_TestAllTypes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_field_presence_test_TestAllTypes__Descriptor, + new string[] { "OptionalInt32", "OptionalString", "OptionalBytes", "OptionalNestedEnum", "OptionalNestedMessage", }); + internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor = internal__static_field_presence_test_TestAllTypes__Descriptor.NestedTypes[0]; + internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor, + new string[] { "Value", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestAllTypes : pb::GeneratedMessage + { + private TestAllTypes() { } + private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); + private static readonly string[] _testAllTypesFieldNames = new string[] { "optional_bytes", "optional_int32", "optional_nested_enum", "optional_nested_message", "optional_string" }; + private static readonly uint[] _testAllTypesFieldTags = new uint[] { 26, 8, 32, 42, 18 }; + public static TestAllTypes DefaultInstance + { + get { return defaultInstance; } + } + + public override TestAllTypes DefaultInstanceForType + { + get { return DefaultInstance; } + } + + protected override TestAllTypes ThisMessage + { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor + { + get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors + { + get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types + { + public enum NestedEnum + { + FOO = 0, + BAR = 1, + BAZ = 2, + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NestedMessage : pb::GeneratedMessage + { + private NestedMessage() { } + private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); + private static readonly string[] _nestedMessageFieldNames = new string[] { "value" }; + private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; + public static NestedMessage DefaultInstance + { + get { return defaultInstance; } + } + + public override NestedMessage DefaultInstanceForType + { + get { return DefaultInstance; } + } + + protected override NestedMessage ThisMessage + { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor + { + get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors + { + get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable; } + } + + public const int ValueFieldNumber = 1; + private int value_; + public int Value + { + get { return value_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) + { + CalcSerializedSize(); + string[] field_names = _nestedMessageFieldNames; + if (Value != 0) + { + output.WriteInt32(1, field_names[0], Value); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize + { + get + { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() + { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (Value != 0) + { + size += pb::CodedOutputStream.ComputeInt32Size(1, Value); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NestedMessage ParseFrom(pb::ByteString data) + { + return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data) + { + return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input) + { + return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) + { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) + { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input) + { + return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NestedMessage MakeReadOnly() + { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NestedMessage prototype) + { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder + { + protected override Builder ThisBuilder + { + get { return this; } + } + public Builder() + { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NestedMessage cloneFrom) + { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NestedMessage result; + + private NestedMessage PrepareBuilder() + { + if (resultIsReadOnly) + { + NestedMessage original = result; + result = new NestedMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized + { + get { return result.IsInitialized; } + } + + protected override NestedMessage MessageBeingBuilt + { + get { return PrepareBuilder(); } + } + + public override Builder Clear() + { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() + { + if (resultIsReadOnly) + { + return new Builder(result); + } + else + { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType + { + get { return global::field_presence_test.TestAllTypes.Types.NestedMessage.Descriptor; } + } + + public override NestedMessage DefaultInstanceForType + { + get { return global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override NestedMessage BuildPartial() + { + if (resultIsReadOnly) + { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) + { + if (other is NestedMessage) + { + return MergeFrom((NestedMessage)other); + } + else + { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NestedMessage other) + { + if (other == global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.Value != 0) + { + Value = other.Value; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) + { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) + { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) + { + if (tag == 0 && field_name != null) + { + int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if (field_ordinal >= 0) + tag = _nestedMessageFieldTags[field_ordinal]; + else + { + if (unknownFields == null) + { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) + { + case 0: + { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: + { + if (pb::WireFormat.IsEndGroupTag(tag)) + { + if (unknownFields != null) + { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) + { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: + { + input.ReadInt32(ref result.value_); + break; + } + } + } + + if (unknownFields != null) + { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int Value + { + get { return result.Value; } + set { SetValue(value); } + } + public Builder SetValue(int value) + { + PrepareBuilder(); + result.value_ = value; + return this; + } + public Builder ClearValue() + { + PrepareBuilder(); + result.value_ = 0; + return this; + } + } + static NestedMessage() + { + object.ReferenceEquals(global::field_presence_test.FieldPresenceTest.Descriptor, null); + } + } + + } + #endregion + + public const int OptionalInt32FieldNumber = 1; + private int optionalInt32_; + public int OptionalInt32 + { + get { return optionalInt32_; } + } + + public const int OptionalStringFieldNumber = 2; + private string optionalString_ = ""; + public string OptionalString + { + get { return optionalString_; } + } + + public const int OptionalBytesFieldNumber = 3; + private pb::ByteString optionalBytes_ = pb::ByteString.Empty; + public pb::ByteString OptionalBytes + { + get { return optionalBytes_; } + } + + public const int OptionalNestedEnumFieldNumber = 4; + private global::field_presence_test.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO; + public global::field_presence_test.TestAllTypes.Types.NestedEnum OptionalNestedEnum + { + get { return optionalNestedEnum_; } + } + + public const int OptionalNestedMessageFieldNumber = 5; + private bool hasOptionalNestedMessage; + private global::field_presence_test.TestAllTypes.Types.NestedMessage optionalNestedMessage_; + public bool HasOptionalNestedMessage + { + get { return hasOptionalNestedMessage; } + } + public global::field_presence_test.TestAllTypes.Types.NestedMessage OptionalNestedMessage + { + get { return optionalNestedMessage_ ?? global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override void WriteTo(pb::ICodedOutputStream output) + { + CalcSerializedSize(); + string[] field_names = _testAllTypesFieldNames; + if (OptionalInt32 != 0) + { + output.WriteInt32(1, field_names[1], OptionalInt32); + } + if (OptionalString != "") + { + output.WriteString(2, field_names[4], OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) + { + output.WriteBytes(3, field_names[0], OptionalBytes); + } + if (OptionalNestedEnum != global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO) + { + output.WriteEnum(4, field_names[2], (int)OptionalNestedEnum, OptionalNestedEnum); + } + if (hasOptionalNestedMessage) + { + output.WriteMessage(5, field_names[3], OptionalNestedMessage); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize + { + get + { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() + { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (OptionalInt32 != 0) + { + size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); + } + if (OptionalString != "") + { + size += pb::CodedOutputStream.ComputeStringSize(2, OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) + { + size += pb::CodedOutputStream.ComputeBytesSize(3, OptionalBytes); + } + if (OptionalNestedEnum != global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO) + { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int)OptionalNestedEnum); + } + if (hasOptionalNestedMessage) + { + size += pb::CodedOutputStream.ComputeMessageSize(5, OptionalNestedMessage); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TestAllTypes ParseFrom(pb::ByteString data) + { + return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data) + { + return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input) + { + return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) + { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) + { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input) + { + return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) + { + return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TestAllTypes MakeReadOnly() + { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TestAllTypes prototype) + { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder + { + protected override Builder ThisBuilder + { + get { return this; } + } + public Builder() + { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TestAllTypes cloneFrom) + { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TestAllTypes result; + + private TestAllTypes PrepareBuilder() + { + if (resultIsReadOnly) + { + TestAllTypes original = result; + result = new TestAllTypes(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized + { + get { return result.IsInitialized; } + } + + protected override TestAllTypes MessageBeingBuilt + { + get { return PrepareBuilder(); } + } + + public override Builder Clear() + { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() + { + if (resultIsReadOnly) + { + return new Builder(result); + } + else + { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType + { + get { return global::field_presence_test.TestAllTypes.Descriptor; } + } + + public override TestAllTypes DefaultInstanceForType + { + get { return global::field_presence_test.TestAllTypes.DefaultInstance; } + } + + public override TestAllTypes BuildPartial() + { + if (resultIsReadOnly) + { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) + { + if (other is TestAllTypes) + { + return MergeFrom((TestAllTypes)other); + } + else + { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TestAllTypes other) + { + if (other == global::field_presence_test.TestAllTypes.DefaultInstance) return this; + PrepareBuilder(); + if (other.OptionalInt32 != 0) + { + OptionalInt32 = other.OptionalInt32; + } + if (other.OptionalString != "") + { + OptionalString = other.OptionalString; + } + if (other.OptionalBytes != pb::ByteString.Empty) + { + OptionalBytes = other.OptionalBytes; + } + if (other.OptionalNestedEnum != global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO) + { + OptionalNestedEnum = other.OptionalNestedEnum; + } + if (other.HasOptionalNestedMessage) + { + MergeOptionalNestedMessage(other.OptionalNestedMessage); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) + { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) + { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) + { + if (tag == 0 && field_name != null) + { + int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); + if (field_ordinal >= 0) + tag = _testAllTypesFieldTags[field_ordinal]; + else + { + if (unknownFields == null) + { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) + { + case 0: + { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: + { + if (pb::WireFormat.IsEndGroupTag(tag)) + { + if (unknownFields != null) + { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) + { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: + { + input.ReadInt32(ref result.optionalInt32_); + break; + } + case 18: + { + input.ReadString(ref result.optionalString_); + break; + } + case 26: + { + input.ReadBytes(ref result.optionalBytes_); + break; + } + case 32: + { + object unknown; + if (input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) + { + } + else if (unknown is int) + { + if (unknownFields == null) + { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + case 42: + { + global::field_presence_test.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::field_presence_test.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOptionalNestedMessage) + { + subBuilder.MergeFrom(OptionalNestedMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalNestedMessage = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) + { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int OptionalInt32 + { + get { return result.OptionalInt32; } + set { SetOptionalInt32(value); } + } + public Builder SetOptionalInt32(int value) + { + PrepareBuilder(); + result.optionalInt32_ = value; + return this; + } + public Builder ClearOptionalInt32() + { + PrepareBuilder(); + result.optionalInt32_ = 0; + return this; + } + + public string OptionalString + { + get { return result.OptionalString; } + set { SetOptionalString(value); } + } + public Builder SetOptionalString(string value) + { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalString_ = value; + return this; + } + public Builder ClearOptionalString() + { + PrepareBuilder(); + result.optionalString_ = ""; + return this; + } + + public pb::ByteString OptionalBytes + { + get { return result.OptionalBytes; } + set { SetOptionalBytes(value); } + } + public Builder SetOptionalBytes(pb::ByteString value) + { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalBytes_ = value; + return this; + } + public Builder ClearOptionalBytes() + { + PrepareBuilder(); + result.optionalBytes_ = pb::ByteString.Empty; + return this; + } + + public global::field_presence_test.TestAllTypes.Types.NestedEnum OptionalNestedEnum + { + get { return result.OptionalNestedEnum; } + set { SetOptionalNestedEnum(value); } + } + public Builder SetOptionalNestedEnum(global::field_presence_test.TestAllTypes.Types.NestedEnum value) + { + PrepareBuilder(); + result.optionalNestedEnum_ = value; + return this; + } + public Builder ClearOptionalNestedEnum() + { + PrepareBuilder(); + result.optionalNestedEnum_ = global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO; + return this; + } + + public bool HasOptionalNestedMessage + { + get { return result.hasOptionalNestedMessage; } + } + public global::field_presence_test.TestAllTypes.Types.NestedMessage OptionalNestedMessage + { + get { return result.OptionalNestedMessage; } + set { SetOptionalNestedMessage(value); } + } + public Builder SetOptionalNestedMessage(global::field_presence_test.TestAllTypes.Types.NestedMessage value) + { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = value; + return this; + } + public Builder SetOptionalNestedMessage(global::field_presence_test.TestAllTypes.Types.NestedMessage.Builder builderForValue) + { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalNestedMessage(global::field_presence_test.TestAllTypes.Types.NestedMessage value) + { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalNestedMessage && + result.optionalNestedMessage_ != global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance) + { + result.optionalNestedMessage_ = global::field_presence_test.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); + } + else + { + result.optionalNestedMessage_ = value; + } + result.hasOptionalNestedMessage = true; + return this; + } + public Builder ClearOptionalNestedMessage() + { + PrepareBuilder(); + result.hasOptionalNestedMessage = false; + result.optionalNestedMessage_ = null; + return this; + } + } + static TestAllTypes() + { + object.ReferenceEquals(global::field_presence_test.FieldPresenceTest.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs index 354e99a3..8a3e26fa 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs @@ -54,6 +54,22 @@ namespace Google.ProtocolBuffers.Descriptors private readonly IList publicDependencies; private readonly DescriptorPool pool; + public enum Syntax + { + UNKNOWN, + PROTO2, + PROTO3 + } + + public Syntax GetSyntax() + { + if (proto.Syntax == "proto3") + { + return Syntax.PROTO3; + } + return Syntax.PROTO2; + } + private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies) { this.pool = pool; diff --git a/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs b/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs index 6ba039c1..60b032e2 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs @@ -68,16 +68,21 @@ namespace Google.ProtocolBuffers.FieldAccess { this.descriptor = descriptor; accessors = new IFieldAccessor[descriptor.Fields.Count]; + bool supportFieldPresence = false; + if (descriptor.File.GetSyntax() == FileDescriptor.Syntax.PROTO2) + { + supportFieldPresence = true; + } for (int i = 0; i < accessors.Length; i++) { - accessors[i] = CreateAccessor(descriptor.Fields[i], propertyNames[i]); + accessors[i] = CreateAccessor(descriptor.Fields[i], propertyNames[i], supportFieldPresence); } } /// /// Creates an accessor for a single field /// - private static IFieldAccessor CreateAccessor(FieldDescriptor field, string name) + private static IFieldAccessor CreateAccessor(FieldDescriptor field, string name, bool supportFieldPresence) { if (field.IsRepeated) { @@ -98,9 +103,9 @@ namespace Google.ProtocolBuffers.FieldAccess case MappedType.Message: return new SingleMessageAccessor(name); case MappedType.Enum: - return new SingleEnumAccessor(field, name); + return new SingleEnumAccessor(field, name, supportFieldPresence); default: - return new SinglePrimitiveAccessor(name); + return new SinglePrimitiveAccessor(field, name, supportFieldPresence); } } } diff --git a/csharp/src/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs b/csharp/src/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs index 6327cc55..e63f717c 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs @@ -42,7 +42,7 @@ namespace Google.ProtocolBuffers.FieldAccess { private readonly EnumDescriptor enumDescriptor; - internal SingleEnumAccessor(FieldDescriptor field, string name) : base(name) + internal SingleEnumAccessor(FieldDescriptor field, string name, bool supportFieldPresence) : base(field, name, supportFieldPresence) { enumDescriptor = field.EnumType; } diff --git a/csharp/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs b/csharp/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs index 6bf48a0c..0ec2b0b7 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs @@ -48,7 +48,7 @@ namespace Google.ProtocolBuffers.FieldAccess /// private readonly Func createBuilderDelegate; - internal SingleMessageAccessor(string name) : base(name) + internal SingleMessageAccessor(string name) : base(null, name, true) { MethodInfo createBuilderMethod = ClrType.GetMethod("CreateBuilder", ReflectionUtil.EmptyTypes); if (createBuilderMethod == null) diff --git a/csharp/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs b/csharp/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs index e5a07540..b964066d 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs @@ -31,6 +31,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Reflection; +using Google.ProtocolBuffers.Descriptors; namespace Google.ProtocolBuffers.FieldAccess { @@ -42,6 +43,7 @@ namespace Google.ProtocolBuffers.FieldAccess where TBuilder : IBuilder { private readonly Type clrType; + private readonly FieldDescriptor field; private readonly Func getValueDelegate; private readonly Action setValueDelegate; private readonly Func hasDelegate; @@ -56,18 +58,28 @@ namespace Google.ProtocolBuffers.FieldAccess get { return clrType; } } - internal SinglePrimitiveAccessor(string name) + internal SinglePrimitiveAccessor(FieldDescriptor fieldDesriptor, string name, bool supportFieldPresence) { + field = fieldDesriptor; PropertyInfo messageProperty = typeof(TMessage).GetProperty(name, null, ReflectionUtil.EmptyTypes); PropertyInfo builderProperty = typeof(TBuilder).GetProperty(name, null, ReflectionUtil.EmptyTypes); - PropertyInfo hasProperty = typeof(TMessage).GetProperty("Has" + name); MethodInfo clearMethod = typeof(TBuilder).GetMethod("Clear" + name); - if (messageProperty == null || builderProperty == null || hasProperty == null || clearMethod == null) + if (messageProperty == null || builderProperty == null || clearMethod == null) { throw new ArgumentException("Not all required properties/methods available"); } + + if (supportFieldPresence) + { + PropertyInfo hasProperty = typeof(TMessage).GetProperty("Has" + name); + if (hasProperty == null) + { + throw new ArgumentException("Has properties not available"); + } + hasDelegate = ReflectionUtil.CreateDelegateFunc(hasProperty.GetGetMethod()); + } + clrType = messageProperty.PropertyType; - hasDelegate = ReflectionUtil.CreateDelegateFunc(hasProperty.GetGetMethod()); clearDelegate = ReflectionUtil.CreateDelegateFunc(clearMethod); getValueDelegate = ReflectionUtil.CreateUpcastDelegate(messageProperty.GetGetMethod()); setValueDelegate = ReflectionUtil.CreateDowncastDelegate(builderProperty.GetSetMethod()); @@ -75,6 +87,10 @@ namespace Google.ProtocolBuffers.FieldAccess public bool Has(TMessage message) { + if (hasDelegate == null) + { + return !GetValue(message).Equals(field.DefaultValue); + } return hasDelegate(message); } -- cgit v1.2.3 From d1f5acaafbc9ed053fbf0c789f70e3414c01a2e6 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Wed, 29 Apr 2015 11:49:14 -0700 Subject: Change the package for field_presence_test.proto --- .../google/protobuf/field_presence_test.proto | 2 +- .../src/ProtocolBuffers.Test/FieldPResenceTest.cs | 48 +- .../TestProtos/FieldPresense.cs | 1748 +++++++++----------- 3 files changed, 808 insertions(+), 990 deletions(-) (limited to 'csharp/src') diff --git a/csharp/protos/google/protobuf/field_presence_test.proto b/csharp/protos/google/protobuf/field_presence_test.proto index 43b4f04b..41a9a5cc 100644 --- a/csharp/protos/google/protobuf/field_presence_test.proto +++ b/csharp/protos/google/protobuf/field_presence_test.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package field_presence_test; +package Google.ProtocolBuffers.TestProtos.FieldPresence; option java_package = "com.google.protobuf"; option java_outer_classname = "FieldPresenceTestProto"; diff --git a/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs b/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs index 7e5abbf2..a4818b63 100644 --- a/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs +++ b/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs @@ -56,22 +56,22 @@ namespace Google.ProtocolBuffers { // Optional non-message fields don't have HasFoo method generated Type proto2Type = typeof(TestAllTypes); - Type proto3Type = typeof(field_presence_test.TestAllTypes); + Type proto3Type = typeof(FieldPresence.TestAllTypes); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); proto2Type = typeof(TestAllTypes.Builder); - proto3Type = typeof(field_presence_test.TestAllTypes.Builder); + proto3Type = typeof(FieldPresence.TestAllTypes.Builder); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); // message fields still have the HasFoo method generated - Assert.False(field_presence_test.TestAllTypes.CreateBuilder().Build().HasOptionalNestedMessage); - Assert.False(field_presence_test.TestAllTypes.CreateBuilder().HasOptionalNestedMessage); + Assert.False(FieldPresence.TestAllTypes.CreateBuilder().Build().HasOptionalNestedMessage); + Assert.False(FieldPresence.TestAllTypes.CreateBuilder().HasOptionalNestedMessage); } [TestMethod] @@ -81,29 +81,29 @@ namespace Google.ProtocolBuffers // way as not set. // Serialization will ignore such fields. - field_presence_test.TestAllTypes.Builder builder = field_presence_test.TestAllTypes.CreateBuilder(); + FieldPresence.TestAllTypes.Builder builder = FieldPresence.TestAllTypes.CreateBuilder(); builder.SetOptionalInt32(0); builder.SetOptionalString(""); builder.SetOptionalBytes(ByteString.Empty); - builder.SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.FOO); - field_presence_test.TestAllTypes message = builder.Build(); + builder.SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.FOO); + FieldPresence.TestAllTypes message = builder.Build(); Assert.AreEqual(0, message.SerializedSize); // Test merge - field_presence_test.TestAllTypes.Builder a = field_presence_test.TestAllTypes.CreateBuilder(); + FieldPresence.TestAllTypes.Builder a = FieldPresence.TestAllTypes.CreateBuilder(); a.SetOptionalInt32(1); a.SetOptionalString("x"); a.SetOptionalBytes(ByteString.CopyFromUtf8("y")); - a.SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.BAR); + a.SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.BAR); a.MergeFrom(message); - field_presence_test.TestAllTypes messageA = a.Build(); + FieldPresence.TestAllTypes messageA = a.Build(); Assert.AreEqual(1, messageA.OptionalInt32); Assert.AreEqual("x", messageA.OptionalString); Assert.AreEqual(ByteString.CopyFromUtf8("y"), messageA.OptionalBytes); - Assert.AreEqual(field_presence_test.TestAllTypes.Types.NestedEnum.BAR, messageA.OptionalNestedEnum); + Assert.AreEqual(FieldPresence.TestAllTypes.Types.NestedEnum.BAR, messageA.OptionalNestedEnum); // equals/hashCode should produce the same results - field_presence_test.TestAllTypes empty = field_presence_test.TestAllTypes.CreateBuilder().Build(); + FieldPresence.TestAllTypes empty = FieldPresence.TestAllTypes.CreateBuilder().Build(); Assert.True(empty.Equals(message)); Assert.True(message.Equals(empty)); Assert.AreEqual(empty.GetHashCode(), message.GetHashCode()); @@ -112,24 +112,24 @@ namespace Google.ProtocolBuffers [TestMethod] public void TestFieldPresenceReflection() { - MessageDescriptor descriptor = field_presence_test.TestAllTypes.Descriptor; + MessageDescriptor descriptor = FieldPresence.TestAllTypes.Descriptor; FieldDescriptor optionalInt32Field = descriptor.FindFieldByName("optional_int32"); FieldDescriptor optionalStringField = descriptor.FindFieldByName("optional_string"); FieldDescriptor optionalBytesField = descriptor.FindFieldByName("optional_bytes"); FieldDescriptor optionalNestedEnumField = descriptor.FindFieldByName("optional_nested_enum"); - field_presence_test.TestAllTypes message = field_presence_test.TestAllTypes.CreateBuilder().Build(); + FieldPresence.TestAllTypes message = FieldPresence.TestAllTypes.CreateBuilder().Build(); Assert.False(message.HasField(optionalInt32Field)); Assert.False(message.HasField(optionalStringField)); Assert.False(message.HasField(optionalBytesField)); Assert.False(message.HasField(optionalNestedEnumField)); // Set to default value is seen as not present - message = field_presence_test.TestAllTypes.CreateBuilder() + message = FieldPresence.TestAllTypes.CreateBuilder() .SetOptionalInt32(0) .SetOptionalString("") .SetOptionalBytes(ByteString.Empty) - .SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.FOO) + .SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.FOO) .Build(); Assert.False(message.HasField(optionalInt32Field)); Assert.False(message.HasField(optionalStringField)); @@ -138,11 +138,11 @@ namespace Google.ProtocolBuffers Assert.AreEqual(0, message.AllFields.Count); // Set t0 non-defalut value is seen as present - message = field_presence_test.TestAllTypes.CreateBuilder() + message = FieldPresence.TestAllTypes.CreateBuilder() .SetOptionalInt32(1) .SetOptionalString("x") .SetOptionalBytes(ByteString.CopyFromUtf8("y")) - .SetOptionalNestedEnum(field_presence_test.TestAllTypes.Types.NestedEnum.BAR) + .SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.BAR) .Build(); Assert.True(message.HasField(optionalInt32Field)); Assert.True(message.HasField(optionalStringField)); @@ -154,13 +154,13 @@ namespace Google.ProtocolBuffers [TestMethod] public void TestMessageField() { - field_presence_test.TestAllTypes.Builder builder = field_presence_test.TestAllTypes.CreateBuilder(); + FieldPresence.TestAllTypes.Builder builder = FieldPresence.TestAllTypes.CreateBuilder(); Assert.False(builder.HasOptionalNestedMessage); Assert.False(builder.Build().HasOptionalNestedMessage); // Unlike non-message fields, if we set default value to message field, the field // shoule be seem as present. - builder.SetOptionalNestedMessage(field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance); + builder.SetOptionalNestedMessage(FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance); Assert.True(builder.HasOptionalNestedMessage); Assert.True(builder.Build().HasOptionalNestedMessage); @@ -169,17 +169,17 @@ namespace Google.ProtocolBuffers [TestMethod] public void TestSeralizeAndParese() { - field_presence_test.TestAllTypes.Builder builder = field_presence_test.TestAllTypes.CreateBuilder(); + FieldPresence.TestAllTypes.Builder builder = FieldPresence.TestAllTypes.CreateBuilder(); builder.SetOptionalInt32(1234); builder.SetOptionalString("hello"); - builder.SetOptionalNestedMessage(field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance); + builder.SetOptionalNestedMessage(FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance); ByteString data = builder.Build().ToByteString(); - field_presence_test.TestAllTypes message = field_presence_test.TestAllTypes.ParseFrom(data); + FieldPresence.TestAllTypes message = FieldPresence.TestAllTypes.ParseFrom(data); Assert.AreEqual(1234, message.OptionalInt32); Assert.AreEqual("hello", message.OptionalString); Assert.AreEqual(ByteString.Empty, message.OptionalBytes); - Assert.AreEqual(field_presence_test.TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); + Assert.AreEqual(FieldPresence.TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); Assert.True(message.HasOptionalNestedMessage); Assert.AreEqual(0, message.OptionalNestedMessage.Value); } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs index 64f447f1..a32630ed 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs @@ -1,965 +1,783 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protos/google/protobuf/field_presence_test.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace field_presence_test -{ - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class FieldPresenceTest - { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) - { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_field_presence_test_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_field_presence_test_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor - { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static FieldPresenceTest() - { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu", - "cHJvdG8SE2ZpZWxkX3ByZXNlbmNlX3Rlc3QivgIKDFRlc3RBbGxUeXBlcxIW", - "Cg5vcHRpb25hbF9pbnQzMhgBIAEoBRIXCg9vcHRpb25hbF9zdHJpbmcYAiAB", - "KAkSFgoOb3B0aW9uYWxfYnl0ZXMYAyABKAwSSgoUb3B0aW9uYWxfbmVzdGVk", - "X2VudW0YBCABKA4yLC5maWVsZF9wcmVzZW5jZV90ZXN0LlRlc3RBbGxUeXBl", - "cy5OZXN0ZWRFbnVtElAKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGAUgASgL", - "Mi8uZmllbGRfcHJlc2VuY2VfdGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVz", - "c2FnZRoeCg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3Rl", - "ZEVudW0SBwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJCMAoTY29tLmdvb2ds", - "ZS5wcm90b2J1ZkIWRmllbGRQcmVzZW5jZVRlc3RQcm90b6ABAWIGcHJvdG8z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) - { - descriptor = root; - internal__static_field_presence_test_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_field_presence_test_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_field_presence_test_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalString", "OptionalBytes", "OptionalNestedEnum", "OptionalNestedMessage", }); - internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor = internal__static_field_presence_test_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Value", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage - { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "optional_bytes", "optional_int32", "optional_nested_enum", "optional_nested_message", "optional_string" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 26, 8, 32, 42, 18 }; - public static TestAllTypes DefaultInstance - { - get { return defaultInstance; } - } - - public override TestAllTypes DefaultInstanceForType - { - get { return DefaultInstance; } - } - - protected override TestAllTypes ThisMessage - { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor - { - get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors - { - get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types - { - public enum NestedEnum - { - FOO = 0, - BAR = 1, - BAZ = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage - { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "value" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance - { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType - { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage - { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor - { - get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors - { - get { return global::field_presence_test.FieldPresenceTest.internal__static_field_presence_test_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private int value_; - public int Value - { - get { return value_; } - } - - public override void WriteTo(pb::ICodedOutputStream output) - { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (Value != 0) - { - output.WriteInt32(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize - { - get - { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() - { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (Value != 0) - { - size += pb::CodedOutputStream.ComputeInt32Size(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) - { - return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) - { - return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) - { - return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) - { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) - { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) - { - return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() - { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) - { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder - { - protected override Builder ThisBuilder - { - get { return this; } - } - public Builder() - { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) - { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() - { - if (resultIsReadOnly) - { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized - { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt - { - get { return PrepareBuilder(); } - } - - public override Builder Clear() - { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() - { - if (resultIsReadOnly) - { - return new Builder(result); - } - else - { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType - { - get { return global::field_presence_test.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType - { - get { return global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() - { - if (resultIsReadOnly) - { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) - { - if (other is NestedMessage) - { - return MergeFrom((NestedMessage)other); - } - else - { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) - { - if (other == global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.Value != 0) - { - Value = other.Value; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) - { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) - { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) - { - if (tag == 0 && field_name != null) - { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if (field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else - { - if (unknownFields == null) - { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) - { - case 0: - { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: - { - if (pb::WireFormat.IsEndGroupTag(tag)) - { - if (unknownFields != null) - { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) - { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: - { - input.ReadInt32(ref result.value_); - break; - } - } - } - - if (unknownFields != null) - { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int Value - { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(int value) - { - PrepareBuilder(); - result.value_ = value; - return this; - } - public Builder ClearValue() - { - PrepareBuilder(); - result.value_ = 0; - return this; - } - } - static NestedMessage() - { - object.ReferenceEquals(global::field_presence_test.FieldPresenceTest.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private int optionalInt32_; - public int OptionalInt32 - { - get { return optionalInt32_; } - } - - public const int OptionalStringFieldNumber = 2; - private string optionalString_ = ""; - public string OptionalString - { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 3; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public pb::ByteString OptionalBytes - { - get { return optionalBytes_; } - } - - public const int OptionalNestedEnumFieldNumber = 4; - private global::field_presence_test.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO; - public global::field_presence_test.TestAllTypes.Types.NestedEnum OptionalNestedEnum - { - get { return optionalNestedEnum_; } - } - - public const int OptionalNestedMessageFieldNumber = 5; - private bool hasOptionalNestedMessage; - private global::field_presence_test.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage - { - get { return hasOptionalNestedMessage; } - } - public global::field_presence_test.TestAllTypes.Types.NestedMessage OptionalNestedMessage - { - get { return optionalNestedMessage_ ?? global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override void WriteTo(pb::ICodedOutputStream output) - { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (OptionalInt32 != 0) - { - output.WriteInt32(1, field_names[1], OptionalInt32); - } - if (OptionalString != "") - { - output.WriteString(2, field_names[4], OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) - { - output.WriteBytes(3, field_names[0], OptionalBytes); - } - if (OptionalNestedEnum != global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO) - { - output.WriteEnum(4, field_names[2], (int)OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalNestedMessage) - { - output.WriteMessage(5, field_names[3], OptionalNestedMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize - { - get - { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() - { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (OptionalInt32 != 0) - { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (OptionalString != "") - { - size += pb::CodedOutputStream.ComputeStringSize(2, OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) - { - size += pb::CodedOutputStream.ComputeBytesSize(3, OptionalBytes); - } - if (OptionalNestedEnum != global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO) - { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int)OptionalNestedEnum); - } - if (hasOptionalNestedMessage) - { - size += pb::CodedOutputStream.ComputeMessageSize(5, OptionalNestedMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) - { - return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) - { - return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) - { - return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) - { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) - { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) - { - return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) - { - return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() - { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) - { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder - { - protected override Builder ThisBuilder - { - get { return this; } - } - public Builder() - { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) - { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() - { - if (resultIsReadOnly) - { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized - { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt - { - get { return PrepareBuilder(); } - } - - public override Builder Clear() - { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() - { - if (resultIsReadOnly) - { - return new Builder(result); - } - else - { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType - { - get { return global::field_presence_test.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType - { - get { return global::field_presence_test.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() - { - if (resultIsReadOnly) - { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) - { - if (other is TestAllTypes) - { - return MergeFrom((TestAllTypes)other); - } - else - { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) - { - if (other == global::field_presence_test.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.OptionalInt32 != 0) - { - OptionalInt32 = other.OptionalInt32; - } - if (other.OptionalString != "") - { - OptionalString = other.OptionalString; - } - if (other.OptionalBytes != pb::ByteString.Empty) - { - OptionalBytes = other.OptionalBytes; - } - if (other.OptionalNestedEnum != global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO) - { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalNestedMessage) - { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) - { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) - { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) - { - if (tag == 0 && field_name != null) - { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if (field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else - { - if (unknownFields == null) - { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) - { - case 0: - { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: - { - if (pb::WireFormat.IsEndGroupTag(tag)) - { - if (unknownFields != null) - { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) - { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: - { - input.ReadInt32(ref result.optionalInt32_); - break; - } - case 18: - { - input.ReadString(ref result.optionalString_); - break; - } - case 26: - { - input.ReadBytes(ref result.optionalBytes_); - break; - } - case 32: - { - object unknown; - if (input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) - { - } - else if (unknown is int) - { - if (unknownFields == null) - { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong)(int)unknown); - } - break; - } - case 42: - { - global::field_presence_test.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::field_presence_test.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) - { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) - { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int OptionalInt32 - { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) - { - PrepareBuilder(); - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() - { - PrepareBuilder(); - result.optionalInt32_ = 0; - return this; - } - - public string OptionalString - { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) - { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() - { - PrepareBuilder(); - result.optionalString_ = ""; - return this; - } - - public pb::ByteString OptionalBytes - { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) - { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() - { - PrepareBuilder(); - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public global::field_presence_test.TestAllTypes.Types.NestedEnum OptionalNestedEnum - { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::field_presence_test.TestAllTypes.Types.NestedEnum value) - { - PrepareBuilder(); - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() - { - PrepareBuilder(); - result.optionalNestedEnum_ = global::field_presence_test.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalNestedMessage - { - get { return result.hasOptionalNestedMessage; } - } - public global::field_presence_test.TestAllTypes.Types.NestedMessage OptionalNestedMessage - { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::field_presence_test.TestAllTypes.Types.NestedMessage value) - { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::field_presence_test.TestAllTypes.Types.NestedMessage.Builder builderForValue) - { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::field_presence_test.TestAllTypes.Types.NestedMessage value) - { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::field_presence_test.TestAllTypes.Types.NestedMessage.DefaultInstance) - { - result.optionalNestedMessage_ = global::field_presence_test.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } - else - { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() - { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - } - static TestAllTypes() - { - object.ReferenceEquals(global::field_presence_test.FieldPresenceTest.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/google/protobuf/field_presence_test.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace Google.ProtocolBuffers.TestProtos.FieldPresence { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class FieldPresenceTest { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static FieldPresenceTest() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu", + "cHJvdG8SL0dvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcy5GaWVs", + "ZFByZXNlbmNlIvYCCgxUZXN0QWxsVHlwZXMSFgoOb3B0aW9uYWxfaW50MzIY", + "ASABKAUSFwoPb3B0aW9uYWxfc3RyaW5nGAIgASgJEhYKDm9wdGlvbmFsX2J5", + "dGVzGAMgASgMEmYKFG9wdGlvbmFsX25lc3RlZF9lbnVtGAQgASgOMkguR29v", + "Z2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zLkZpZWxkUHJlc2VuY2Uu", + "VGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SbAoXb3B0aW9uYWxfbmVzdGVkX21l", + "c3NhZ2UYBSABKAsySy5Hb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90", + "b3MuRmllbGRQcmVzZW5jZS5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRoe", + "Cg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3RlZEVudW0S", + "BwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJCMAoTY29tLmdvb2dsZS5wcm90", + "b2J1ZkIWRmllbGRQcmVzZW5jZVRlc3RQcm90b6ABAWIGcHJvdG8z")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor, + new string[] { "OptionalInt32", "OptionalString", "OptionalBytes", "OptionalNestedEnum", "OptionalNestedMessage", }); + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor = internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor.NestedTypes[0]; + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor, + new string[] { "Value", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestAllTypes : pb::GeneratedMessage { + private TestAllTypes() { } + private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); + private static readonly string[] _testAllTypesFieldNames = new string[] { "optional_bytes", "optional_int32", "optional_nested_enum", "optional_nested_message", "optional_string" }; + private static readonly uint[] _testAllTypesFieldTags = new uint[] { 26, 8, 32, 42, 18 }; + public static TestAllTypes DefaultInstance { + get { return defaultInstance; } + } + + public override TestAllTypes DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TestAllTypes ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum NestedEnum { + FOO = 0, + BAR = 1, + BAZ = 2, + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NestedMessage : pb::GeneratedMessage { + private NestedMessage() { } + private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); + private static readonly string[] _nestedMessageFieldNames = new string[] { "value" }; + private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; + public static NestedMessage DefaultInstance { + get { return defaultInstance; } + } + + public override NestedMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NestedMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; } + } + + public const int ValueFieldNumber = 1; + private int value_; + public int Value { + get { return value_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _nestedMessageFieldNames; + if (Value != 0) { + output.WriteInt32(1, field_names[0], Value); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (Value != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Value); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NestedMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NestedMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NestedMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NestedMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NestedMessage result; + + private NestedMessage PrepareBuilder() { + if (resultIsReadOnly) { + NestedMessage original = result; + result = new NestedMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NestedMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Descriptor; } + } + + public override NestedMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override NestedMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NestedMessage) { + return MergeFrom((NestedMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NestedMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.Value != 0) { + Value = other.Value; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nestedMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.value_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int Value { + get { return result.Value; } + set { SetValue(value); } + } + public Builder SetValue(int value) { + PrepareBuilder(); + result.value_ = value; + return this; + } + public Builder ClearValue() { + PrepareBuilder(); + result.value_ = 0; + return this; + } + } + static NestedMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); + } + } + + } + #endregion + + public const int OptionalInt32FieldNumber = 1; + private int optionalInt32_; + public int OptionalInt32 { + get { return optionalInt32_; } + } + + public const int OptionalStringFieldNumber = 2; + private string optionalString_ = ""; + public string OptionalString { + get { return optionalString_; } + } + + public const int OptionalBytesFieldNumber = 3; + private pb::ByteString optionalBytes_ = pb::ByteString.Empty; + public pb::ByteString OptionalBytes { + get { return optionalBytes_; } + } + + public const int OptionalNestedEnumFieldNumber = 4; + private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return optionalNestedEnum_; } + } + + public const int OptionalNestedMessageFieldNumber = 5; + private bool hasOptionalNestedMessage; + private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage optionalNestedMessage_; + public bool HasOptionalNestedMessage { + get { return hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _testAllTypesFieldNames; + if (OptionalInt32 != 0) { + output.WriteInt32(1, field_names[1], OptionalInt32); + } + if (OptionalString != "") { + output.WriteString(2, field_names[4], OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + output.WriteBytes(3, field_names[0], OptionalBytes); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { + output.WriteEnum(4, field_names[2], (int) OptionalNestedEnum, OptionalNestedEnum); + } + if (hasOptionalNestedMessage) { + output.WriteMessage(5, field_names[3], OptionalNestedMessage); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (OptionalInt32 != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); + } + if (OptionalString != "") { + size += pb::CodedOutputStream.ComputeStringSize(2, OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + size += pb::CodedOutputStream.ComputeBytesSize(3, OptionalBytes); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int) OptionalNestedEnum); + } + if (hasOptionalNestedMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(5, OptionalNestedMessage); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TestAllTypes ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TestAllTypes MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TestAllTypes prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TestAllTypes cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TestAllTypes result; + + private TestAllTypes PrepareBuilder() { + if (resultIsReadOnly) { + TestAllTypes original = result; + result = new TestAllTypes(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TestAllTypes MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Descriptor; } + } + + public override TestAllTypes DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance; } + } + + public override TestAllTypes BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TestAllTypes) { + return MergeFrom((TestAllTypes) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TestAllTypes other) { + if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance) return this; + PrepareBuilder(); + if (other.OptionalInt32 != 0) { + OptionalInt32 = other.OptionalInt32; + } + if (other.OptionalString != "") { + OptionalString = other.OptionalString; + } + if (other.OptionalBytes != pb::ByteString.Empty) { + OptionalBytes = other.OptionalBytes; + } + if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { + OptionalNestedEnum = other.OptionalNestedEnum; + } + if (other.HasOptionalNestedMessage) { + MergeOptionalNestedMessage(other.OptionalNestedMessage); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _testAllTypesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.optionalInt32_); + break; + } + case 18: { + input.ReadString(ref result.optionalString_); + break; + } + case 26: { + input.ReadBytes(ref result.optionalBytes_); + break; + } + case 32: { + object unknown; + if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + case 42: { + global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOptionalNestedMessage) { + subBuilder.MergeFrom(OptionalNestedMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalNestedMessage = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int OptionalInt32 { + get { return result.OptionalInt32; } + set { SetOptionalInt32(value); } + } + public Builder SetOptionalInt32(int value) { + PrepareBuilder(); + result.optionalInt32_ = value; + return this; + } + public Builder ClearOptionalInt32() { + PrepareBuilder(); + result.optionalInt32_ = 0; + return this; + } + + public string OptionalString { + get { return result.OptionalString; } + set { SetOptionalString(value); } + } + public Builder SetOptionalString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalString_ = value; + return this; + } + public Builder ClearOptionalString() { + PrepareBuilder(); + result.optionalString_ = ""; + return this; + } + + public pb::ByteString OptionalBytes { + get { return result.OptionalBytes; } + set { SetOptionalBytes(value); } + } + public Builder SetOptionalBytes(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalBytes_ = value; + return this; + } + public Builder ClearOptionalBytes() { + PrepareBuilder(); + result.optionalBytes_ = pb::ByteString.Empty; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return result.OptionalNestedEnum; } + set { SetOptionalNestedEnum(value); } + } + public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.optionalNestedEnum_ = value; + return this; + } + public Builder ClearOptionalNestedEnum() { + PrepareBuilder(); + result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; + return this; + } + + public bool HasOptionalNestedMessage { + get { return result.hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return result.OptionalNestedMessage; } + set { SetOptionalNestedMessage(value); } + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = value; + return this; + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalNestedMessage && + result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalNestedMessage_ = value; + } + result.hasOptionalNestedMessage = true; + return this; + } + public Builder ClearOptionalNestedMessage() { + PrepareBuilder(); + result.hasOptionalNestedMessage = false; + result.optionalNestedMessage_ = null; + return this; + } + } + static TestAllTypes() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code -- cgit v1.2.3 From ce97e686826147e2a071fd2321555f7d40ec5d93 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 29 Apr 2015 15:27:14 +0100 Subject: Convert both the full and lite runtimes (and json/xml serialization assemblies) to be Portable Class Libraries. All referring projects are now .NET 4 client rather than .NET 3.5. This commit also fixes up the ProtoBench app, which I'd neglected in previous commits. (Disentangling the two sets of changes would be time-consuming.) --- csharp/src/AddressBook/AddressBook.csproj | 13 +- csharp/src/AddressBook/app.config | 2 +- csharp/src/ProtoBench/GoogleSize.cs | 4569 +++ csharp/src/ProtoBench/GoogleSpeed.cs | 6634 ++++ csharp/src/ProtoBench/Properties/AssemblyInfo.cs | 1 - csharp/src/ProtoBench/ProtoBench.csproj | 28 +- .../ProtoBench/TestProtos/GoogleSizeProtoFile.cs | 4572 --- .../ProtoBench/TestProtos/GoogleSpeedProtoFile.cs | 6637 ---- .../TestProtos/UnitTestImportProtoFile.cs | 346 - .../src/ProtoBench/TestProtos/UnitTestProtoFile.cs | 21602 ------------ csharp/src/ProtoBench/Unittest.cs | 33516 +++++++++++++++++++ csharp/src/ProtoBench/UnittestImport.cs | 347 + csharp/src/ProtoBench/UnittestImportPublic.cs | 333 + csharp/src/ProtoBench/app.config | 3 + csharp/src/ProtoDump/ProtoDump.csproj | 14 +- csharp/src/ProtoDump/app.config | 3 + csharp/src/ProtoMunge/ProtoMunge.csproj | 14 +- csharp/src/ProtoMunge/app.config | 3 + .../ProtocolBuffers.Serialization.csproj | 16 +- .../ProtocolBuffersLite.Serialization.csproj | 16 +- .../ProtocolBuffers.Test.CF20.csproj | 190 - .../ProtocolBuffers.Test.CF35.csproj | 191 - .../ProtocolBuffers.Test.NET20.csproj | 178 - .../ProtocolBuffers.Test.NET35.csproj | 179 - .../ProtocolBuffers.Test.NET40.csproj | 179 - .../ProtocolBuffers.Test.PL40.csproj | 213 - .../ProtocolBuffers.Test.SL20.csproj | 214 - .../ProtocolBuffers.Test.SL30.csproj | 215 - .../ProtocolBuffers.Test.SL40.csproj | 215 - .../ProtocolBuffers.Test.csproj | 11 +- csharp/src/ProtocolBuffers.sln | 6 + csharp/src/ProtocolBuffers/FieldSet.cs | 8 +- csharp/src/ProtocolBuffers/GeneratedMessage.cs | 4 +- .../src/ProtocolBuffers/Properties/AssemblyInfo.cs | 3 - csharp/src/ProtocolBuffers/ProtocolBuffers.csproj | 17 +- .../src/ProtocolBuffers/ProtocolBuffersLite.csproj | 17 +- csharp/src/ProtocolBuffers/TextFormat.cs | 4 - csharp/src/ProtocolBuffers/UnknownFieldSet.cs | 4 +- .../ProtocolBuffersLite.Test.CF20.csproj | 133 - .../ProtocolBuffersLite.Test.CF35.csproj | 134 - .../ProtocolBuffersLite.Test.NET20.csproj | 121 - .../ProtocolBuffersLite.Test.NET35.csproj | 122 - .../ProtocolBuffersLite.Test.NET40.csproj | 122 - .../ProtocolBuffersLite.Test.PL40.csproj | 156 - .../ProtocolBuffersLite.Test.SL20.csproj | 157 - .../ProtocolBuffersLite.Test.SL30.csproj | 158 - .../ProtocolBuffersLite.Test.SL40.csproj | 158 - .../ProtocolBuffersLite.Test.csproj | 11 +- .../ProtocolBuffersLiteMixed.Test.CF20.csproj | 126 - .../ProtocolBuffersLiteMixed.Test.CF35.csproj | 127 - .../ProtocolBuffersLiteMixed.Test.NET20.csproj | 114 - .../ProtocolBuffersLiteMixed.Test.NET35.csproj | 115 - .../ProtocolBuffersLiteMixed.Test.NET40.csproj | 115 - .../ProtocolBuffersLiteMixed.Test.PL40.csproj | 149 - .../ProtocolBuffersLiteMixed.Test.SL20.csproj | 150 - .../ProtocolBuffersLiteMixed.Test.SL30.csproj | 151 - .../ProtocolBuffersLiteMixed.Test.SL40.csproj | 151 - .../ProtocolBuffersLiteMixed.Test.csproj | 11 +- 58 files changed, 45514 insertions(+), 37484 deletions(-) create mode 100644 csharp/src/ProtoBench/GoogleSize.cs create mode 100644 csharp/src/ProtoBench/GoogleSpeed.cs delete mode 100644 csharp/src/ProtoBench/TestProtos/GoogleSizeProtoFile.cs delete mode 100644 csharp/src/ProtoBench/TestProtos/GoogleSpeedProtoFile.cs delete mode 100644 csharp/src/ProtoBench/TestProtos/UnitTestImportProtoFile.cs delete mode 100644 csharp/src/ProtoBench/TestProtos/UnitTestProtoFile.cs create mode 100644 csharp/src/ProtoBench/Unittest.cs create mode 100644 csharp/src/ProtoBench/UnittestImport.cs create mode 100644 csharp/src/ProtoBench/UnittestImportPublic.cs create mode 100644 csharp/src/ProtoBench/app.config create mode 100644 csharp/src/ProtoDump/app.config create mode 100644 csharp/src/ProtoMunge/app.config delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF35.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET35.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET40.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.PL40.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL20.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL30.csproj delete mode 100644 csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL40.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF20.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF35.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET20.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET35.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET40.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.PL40.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL20.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL30.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL40.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF20.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF35.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET20.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET35.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET40.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.PL40.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL20.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL30.csproj delete mode 100644 csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL40.csproj (limited to 'csharp/src') diff --git a/csharp/src/AddressBook/AddressBook.csproj b/csharp/src/AddressBook/AddressBook.csproj index fe05ad6c..52b82a8f 100644 --- a/csharp/src/AddressBook/AddressBook.csproj +++ b/csharp/src/AddressBook/AddressBook.csproj @@ -1,8 +1,6 @@  - CLIENTPROFILE - NET35 Debug AnyCPU 9.0.30729 @@ -12,16 +10,17 @@ Properties Google.ProtocolBuffers.Examples.AddressBook AddressBook - v3.5 + v4.0 512 Google.ProtocolBuffers.Examples.AddressBook.Program + Client true full false - bin\NET35\Debug - obj\NET35\Debug\ + bin\Debug + obj\Debug\ DEBUG;TRACE prompt 4 @@ -32,8 +31,8 @@ pdbonly true - bin\NET35\Release - obj\NET35\Release\ + bin\Release + obj\Release\ TRACE prompt 4 diff --git a/csharp/src/AddressBook/app.config b/csharp/src/AddressBook/app.config index 0df7832f..19fac17a 100644 --- a/csharp/src/AddressBook/app.config +++ b/csharp/src/AddressBook/app.config @@ -1,3 +1,3 @@ - + diff --git a/csharp/src/ProtoBench/GoogleSize.cs b/csharp/src/ProtoBench/GoogleSize.cs new file mode 100644 index 00000000..06f2c0ca --- /dev/null +++ b/csharp/src/ProtoBench/GoogleSize.cs @@ -0,0 +1,4569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google_size.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace Google.ProtocolBuffers.TestProtos { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class GoogleSize { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage1__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage1__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage1SubMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage1SubMessage__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage2__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage2__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage2_Group1__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage2_Group1__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage2GroupedMessage__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static GoogleSize() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChFnb29nbGVfc2l6ZS5wcm90bxIKYmVuY2htYXJrcyL2BgoMU2l6ZU1lc3Nh", + "Z2UxEg4KBmZpZWxkMRgBIAIoCRIOCgZmaWVsZDkYCSABKAkSDwoHZmllbGQx", + "OBgSIAEoCRIWCgdmaWVsZDgwGFAgASgIOgVmYWxzZRIVCgdmaWVsZDgxGFEg", + "ASgIOgR0cnVlEg4KBmZpZWxkMhgCIAIoBRIOCgZmaWVsZDMYAyACKAUSEQoI", + "ZmllbGQyODAYmAIgASgFEhEKBmZpZWxkNhgGIAEoBToBMBIPCgdmaWVsZDIy", + "GBYgASgDEg4KBmZpZWxkNBgEIAEoCRIOCgZmaWVsZDUYBSADKAYSFgoHZmll", + "bGQ1ORg7IAEoCDoFZmFsc2USDgoGZmllbGQ3GAcgASgJEg8KB2ZpZWxkMTYY", + "ECABKAUSFAoIZmllbGQxMzAYggEgASgFOgEwEhUKB2ZpZWxkMTIYDCABKAg6", + "BHRydWUSFQoHZmllbGQxNxgRIAEoCDoEdHJ1ZRIVCgdmaWVsZDEzGA0gASgI", + "OgR0cnVlEhUKB2ZpZWxkMTQYDiABKAg6BHRydWUSEwoIZmllbGQxMDQYaCAB", + "KAU6ATASEwoIZmllbGQxMDAYZCABKAU6ATASEwoIZmllbGQxMDEYZSABKAU6", + "ATASEAoIZmllbGQxMDIYZiABKAkSEAoIZmllbGQxMDMYZyABKAkSEgoHZmll", + "bGQyORgdIAEoBToBMBIWCgdmaWVsZDMwGB4gASgIOgVmYWxzZRITCgdmaWVs", + "ZDYwGDwgASgFOgItMRIVCghmaWVsZDI3MRiPAiABKAU6Ai0xEhUKCGZpZWxk", + "MjcyGJACIAEoBToCLTESEQoIZmllbGQxNTAYlgEgASgFEhIKB2ZpZWxkMjMY", + "FyABKAU6ATASFgoHZmllbGQyNBgYIAEoCDoFZmFsc2USEgoHZmllbGQyNRgZ", + "IAEoBToBMBIzCgdmaWVsZDE1GA8gASgLMiIuYmVuY2htYXJrcy5TaXplTWVz", + "c2FnZTFTdWJNZXNzYWdlEg8KB2ZpZWxkNzgYTiABKAgSEgoHZmllbGQ2NxhD", + "IAEoBToBMBIPCgdmaWVsZDY4GEQgASgFEhQKCGZpZWxkMTI4GIABIAEoBToB", + "MBIoCghmaWVsZDEyORiBASABKAk6FXh4eHh4eHh4eHh4eHh4eHh4eHh4eBIU", + "CghmaWVsZDEzMRiDASABKAU6ATAioQMKFlNpemVNZXNzYWdlMVN1Yk1lc3Nh", + "Z2USEQoGZmllbGQxGAEgASgFOgEwEhEKBmZpZWxkMhgCIAEoBToBMBIRCgZm", + "aWVsZDMYAyABKAU6ATASDwoHZmllbGQxNRgPIAEoCRIVCgdmaWVsZDEyGAwg", + "ASgIOgR0cnVlEg8KB2ZpZWxkMTMYDSABKAMSDwoHZmllbGQxNBgOIAEoAxIP", + "CgdmaWVsZDE2GBAgASgFEhIKB2ZpZWxkMTkYEyABKAU6ATISFQoHZmllbGQy", + "MBgUIAEoCDoEdHJ1ZRIVCgdmaWVsZDI4GBwgASgIOgR0cnVlEg8KB2ZpZWxk", + "MjEYFSABKAYSDwoHZmllbGQyMhgWIAEoBRIWCgdmaWVsZDIzGBcgASgIOgVm", + "YWxzZRIYCghmaWVsZDIwNhjOASABKAg6BWZhbHNlEhEKCGZpZWxkMjAzGMsB", + "IAEoBxIRCghmaWVsZDIwNBjMASABKAUSEQoIZmllbGQyMDUYzQEgASgJEhEK", + "CGZpZWxkMjA3GM8BIAEoBBIRCghmaWVsZDMwMBisAiABKAQixwcKDFNpemVN", + "ZXNzYWdlMhIOCgZmaWVsZDEYASABKAkSDgoGZmllbGQzGAMgASgDEg4KBmZp", + "ZWxkNBgEIAEoAxIPCgdmaWVsZDMwGB4gASgDEhYKB2ZpZWxkNzUYSyABKAg6", + "BWZhbHNlEg4KBmZpZWxkNhgGIAEoCRIOCgZmaWVsZDIYAiABKAwSEgoHZmll", + "bGQyMRgVIAEoBToBMBIPCgdmaWVsZDcxGEcgASgFEg8KB2ZpZWxkMjUYGSAB", + "KAISEwoIZmllbGQxMDkYbSABKAU6ATASFAoIZmllbGQyMTAY0gEgASgFOgEw", + "EhQKCGZpZWxkMjExGNMBIAEoBToBMBIUCghmaWVsZDIxMhjUASABKAU6ATAS", + "FAoIZmllbGQyMTMY1QEgASgFOgEwEhQKCGZpZWxkMjE2GNgBIAEoBToBMBIU", + "CghmaWVsZDIxNxjZASABKAU6ATASFAoIZmllbGQyMTgY2gEgASgFOgEwEhQK", + "CGZpZWxkMjIwGNwBIAEoBToBMBIUCghmaWVsZDIyMRjdASABKAU6ATASFAoI", + "ZmllbGQyMjIY3gEgASgCOgEwEg8KB2ZpZWxkNjMYPyABKAUSLwoGZ3JvdXAx", + "GAogAygKMh8uYmVuY2htYXJrcy5TaXplTWVzc2FnZTIuR3JvdXAxEhEKCGZp", + "ZWxkMTI4GIABIAMoCRIRCghmaWVsZDEzMRiDASABKAMSEAoIZmllbGQxMjcY", + "fyADKAkSEQoIZmllbGQxMjkYgQEgASgFEhEKCGZpZWxkMTMwGIIBIAMoAxIY", + "CghmaWVsZDIwNRjNASABKAg6BWZhbHNlEhgKCGZpZWxkMjA2GM4BIAEoCDoF", + "ZmFsc2UawgIKBkdyb3VwMRIPCgdmaWVsZDExGAsgAigCEg8KB2ZpZWxkMjYY", + "GiABKAISDwoHZmllbGQxMhgMIAEoCRIPCgdmaWVsZDEzGA0gASgJEg8KB2Zp", + "ZWxkMTQYDiADKAkSDwoHZmllbGQxNRgPIAIoBBIOCgZmaWVsZDUYBSABKAUS", + "DwoHZmllbGQyNxgbIAEoCRIPCgdmaWVsZDI4GBwgASgFEg8KB2ZpZWxkMjkY", + "HSABKAkSDwoHZmllbGQxNhgQIAEoCRIPCgdmaWVsZDIyGBYgAygJEg8KB2Zp", + "ZWxkNzMYSSADKAUSEgoHZmllbGQyMBgUIAEoBToBMBIPCgdmaWVsZDI0GBgg", + "ASgJEjcKB2ZpZWxkMzEYHyABKAsyJi5iZW5jaG1hcmtzLlNpemVNZXNzYWdl", + "Mkdyb3VwZWRNZXNzYWdlIt4BChpTaXplTWVzc2FnZTJHcm91cGVkTWVzc2Fn", + "ZRIOCgZmaWVsZDEYASABKAISDgoGZmllbGQyGAIgASgCEhEKBmZpZWxkMxgD", + "IAEoAjoBMBIOCgZmaWVsZDQYBCABKAgSDgoGZmllbGQ1GAUgASgIEhQKBmZp", + "ZWxkNhgGIAEoCDoEdHJ1ZRIVCgZmaWVsZDcYByABKAg6BWZhbHNlEg4KBmZp", + "ZWxkOBgIIAEoAhIOCgZmaWVsZDkYCSABKAgSDwoHZmllbGQxMBgKIAEoAhIP", + "CgdmaWVsZDExGAsgASgDQjJCCkdvb2dsZVNpemVIAqoCIUdvb2dsZS5Qcm90", + "b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_benchmarks_SizeMessage1__Descriptor = Descriptor.MessageTypes[0]; + internal__static_benchmarks_SizeMessage1__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage1__Descriptor, + new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); + internal__static_benchmarks_SizeMessage1SubMessage__Descriptor = Descriptor.MessageTypes[1]; + internal__static_benchmarks_SizeMessage1SubMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage1SubMessage__Descriptor, + new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); + internal__static_benchmarks_SizeMessage2__Descriptor = Descriptor.MessageTypes[2]; + internal__static_benchmarks_SizeMessage2__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage2__Descriptor, + new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); + internal__static_benchmarks_SizeMessage2_Group1__Descriptor = internal__static_benchmarks_SizeMessage2__Descriptor.NestedTypes[0]; + internal__static_benchmarks_SizeMessage2_Group1__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage2_Group1__Descriptor, + new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); + internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor = Descriptor.MessageTypes[3]; + internal__static_benchmarks_SizeMessage2GroupedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor, + new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SizeMessage1 : pb::GeneratedMessage { + private SizeMessage1() { } + private static readonly SizeMessage1 defaultInstance = new SizeMessage1().MakeReadOnly(); + public static SizeMessage1 DefaultInstance { + get { return defaultInstance; } + } + + public override SizeMessage1 DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SizeMessage1 ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage1__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage1__FieldAccessorTable; } + } + + public const int Field1FieldNumber = 1; + private bool hasField1; + private string field1_ = ""; + public bool HasField1 { + get { return hasField1; } + } + public string Field1 { + get { return field1_; } + } + + public const int Field9FieldNumber = 9; + private bool hasField9; + private string field9_ = ""; + public bool HasField9 { + get { return hasField9; } + } + public string Field9 { + get { return field9_; } + } + + public const int Field18FieldNumber = 18; + private bool hasField18; + private string field18_ = ""; + public bool HasField18 { + get { return hasField18; } + } + public string Field18 { + get { return field18_; } + } + + public const int Field80FieldNumber = 80; + private bool hasField80; + private bool field80_; + public bool HasField80 { + get { return hasField80; } + } + public bool Field80 { + get { return field80_; } + } + + public const int Field81FieldNumber = 81; + private bool hasField81; + private bool field81_ = true; + public bool HasField81 { + get { return hasField81; } + } + public bool Field81 { + get { return field81_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private int field2_; + public bool HasField2 { + get { return hasField2; } + } + public int Field2 { + get { return field2_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private int field3_; + public bool HasField3 { + get { return hasField3; } + } + public int Field3 { + get { return field3_; } + } + + public const int Field280FieldNumber = 280; + private bool hasField280; + private int field280_; + public bool HasField280 { + get { return hasField280; } + } + public int Field280 { + get { return field280_; } + } + + public const int Field6FieldNumber = 6; + private bool hasField6; + private int field6_; + public bool HasField6 { + get { return hasField6; } + } + public int Field6 { + get { return field6_; } + } + + public const int Field22FieldNumber = 22; + private bool hasField22; + private long field22_; + public bool HasField22 { + get { return hasField22; } + } + public long Field22 { + get { return field22_; } + } + + public const int Field4FieldNumber = 4; + private bool hasField4; + private string field4_ = ""; + public bool HasField4 { + get { return hasField4; } + } + public string Field4 { + get { return field4_; } + } + + public const int Field5FieldNumber = 5; + private pbc::PopsicleList field5_ = new pbc::PopsicleList(); + [global::System.CLSCompliant(false)] + public scg::IList Field5List { + get { return pbc::Lists.AsReadOnly(field5_); } + } + public int Field5Count { + get { return field5_.Count; } + } + [global::System.CLSCompliant(false)] + public ulong GetField5(int index) { + return field5_[index]; + } + + public const int Field59FieldNumber = 59; + private bool hasField59; + private bool field59_; + public bool HasField59 { + get { return hasField59; } + } + public bool Field59 { + get { return field59_; } + } + + public const int Field7FieldNumber = 7; + private bool hasField7; + private string field7_ = ""; + public bool HasField7 { + get { return hasField7; } + } + public string Field7 { + get { return field7_; } + } + + public const int Field16FieldNumber = 16; + private bool hasField16; + private int field16_; + public bool HasField16 { + get { return hasField16; } + } + public int Field16 { + get { return field16_; } + } + + public const int Field130FieldNumber = 130; + private bool hasField130; + private int field130_; + public bool HasField130 { + get { return hasField130; } + } + public int Field130 { + get { return field130_; } + } + + public const int Field12FieldNumber = 12; + private bool hasField12; + private bool field12_ = true; + public bool HasField12 { + get { return hasField12; } + } + public bool Field12 { + get { return field12_; } + } + + public const int Field17FieldNumber = 17; + private bool hasField17; + private bool field17_ = true; + public bool HasField17 { + get { return hasField17; } + } + public bool Field17 { + get { return field17_; } + } + + public const int Field13FieldNumber = 13; + private bool hasField13; + private bool field13_ = true; + public bool HasField13 { + get { return hasField13; } + } + public bool Field13 { + get { return field13_; } + } + + public const int Field14FieldNumber = 14; + private bool hasField14; + private bool field14_ = true; + public bool HasField14 { + get { return hasField14; } + } + public bool Field14 { + get { return field14_; } + } + + public const int Field104FieldNumber = 104; + private bool hasField104; + private int field104_; + public bool HasField104 { + get { return hasField104; } + } + public int Field104 { + get { return field104_; } + } + + public const int Field100FieldNumber = 100; + private bool hasField100; + private int field100_; + public bool HasField100 { + get { return hasField100; } + } + public int Field100 { + get { return field100_; } + } + + public const int Field101FieldNumber = 101; + private bool hasField101; + private int field101_; + public bool HasField101 { + get { return hasField101; } + } + public int Field101 { + get { return field101_; } + } + + public const int Field102FieldNumber = 102; + private bool hasField102; + private string field102_ = ""; + public bool HasField102 { + get { return hasField102; } + } + public string Field102 { + get { return field102_; } + } + + public const int Field103FieldNumber = 103; + private bool hasField103; + private string field103_ = ""; + public bool HasField103 { + get { return hasField103; } + } + public string Field103 { + get { return field103_; } + } + + public const int Field29FieldNumber = 29; + private bool hasField29; + private int field29_; + public bool HasField29 { + get { return hasField29; } + } + public int Field29 { + get { return field29_; } + } + + public const int Field30FieldNumber = 30; + private bool hasField30; + private bool field30_; + public bool HasField30 { + get { return hasField30; } + } + public bool Field30 { + get { return field30_; } + } + + public const int Field60FieldNumber = 60; + private bool hasField60; + private int field60_ = -1; + public bool HasField60 { + get { return hasField60; } + } + public int Field60 { + get { return field60_; } + } + + public const int Field271FieldNumber = 271; + private bool hasField271; + private int field271_ = -1; + public bool HasField271 { + get { return hasField271; } + } + public int Field271 { + get { return field271_; } + } + + public const int Field272FieldNumber = 272; + private bool hasField272; + private int field272_ = -1; + public bool HasField272 { + get { return hasField272; } + } + public int Field272 { + get { return field272_; } + } + + public const int Field150FieldNumber = 150; + private bool hasField150; + private int field150_; + public bool HasField150 { + get { return hasField150; } + } + public int Field150 { + get { return field150_; } + } + + public const int Field23FieldNumber = 23; + private bool hasField23; + private int field23_; + public bool HasField23 { + get { return hasField23; } + } + public int Field23 { + get { return field23_; } + } + + public const int Field24FieldNumber = 24; + private bool hasField24; + private bool field24_; + public bool HasField24 { + get { return hasField24; } + } + public bool Field24 { + get { return field24_; } + } + + public const int Field25FieldNumber = 25; + private bool hasField25; + private int field25_; + public bool HasField25 { + get { return hasField25; } + } + public int Field25 { + get { return field25_; } + } + + public const int Field15FieldNumber = 15; + private bool hasField15; + private global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage field15_; + public bool HasField15 { + get { return hasField15; } + } + public global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage Field15 { + get { return field15_ ?? global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.DefaultInstance; } + } + + public const int Field78FieldNumber = 78; + private bool hasField78; + private bool field78_; + public bool HasField78 { + get { return hasField78; } + } + public bool Field78 { + get { return field78_; } + } + + public const int Field67FieldNumber = 67; + private bool hasField67; + private int field67_; + public bool HasField67 { + get { return hasField67; } + } + public int Field67 { + get { return field67_; } + } + + public const int Field68FieldNumber = 68; + private bool hasField68; + private int field68_; + public bool HasField68 { + get { return hasField68; } + } + public int Field68 { + get { return field68_; } + } + + public const int Field128FieldNumber = 128; + private bool hasField128; + private int field128_; + public bool HasField128 { + get { return hasField128; } + } + public int Field128 { + get { return field128_; } + } + + public const int Field129FieldNumber = 129; + private bool hasField129; + private string field129_ = "xxxxxxxxxxxxxxxxxxxxx"; + public bool HasField129 { + get { return hasField129; } + } + public string Field129 { + get { return field129_; } + } + + public const int Field131FieldNumber = 131; + private bool hasField131; + private int field131_; + public bool HasField131 { + get { return hasField131; } + } + public int Field131 { + get { return field131_; } + } + + public static SizeMessage1 ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage1 ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage1 ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SizeMessage1 ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SizeMessage1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SizeMessage1 ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SizeMessage1 MakeReadOnly() { + field5_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SizeMessage1 prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SizeMessage1 cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SizeMessage1 result; + + private SizeMessage1 PrepareBuilder() { + if (resultIsReadOnly) { + SizeMessage1 original = result; + result = new SizeMessage1(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SizeMessage1 MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1.Descriptor; } + } + + public override SizeMessage1 DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1.DefaultInstance; } + } + + public override SizeMessage1 BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public string Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = ""; + return this; + } + + public bool HasField9 { + get { return result.hasField9; } + } + public string Field9 { + get { return result.Field9; } + set { SetField9(value); } + } + public Builder SetField9(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField9 = true; + result.field9_ = value; + return this; + } + public Builder ClearField9() { + PrepareBuilder(); + result.hasField9 = false; + result.field9_ = ""; + return this; + } + + public bool HasField18 { + get { return result.hasField18; } + } + public string Field18 { + get { return result.Field18; } + set { SetField18(value); } + } + public Builder SetField18(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField18 = true; + result.field18_ = value; + return this; + } + public Builder ClearField18() { + PrepareBuilder(); + result.hasField18 = false; + result.field18_ = ""; + return this; + } + + public bool HasField80 { + get { return result.hasField80; } + } + public bool Field80 { + get { return result.Field80; } + set { SetField80(value); } + } + public Builder SetField80(bool value) { + PrepareBuilder(); + result.hasField80 = true; + result.field80_ = value; + return this; + } + public Builder ClearField80() { + PrepareBuilder(); + result.hasField80 = false; + result.field80_ = false; + return this; + } + + public bool HasField81 { + get { return result.hasField81; } + } + public bool Field81 { + get { return result.Field81; } + set { SetField81(value); } + } + public Builder SetField81(bool value) { + PrepareBuilder(); + result.hasField81 = true; + result.field81_ = value; + return this; + } + public Builder ClearField81() { + PrepareBuilder(); + result.hasField81 = false; + result.field81_ = true; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public int Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(int value) { + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = 0; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public int Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(int value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0; + return this; + } + + public bool HasField280 { + get { return result.hasField280; } + } + public int Field280 { + get { return result.Field280; } + set { SetField280(value); } + } + public Builder SetField280(int value) { + PrepareBuilder(); + result.hasField280 = true; + result.field280_ = value; + return this; + } + public Builder ClearField280() { + PrepareBuilder(); + result.hasField280 = false; + result.field280_ = 0; + return this; + } + + public bool HasField6 { + get { return result.hasField6; } + } + public int Field6 { + get { return result.Field6; } + set { SetField6(value); } + } + public Builder SetField6(int value) { + PrepareBuilder(); + result.hasField6 = true; + result.field6_ = value; + return this; + } + public Builder ClearField6() { + PrepareBuilder(); + result.hasField6 = false; + result.field6_ = 0; + return this; + } + + public bool HasField22 { + get { return result.hasField22; } + } + public long Field22 { + get { return result.Field22; } + set { SetField22(value); } + } + public Builder SetField22(long value) { + PrepareBuilder(); + result.hasField22 = true; + result.field22_ = value; + return this; + } + public Builder ClearField22() { + PrepareBuilder(); + result.hasField22 = false; + result.field22_ = 0L; + return this; + } + + public bool HasField4 { + get { return result.hasField4; } + } + public string Field4 { + get { return result.Field4; } + set { SetField4(value); } + } + public Builder SetField4(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField4 = true; + result.field4_ = value; + return this; + } + public Builder ClearField4() { + PrepareBuilder(); + result.hasField4 = false; + result.field4_ = ""; + return this; + } + + [global::System.CLSCompliant(false)] + public pbc::IPopsicleList Field5List { + get { return PrepareBuilder().field5_; } + } + public int Field5Count { + get { return result.Field5Count; } + } + [global::System.CLSCompliant(false)] + public ulong GetField5(int index) { + return result.GetField5(index); + } + [global::System.CLSCompliant(false)] + public Builder SetField5(int index, ulong value) { + PrepareBuilder(); + result.field5_[index] = value; + return this; + } + [global::System.CLSCompliant(false)] + public Builder AddField5(ulong value) { + PrepareBuilder(); + result.field5_.Add(value); + return this; + } + [global::System.CLSCompliant(false)] + public Builder AddRangeField5(scg::IEnumerable values) { + PrepareBuilder(); + result.field5_.Add(values); + return this; + } + public Builder ClearField5() { + PrepareBuilder(); + result.field5_.Clear(); + return this; + } + + public bool HasField59 { + get { return result.hasField59; } + } + public bool Field59 { + get { return result.Field59; } + set { SetField59(value); } + } + public Builder SetField59(bool value) { + PrepareBuilder(); + result.hasField59 = true; + result.field59_ = value; + return this; + } + public Builder ClearField59() { + PrepareBuilder(); + result.hasField59 = false; + result.field59_ = false; + return this; + } + + public bool HasField7 { + get { return result.hasField7; } + } + public string Field7 { + get { return result.Field7; } + set { SetField7(value); } + } + public Builder SetField7(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField7 = true; + result.field7_ = value; + return this; + } + public Builder ClearField7() { + PrepareBuilder(); + result.hasField7 = false; + result.field7_ = ""; + return this; + } + + public bool HasField16 { + get { return result.hasField16; } + } + public int Field16 { + get { return result.Field16; } + set { SetField16(value); } + } + public Builder SetField16(int value) { + PrepareBuilder(); + result.hasField16 = true; + result.field16_ = value; + return this; + } + public Builder ClearField16() { + PrepareBuilder(); + result.hasField16 = false; + result.field16_ = 0; + return this; + } + + public bool HasField130 { + get { return result.hasField130; } + } + public int Field130 { + get { return result.Field130; } + set { SetField130(value); } + } + public Builder SetField130(int value) { + PrepareBuilder(); + result.hasField130 = true; + result.field130_ = value; + return this; + } + public Builder ClearField130() { + PrepareBuilder(); + result.hasField130 = false; + result.field130_ = 0; + return this; + } + + public bool HasField12 { + get { return result.hasField12; } + } + public bool Field12 { + get { return result.Field12; } + set { SetField12(value); } + } + public Builder SetField12(bool value) { + PrepareBuilder(); + result.hasField12 = true; + result.field12_ = value; + return this; + } + public Builder ClearField12() { + PrepareBuilder(); + result.hasField12 = false; + result.field12_ = true; + return this; + } + + public bool HasField17 { + get { return result.hasField17; } + } + public bool Field17 { + get { return result.Field17; } + set { SetField17(value); } + } + public Builder SetField17(bool value) { + PrepareBuilder(); + result.hasField17 = true; + result.field17_ = value; + return this; + } + public Builder ClearField17() { + PrepareBuilder(); + result.hasField17 = false; + result.field17_ = true; + return this; + } + + public bool HasField13 { + get { return result.hasField13; } + } + public bool Field13 { + get { return result.Field13; } + set { SetField13(value); } + } + public Builder SetField13(bool value) { + PrepareBuilder(); + result.hasField13 = true; + result.field13_ = value; + return this; + } + public Builder ClearField13() { + PrepareBuilder(); + result.hasField13 = false; + result.field13_ = true; + return this; + } + + public bool HasField14 { + get { return result.hasField14; } + } + public bool Field14 { + get { return result.Field14; } + set { SetField14(value); } + } + public Builder SetField14(bool value) { + PrepareBuilder(); + result.hasField14 = true; + result.field14_ = value; + return this; + } + public Builder ClearField14() { + PrepareBuilder(); + result.hasField14 = false; + result.field14_ = true; + return this; + } + + public bool HasField104 { + get { return result.hasField104; } + } + public int Field104 { + get { return result.Field104; } + set { SetField104(value); } + } + public Builder SetField104(int value) { + PrepareBuilder(); + result.hasField104 = true; + result.field104_ = value; + return this; + } + public Builder ClearField104() { + PrepareBuilder(); + result.hasField104 = false; + result.field104_ = 0; + return this; + } + + public bool HasField100 { + get { return result.hasField100; } + } + public int Field100 { + get { return result.Field100; } + set { SetField100(value); } + } + public Builder SetField100(int value) { + PrepareBuilder(); + result.hasField100 = true; + result.field100_ = value; + return this; + } + public Builder ClearField100() { + PrepareBuilder(); + result.hasField100 = false; + result.field100_ = 0; + return this; + } + + public bool HasField101 { + get { return result.hasField101; } + } + public int Field101 { + get { return result.Field101; } + set { SetField101(value); } + } + public Builder SetField101(int value) { + PrepareBuilder(); + result.hasField101 = true; + result.field101_ = value; + return this; + } + public Builder ClearField101() { + PrepareBuilder(); + result.hasField101 = false; + result.field101_ = 0; + return this; + } + + public bool HasField102 { + get { return result.hasField102; } + } + public string Field102 { + get { return result.Field102; } + set { SetField102(value); } + } + public Builder SetField102(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField102 = true; + result.field102_ = value; + return this; + } + public Builder ClearField102() { + PrepareBuilder(); + result.hasField102 = false; + result.field102_ = ""; + return this; + } + + public bool HasField103 { + get { return result.hasField103; } + } + public string Field103 { + get { return result.Field103; } + set { SetField103(value); } + } + public Builder SetField103(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField103 = true; + result.field103_ = value; + return this; + } + public Builder ClearField103() { + PrepareBuilder(); + result.hasField103 = false; + result.field103_ = ""; + return this; + } + + public bool HasField29 { + get { return result.hasField29; } + } + public int Field29 { + get { return result.Field29; } + set { SetField29(value); } + } + public Builder SetField29(int value) { + PrepareBuilder(); + result.hasField29 = true; + result.field29_ = value; + return this; + } + public Builder ClearField29() { + PrepareBuilder(); + result.hasField29 = false; + result.field29_ = 0; + return this; + } + + public bool HasField30 { + get { return result.hasField30; } + } + public bool Field30 { + get { return result.Field30; } + set { SetField30(value); } + } + public Builder SetField30(bool value) { + PrepareBuilder(); + result.hasField30 = true; + result.field30_ = value; + return this; + } + public Builder ClearField30() { + PrepareBuilder(); + result.hasField30 = false; + result.field30_ = false; + return this; + } + + public bool HasField60 { + get { return result.hasField60; } + } + public int Field60 { + get { return result.Field60; } + set { SetField60(value); } + } + public Builder SetField60(int value) { + PrepareBuilder(); + result.hasField60 = true; + result.field60_ = value; + return this; + } + public Builder ClearField60() { + PrepareBuilder(); + result.hasField60 = false; + result.field60_ = -1; + return this; + } + + public bool HasField271 { + get { return result.hasField271; } + } + public int Field271 { + get { return result.Field271; } + set { SetField271(value); } + } + public Builder SetField271(int value) { + PrepareBuilder(); + result.hasField271 = true; + result.field271_ = value; + return this; + } + public Builder ClearField271() { + PrepareBuilder(); + result.hasField271 = false; + result.field271_ = -1; + return this; + } + + public bool HasField272 { + get { return result.hasField272; } + } + public int Field272 { + get { return result.Field272; } + set { SetField272(value); } + } + public Builder SetField272(int value) { + PrepareBuilder(); + result.hasField272 = true; + result.field272_ = value; + return this; + } + public Builder ClearField272() { + PrepareBuilder(); + result.hasField272 = false; + result.field272_ = -1; + return this; + } + + public bool HasField150 { + get { return result.hasField150; } + } + public int Field150 { + get { return result.Field150; } + set { SetField150(value); } + } + public Builder SetField150(int value) { + PrepareBuilder(); + result.hasField150 = true; + result.field150_ = value; + return this; + } + public Builder ClearField150() { + PrepareBuilder(); + result.hasField150 = false; + result.field150_ = 0; + return this; + } + + public bool HasField23 { + get { return result.hasField23; } + } + public int Field23 { + get { return result.Field23; } + set { SetField23(value); } + } + public Builder SetField23(int value) { + PrepareBuilder(); + result.hasField23 = true; + result.field23_ = value; + return this; + } + public Builder ClearField23() { + PrepareBuilder(); + result.hasField23 = false; + result.field23_ = 0; + return this; + } + + public bool HasField24 { + get { return result.hasField24; } + } + public bool Field24 { + get { return result.Field24; } + set { SetField24(value); } + } + public Builder SetField24(bool value) { + PrepareBuilder(); + result.hasField24 = true; + result.field24_ = value; + return this; + } + public Builder ClearField24() { + PrepareBuilder(); + result.hasField24 = false; + result.field24_ = false; + return this; + } + + public bool HasField25 { + get { return result.hasField25; } + } + public int Field25 { + get { return result.Field25; } + set { SetField25(value); } + } + public Builder SetField25(int value) { + PrepareBuilder(); + result.hasField25 = true; + result.field25_ = value; + return this; + } + public Builder ClearField25() { + PrepareBuilder(); + result.hasField25 = false; + result.field25_ = 0; + return this; + } + + public bool HasField15 { + get { return result.hasField15; } + } + public global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage Field15 { + get { return result.Field15; } + set { SetField15(value); } + } + public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = value; + return this; + } + public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = builderForValue.Build(); + return this; + } + public Builder MergeField15(global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasField15 && + result.field15_ != global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.DefaultInstance) { + result.field15_ = global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); + } else { + result.field15_ = value; + } + result.hasField15 = true; + return this; + } + public Builder ClearField15() { + PrepareBuilder(); + result.hasField15 = false; + result.field15_ = null; + return this; + } + + public bool HasField78 { + get { return result.hasField78; } + } + public bool Field78 { + get { return result.Field78; } + set { SetField78(value); } + } + public Builder SetField78(bool value) { + PrepareBuilder(); + result.hasField78 = true; + result.field78_ = value; + return this; + } + public Builder ClearField78() { + PrepareBuilder(); + result.hasField78 = false; + result.field78_ = false; + return this; + } + + public bool HasField67 { + get { return result.hasField67; } + } + public int Field67 { + get { return result.Field67; } + set { SetField67(value); } + } + public Builder SetField67(int value) { + PrepareBuilder(); + result.hasField67 = true; + result.field67_ = value; + return this; + } + public Builder ClearField67() { + PrepareBuilder(); + result.hasField67 = false; + result.field67_ = 0; + return this; + } + + public bool HasField68 { + get { return result.hasField68; } + } + public int Field68 { + get { return result.Field68; } + set { SetField68(value); } + } + public Builder SetField68(int value) { + PrepareBuilder(); + result.hasField68 = true; + result.field68_ = value; + return this; + } + public Builder ClearField68() { + PrepareBuilder(); + result.hasField68 = false; + result.field68_ = 0; + return this; + } + + public bool HasField128 { + get { return result.hasField128; } + } + public int Field128 { + get { return result.Field128; } + set { SetField128(value); } + } + public Builder SetField128(int value) { + PrepareBuilder(); + result.hasField128 = true; + result.field128_ = value; + return this; + } + public Builder ClearField128() { + PrepareBuilder(); + result.hasField128 = false; + result.field128_ = 0; + return this; + } + + public bool HasField129 { + get { return result.hasField129; } + } + public string Field129 { + get { return result.Field129; } + set { SetField129(value); } + } + public Builder SetField129(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField129 = true; + result.field129_ = value; + return this; + } + public Builder ClearField129() { + PrepareBuilder(); + result.hasField129 = false; + result.field129_ = "xxxxxxxxxxxxxxxxxxxxx"; + return this; + } + + public bool HasField131 { + get { return result.hasField131; } + } + public int Field131 { + get { return result.Field131; } + set { SetField131(value); } + } + public Builder SetField131(int value) { + PrepareBuilder(); + result.hasField131 = true; + result.field131_ = value; + return this; + } + public Builder ClearField131() { + PrepareBuilder(); + result.hasField131 = false; + result.field131_ = 0; + return this; + } + } + static SizeMessage1() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSize.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SizeMessage1SubMessage : pb::GeneratedMessage { + private SizeMessage1SubMessage() { } + private static readonly SizeMessage1SubMessage defaultInstance = new SizeMessage1SubMessage().MakeReadOnly(); + public static SizeMessage1SubMessage DefaultInstance { + get { return defaultInstance; } + } + + public override SizeMessage1SubMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SizeMessage1SubMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage1SubMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage1SubMessage__FieldAccessorTable; } + } + + public const int Field1FieldNumber = 1; + private bool hasField1; + private int field1_; + public bool HasField1 { + get { return hasField1; } + } + public int Field1 { + get { return field1_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private int field2_; + public bool HasField2 { + get { return hasField2; } + } + public int Field2 { + get { return field2_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private int field3_; + public bool HasField3 { + get { return hasField3; } + } + public int Field3 { + get { return field3_; } + } + + public const int Field15FieldNumber = 15; + private bool hasField15; + private string field15_ = ""; + public bool HasField15 { + get { return hasField15; } + } + public string Field15 { + get { return field15_; } + } + + public const int Field12FieldNumber = 12; + private bool hasField12; + private bool field12_ = true; + public bool HasField12 { + get { return hasField12; } + } + public bool Field12 { + get { return field12_; } + } + + public const int Field13FieldNumber = 13; + private bool hasField13; + private long field13_; + public bool HasField13 { + get { return hasField13; } + } + public long Field13 { + get { return field13_; } + } + + public const int Field14FieldNumber = 14; + private bool hasField14; + private long field14_; + public bool HasField14 { + get { return hasField14; } + } + public long Field14 { + get { return field14_; } + } + + public const int Field16FieldNumber = 16; + private bool hasField16; + private int field16_; + public bool HasField16 { + get { return hasField16; } + } + public int Field16 { + get { return field16_; } + } + + public const int Field19FieldNumber = 19; + private bool hasField19; + private int field19_ = 2; + public bool HasField19 { + get { return hasField19; } + } + public int Field19 { + get { return field19_; } + } + + public const int Field20FieldNumber = 20; + private bool hasField20; + private bool field20_ = true; + public bool HasField20 { + get { return hasField20; } + } + public bool Field20 { + get { return field20_; } + } + + public const int Field28FieldNumber = 28; + private bool hasField28; + private bool field28_ = true; + public bool HasField28 { + get { return hasField28; } + } + public bool Field28 { + get { return field28_; } + } + + public const int Field21FieldNumber = 21; + private bool hasField21; + private ulong field21_; + public bool HasField21 { + get { return hasField21; } + } + [global::System.CLSCompliant(false)] + public ulong Field21 { + get { return field21_; } + } + + public const int Field22FieldNumber = 22; + private bool hasField22; + private int field22_; + public bool HasField22 { + get { return hasField22; } + } + public int Field22 { + get { return field22_; } + } + + public const int Field23FieldNumber = 23; + private bool hasField23; + private bool field23_; + public bool HasField23 { + get { return hasField23; } + } + public bool Field23 { + get { return field23_; } + } + + public const int Field206FieldNumber = 206; + private bool hasField206; + private bool field206_; + public bool HasField206 { + get { return hasField206; } + } + public bool Field206 { + get { return field206_; } + } + + public const int Field203FieldNumber = 203; + private bool hasField203; + private uint field203_; + public bool HasField203 { + get { return hasField203; } + } + [global::System.CLSCompliant(false)] + public uint Field203 { + get { return field203_; } + } + + public const int Field204FieldNumber = 204; + private bool hasField204; + private int field204_; + public bool HasField204 { + get { return hasField204; } + } + public int Field204 { + get { return field204_; } + } + + public const int Field205FieldNumber = 205; + private bool hasField205; + private string field205_ = ""; + public bool HasField205 { + get { return hasField205; } + } + public string Field205 { + get { return field205_; } + } + + public const int Field207FieldNumber = 207; + private bool hasField207; + private ulong field207_; + public bool HasField207 { + get { return hasField207; } + } + [global::System.CLSCompliant(false)] + public ulong Field207 { + get { return field207_; } + } + + public const int Field300FieldNumber = 300; + private bool hasField300; + private ulong field300_; + public bool HasField300 { + get { return hasField300; } + } + [global::System.CLSCompliant(false)] + public ulong Field300 { + get { return field300_; } + } + + public static SizeMessage1SubMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage1SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage1SubMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage1SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage1SubMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage1SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SizeMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SizeMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SizeMessage1SubMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage1SubMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SizeMessage1SubMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SizeMessage1SubMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SizeMessage1SubMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SizeMessage1SubMessage result; + + private SizeMessage1SubMessage PrepareBuilder() { + if (resultIsReadOnly) { + SizeMessage1SubMessage original = result; + result = new SizeMessage1SubMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SizeMessage1SubMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.Descriptor; } + } + + public override SizeMessage1SubMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.DefaultInstance; } + } + + public override SizeMessage1SubMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public int Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(int value) { + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = 0; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public int Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(int value) { + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = 0; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public int Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(int value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0; + return this; + } + + public bool HasField15 { + get { return result.hasField15; } + } + public string Field15 { + get { return result.Field15; } + set { SetField15(value); } + } + public Builder SetField15(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = value; + return this; + } + public Builder ClearField15() { + PrepareBuilder(); + result.hasField15 = false; + result.field15_ = ""; + return this; + } + + public bool HasField12 { + get { return result.hasField12; } + } + public bool Field12 { + get { return result.Field12; } + set { SetField12(value); } + } + public Builder SetField12(bool value) { + PrepareBuilder(); + result.hasField12 = true; + result.field12_ = value; + return this; + } + public Builder ClearField12() { + PrepareBuilder(); + result.hasField12 = false; + result.field12_ = true; + return this; + } + + public bool HasField13 { + get { return result.hasField13; } + } + public long Field13 { + get { return result.Field13; } + set { SetField13(value); } + } + public Builder SetField13(long value) { + PrepareBuilder(); + result.hasField13 = true; + result.field13_ = value; + return this; + } + public Builder ClearField13() { + PrepareBuilder(); + result.hasField13 = false; + result.field13_ = 0L; + return this; + } + + public bool HasField14 { + get { return result.hasField14; } + } + public long Field14 { + get { return result.Field14; } + set { SetField14(value); } + } + public Builder SetField14(long value) { + PrepareBuilder(); + result.hasField14 = true; + result.field14_ = value; + return this; + } + public Builder ClearField14() { + PrepareBuilder(); + result.hasField14 = false; + result.field14_ = 0L; + return this; + } + + public bool HasField16 { + get { return result.hasField16; } + } + public int Field16 { + get { return result.Field16; } + set { SetField16(value); } + } + public Builder SetField16(int value) { + PrepareBuilder(); + result.hasField16 = true; + result.field16_ = value; + return this; + } + public Builder ClearField16() { + PrepareBuilder(); + result.hasField16 = false; + result.field16_ = 0; + return this; + } + + public bool HasField19 { + get { return result.hasField19; } + } + public int Field19 { + get { return result.Field19; } + set { SetField19(value); } + } + public Builder SetField19(int value) { + PrepareBuilder(); + result.hasField19 = true; + result.field19_ = value; + return this; + } + public Builder ClearField19() { + PrepareBuilder(); + result.hasField19 = false; + result.field19_ = 2; + return this; + } + + public bool HasField20 { + get { return result.hasField20; } + } + public bool Field20 { + get { return result.Field20; } + set { SetField20(value); } + } + public Builder SetField20(bool value) { + PrepareBuilder(); + result.hasField20 = true; + result.field20_ = value; + return this; + } + public Builder ClearField20() { + PrepareBuilder(); + result.hasField20 = false; + result.field20_ = true; + return this; + } + + public bool HasField28 { + get { return result.hasField28; } + } + public bool Field28 { + get { return result.Field28; } + set { SetField28(value); } + } + public Builder SetField28(bool value) { + PrepareBuilder(); + result.hasField28 = true; + result.field28_ = value; + return this; + } + public Builder ClearField28() { + PrepareBuilder(); + result.hasField28 = false; + result.field28_ = true; + return this; + } + + public bool HasField21 { + get { return result.hasField21; } + } + [global::System.CLSCompliant(false)] + public ulong Field21 { + get { return result.Field21; } + set { SetField21(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField21(ulong value) { + PrepareBuilder(); + result.hasField21 = true; + result.field21_ = value; + return this; + } + public Builder ClearField21() { + PrepareBuilder(); + result.hasField21 = false; + result.field21_ = 0UL; + return this; + } + + public bool HasField22 { + get { return result.hasField22; } + } + public int Field22 { + get { return result.Field22; } + set { SetField22(value); } + } + public Builder SetField22(int value) { + PrepareBuilder(); + result.hasField22 = true; + result.field22_ = value; + return this; + } + public Builder ClearField22() { + PrepareBuilder(); + result.hasField22 = false; + result.field22_ = 0; + return this; + } + + public bool HasField23 { + get { return result.hasField23; } + } + public bool Field23 { + get { return result.Field23; } + set { SetField23(value); } + } + public Builder SetField23(bool value) { + PrepareBuilder(); + result.hasField23 = true; + result.field23_ = value; + return this; + } + public Builder ClearField23() { + PrepareBuilder(); + result.hasField23 = false; + result.field23_ = false; + return this; + } + + public bool HasField206 { + get { return result.hasField206; } + } + public bool Field206 { + get { return result.Field206; } + set { SetField206(value); } + } + public Builder SetField206(bool value) { + PrepareBuilder(); + result.hasField206 = true; + result.field206_ = value; + return this; + } + public Builder ClearField206() { + PrepareBuilder(); + result.hasField206 = false; + result.field206_ = false; + return this; + } + + public bool HasField203 { + get { return result.hasField203; } + } + [global::System.CLSCompliant(false)] + public uint Field203 { + get { return result.Field203; } + set { SetField203(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField203(uint value) { + PrepareBuilder(); + result.hasField203 = true; + result.field203_ = value; + return this; + } + public Builder ClearField203() { + PrepareBuilder(); + result.hasField203 = false; + result.field203_ = 0; + return this; + } + + public bool HasField204 { + get { return result.hasField204; } + } + public int Field204 { + get { return result.Field204; } + set { SetField204(value); } + } + public Builder SetField204(int value) { + PrepareBuilder(); + result.hasField204 = true; + result.field204_ = value; + return this; + } + public Builder ClearField204() { + PrepareBuilder(); + result.hasField204 = false; + result.field204_ = 0; + return this; + } + + public bool HasField205 { + get { return result.hasField205; } + } + public string Field205 { + get { return result.Field205; } + set { SetField205(value); } + } + public Builder SetField205(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField205 = true; + result.field205_ = value; + return this; + } + public Builder ClearField205() { + PrepareBuilder(); + result.hasField205 = false; + result.field205_ = ""; + return this; + } + + public bool HasField207 { + get { return result.hasField207; } + } + [global::System.CLSCompliant(false)] + public ulong Field207 { + get { return result.Field207; } + set { SetField207(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField207(ulong value) { + PrepareBuilder(); + result.hasField207 = true; + result.field207_ = value; + return this; + } + public Builder ClearField207() { + PrepareBuilder(); + result.hasField207 = false; + result.field207_ = 0UL; + return this; + } + + public bool HasField300 { + get { return result.hasField300; } + } + [global::System.CLSCompliant(false)] + public ulong Field300 { + get { return result.Field300; } + set { SetField300(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField300(ulong value) { + PrepareBuilder(); + result.hasField300 = true; + result.field300_ = value; + return this; + } + public Builder ClearField300() { + PrepareBuilder(); + result.hasField300 = false; + result.field300_ = 0UL; + return this; + } + } + static SizeMessage1SubMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSize.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SizeMessage2 : pb::GeneratedMessage { + private SizeMessage2() { } + private static readonly SizeMessage2 defaultInstance = new SizeMessage2().MakeReadOnly(); + public static SizeMessage2 DefaultInstance { + get { return defaultInstance; } + } + + public override SizeMessage2 DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SizeMessage2 ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage2__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage2__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Group1 : pb::GeneratedMessage { + private Group1() { } + private static readonly Group1 defaultInstance = new Group1().MakeReadOnly(); + public static Group1 DefaultInstance { + get { return defaultInstance; } + } + + public override Group1 DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Group1 ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage2_Group1__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage2_Group1__FieldAccessorTable; } + } + + public const int Field11FieldNumber = 11; + private bool hasField11; + private float field11_; + public bool HasField11 { + get { return hasField11; } + } + public float Field11 { + get { return field11_; } + } + + public const int Field26FieldNumber = 26; + private bool hasField26; + private float field26_; + public bool HasField26 { + get { return hasField26; } + } + public float Field26 { + get { return field26_; } + } + + public const int Field12FieldNumber = 12; + private bool hasField12; + private string field12_ = ""; + public bool HasField12 { + get { return hasField12; } + } + public string Field12 { + get { return field12_; } + } + + public const int Field13FieldNumber = 13; + private bool hasField13; + private string field13_ = ""; + public bool HasField13 { + get { return hasField13; } + } + public string Field13 { + get { return field13_; } + } + + public const int Field14FieldNumber = 14; + private pbc::PopsicleList field14_ = new pbc::PopsicleList(); + public scg::IList Field14List { + get { return pbc::Lists.AsReadOnly(field14_); } + } + public int Field14Count { + get { return field14_.Count; } + } + public string GetField14(int index) { + return field14_[index]; + } + + public const int Field15FieldNumber = 15; + private bool hasField15; + private ulong field15_; + public bool HasField15 { + get { return hasField15; } + } + [global::System.CLSCompliant(false)] + public ulong Field15 { + get { return field15_; } + } + + public const int Field5FieldNumber = 5; + private bool hasField5; + private int field5_; + public bool HasField5 { + get { return hasField5; } + } + public int Field5 { + get { return field5_; } + } + + public const int Field27FieldNumber = 27; + private bool hasField27; + private string field27_ = ""; + public bool HasField27 { + get { return hasField27; } + } + public string Field27 { + get { return field27_; } + } + + public const int Field28FieldNumber = 28; + private bool hasField28; + private int field28_; + public bool HasField28 { + get { return hasField28; } + } + public int Field28 { + get { return field28_; } + } + + public const int Field29FieldNumber = 29; + private bool hasField29; + private string field29_ = ""; + public bool HasField29 { + get { return hasField29; } + } + public string Field29 { + get { return field29_; } + } + + public const int Field16FieldNumber = 16; + private bool hasField16; + private string field16_ = ""; + public bool HasField16 { + get { return hasField16; } + } + public string Field16 { + get { return field16_; } + } + + public const int Field22FieldNumber = 22; + private pbc::PopsicleList field22_ = new pbc::PopsicleList(); + public scg::IList Field22List { + get { return pbc::Lists.AsReadOnly(field22_); } + } + public int Field22Count { + get { return field22_.Count; } + } + public string GetField22(int index) { + return field22_[index]; + } + + public const int Field73FieldNumber = 73; + private pbc::PopsicleList field73_ = new pbc::PopsicleList(); + public scg::IList Field73List { + get { return pbc::Lists.AsReadOnly(field73_); } + } + public int Field73Count { + get { return field73_.Count; } + } + public int GetField73(int index) { + return field73_[index]; + } + + public const int Field20FieldNumber = 20; + private bool hasField20; + private int field20_; + public bool HasField20 { + get { return hasField20; } + } + public int Field20 { + get { return field20_; } + } + + public const int Field24FieldNumber = 24; + private bool hasField24; + private string field24_ = ""; + public bool HasField24 { + get { return hasField24; } + } + public string Field24 { + get { return field24_; } + } + + public const int Field31FieldNumber = 31; + private bool hasField31; + private global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage field31_; + public bool HasField31 { + get { return hasField31; } + } + public global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage Field31 { + get { return field31_ ?? global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.DefaultInstance; } + } + + public static Group1 ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Group1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Group1 ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Group1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Group1 ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Group1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Group1 ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Group1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Group1 ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Group1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Group1 MakeReadOnly() { + field14_.MakeReadOnly(); + field22_.MakeReadOnly(); + field73_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Group1 prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Group1 cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Group1 result; + + private Group1 PrepareBuilder() { + if (resultIsReadOnly) { + Group1 original = result; + result = new Group1(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Group1 MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.Descriptor; } + } + + public override Group1 DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.DefaultInstance; } + } + + public override Group1 BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + + public bool HasField11 { + get { return result.hasField11; } + } + public float Field11 { + get { return result.Field11; } + set { SetField11(value); } + } + public Builder SetField11(float value) { + PrepareBuilder(); + result.hasField11 = true; + result.field11_ = value; + return this; + } + public Builder ClearField11() { + PrepareBuilder(); + result.hasField11 = false; + result.field11_ = 0F; + return this; + } + + public bool HasField26 { + get { return result.hasField26; } + } + public float Field26 { + get { return result.Field26; } + set { SetField26(value); } + } + public Builder SetField26(float value) { + PrepareBuilder(); + result.hasField26 = true; + result.field26_ = value; + return this; + } + public Builder ClearField26() { + PrepareBuilder(); + result.hasField26 = false; + result.field26_ = 0F; + return this; + } + + public bool HasField12 { + get { return result.hasField12; } + } + public string Field12 { + get { return result.Field12; } + set { SetField12(value); } + } + public Builder SetField12(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField12 = true; + result.field12_ = value; + return this; + } + public Builder ClearField12() { + PrepareBuilder(); + result.hasField12 = false; + result.field12_ = ""; + return this; + } + + public bool HasField13 { + get { return result.hasField13; } + } + public string Field13 { + get { return result.Field13; } + set { SetField13(value); } + } + public Builder SetField13(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField13 = true; + result.field13_ = value; + return this; + } + public Builder ClearField13() { + PrepareBuilder(); + result.hasField13 = false; + result.field13_ = ""; + return this; + } + + public pbc::IPopsicleList Field14List { + get { return PrepareBuilder().field14_; } + } + public int Field14Count { + get { return result.Field14Count; } + } + public string GetField14(int index) { + return result.GetField14(index); + } + public Builder SetField14(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field14_[index] = value; + return this; + } + public Builder AddField14(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field14_.Add(value); + return this; + } + public Builder AddRangeField14(scg::IEnumerable values) { + PrepareBuilder(); + result.field14_.Add(values); + return this; + } + public Builder ClearField14() { + PrepareBuilder(); + result.field14_.Clear(); + return this; + } + + public bool HasField15 { + get { return result.hasField15; } + } + [global::System.CLSCompliant(false)] + public ulong Field15 { + get { return result.Field15; } + set { SetField15(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField15(ulong value) { + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = value; + return this; + } + public Builder ClearField15() { + PrepareBuilder(); + result.hasField15 = false; + result.field15_ = 0UL; + return this; + } + + public bool HasField5 { + get { return result.hasField5; } + } + public int Field5 { + get { return result.Field5; } + set { SetField5(value); } + } + public Builder SetField5(int value) { + PrepareBuilder(); + result.hasField5 = true; + result.field5_ = value; + return this; + } + public Builder ClearField5() { + PrepareBuilder(); + result.hasField5 = false; + result.field5_ = 0; + return this; + } + + public bool HasField27 { + get { return result.hasField27; } + } + public string Field27 { + get { return result.Field27; } + set { SetField27(value); } + } + public Builder SetField27(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField27 = true; + result.field27_ = value; + return this; + } + public Builder ClearField27() { + PrepareBuilder(); + result.hasField27 = false; + result.field27_ = ""; + return this; + } + + public bool HasField28 { + get { return result.hasField28; } + } + public int Field28 { + get { return result.Field28; } + set { SetField28(value); } + } + public Builder SetField28(int value) { + PrepareBuilder(); + result.hasField28 = true; + result.field28_ = value; + return this; + } + public Builder ClearField28() { + PrepareBuilder(); + result.hasField28 = false; + result.field28_ = 0; + return this; + } + + public bool HasField29 { + get { return result.hasField29; } + } + public string Field29 { + get { return result.Field29; } + set { SetField29(value); } + } + public Builder SetField29(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField29 = true; + result.field29_ = value; + return this; + } + public Builder ClearField29() { + PrepareBuilder(); + result.hasField29 = false; + result.field29_ = ""; + return this; + } + + public bool HasField16 { + get { return result.hasField16; } + } + public string Field16 { + get { return result.Field16; } + set { SetField16(value); } + } + public Builder SetField16(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField16 = true; + result.field16_ = value; + return this; + } + public Builder ClearField16() { + PrepareBuilder(); + result.hasField16 = false; + result.field16_ = ""; + return this; + } + + public pbc::IPopsicleList Field22List { + get { return PrepareBuilder().field22_; } + } + public int Field22Count { + get { return result.Field22Count; } + } + public string GetField22(int index) { + return result.GetField22(index); + } + public Builder SetField22(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field22_[index] = value; + return this; + } + public Builder AddField22(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field22_.Add(value); + return this; + } + public Builder AddRangeField22(scg::IEnumerable values) { + PrepareBuilder(); + result.field22_.Add(values); + return this; + } + public Builder ClearField22() { + PrepareBuilder(); + result.field22_.Clear(); + return this; + } + + public pbc::IPopsicleList Field73List { + get { return PrepareBuilder().field73_; } + } + public int Field73Count { + get { return result.Field73Count; } + } + public int GetField73(int index) { + return result.GetField73(index); + } + public Builder SetField73(int index, int value) { + PrepareBuilder(); + result.field73_[index] = value; + return this; + } + public Builder AddField73(int value) { + PrepareBuilder(); + result.field73_.Add(value); + return this; + } + public Builder AddRangeField73(scg::IEnumerable values) { + PrepareBuilder(); + result.field73_.Add(values); + return this; + } + public Builder ClearField73() { + PrepareBuilder(); + result.field73_.Clear(); + return this; + } + + public bool HasField20 { + get { return result.hasField20; } + } + public int Field20 { + get { return result.Field20; } + set { SetField20(value); } + } + public Builder SetField20(int value) { + PrepareBuilder(); + result.hasField20 = true; + result.field20_ = value; + return this; + } + public Builder ClearField20() { + PrepareBuilder(); + result.hasField20 = false; + result.field20_ = 0; + return this; + } + + public bool HasField24 { + get { return result.hasField24; } + } + public string Field24 { + get { return result.Field24; } + set { SetField24(value); } + } + public Builder SetField24(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField24 = true; + result.field24_ = value; + return this; + } + public Builder ClearField24() { + PrepareBuilder(); + result.hasField24 = false; + result.field24_ = ""; + return this; + } + + public bool HasField31 { + get { return result.hasField31; } + } + public global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage Field31 { + get { return result.Field31; } + set { SetField31(value); } + } + public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField31 = true; + result.field31_ = value; + return this; + } + public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasField31 = true; + result.field31_ = builderForValue.Build(); + return this; + } + public Builder MergeField31(global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasField31 && + result.field31_ != global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.DefaultInstance) { + result.field31_ = global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); + } else { + result.field31_ = value; + } + result.hasField31 = true; + return this; + } + public Builder ClearField31() { + PrepareBuilder(); + result.hasField31 = false; + result.field31_ = null; + return this; + } + } + static Group1() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSize.Descriptor, null); + } + } + + } + #endregion + + public const int Field1FieldNumber = 1; + private bool hasField1; + private string field1_ = ""; + public bool HasField1 { + get { return hasField1; } + } + public string Field1 { + get { return field1_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private long field3_; + public bool HasField3 { + get { return hasField3; } + } + public long Field3 { + get { return field3_; } + } + + public const int Field4FieldNumber = 4; + private bool hasField4; + private long field4_; + public bool HasField4 { + get { return hasField4; } + } + public long Field4 { + get { return field4_; } + } + + public const int Field30FieldNumber = 30; + private bool hasField30; + private long field30_; + public bool HasField30 { + get { return hasField30; } + } + public long Field30 { + get { return field30_; } + } + + public const int Field75FieldNumber = 75; + private bool hasField75; + private bool field75_; + public bool HasField75 { + get { return hasField75; } + } + public bool Field75 { + get { return field75_; } + } + + public const int Field6FieldNumber = 6; + private bool hasField6; + private string field6_ = ""; + public bool HasField6 { + get { return hasField6; } + } + public string Field6 { + get { return field6_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private pb::ByteString field2_ = pb::ByteString.Empty; + public bool HasField2 { + get { return hasField2; } + } + public pb::ByteString Field2 { + get { return field2_; } + } + + public const int Field21FieldNumber = 21; + private bool hasField21; + private int field21_; + public bool HasField21 { + get { return hasField21; } + } + public int Field21 { + get { return field21_; } + } + + public const int Field71FieldNumber = 71; + private bool hasField71; + private int field71_; + public bool HasField71 { + get { return hasField71; } + } + public int Field71 { + get { return field71_; } + } + + public const int Field25FieldNumber = 25; + private bool hasField25; + private float field25_; + public bool HasField25 { + get { return hasField25; } + } + public float Field25 { + get { return field25_; } + } + + public const int Field109FieldNumber = 109; + private bool hasField109; + private int field109_; + public bool HasField109 { + get { return hasField109; } + } + public int Field109 { + get { return field109_; } + } + + public const int Field210FieldNumber = 210; + private bool hasField210; + private int field210_; + public bool HasField210 { + get { return hasField210; } + } + public int Field210 { + get { return field210_; } + } + + public const int Field211FieldNumber = 211; + private bool hasField211; + private int field211_; + public bool HasField211 { + get { return hasField211; } + } + public int Field211 { + get { return field211_; } + } + + public const int Field212FieldNumber = 212; + private bool hasField212; + private int field212_; + public bool HasField212 { + get { return hasField212; } + } + public int Field212 { + get { return field212_; } + } + + public const int Field213FieldNumber = 213; + private bool hasField213; + private int field213_; + public bool HasField213 { + get { return hasField213; } + } + public int Field213 { + get { return field213_; } + } + + public const int Field216FieldNumber = 216; + private bool hasField216; + private int field216_; + public bool HasField216 { + get { return hasField216; } + } + public int Field216 { + get { return field216_; } + } + + public const int Field217FieldNumber = 217; + private bool hasField217; + private int field217_; + public bool HasField217 { + get { return hasField217; } + } + public int Field217 { + get { return field217_; } + } + + public const int Field218FieldNumber = 218; + private bool hasField218; + private int field218_; + public bool HasField218 { + get { return hasField218; } + } + public int Field218 { + get { return field218_; } + } + + public const int Field220FieldNumber = 220; + private bool hasField220; + private int field220_; + public bool HasField220 { + get { return hasField220; } + } + public int Field220 { + get { return field220_; } + } + + public const int Field221FieldNumber = 221; + private bool hasField221; + private int field221_; + public bool HasField221 { + get { return hasField221; } + } + public int Field221 { + get { return field221_; } + } + + public const int Field222FieldNumber = 222; + private bool hasField222; + private float field222_; + public bool HasField222 { + get { return hasField222; } + } + public float Field222 { + get { return field222_; } + } + + public const int Field63FieldNumber = 63; + private bool hasField63; + private int field63_; + public bool HasField63 { + get { return hasField63; } + } + public int Field63 { + get { return field63_; } + } + + public const int Group1FieldNumber = 10; + private pbc::PopsicleList group1_ = new pbc::PopsicleList(); + public scg::IList Group1List { + get { return group1_; } + } + public int Group1Count { + get { return group1_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 GetGroup1(int index) { + return group1_[index]; + } + + public const int Field128FieldNumber = 128; + private pbc::PopsicleList field128_ = new pbc::PopsicleList(); + public scg::IList Field128List { + get { return pbc::Lists.AsReadOnly(field128_); } + } + public int Field128Count { + get { return field128_.Count; } + } + public string GetField128(int index) { + return field128_[index]; + } + + public const int Field131FieldNumber = 131; + private bool hasField131; + private long field131_; + public bool HasField131 { + get { return hasField131; } + } + public long Field131 { + get { return field131_; } + } + + public const int Field127FieldNumber = 127; + private pbc::PopsicleList field127_ = new pbc::PopsicleList(); + public scg::IList Field127List { + get { return pbc::Lists.AsReadOnly(field127_); } + } + public int Field127Count { + get { return field127_.Count; } + } + public string GetField127(int index) { + return field127_[index]; + } + + public const int Field129FieldNumber = 129; + private bool hasField129; + private int field129_; + public bool HasField129 { + get { return hasField129; } + } + public int Field129 { + get { return field129_; } + } + + public const int Field130FieldNumber = 130; + private pbc::PopsicleList field130_ = new pbc::PopsicleList(); + public scg::IList Field130List { + get { return pbc::Lists.AsReadOnly(field130_); } + } + public int Field130Count { + get { return field130_.Count; } + } + public long GetField130(int index) { + return field130_[index]; + } + + public const int Field205FieldNumber = 205; + private bool hasField205; + private bool field205_; + public bool HasField205 { + get { return hasField205; } + } + public bool Field205 { + get { return field205_; } + } + + public const int Field206FieldNumber = 206; + private bool hasField206; + private bool field206_; + public bool HasField206 { + get { return hasField206; } + } + public bool Field206 { + get { return field206_; } + } + + public static SizeMessage2 ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage2 ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage2 ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SizeMessage2 ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SizeMessage2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SizeMessage2 ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SizeMessage2 MakeReadOnly() { + group1_.MakeReadOnly(); + field128_.MakeReadOnly(); + field127_.MakeReadOnly(); + field130_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SizeMessage2 prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SizeMessage2 cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SizeMessage2 result; + + private SizeMessage2 PrepareBuilder() { + if (resultIsReadOnly) { + SizeMessage2 original = result; + result = new SizeMessage2(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SizeMessage2 MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Descriptor; } + } + + public override SizeMessage2 DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.DefaultInstance; } + } + + public override SizeMessage2 BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public string Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = ""; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public long Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(long value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0L; + return this; + } + + public bool HasField4 { + get { return result.hasField4; } + } + public long Field4 { + get { return result.Field4; } + set { SetField4(value); } + } + public Builder SetField4(long value) { + PrepareBuilder(); + result.hasField4 = true; + result.field4_ = value; + return this; + } + public Builder ClearField4() { + PrepareBuilder(); + result.hasField4 = false; + result.field4_ = 0L; + return this; + } + + public bool HasField30 { + get { return result.hasField30; } + } + public long Field30 { + get { return result.Field30; } + set { SetField30(value); } + } + public Builder SetField30(long value) { + PrepareBuilder(); + result.hasField30 = true; + result.field30_ = value; + return this; + } + public Builder ClearField30() { + PrepareBuilder(); + result.hasField30 = false; + result.field30_ = 0L; + return this; + } + + public bool HasField75 { + get { return result.hasField75; } + } + public bool Field75 { + get { return result.Field75; } + set { SetField75(value); } + } + public Builder SetField75(bool value) { + PrepareBuilder(); + result.hasField75 = true; + result.field75_ = value; + return this; + } + public Builder ClearField75() { + PrepareBuilder(); + result.hasField75 = false; + result.field75_ = false; + return this; + } + + public bool HasField6 { + get { return result.hasField6; } + } + public string Field6 { + get { return result.Field6; } + set { SetField6(value); } + } + public Builder SetField6(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField6 = true; + result.field6_ = value; + return this; + } + public Builder ClearField6() { + PrepareBuilder(); + result.hasField6 = false; + result.field6_ = ""; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public pb::ByteString Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = pb::ByteString.Empty; + return this; + } + + public bool HasField21 { + get { return result.hasField21; } + } + public int Field21 { + get { return result.Field21; } + set { SetField21(value); } + } + public Builder SetField21(int value) { + PrepareBuilder(); + result.hasField21 = true; + result.field21_ = value; + return this; + } + public Builder ClearField21() { + PrepareBuilder(); + result.hasField21 = false; + result.field21_ = 0; + return this; + } + + public bool HasField71 { + get { return result.hasField71; } + } + public int Field71 { + get { return result.Field71; } + set { SetField71(value); } + } + public Builder SetField71(int value) { + PrepareBuilder(); + result.hasField71 = true; + result.field71_ = value; + return this; + } + public Builder ClearField71() { + PrepareBuilder(); + result.hasField71 = false; + result.field71_ = 0; + return this; + } + + public bool HasField25 { + get { return result.hasField25; } + } + public float Field25 { + get { return result.Field25; } + set { SetField25(value); } + } + public Builder SetField25(float value) { + PrepareBuilder(); + result.hasField25 = true; + result.field25_ = value; + return this; + } + public Builder ClearField25() { + PrepareBuilder(); + result.hasField25 = false; + result.field25_ = 0F; + return this; + } + + public bool HasField109 { + get { return result.hasField109; } + } + public int Field109 { + get { return result.Field109; } + set { SetField109(value); } + } + public Builder SetField109(int value) { + PrepareBuilder(); + result.hasField109 = true; + result.field109_ = value; + return this; + } + public Builder ClearField109() { + PrepareBuilder(); + result.hasField109 = false; + result.field109_ = 0; + return this; + } + + public bool HasField210 { + get { return result.hasField210; } + } + public int Field210 { + get { return result.Field210; } + set { SetField210(value); } + } + public Builder SetField210(int value) { + PrepareBuilder(); + result.hasField210 = true; + result.field210_ = value; + return this; + } + public Builder ClearField210() { + PrepareBuilder(); + result.hasField210 = false; + result.field210_ = 0; + return this; + } + + public bool HasField211 { + get { return result.hasField211; } + } + public int Field211 { + get { return result.Field211; } + set { SetField211(value); } + } + public Builder SetField211(int value) { + PrepareBuilder(); + result.hasField211 = true; + result.field211_ = value; + return this; + } + public Builder ClearField211() { + PrepareBuilder(); + result.hasField211 = false; + result.field211_ = 0; + return this; + } + + public bool HasField212 { + get { return result.hasField212; } + } + public int Field212 { + get { return result.Field212; } + set { SetField212(value); } + } + public Builder SetField212(int value) { + PrepareBuilder(); + result.hasField212 = true; + result.field212_ = value; + return this; + } + public Builder ClearField212() { + PrepareBuilder(); + result.hasField212 = false; + result.field212_ = 0; + return this; + } + + public bool HasField213 { + get { return result.hasField213; } + } + public int Field213 { + get { return result.Field213; } + set { SetField213(value); } + } + public Builder SetField213(int value) { + PrepareBuilder(); + result.hasField213 = true; + result.field213_ = value; + return this; + } + public Builder ClearField213() { + PrepareBuilder(); + result.hasField213 = false; + result.field213_ = 0; + return this; + } + + public bool HasField216 { + get { return result.hasField216; } + } + public int Field216 { + get { return result.Field216; } + set { SetField216(value); } + } + public Builder SetField216(int value) { + PrepareBuilder(); + result.hasField216 = true; + result.field216_ = value; + return this; + } + public Builder ClearField216() { + PrepareBuilder(); + result.hasField216 = false; + result.field216_ = 0; + return this; + } + + public bool HasField217 { + get { return result.hasField217; } + } + public int Field217 { + get { return result.Field217; } + set { SetField217(value); } + } + public Builder SetField217(int value) { + PrepareBuilder(); + result.hasField217 = true; + result.field217_ = value; + return this; + } + public Builder ClearField217() { + PrepareBuilder(); + result.hasField217 = false; + result.field217_ = 0; + return this; + } + + public bool HasField218 { + get { return result.hasField218; } + } + public int Field218 { + get { return result.Field218; } + set { SetField218(value); } + } + public Builder SetField218(int value) { + PrepareBuilder(); + result.hasField218 = true; + result.field218_ = value; + return this; + } + public Builder ClearField218() { + PrepareBuilder(); + result.hasField218 = false; + result.field218_ = 0; + return this; + } + + public bool HasField220 { + get { return result.hasField220; } + } + public int Field220 { + get { return result.Field220; } + set { SetField220(value); } + } + public Builder SetField220(int value) { + PrepareBuilder(); + result.hasField220 = true; + result.field220_ = value; + return this; + } + public Builder ClearField220() { + PrepareBuilder(); + result.hasField220 = false; + result.field220_ = 0; + return this; + } + + public bool HasField221 { + get { return result.hasField221; } + } + public int Field221 { + get { return result.Field221; } + set { SetField221(value); } + } + public Builder SetField221(int value) { + PrepareBuilder(); + result.hasField221 = true; + result.field221_ = value; + return this; + } + public Builder ClearField221() { + PrepareBuilder(); + result.hasField221 = false; + result.field221_ = 0; + return this; + } + + public bool HasField222 { + get { return result.hasField222; } + } + public float Field222 { + get { return result.Field222; } + set { SetField222(value); } + } + public Builder SetField222(float value) { + PrepareBuilder(); + result.hasField222 = true; + result.field222_ = value; + return this; + } + public Builder ClearField222() { + PrepareBuilder(); + result.hasField222 = false; + result.field222_ = 0F; + return this; + } + + public bool HasField63 { + get { return result.hasField63; } + } + public int Field63 { + get { return result.Field63; } + set { SetField63(value); } + } + public Builder SetField63(int value) { + PrepareBuilder(); + result.hasField63 = true; + result.field63_ = value; + return this; + } + public Builder ClearField63() { + PrepareBuilder(); + result.hasField63 = false; + result.field63_ = 0; + return this; + } + + public pbc::IPopsicleList Group1List { + get { return PrepareBuilder().group1_; } + } + public int Group1Count { + get { return result.Group1Count; } + } + public global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 GetGroup1(int index) { + return result.GetGroup1(index); + } + public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.group1_[index] = value; + return this; + } + public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.group1_[index] = builderForValue.Build(); + return this; + } + public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.group1_.Add(value); + return this; + } + public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.group1_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeGroup1(scg::IEnumerable values) { + PrepareBuilder(); + result.group1_.Add(values); + return this; + } + public Builder ClearGroup1() { + PrepareBuilder(); + result.group1_.Clear(); + return this; + } + + public pbc::IPopsicleList Field128List { + get { return PrepareBuilder().field128_; } + } + public int Field128Count { + get { return result.Field128Count; } + } + public string GetField128(int index) { + return result.GetField128(index); + } + public Builder SetField128(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field128_[index] = value; + return this; + } + public Builder AddField128(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field128_.Add(value); + return this; + } + public Builder AddRangeField128(scg::IEnumerable values) { + PrepareBuilder(); + result.field128_.Add(values); + return this; + } + public Builder ClearField128() { + PrepareBuilder(); + result.field128_.Clear(); + return this; + } + + public bool HasField131 { + get { return result.hasField131; } + } + public long Field131 { + get { return result.Field131; } + set { SetField131(value); } + } + public Builder SetField131(long value) { + PrepareBuilder(); + result.hasField131 = true; + result.field131_ = value; + return this; + } + public Builder ClearField131() { + PrepareBuilder(); + result.hasField131 = false; + result.field131_ = 0L; + return this; + } + + public pbc::IPopsicleList Field127List { + get { return PrepareBuilder().field127_; } + } + public int Field127Count { + get { return result.Field127Count; } + } + public string GetField127(int index) { + return result.GetField127(index); + } + public Builder SetField127(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field127_[index] = value; + return this; + } + public Builder AddField127(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field127_.Add(value); + return this; + } + public Builder AddRangeField127(scg::IEnumerable values) { + PrepareBuilder(); + result.field127_.Add(values); + return this; + } + public Builder ClearField127() { + PrepareBuilder(); + result.field127_.Clear(); + return this; + } + + public bool HasField129 { + get { return result.hasField129; } + } + public int Field129 { + get { return result.Field129; } + set { SetField129(value); } + } + public Builder SetField129(int value) { + PrepareBuilder(); + result.hasField129 = true; + result.field129_ = value; + return this; + } + public Builder ClearField129() { + PrepareBuilder(); + result.hasField129 = false; + result.field129_ = 0; + return this; + } + + public pbc::IPopsicleList Field130List { + get { return PrepareBuilder().field130_; } + } + public int Field130Count { + get { return result.Field130Count; } + } + public long GetField130(int index) { + return result.GetField130(index); + } + public Builder SetField130(int index, long value) { + PrepareBuilder(); + result.field130_[index] = value; + return this; + } + public Builder AddField130(long value) { + PrepareBuilder(); + result.field130_.Add(value); + return this; + } + public Builder AddRangeField130(scg::IEnumerable values) { + PrepareBuilder(); + result.field130_.Add(values); + return this; + } + public Builder ClearField130() { + PrepareBuilder(); + result.field130_.Clear(); + return this; + } + + public bool HasField205 { + get { return result.hasField205; } + } + public bool Field205 { + get { return result.Field205; } + set { SetField205(value); } + } + public Builder SetField205(bool value) { + PrepareBuilder(); + result.hasField205 = true; + result.field205_ = value; + return this; + } + public Builder ClearField205() { + PrepareBuilder(); + result.hasField205 = false; + result.field205_ = false; + return this; + } + + public bool HasField206 { + get { return result.hasField206; } + } + public bool Field206 { + get { return result.Field206; } + set { SetField206(value); } + } + public Builder SetField206(bool value) { + PrepareBuilder(); + result.hasField206 = true; + result.field206_ = value; + return this; + } + public Builder ClearField206() { + PrepareBuilder(); + result.hasField206 = false; + result.field206_ = false; + return this; + } + } + static SizeMessage2() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSize.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SizeMessage2GroupedMessage : pb::GeneratedMessage { + private SizeMessage2GroupedMessage() { } + private static readonly SizeMessage2GroupedMessage defaultInstance = new SizeMessage2GroupedMessage().MakeReadOnly(); + public static SizeMessage2GroupedMessage DefaultInstance { + get { return defaultInstance; } + } + + public override SizeMessage2GroupedMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SizeMessage2GroupedMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSize.internal__static_benchmarks_SizeMessage2GroupedMessage__FieldAccessorTable; } + } + + public const int Field1FieldNumber = 1; + private bool hasField1; + private float field1_; + public bool HasField1 { + get { return hasField1; } + } + public float Field1 { + get { return field1_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private float field2_; + public bool HasField2 { + get { return hasField2; } + } + public float Field2 { + get { return field2_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private float field3_; + public bool HasField3 { + get { return hasField3; } + } + public float Field3 { + get { return field3_; } + } + + public const int Field4FieldNumber = 4; + private bool hasField4; + private bool field4_; + public bool HasField4 { + get { return hasField4; } + } + public bool Field4 { + get { return field4_; } + } + + public const int Field5FieldNumber = 5; + private bool hasField5; + private bool field5_; + public bool HasField5 { + get { return hasField5; } + } + public bool Field5 { + get { return field5_; } + } + + public const int Field6FieldNumber = 6; + private bool hasField6; + private bool field6_ = true; + public bool HasField6 { + get { return hasField6; } + } + public bool Field6 { + get { return field6_; } + } + + public const int Field7FieldNumber = 7; + private bool hasField7; + private bool field7_; + public bool HasField7 { + get { return hasField7; } + } + public bool Field7 { + get { return field7_; } + } + + public const int Field8FieldNumber = 8; + private bool hasField8; + private float field8_; + public bool HasField8 { + get { return hasField8; } + } + public float Field8 { + get { return field8_; } + } + + public const int Field9FieldNumber = 9; + private bool hasField9; + private bool field9_; + public bool HasField9 { + get { return hasField9; } + } + public bool Field9 { + get { return field9_; } + } + + public const int Field10FieldNumber = 10; + private bool hasField10; + private float field10_; + public bool HasField10 { + get { return hasField10; } + } + public float Field10 { + get { return field10_; } + } + + public const int Field11FieldNumber = 11; + private bool hasField11; + private long field11_; + public bool HasField11 { + get { return hasField11; } + } + public long Field11 { + get { return field11_; } + } + + public static SizeMessage2GroupedMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SizeMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SizeMessage2GroupedMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SizeMessage2GroupedMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SizeMessage2GroupedMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SizeMessage2GroupedMessage result; + + private SizeMessage2GroupedMessage PrepareBuilder() { + if (resultIsReadOnly) { + SizeMessage2GroupedMessage original = result; + result = new SizeMessage2GroupedMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SizeMessage2GroupedMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.Descriptor; } + } + + public override SizeMessage2GroupedMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.DefaultInstance; } + } + + public override SizeMessage2GroupedMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public float Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(float value) { + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = 0F; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public float Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(float value) { + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = 0F; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public float Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(float value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0F; + return this; + } + + public bool HasField4 { + get { return result.hasField4; } + } + public bool Field4 { + get { return result.Field4; } + set { SetField4(value); } + } + public Builder SetField4(bool value) { + PrepareBuilder(); + result.hasField4 = true; + result.field4_ = value; + return this; + } + public Builder ClearField4() { + PrepareBuilder(); + result.hasField4 = false; + result.field4_ = false; + return this; + } + + public bool HasField5 { + get { return result.hasField5; } + } + public bool Field5 { + get { return result.Field5; } + set { SetField5(value); } + } + public Builder SetField5(bool value) { + PrepareBuilder(); + result.hasField5 = true; + result.field5_ = value; + return this; + } + public Builder ClearField5() { + PrepareBuilder(); + result.hasField5 = false; + result.field5_ = false; + return this; + } + + public bool HasField6 { + get { return result.hasField6; } + } + public bool Field6 { + get { return result.Field6; } + set { SetField6(value); } + } + public Builder SetField6(bool value) { + PrepareBuilder(); + result.hasField6 = true; + result.field6_ = value; + return this; + } + public Builder ClearField6() { + PrepareBuilder(); + result.hasField6 = false; + result.field6_ = true; + return this; + } + + public bool HasField7 { + get { return result.hasField7; } + } + public bool Field7 { + get { return result.Field7; } + set { SetField7(value); } + } + public Builder SetField7(bool value) { + PrepareBuilder(); + result.hasField7 = true; + result.field7_ = value; + return this; + } + public Builder ClearField7() { + PrepareBuilder(); + result.hasField7 = false; + result.field7_ = false; + return this; + } + + public bool HasField8 { + get { return result.hasField8; } + } + public float Field8 { + get { return result.Field8; } + set { SetField8(value); } + } + public Builder SetField8(float value) { + PrepareBuilder(); + result.hasField8 = true; + result.field8_ = value; + return this; + } + public Builder ClearField8() { + PrepareBuilder(); + result.hasField8 = false; + result.field8_ = 0F; + return this; + } + + public bool HasField9 { + get { return result.hasField9; } + } + public bool Field9 { + get { return result.Field9; } + set { SetField9(value); } + } + public Builder SetField9(bool value) { + PrepareBuilder(); + result.hasField9 = true; + result.field9_ = value; + return this; + } + public Builder ClearField9() { + PrepareBuilder(); + result.hasField9 = false; + result.field9_ = false; + return this; + } + + public bool HasField10 { + get { return result.hasField10; } + } + public float Field10 { + get { return result.Field10; } + set { SetField10(value); } + } + public Builder SetField10(float value) { + PrepareBuilder(); + result.hasField10 = true; + result.field10_ = value; + return this; + } + public Builder ClearField10() { + PrepareBuilder(); + result.hasField10 = false; + result.field10_ = 0F; + return this; + } + + public bool HasField11 { + get { return result.hasField11; } + } + public long Field11 { + get { return result.Field11; } + set { SetField11(value); } + } + public Builder SetField11(long value) { + PrepareBuilder(); + result.hasField11 = true; + result.field11_ = value; + return this; + } + public Builder ClearField11() { + PrepareBuilder(); + result.hasField11 = false; + result.field11_ = 0L; + return this; + } + } + static SizeMessage2GroupedMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSize.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/ProtoBench/GoogleSpeed.cs b/csharp/src/ProtoBench/GoogleSpeed.cs new file mode 100644 index 00000000..13e684a5 --- /dev/null +++ b/csharp/src/ProtoBench/GoogleSpeed.cs @@ -0,0 +1,6634 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google_speed.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace Google.ProtocolBuffers.TestProtos { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class GoogleSpeed { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage1__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage1__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage1SubMessage__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage2__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage2__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage2_Group1__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage2_Group1__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage2GroupedMessage__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static GoogleSpeed() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChJnb29nbGVfc3BlZWQucHJvdG8SCmJlbmNobWFya3Mi+AYKDVNwZWVkTWVz", + "c2FnZTESDgoGZmllbGQxGAEgAigJEg4KBmZpZWxkORgJIAEoCRIPCgdmaWVs", + "ZDE4GBIgASgJEhYKB2ZpZWxkODAYUCABKAg6BWZhbHNlEhUKB2ZpZWxkODEY", + "USABKAg6BHRydWUSDgoGZmllbGQyGAIgAigFEg4KBmZpZWxkMxgDIAIoBRIR", + "CghmaWVsZDI4MBiYAiABKAUSEQoGZmllbGQ2GAYgASgFOgEwEg8KB2ZpZWxk", + "MjIYFiABKAMSDgoGZmllbGQ0GAQgASgJEg4KBmZpZWxkNRgFIAMoBhIWCgdm", + "aWVsZDU5GDsgASgIOgVmYWxzZRIOCgZmaWVsZDcYByABKAkSDwoHZmllbGQx", + "NhgQIAEoBRIUCghmaWVsZDEzMBiCASABKAU6ATASFQoHZmllbGQxMhgMIAEo", + "CDoEdHJ1ZRIVCgdmaWVsZDE3GBEgASgIOgR0cnVlEhUKB2ZpZWxkMTMYDSAB", + "KAg6BHRydWUSFQoHZmllbGQxNBgOIAEoCDoEdHJ1ZRITCghmaWVsZDEwNBho", + "IAEoBToBMBITCghmaWVsZDEwMBhkIAEoBToBMBITCghmaWVsZDEwMRhlIAEo", + "BToBMBIQCghmaWVsZDEwMhhmIAEoCRIQCghmaWVsZDEwMxhnIAEoCRISCgdm", + "aWVsZDI5GB0gASgFOgEwEhYKB2ZpZWxkMzAYHiABKAg6BWZhbHNlEhMKB2Zp", + "ZWxkNjAYPCABKAU6Ai0xEhUKCGZpZWxkMjcxGI8CIAEoBToCLTESFQoIZmll", + "bGQyNzIYkAIgASgFOgItMRIRCghmaWVsZDE1MBiWASABKAUSEgoHZmllbGQy", + "MxgXIAEoBToBMBIWCgdmaWVsZDI0GBggASgIOgVmYWxzZRISCgdmaWVsZDI1", + "GBkgASgFOgEwEjQKB2ZpZWxkMTUYDyABKAsyIy5iZW5jaG1hcmtzLlNwZWVk", + "TWVzc2FnZTFTdWJNZXNzYWdlEg8KB2ZpZWxkNzgYTiABKAgSEgoHZmllbGQ2", + "NxhDIAEoBToBMBIPCgdmaWVsZDY4GEQgASgFEhQKCGZpZWxkMTI4GIABIAEo", + "BToBMBIoCghmaWVsZDEyORiBASABKAk6FXh4eHh4eHh4eHh4eHh4eHh4eHh4", + "eBIUCghmaWVsZDEzMRiDASABKAU6ATAiogMKF1NwZWVkTWVzc2FnZTFTdWJN", + "ZXNzYWdlEhEKBmZpZWxkMRgBIAEoBToBMBIRCgZmaWVsZDIYAiABKAU6ATAS", + "EQoGZmllbGQzGAMgASgFOgEwEg8KB2ZpZWxkMTUYDyABKAkSFQoHZmllbGQx", + "MhgMIAEoCDoEdHJ1ZRIPCgdmaWVsZDEzGA0gASgDEg8KB2ZpZWxkMTQYDiAB", + "KAMSDwoHZmllbGQxNhgQIAEoBRISCgdmaWVsZDE5GBMgASgFOgEyEhUKB2Zp", + "ZWxkMjAYFCABKAg6BHRydWUSFQoHZmllbGQyOBgcIAEoCDoEdHJ1ZRIPCgdm", + "aWVsZDIxGBUgASgGEg8KB2ZpZWxkMjIYFiABKAUSFgoHZmllbGQyMxgXIAEo", + "CDoFZmFsc2USGAoIZmllbGQyMDYYzgEgASgIOgVmYWxzZRIRCghmaWVsZDIw", + "MxjLASABKAcSEQoIZmllbGQyMDQYzAEgASgFEhEKCGZpZWxkMjA1GM0BIAEo", + "CRIRCghmaWVsZDIwNxjPASABKAQSEQoIZmllbGQzMDAYrAIgASgEIsoHCg1T", + "cGVlZE1lc3NhZ2UyEg4KBmZpZWxkMRgBIAEoCRIOCgZmaWVsZDMYAyABKAMS", + "DgoGZmllbGQ0GAQgASgDEg8KB2ZpZWxkMzAYHiABKAMSFgoHZmllbGQ3NRhL", + "IAEoCDoFZmFsc2USDgoGZmllbGQ2GAYgASgJEg4KBmZpZWxkMhgCIAEoDBIS", + "CgdmaWVsZDIxGBUgASgFOgEwEg8KB2ZpZWxkNzEYRyABKAUSDwoHZmllbGQy", + "NRgZIAEoAhITCghmaWVsZDEwORhtIAEoBToBMBIUCghmaWVsZDIxMBjSASAB", + "KAU6ATASFAoIZmllbGQyMTEY0wEgASgFOgEwEhQKCGZpZWxkMjEyGNQBIAEo", + "BToBMBIUCghmaWVsZDIxMxjVASABKAU6ATASFAoIZmllbGQyMTYY2AEgASgF", + "OgEwEhQKCGZpZWxkMjE3GNkBIAEoBToBMBIUCghmaWVsZDIxOBjaASABKAU6", + "ATASFAoIZmllbGQyMjAY3AEgASgFOgEwEhQKCGZpZWxkMjIxGN0BIAEoBToB", + "MBIUCghmaWVsZDIyMhjeASABKAI6ATASDwoHZmllbGQ2Mxg/IAEoBRIwCgZn", + "cm91cDEYCiADKAoyIC5iZW5jaG1hcmtzLlNwZWVkTWVzc2FnZTIuR3JvdXAx", + "EhEKCGZpZWxkMTI4GIABIAMoCRIRCghmaWVsZDEzMRiDASABKAMSEAoIZmll", + "bGQxMjcYfyADKAkSEQoIZmllbGQxMjkYgQEgASgFEhEKCGZpZWxkMTMwGIIB", + "IAMoAxIYCghmaWVsZDIwNRjNASABKAg6BWZhbHNlEhgKCGZpZWxkMjA2GM4B", + "IAEoCDoFZmFsc2UawwIKBkdyb3VwMRIPCgdmaWVsZDExGAsgAigCEg8KB2Zp", + "ZWxkMjYYGiABKAISDwoHZmllbGQxMhgMIAEoCRIPCgdmaWVsZDEzGA0gASgJ", + "Eg8KB2ZpZWxkMTQYDiADKAkSDwoHZmllbGQxNRgPIAIoBBIOCgZmaWVsZDUY", + "BSABKAUSDwoHZmllbGQyNxgbIAEoCRIPCgdmaWVsZDI4GBwgASgFEg8KB2Zp", + "ZWxkMjkYHSABKAkSDwoHZmllbGQxNhgQIAEoCRIPCgdmaWVsZDIyGBYgAygJ", + "Eg8KB2ZpZWxkNzMYSSADKAUSEgoHZmllbGQyMBgUIAEoBToBMBIPCgdmaWVs", + "ZDI0GBggASgJEjgKB2ZpZWxkMzEYHyABKAsyJy5iZW5jaG1hcmtzLlNwZWVk", + "TWVzc2FnZTJHcm91cGVkTWVzc2FnZSLfAQobU3BlZWRNZXNzYWdlMkdyb3Vw", + "ZWRNZXNzYWdlEg4KBmZpZWxkMRgBIAEoAhIOCgZmaWVsZDIYAiABKAISEQoG", + "ZmllbGQzGAMgASgCOgEwEg4KBmZpZWxkNBgEIAEoCBIOCgZmaWVsZDUYBSAB", + "KAgSFAoGZmllbGQ2GAYgASgIOgR0cnVlEhUKBmZpZWxkNxgHIAEoCDoFZmFs", + "c2USDgoGZmllbGQ4GAggASgCEg4KBmZpZWxkORgJIAEoCBIPCgdmaWVsZDEw", + "GAogASgCEg8KB2ZpZWxkMTEYCyABKANCM0ILR29vZ2xlU3BlZWRIAaoCIUdv", + "b2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_benchmarks_SpeedMessage1__Descriptor = Descriptor.MessageTypes[0]; + internal__static_benchmarks_SpeedMessage1__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage1__Descriptor, + new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); + internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor = Descriptor.MessageTypes[1]; + internal__static_benchmarks_SpeedMessage1SubMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor, + new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); + internal__static_benchmarks_SpeedMessage2__Descriptor = Descriptor.MessageTypes[2]; + internal__static_benchmarks_SpeedMessage2__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage2__Descriptor, + new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); + internal__static_benchmarks_SpeedMessage2_Group1__Descriptor = internal__static_benchmarks_SpeedMessage2__Descriptor.NestedTypes[0]; + internal__static_benchmarks_SpeedMessage2_Group1__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage2_Group1__Descriptor, + new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); + internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor = Descriptor.MessageTypes[3]; + internal__static_benchmarks_SpeedMessage2GroupedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor, + new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SpeedMessage1 : pb::GeneratedMessage { + private SpeedMessage1() { } + private static readonly SpeedMessage1 defaultInstance = new SpeedMessage1().MakeReadOnly(); + private static readonly string[] _speedMessage1FieldNames = new string[] { "field1", "field100", "field101", "field102", "field103", "field104", "field12", "field128", "field129", "field13", "field130", "field131", "field14", "field15", "field150", "field16", "field17", "field18", "field2", "field22", "field23", "field24", "field25", "field271", "field272", "field280", "field29", "field3", "field30", "field4", "field5", "field59", "field6", "field60", "field67", "field68", "field7", "field78", "field80", "field81", "field9" }; + private static readonly uint[] _speedMessage1FieldTags = new uint[] { 10, 800, 808, 818, 826, 832, 96, 1024, 1034, 104, 1040, 1048, 112, 122, 1200, 128, 136, 146, 16, 176, 184, 192, 200, 2168, 2176, 2240, 232, 24, 240, 34, 41, 472, 48, 480, 536, 544, 58, 624, 640, 648, 74 }; + public static SpeedMessage1 DefaultInstance { + get { return defaultInstance; } + } + + public override SpeedMessage1 DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SpeedMessage1 ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage1__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage1__FieldAccessorTable; } + } + + public const int Field1FieldNumber = 1; + private bool hasField1; + private string field1_ = ""; + public bool HasField1 { + get { return hasField1; } + } + public string Field1 { + get { return field1_; } + } + + public const int Field9FieldNumber = 9; + private bool hasField9; + private string field9_ = ""; + public bool HasField9 { + get { return hasField9; } + } + public string Field9 { + get { return field9_; } + } + + public const int Field18FieldNumber = 18; + private bool hasField18; + private string field18_ = ""; + public bool HasField18 { + get { return hasField18; } + } + public string Field18 { + get { return field18_; } + } + + public const int Field80FieldNumber = 80; + private bool hasField80; + private bool field80_; + public bool HasField80 { + get { return hasField80; } + } + public bool Field80 { + get { return field80_; } + } + + public const int Field81FieldNumber = 81; + private bool hasField81; + private bool field81_ = true; + public bool HasField81 { + get { return hasField81; } + } + public bool Field81 { + get { return field81_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private int field2_; + public bool HasField2 { + get { return hasField2; } + } + public int Field2 { + get { return field2_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private int field3_; + public bool HasField3 { + get { return hasField3; } + } + public int Field3 { + get { return field3_; } + } + + public const int Field280FieldNumber = 280; + private bool hasField280; + private int field280_; + public bool HasField280 { + get { return hasField280; } + } + public int Field280 { + get { return field280_; } + } + + public const int Field6FieldNumber = 6; + private bool hasField6; + private int field6_; + public bool HasField6 { + get { return hasField6; } + } + public int Field6 { + get { return field6_; } + } + + public const int Field22FieldNumber = 22; + private bool hasField22; + private long field22_; + public bool HasField22 { + get { return hasField22; } + } + public long Field22 { + get { return field22_; } + } + + public const int Field4FieldNumber = 4; + private bool hasField4; + private string field4_ = ""; + public bool HasField4 { + get { return hasField4; } + } + public string Field4 { + get { return field4_; } + } + + public const int Field5FieldNumber = 5; + private pbc::PopsicleList field5_ = new pbc::PopsicleList(); + [global::System.CLSCompliant(false)] + public scg::IList Field5List { + get { return pbc::Lists.AsReadOnly(field5_); } + } + public int Field5Count { + get { return field5_.Count; } + } + [global::System.CLSCompliant(false)] + public ulong GetField5(int index) { + return field5_[index]; + } + + public const int Field59FieldNumber = 59; + private bool hasField59; + private bool field59_; + public bool HasField59 { + get { return hasField59; } + } + public bool Field59 { + get { return field59_; } + } + + public const int Field7FieldNumber = 7; + private bool hasField7; + private string field7_ = ""; + public bool HasField7 { + get { return hasField7; } + } + public string Field7 { + get { return field7_; } + } + + public const int Field16FieldNumber = 16; + private bool hasField16; + private int field16_; + public bool HasField16 { + get { return hasField16; } + } + public int Field16 { + get { return field16_; } + } + + public const int Field130FieldNumber = 130; + private bool hasField130; + private int field130_; + public bool HasField130 { + get { return hasField130; } + } + public int Field130 { + get { return field130_; } + } + + public const int Field12FieldNumber = 12; + private bool hasField12; + private bool field12_ = true; + public bool HasField12 { + get { return hasField12; } + } + public bool Field12 { + get { return field12_; } + } + + public const int Field17FieldNumber = 17; + private bool hasField17; + private bool field17_ = true; + public bool HasField17 { + get { return hasField17; } + } + public bool Field17 { + get { return field17_; } + } + + public const int Field13FieldNumber = 13; + private bool hasField13; + private bool field13_ = true; + public bool HasField13 { + get { return hasField13; } + } + public bool Field13 { + get { return field13_; } + } + + public const int Field14FieldNumber = 14; + private bool hasField14; + private bool field14_ = true; + public bool HasField14 { + get { return hasField14; } + } + public bool Field14 { + get { return field14_; } + } + + public const int Field104FieldNumber = 104; + private bool hasField104; + private int field104_; + public bool HasField104 { + get { return hasField104; } + } + public int Field104 { + get { return field104_; } + } + + public const int Field100FieldNumber = 100; + private bool hasField100; + private int field100_; + public bool HasField100 { + get { return hasField100; } + } + public int Field100 { + get { return field100_; } + } + + public const int Field101FieldNumber = 101; + private bool hasField101; + private int field101_; + public bool HasField101 { + get { return hasField101; } + } + public int Field101 { + get { return field101_; } + } + + public const int Field102FieldNumber = 102; + private bool hasField102; + private string field102_ = ""; + public bool HasField102 { + get { return hasField102; } + } + public string Field102 { + get { return field102_; } + } + + public const int Field103FieldNumber = 103; + private bool hasField103; + private string field103_ = ""; + public bool HasField103 { + get { return hasField103; } + } + public string Field103 { + get { return field103_; } + } + + public const int Field29FieldNumber = 29; + private bool hasField29; + private int field29_; + public bool HasField29 { + get { return hasField29; } + } + public int Field29 { + get { return field29_; } + } + + public const int Field30FieldNumber = 30; + private bool hasField30; + private bool field30_; + public bool HasField30 { + get { return hasField30; } + } + public bool Field30 { + get { return field30_; } + } + + public const int Field60FieldNumber = 60; + private bool hasField60; + private int field60_ = -1; + public bool HasField60 { + get { return hasField60; } + } + public int Field60 { + get { return field60_; } + } + + public const int Field271FieldNumber = 271; + private bool hasField271; + private int field271_ = -1; + public bool HasField271 { + get { return hasField271; } + } + public int Field271 { + get { return field271_; } + } + + public const int Field272FieldNumber = 272; + private bool hasField272; + private int field272_ = -1; + public bool HasField272 { + get { return hasField272; } + } + public int Field272 { + get { return field272_; } + } + + public const int Field150FieldNumber = 150; + private bool hasField150; + private int field150_; + public bool HasField150 { + get { return hasField150; } + } + public int Field150 { + get { return field150_; } + } + + public const int Field23FieldNumber = 23; + private bool hasField23; + private int field23_; + public bool HasField23 { + get { return hasField23; } + } + public int Field23 { + get { return field23_; } + } + + public const int Field24FieldNumber = 24; + private bool hasField24; + private bool field24_; + public bool HasField24 { + get { return hasField24; } + } + public bool Field24 { + get { return field24_; } + } + + public const int Field25FieldNumber = 25; + private bool hasField25; + private int field25_; + public bool HasField25 { + get { return hasField25; } + } + public int Field25 { + get { return field25_; } + } + + public const int Field15FieldNumber = 15; + private bool hasField15; + private global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage field15_; + public bool HasField15 { + get { return hasField15; } + } + public global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage Field15 { + get { return field15_ ?? global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance; } + } + + public const int Field78FieldNumber = 78; + private bool hasField78; + private bool field78_; + public bool HasField78 { + get { return hasField78; } + } + public bool Field78 { + get { return field78_; } + } + + public const int Field67FieldNumber = 67; + private bool hasField67; + private int field67_; + public bool HasField67 { + get { return hasField67; } + } + public int Field67 { + get { return field67_; } + } + + public const int Field68FieldNumber = 68; + private bool hasField68; + private int field68_; + public bool HasField68 { + get { return hasField68; } + } + public int Field68 { + get { return field68_; } + } + + public const int Field128FieldNumber = 128; + private bool hasField128; + private int field128_; + public bool HasField128 { + get { return hasField128; } + } + public int Field128 { + get { return field128_; } + } + + public const int Field129FieldNumber = 129; + private bool hasField129; + private string field129_ = "xxxxxxxxxxxxxxxxxxxxx"; + public bool HasField129 { + get { return hasField129; } + } + public string Field129 { + get { return field129_; } + } + + public const int Field131FieldNumber = 131; + private bool hasField131; + private int field131_; + public bool HasField131 { + get { return hasField131; } + } + public int Field131 { + get { return field131_; } + } + + public override bool IsInitialized { + get { + if (!hasField1) return false; + if (!hasField2) return false; + if (!hasField3) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _speedMessage1FieldNames; + if (hasField1) { + output.WriteString(1, field_names[0], Field1); + } + if (hasField2) { + output.WriteInt32(2, field_names[18], Field2); + } + if (hasField3) { + output.WriteInt32(3, field_names[27], Field3); + } + if (hasField4) { + output.WriteString(4, field_names[29], Field4); + } + if (field5_.Count > 0) { + output.WriteFixed64Array(5, field_names[30], field5_); + } + if (hasField6) { + output.WriteInt32(6, field_names[32], Field6); + } + if (hasField7) { + output.WriteString(7, field_names[36], Field7); + } + if (hasField9) { + output.WriteString(9, field_names[40], Field9); + } + if (hasField12) { + output.WriteBool(12, field_names[6], Field12); + } + if (hasField13) { + output.WriteBool(13, field_names[9], Field13); + } + if (hasField14) { + output.WriteBool(14, field_names[12], Field14); + } + if (hasField15) { + output.WriteMessage(15, field_names[13], Field15); + } + if (hasField16) { + output.WriteInt32(16, field_names[15], Field16); + } + if (hasField17) { + output.WriteBool(17, field_names[16], Field17); + } + if (hasField18) { + output.WriteString(18, field_names[17], Field18); + } + if (hasField22) { + output.WriteInt64(22, field_names[19], Field22); + } + if (hasField23) { + output.WriteInt32(23, field_names[20], Field23); + } + if (hasField24) { + output.WriteBool(24, field_names[21], Field24); + } + if (hasField25) { + output.WriteInt32(25, field_names[22], Field25); + } + if (hasField29) { + output.WriteInt32(29, field_names[26], Field29); + } + if (hasField30) { + output.WriteBool(30, field_names[28], Field30); + } + if (hasField59) { + output.WriteBool(59, field_names[31], Field59); + } + if (hasField60) { + output.WriteInt32(60, field_names[33], Field60); + } + if (hasField67) { + output.WriteInt32(67, field_names[34], Field67); + } + if (hasField68) { + output.WriteInt32(68, field_names[35], Field68); + } + if (hasField78) { + output.WriteBool(78, field_names[37], Field78); + } + if (hasField80) { + output.WriteBool(80, field_names[38], Field80); + } + if (hasField81) { + output.WriteBool(81, field_names[39], Field81); + } + if (hasField100) { + output.WriteInt32(100, field_names[1], Field100); + } + if (hasField101) { + output.WriteInt32(101, field_names[2], Field101); + } + if (hasField102) { + output.WriteString(102, field_names[3], Field102); + } + if (hasField103) { + output.WriteString(103, field_names[4], Field103); + } + if (hasField104) { + output.WriteInt32(104, field_names[5], Field104); + } + if (hasField128) { + output.WriteInt32(128, field_names[7], Field128); + } + if (hasField129) { + output.WriteString(129, field_names[8], Field129); + } + if (hasField130) { + output.WriteInt32(130, field_names[10], Field130); + } + if (hasField131) { + output.WriteInt32(131, field_names[11], Field131); + } + if (hasField150) { + output.WriteInt32(150, field_names[14], Field150); + } + if (hasField271) { + output.WriteInt32(271, field_names[23], Field271); + } + if (hasField272) { + output.WriteInt32(272, field_names[24], Field272); + } + if (hasField280) { + output.WriteInt32(280, field_names[25], Field280); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasField1) { + size += pb::CodedOutputStream.ComputeStringSize(1, Field1); + } + if (hasField9) { + size += pb::CodedOutputStream.ComputeStringSize(9, Field9); + } + if (hasField18) { + size += pb::CodedOutputStream.ComputeStringSize(18, Field18); + } + if (hasField80) { + size += pb::CodedOutputStream.ComputeBoolSize(80, Field80); + } + if (hasField81) { + size += pb::CodedOutputStream.ComputeBoolSize(81, Field81); + } + if (hasField2) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Field2); + } + if (hasField3) { + size += pb::CodedOutputStream.ComputeInt32Size(3, Field3); + } + if (hasField280) { + size += pb::CodedOutputStream.ComputeInt32Size(280, Field280); + } + if (hasField6) { + size += pb::CodedOutputStream.ComputeInt32Size(6, Field6); + } + if (hasField22) { + size += pb::CodedOutputStream.ComputeInt64Size(22, Field22); + } + if (hasField4) { + size += pb::CodedOutputStream.ComputeStringSize(4, Field4); + } + { + int dataSize = 0; + dataSize = 8 * field5_.Count; + size += dataSize; + size += 1 * field5_.Count; + } + if (hasField59) { + size += pb::CodedOutputStream.ComputeBoolSize(59, Field59); + } + if (hasField7) { + size += pb::CodedOutputStream.ComputeStringSize(7, Field7); + } + if (hasField16) { + size += pb::CodedOutputStream.ComputeInt32Size(16, Field16); + } + if (hasField130) { + size += pb::CodedOutputStream.ComputeInt32Size(130, Field130); + } + if (hasField12) { + size += pb::CodedOutputStream.ComputeBoolSize(12, Field12); + } + if (hasField17) { + size += pb::CodedOutputStream.ComputeBoolSize(17, Field17); + } + if (hasField13) { + size += pb::CodedOutputStream.ComputeBoolSize(13, Field13); + } + if (hasField14) { + size += pb::CodedOutputStream.ComputeBoolSize(14, Field14); + } + if (hasField104) { + size += pb::CodedOutputStream.ComputeInt32Size(104, Field104); + } + if (hasField100) { + size += pb::CodedOutputStream.ComputeInt32Size(100, Field100); + } + if (hasField101) { + size += pb::CodedOutputStream.ComputeInt32Size(101, Field101); + } + if (hasField102) { + size += pb::CodedOutputStream.ComputeStringSize(102, Field102); + } + if (hasField103) { + size += pb::CodedOutputStream.ComputeStringSize(103, Field103); + } + if (hasField29) { + size += pb::CodedOutputStream.ComputeInt32Size(29, Field29); + } + if (hasField30) { + size += pb::CodedOutputStream.ComputeBoolSize(30, Field30); + } + if (hasField60) { + size += pb::CodedOutputStream.ComputeInt32Size(60, Field60); + } + if (hasField271) { + size += pb::CodedOutputStream.ComputeInt32Size(271, Field271); + } + if (hasField272) { + size += pb::CodedOutputStream.ComputeInt32Size(272, Field272); + } + if (hasField150) { + size += pb::CodedOutputStream.ComputeInt32Size(150, Field150); + } + if (hasField23) { + size += pb::CodedOutputStream.ComputeInt32Size(23, Field23); + } + if (hasField24) { + size += pb::CodedOutputStream.ComputeBoolSize(24, Field24); + } + if (hasField25) { + size += pb::CodedOutputStream.ComputeInt32Size(25, Field25); + } + if (hasField15) { + size += pb::CodedOutputStream.ComputeMessageSize(15, Field15); + } + if (hasField78) { + size += pb::CodedOutputStream.ComputeBoolSize(78, Field78); + } + if (hasField67) { + size += pb::CodedOutputStream.ComputeInt32Size(67, Field67); + } + if (hasField68) { + size += pb::CodedOutputStream.ComputeInt32Size(68, Field68); + } + if (hasField128) { + size += pb::CodedOutputStream.ComputeInt32Size(128, Field128); + } + if (hasField129) { + size += pb::CodedOutputStream.ComputeStringSize(129, Field129); + } + if (hasField131) { + size += pb::CodedOutputStream.ComputeInt32Size(131, Field131); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SpeedMessage1 ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage1 ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage1 ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage1 ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SpeedMessage1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SpeedMessage1 ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SpeedMessage1 MakeReadOnly() { + field5_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SpeedMessage1 prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SpeedMessage1 cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SpeedMessage1 result; + + private SpeedMessage1 PrepareBuilder() { + if (resultIsReadOnly) { + SpeedMessage1 original = result; + result = new SpeedMessage1(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SpeedMessage1 MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1.Descriptor; } + } + + public override SpeedMessage1 DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1.DefaultInstance; } + } + + public override SpeedMessage1 BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SpeedMessage1) { + return MergeFrom((SpeedMessage1) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SpeedMessage1 other) { + if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage1.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasField1) { + Field1 = other.Field1; + } + if (other.HasField9) { + Field9 = other.Field9; + } + if (other.HasField18) { + Field18 = other.Field18; + } + if (other.HasField80) { + Field80 = other.Field80; + } + if (other.HasField81) { + Field81 = other.Field81; + } + if (other.HasField2) { + Field2 = other.Field2; + } + if (other.HasField3) { + Field3 = other.Field3; + } + if (other.HasField280) { + Field280 = other.Field280; + } + if (other.HasField6) { + Field6 = other.Field6; + } + if (other.HasField22) { + Field22 = other.Field22; + } + if (other.HasField4) { + Field4 = other.Field4; + } + if (other.field5_.Count != 0) { + result.field5_.Add(other.field5_); + } + if (other.HasField59) { + Field59 = other.Field59; + } + if (other.HasField7) { + Field7 = other.Field7; + } + if (other.HasField16) { + Field16 = other.Field16; + } + if (other.HasField130) { + Field130 = other.Field130; + } + if (other.HasField12) { + Field12 = other.Field12; + } + if (other.HasField17) { + Field17 = other.Field17; + } + if (other.HasField13) { + Field13 = other.Field13; + } + if (other.HasField14) { + Field14 = other.Field14; + } + if (other.HasField104) { + Field104 = other.Field104; + } + if (other.HasField100) { + Field100 = other.Field100; + } + if (other.HasField101) { + Field101 = other.Field101; + } + if (other.HasField102) { + Field102 = other.Field102; + } + if (other.HasField103) { + Field103 = other.Field103; + } + if (other.HasField29) { + Field29 = other.Field29; + } + if (other.HasField30) { + Field30 = other.Field30; + } + if (other.HasField60) { + Field60 = other.Field60; + } + if (other.HasField271) { + Field271 = other.Field271; + } + if (other.HasField272) { + Field272 = other.Field272; + } + if (other.HasField150) { + Field150 = other.Field150; + } + if (other.HasField23) { + Field23 = other.Field23; + } + if (other.HasField24) { + Field24 = other.Field24; + } + if (other.HasField25) { + Field25 = other.Field25; + } + if (other.HasField15) { + MergeField15(other.Field15); + } + if (other.HasField78) { + Field78 = other.Field78; + } + if (other.HasField67) { + Field67 = other.Field67; + } + if (other.HasField68) { + Field68 = other.Field68; + } + if (other.HasField128) { + Field128 = other.Field128; + } + if (other.HasField129) { + Field129 = other.Field129; + } + if (other.HasField131) { + Field131 = other.Field131; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_speedMessage1FieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _speedMessage1FieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasField1 = input.ReadString(ref result.field1_); + break; + } + case 16: { + result.hasField2 = input.ReadInt32(ref result.field2_); + break; + } + case 24: { + result.hasField3 = input.ReadInt32(ref result.field3_); + break; + } + case 34: { + result.hasField4 = input.ReadString(ref result.field4_); + break; + } + case 42: + case 41: { + input.ReadFixed64Array(tag, field_name, result.field5_); + break; + } + case 48: { + result.hasField6 = input.ReadInt32(ref result.field6_); + break; + } + case 58: { + result.hasField7 = input.ReadString(ref result.field7_); + break; + } + case 74: { + result.hasField9 = input.ReadString(ref result.field9_); + break; + } + case 96: { + result.hasField12 = input.ReadBool(ref result.field12_); + break; + } + case 104: { + result.hasField13 = input.ReadBool(ref result.field13_); + break; + } + case 112: { + result.hasField14 = input.ReadBool(ref result.field14_); + break; + } + case 122: { + global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.CreateBuilder(); + if (result.hasField15) { + subBuilder.MergeFrom(Field15); + } + input.ReadMessage(subBuilder, extensionRegistry); + Field15 = subBuilder.BuildPartial(); + break; + } + case 128: { + result.hasField16 = input.ReadInt32(ref result.field16_); + break; + } + case 136: { + result.hasField17 = input.ReadBool(ref result.field17_); + break; + } + case 146: { + result.hasField18 = input.ReadString(ref result.field18_); + break; + } + case 176: { + result.hasField22 = input.ReadInt64(ref result.field22_); + break; + } + case 184: { + result.hasField23 = input.ReadInt32(ref result.field23_); + break; + } + case 192: { + result.hasField24 = input.ReadBool(ref result.field24_); + break; + } + case 200: { + result.hasField25 = input.ReadInt32(ref result.field25_); + break; + } + case 232: { + result.hasField29 = input.ReadInt32(ref result.field29_); + break; + } + case 240: { + result.hasField30 = input.ReadBool(ref result.field30_); + break; + } + case 472: { + result.hasField59 = input.ReadBool(ref result.field59_); + break; + } + case 480: { + result.hasField60 = input.ReadInt32(ref result.field60_); + break; + } + case 536: { + result.hasField67 = input.ReadInt32(ref result.field67_); + break; + } + case 544: { + result.hasField68 = input.ReadInt32(ref result.field68_); + break; + } + case 624: { + result.hasField78 = input.ReadBool(ref result.field78_); + break; + } + case 640: { + result.hasField80 = input.ReadBool(ref result.field80_); + break; + } + case 648: { + result.hasField81 = input.ReadBool(ref result.field81_); + break; + } + case 800: { + result.hasField100 = input.ReadInt32(ref result.field100_); + break; + } + case 808: { + result.hasField101 = input.ReadInt32(ref result.field101_); + break; + } + case 818: { + result.hasField102 = input.ReadString(ref result.field102_); + break; + } + case 826: { + result.hasField103 = input.ReadString(ref result.field103_); + break; + } + case 832: { + result.hasField104 = input.ReadInt32(ref result.field104_); + break; + } + case 1024: { + result.hasField128 = input.ReadInt32(ref result.field128_); + break; + } + case 1034: { + result.hasField129 = input.ReadString(ref result.field129_); + break; + } + case 1040: { + result.hasField130 = input.ReadInt32(ref result.field130_); + break; + } + case 1048: { + result.hasField131 = input.ReadInt32(ref result.field131_); + break; + } + case 1200: { + result.hasField150 = input.ReadInt32(ref result.field150_); + break; + } + case 2168: { + result.hasField271 = input.ReadInt32(ref result.field271_); + break; + } + case 2176: { + result.hasField272 = input.ReadInt32(ref result.field272_); + break; + } + case 2240: { + result.hasField280 = input.ReadInt32(ref result.field280_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public string Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = ""; + return this; + } + + public bool HasField9 { + get { return result.hasField9; } + } + public string Field9 { + get { return result.Field9; } + set { SetField9(value); } + } + public Builder SetField9(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField9 = true; + result.field9_ = value; + return this; + } + public Builder ClearField9() { + PrepareBuilder(); + result.hasField9 = false; + result.field9_ = ""; + return this; + } + + public bool HasField18 { + get { return result.hasField18; } + } + public string Field18 { + get { return result.Field18; } + set { SetField18(value); } + } + public Builder SetField18(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField18 = true; + result.field18_ = value; + return this; + } + public Builder ClearField18() { + PrepareBuilder(); + result.hasField18 = false; + result.field18_ = ""; + return this; + } + + public bool HasField80 { + get { return result.hasField80; } + } + public bool Field80 { + get { return result.Field80; } + set { SetField80(value); } + } + public Builder SetField80(bool value) { + PrepareBuilder(); + result.hasField80 = true; + result.field80_ = value; + return this; + } + public Builder ClearField80() { + PrepareBuilder(); + result.hasField80 = false; + result.field80_ = false; + return this; + } + + public bool HasField81 { + get { return result.hasField81; } + } + public bool Field81 { + get { return result.Field81; } + set { SetField81(value); } + } + public Builder SetField81(bool value) { + PrepareBuilder(); + result.hasField81 = true; + result.field81_ = value; + return this; + } + public Builder ClearField81() { + PrepareBuilder(); + result.hasField81 = false; + result.field81_ = true; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public int Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(int value) { + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = 0; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public int Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(int value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0; + return this; + } + + public bool HasField280 { + get { return result.hasField280; } + } + public int Field280 { + get { return result.Field280; } + set { SetField280(value); } + } + public Builder SetField280(int value) { + PrepareBuilder(); + result.hasField280 = true; + result.field280_ = value; + return this; + } + public Builder ClearField280() { + PrepareBuilder(); + result.hasField280 = false; + result.field280_ = 0; + return this; + } + + public bool HasField6 { + get { return result.hasField6; } + } + public int Field6 { + get { return result.Field6; } + set { SetField6(value); } + } + public Builder SetField6(int value) { + PrepareBuilder(); + result.hasField6 = true; + result.field6_ = value; + return this; + } + public Builder ClearField6() { + PrepareBuilder(); + result.hasField6 = false; + result.field6_ = 0; + return this; + } + + public bool HasField22 { + get { return result.hasField22; } + } + public long Field22 { + get { return result.Field22; } + set { SetField22(value); } + } + public Builder SetField22(long value) { + PrepareBuilder(); + result.hasField22 = true; + result.field22_ = value; + return this; + } + public Builder ClearField22() { + PrepareBuilder(); + result.hasField22 = false; + result.field22_ = 0L; + return this; + } + + public bool HasField4 { + get { return result.hasField4; } + } + public string Field4 { + get { return result.Field4; } + set { SetField4(value); } + } + public Builder SetField4(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField4 = true; + result.field4_ = value; + return this; + } + public Builder ClearField4() { + PrepareBuilder(); + result.hasField4 = false; + result.field4_ = ""; + return this; + } + + [global::System.CLSCompliant(false)] + public pbc::IPopsicleList Field5List { + get { return PrepareBuilder().field5_; } + } + public int Field5Count { + get { return result.Field5Count; } + } + [global::System.CLSCompliant(false)] + public ulong GetField5(int index) { + return result.GetField5(index); + } + [global::System.CLSCompliant(false)] + public Builder SetField5(int index, ulong value) { + PrepareBuilder(); + result.field5_[index] = value; + return this; + } + [global::System.CLSCompliant(false)] + public Builder AddField5(ulong value) { + PrepareBuilder(); + result.field5_.Add(value); + return this; + } + [global::System.CLSCompliant(false)] + public Builder AddRangeField5(scg::IEnumerable values) { + PrepareBuilder(); + result.field5_.Add(values); + return this; + } + public Builder ClearField5() { + PrepareBuilder(); + result.field5_.Clear(); + return this; + } + + public bool HasField59 { + get { return result.hasField59; } + } + public bool Field59 { + get { return result.Field59; } + set { SetField59(value); } + } + public Builder SetField59(bool value) { + PrepareBuilder(); + result.hasField59 = true; + result.field59_ = value; + return this; + } + public Builder ClearField59() { + PrepareBuilder(); + result.hasField59 = false; + result.field59_ = false; + return this; + } + + public bool HasField7 { + get { return result.hasField7; } + } + public string Field7 { + get { return result.Field7; } + set { SetField7(value); } + } + public Builder SetField7(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField7 = true; + result.field7_ = value; + return this; + } + public Builder ClearField7() { + PrepareBuilder(); + result.hasField7 = false; + result.field7_ = ""; + return this; + } + + public bool HasField16 { + get { return result.hasField16; } + } + public int Field16 { + get { return result.Field16; } + set { SetField16(value); } + } + public Builder SetField16(int value) { + PrepareBuilder(); + result.hasField16 = true; + result.field16_ = value; + return this; + } + public Builder ClearField16() { + PrepareBuilder(); + result.hasField16 = false; + result.field16_ = 0; + return this; + } + + public bool HasField130 { + get { return result.hasField130; } + } + public int Field130 { + get { return result.Field130; } + set { SetField130(value); } + } + public Builder SetField130(int value) { + PrepareBuilder(); + result.hasField130 = true; + result.field130_ = value; + return this; + } + public Builder ClearField130() { + PrepareBuilder(); + result.hasField130 = false; + result.field130_ = 0; + return this; + } + + public bool HasField12 { + get { return result.hasField12; } + } + public bool Field12 { + get { return result.Field12; } + set { SetField12(value); } + } + public Builder SetField12(bool value) { + PrepareBuilder(); + result.hasField12 = true; + result.field12_ = value; + return this; + } + public Builder ClearField12() { + PrepareBuilder(); + result.hasField12 = false; + result.field12_ = true; + return this; + } + + public bool HasField17 { + get { return result.hasField17; } + } + public bool Field17 { + get { return result.Field17; } + set { SetField17(value); } + } + public Builder SetField17(bool value) { + PrepareBuilder(); + result.hasField17 = true; + result.field17_ = value; + return this; + } + public Builder ClearField17() { + PrepareBuilder(); + result.hasField17 = false; + result.field17_ = true; + return this; + } + + public bool HasField13 { + get { return result.hasField13; } + } + public bool Field13 { + get { return result.Field13; } + set { SetField13(value); } + } + public Builder SetField13(bool value) { + PrepareBuilder(); + result.hasField13 = true; + result.field13_ = value; + return this; + } + public Builder ClearField13() { + PrepareBuilder(); + result.hasField13 = false; + result.field13_ = true; + return this; + } + + public bool HasField14 { + get { return result.hasField14; } + } + public bool Field14 { + get { return result.Field14; } + set { SetField14(value); } + } + public Builder SetField14(bool value) { + PrepareBuilder(); + result.hasField14 = true; + result.field14_ = value; + return this; + } + public Builder ClearField14() { + PrepareBuilder(); + result.hasField14 = false; + result.field14_ = true; + return this; + } + + public bool HasField104 { + get { return result.hasField104; } + } + public int Field104 { + get { return result.Field104; } + set { SetField104(value); } + } + public Builder SetField104(int value) { + PrepareBuilder(); + result.hasField104 = true; + result.field104_ = value; + return this; + } + public Builder ClearField104() { + PrepareBuilder(); + result.hasField104 = false; + result.field104_ = 0; + return this; + } + + public bool HasField100 { + get { return result.hasField100; } + } + public int Field100 { + get { return result.Field100; } + set { SetField100(value); } + } + public Builder SetField100(int value) { + PrepareBuilder(); + result.hasField100 = true; + result.field100_ = value; + return this; + } + public Builder ClearField100() { + PrepareBuilder(); + result.hasField100 = false; + result.field100_ = 0; + return this; + } + + public bool HasField101 { + get { return result.hasField101; } + } + public int Field101 { + get { return result.Field101; } + set { SetField101(value); } + } + public Builder SetField101(int value) { + PrepareBuilder(); + result.hasField101 = true; + result.field101_ = value; + return this; + } + public Builder ClearField101() { + PrepareBuilder(); + result.hasField101 = false; + result.field101_ = 0; + return this; + } + + public bool HasField102 { + get { return result.hasField102; } + } + public string Field102 { + get { return result.Field102; } + set { SetField102(value); } + } + public Builder SetField102(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField102 = true; + result.field102_ = value; + return this; + } + public Builder ClearField102() { + PrepareBuilder(); + result.hasField102 = false; + result.field102_ = ""; + return this; + } + + public bool HasField103 { + get { return result.hasField103; } + } + public string Field103 { + get { return result.Field103; } + set { SetField103(value); } + } + public Builder SetField103(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField103 = true; + result.field103_ = value; + return this; + } + public Builder ClearField103() { + PrepareBuilder(); + result.hasField103 = false; + result.field103_ = ""; + return this; + } + + public bool HasField29 { + get { return result.hasField29; } + } + public int Field29 { + get { return result.Field29; } + set { SetField29(value); } + } + public Builder SetField29(int value) { + PrepareBuilder(); + result.hasField29 = true; + result.field29_ = value; + return this; + } + public Builder ClearField29() { + PrepareBuilder(); + result.hasField29 = false; + result.field29_ = 0; + return this; + } + + public bool HasField30 { + get { return result.hasField30; } + } + public bool Field30 { + get { return result.Field30; } + set { SetField30(value); } + } + public Builder SetField30(bool value) { + PrepareBuilder(); + result.hasField30 = true; + result.field30_ = value; + return this; + } + public Builder ClearField30() { + PrepareBuilder(); + result.hasField30 = false; + result.field30_ = false; + return this; + } + + public bool HasField60 { + get { return result.hasField60; } + } + public int Field60 { + get { return result.Field60; } + set { SetField60(value); } + } + public Builder SetField60(int value) { + PrepareBuilder(); + result.hasField60 = true; + result.field60_ = value; + return this; + } + public Builder ClearField60() { + PrepareBuilder(); + result.hasField60 = false; + result.field60_ = -1; + return this; + } + + public bool HasField271 { + get { return result.hasField271; } + } + public int Field271 { + get { return result.Field271; } + set { SetField271(value); } + } + public Builder SetField271(int value) { + PrepareBuilder(); + result.hasField271 = true; + result.field271_ = value; + return this; + } + public Builder ClearField271() { + PrepareBuilder(); + result.hasField271 = false; + result.field271_ = -1; + return this; + } + + public bool HasField272 { + get { return result.hasField272; } + } + public int Field272 { + get { return result.Field272; } + set { SetField272(value); } + } + public Builder SetField272(int value) { + PrepareBuilder(); + result.hasField272 = true; + result.field272_ = value; + return this; + } + public Builder ClearField272() { + PrepareBuilder(); + result.hasField272 = false; + result.field272_ = -1; + return this; + } + + public bool HasField150 { + get { return result.hasField150; } + } + public int Field150 { + get { return result.Field150; } + set { SetField150(value); } + } + public Builder SetField150(int value) { + PrepareBuilder(); + result.hasField150 = true; + result.field150_ = value; + return this; + } + public Builder ClearField150() { + PrepareBuilder(); + result.hasField150 = false; + result.field150_ = 0; + return this; + } + + public bool HasField23 { + get { return result.hasField23; } + } + public int Field23 { + get { return result.Field23; } + set { SetField23(value); } + } + public Builder SetField23(int value) { + PrepareBuilder(); + result.hasField23 = true; + result.field23_ = value; + return this; + } + public Builder ClearField23() { + PrepareBuilder(); + result.hasField23 = false; + result.field23_ = 0; + return this; + } + + public bool HasField24 { + get { return result.hasField24; } + } + public bool Field24 { + get { return result.Field24; } + set { SetField24(value); } + } + public Builder SetField24(bool value) { + PrepareBuilder(); + result.hasField24 = true; + result.field24_ = value; + return this; + } + public Builder ClearField24() { + PrepareBuilder(); + result.hasField24 = false; + result.field24_ = false; + return this; + } + + public bool HasField25 { + get { return result.hasField25; } + } + public int Field25 { + get { return result.Field25; } + set { SetField25(value); } + } + public Builder SetField25(int value) { + PrepareBuilder(); + result.hasField25 = true; + result.field25_ = value; + return this; + } + public Builder ClearField25() { + PrepareBuilder(); + result.hasField25 = false; + result.field25_ = 0; + return this; + } + + public bool HasField15 { + get { return result.hasField15; } + } + public global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage Field15 { + get { return result.Field15; } + set { SetField15(value); } + } + public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = value; + return this; + } + public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = builderForValue.Build(); + return this; + } + public Builder MergeField15(global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasField15 && + result.field15_ != global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance) { + result.field15_ = global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); + } else { + result.field15_ = value; + } + result.hasField15 = true; + return this; + } + public Builder ClearField15() { + PrepareBuilder(); + result.hasField15 = false; + result.field15_ = null; + return this; + } + + public bool HasField78 { + get { return result.hasField78; } + } + public bool Field78 { + get { return result.Field78; } + set { SetField78(value); } + } + public Builder SetField78(bool value) { + PrepareBuilder(); + result.hasField78 = true; + result.field78_ = value; + return this; + } + public Builder ClearField78() { + PrepareBuilder(); + result.hasField78 = false; + result.field78_ = false; + return this; + } + + public bool HasField67 { + get { return result.hasField67; } + } + public int Field67 { + get { return result.Field67; } + set { SetField67(value); } + } + public Builder SetField67(int value) { + PrepareBuilder(); + result.hasField67 = true; + result.field67_ = value; + return this; + } + public Builder ClearField67() { + PrepareBuilder(); + result.hasField67 = false; + result.field67_ = 0; + return this; + } + + public bool HasField68 { + get { return result.hasField68; } + } + public int Field68 { + get { return result.Field68; } + set { SetField68(value); } + } + public Builder SetField68(int value) { + PrepareBuilder(); + result.hasField68 = true; + result.field68_ = value; + return this; + } + public Builder ClearField68() { + PrepareBuilder(); + result.hasField68 = false; + result.field68_ = 0; + return this; + } + + public bool HasField128 { + get { return result.hasField128; } + } + public int Field128 { + get { return result.Field128; } + set { SetField128(value); } + } + public Builder SetField128(int value) { + PrepareBuilder(); + result.hasField128 = true; + result.field128_ = value; + return this; + } + public Builder ClearField128() { + PrepareBuilder(); + result.hasField128 = false; + result.field128_ = 0; + return this; + } + + public bool HasField129 { + get { return result.hasField129; } + } + public string Field129 { + get { return result.Field129; } + set { SetField129(value); } + } + public Builder SetField129(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField129 = true; + result.field129_ = value; + return this; + } + public Builder ClearField129() { + PrepareBuilder(); + result.hasField129 = false; + result.field129_ = "xxxxxxxxxxxxxxxxxxxxx"; + return this; + } + + public bool HasField131 { + get { return result.hasField131; } + } + public int Field131 { + get { return result.Field131; } + set { SetField131(value); } + } + public Builder SetField131(int value) { + PrepareBuilder(); + result.hasField131 = true; + result.field131_ = value; + return this; + } + public Builder ClearField131() { + PrepareBuilder(); + result.hasField131 = false; + result.field131_ = 0; + return this; + } + } + static SpeedMessage1() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SpeedMessage1SubMessage : pb::GeneratedMessage { + private SpeedMessage1SubMessage() { } + private static readonly SpeedMessage1SubMessage defaultInstance = new SpeedMessage1SubMessage().MakeReadOnly(); + private static readonly string[] _speedMessage1SubMessageFieldNames = new string[] { "field1", "field12", "field13", "field14", "field15", "field16", "field19", "field2", "field20", "field203", "field204", "field205", "field206", "field207", "field21", "field22", "field23", "field28", "field3", "field300" }; + private static readonly uint[] _speedMessage1SubMessageFieldTags = new uint[] { 8, 96, 104, 112, 122, 128, 152, 16, 160, 1629, 1632, 1642, 1648, 1656, 169, 176, 184, 224, 24, 2400 }; + public static SpeedMessage1SubMessage DefaultInstance { + get { return defaultInstance; } + } + + public override SpeedMessage1SubMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SpeedMessage1SubMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage1SubMessage__FieldAccessorTable; } + } + + public const int Field1FieldNumber = 1; + private bool hasField1; + private int field1_; + public bool HasField1 { + get { return hasField1; } + } + public int Field1 { + get { return field1_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private int field2_; + public bool HasField2 { + get { return hasField2; } + } + public int Field2 { + get { return field2_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private int field3_; + public bool HasField3 { + get { return hasField3; } + } + public int Field3 { + get { return field3_; } + } + + public const int Field15FieldNumber = 15; + private bool hasField15; + private string field15_ = ""; + public bool HasField15 { + get { return hasField15; } + } + public string Field15 { + get { return field15_; } + } + + public const int Field12FieldNumber = 12; + private bool hasField12; + private bool field12_ = true; + public bool HasField12 { + get { return hasField12; } + } + public bool Field12 { + get { return field12_; } + } + + public const int Field13FieldNumber = 13; + private bool hasField13; + private long field13_; + public bool HasField13 { + get { return hasField13; } + } + public long Field13 { + get { return field13_; } + } + + public const int Field14FieldNumber = 14; + private bool hasField14; + private long field14_; + public bool HasField14 { + get { return hasField14; } + } + public long Field14 { + get { return field14_; } + } + + public const int Field16FieldNumber = 16; + private bool hasField16; + private int field16_; + public bool HasField16 { + get { return hasField16; } + } + public int Field16 { + get { return field16_; } + } + + public const int Field19FieldNumber = 19; + private bool hasField19; + private int field19_ = 2; + public bool HasField19 { + get { return hasField19; } + } + public int Field19 { + get { return field19_; } + } + + public const int Field20FieldNumber = 20; + private bool hasField20; + private bool field20_ = true; + public bool HasField20 { + get { return hasField20; } + } + public bool Field20 { + get { return field20_; } + } + + public const int Field28FieldNumber = 28; + private bool hasField28; + private bool field28_ = true; + public bool HasField28 { + get { return hasField28; } + } + public bool Field28 { + get { return field28_; } + } + + public const int Field21FieldNumber = 21; + private bool hasField21; + private ulong field21_; + public bool HasField21 { + get { return hasField21; } + } + [global::System.CLSCompliant(false)] + public ulong Field21 { + get { return field21_; } + } + + public const int Field22FieldNumber = 22; + private bool hasField22; + private int field22_; + public bool HasField22 { + get { return hasField22; } + } + public int Field22 { + get { return field22_; } + } + + public const int Field23FieldNumber = 23; + private bool hasField23; + private bool field23_; + public bool HasField23 { + get { return hasField23; } + } + public bool Field23 { + get { return field23_; } + } + + public const int Field206FieldNumber = 206; + private bool hasField206; + private bool field206_; + public bool HasField206 { + get { return hasField206; } + } + public bool Field206 { + get { return field206_; } + } + + public const int Field203FieldNumber = 203; + private bool hasField203; + private uint field203_; + public bool HasField203 { + get { return hasField203; } + } + [global::System.CLSCompliant(false)] + public uint Field203 { + get { return field203_; } + } + + public const int Field204FieldNumber = 204; + private bool hasField204; + private int field204_; + public bool HasField204 { + get { return hasField204; } + } + public int Field204 { + get { return field204_; } + } + + public const int Field205FieldNumber = 205; + private bool hasField205; + private string field205_ = ""; + public bool HasField205 { + get { return hasField205; } + } + public string Field205 { + get { return field205_; } + } + + public const int Field207FieldNumber = 207; + private bool hasField207; + private ulong field207_; + public bool HasField207 { + get { return hasField207; } + } + [global::System.CLSCompliant(false)] + public ulong Field207 { + get { return field207_; } + } + + public const int Field300FieldNumber = 300; + private bool hasField300; + private ulong field300_; + public bool HasField300 { + get { return hasField300; } + } + [global::System.CLSCompliant(false)] + public ulong Field300 { + get { return field300_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _speedMessage1SubMessageFieldNames; + if (hasField1) { + output.WriteInt32(1, field_names[0], Field1); + } + if (hasField2) { + output.WriteInt32(2, field_names[7], Field2); + } + if (hasField3) { + output.WriteInt32(3, field_names[18], Field3); + } + if (hasField12) { + output.WriteBool(12, field_names[1], Field12); + } + if (hasField13) { + output.WriteInt64(13, field_names[2], Field13); + } + if (hasField14) { + output.WriteInt64(14, field_names[3], Field14); + } + if (hasField15) { + output.WriteString(15, field_names[4], Field15); + } + if (hasField16) { + output.WriteInt32(16, field_names[5], Field16); + } + if (hasField19) { + output.WriteInt32(19, field_names[6], Field19); + } + if (hasField20) { + output.WriteBool(20, field_names[8], Field20); + } + if (hasField21) { + output.WriteFixed64(21, field_names[14], Field21); + } + if (hasField22) { + output.WriteInt32(22, field_names[15], Field22); + } + if (hasField23) { + output.WriteBool(23, field_names[16], Field23); + } + if (hasField28) { + output.WriteBool(28, field_names[17], Field28); + } + if (hasField203) { + output.WriteFixed32(203, field_names[9], Field203); + } + if (hasField204) { + output.WriteInt32(204, field_names[10], Field204); + } + if (hasField205) { + output.WriteString(205, field_names[11], Field205); + } + if (hasField206) { + output.WriteBool(206, field_names[12], Field206); + } + if (hasField207) { + output.WriteUInt64(207, field_names[13], Field207); + } + if (hasField300) { + output.WriteUInt64(300, field_names[19], Field300); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasField1) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Field1); + } + if (hasField2) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Field2); + } + if (hasField3) { + size += pb::CodedOutputStream.ComputeInt32Size(3, Field3); + } + if (hasField15) { + size += pb::CodedOutputStream.ComputeStringSize(15, Field15); + } + if (hasField12) { + size += pb::CodedOutputStream.ComputeBoolSize(12, Field12); + } + if (hasField13) { + size += pb::CodedOutputStream.ComputeInt64Size(13, Field13); + } + if (hasField14) { + size += pb::CodedOutputStream.ComputeInt64Size(14, Field14); + } + if (hasField16) { + size += pb::CodedOutputStream.ComputeInt32Size(16, Field16); + } + if (hasField19) { + size += pb::CodedOutputStream.ComputeInt32Size(19, Field19); + } + if (hasField20) { + size += pb::CodedOutputStream.ComputeBoolSize(20, Field20); + } + if (hasField28) { + size += pb::CodedOutputStream.ComputeBoolSize(28, Field28); + } + if (hasField21) { + size += pb::CodedOutputStream.ComputeFixed64Size(21, Field21); + } + if (hasField22) { + size += pb::CodedOutputStream.ComputeInt32Size(22, Field22); + } + if (hasField23) { + size += pb::CodedOutputStream.ComputeBoolSize(23, Field23); + } + if (hasField206) { + size += pb::CodedOutputStream.ComputeBoolSize(206, Field206); + } + if (hasField203) { + size += pb::CodedOutputStream.ComputeFixed32Size(203, Field203); + } + if (hasField204) { + size += pb::CodedOutputStream.ComputeInt32Size(204, Field204); + } + if (hasField205) { + size += pb::CodedOutputStream.ComputeStringSize(205, Field205); + } + if (hasField207) { + size += pb::CodedOutputStream.ComputeUInt64Size(207, Field207); + } + if (hasField300) { + size += pb::CodedOutputStream.ComputeUInt64Size(300, Field300); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SpeedMessage1SubMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage1SubMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SpeedMessage1SubMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SpeedMessage1SubMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SpeedMessage1SubMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SpeedMessage1SubMessage result; + + private SpeedMessage1SubMessage PrepareBuilder() { + if (resultIsReadOnly) { + SpeedMessage1SubMessage original = result; + result = new SpeedMessage1SubMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SpeedMessage1SubMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.Descriptor; } + } + + public override SpeedMessage1SubMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance; } + } + + public override SpeedMessage1SubMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SpeedMessage1SubMessage) { + return MergeFrom((SpeedMessage1SubMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SpeedMessage1SubMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasField1) { + Field1 = other.Field1; + } + if (other.HasField2) { + Field2 = other.Field2; + } + if (other.HasField3) { + Field3 = other.Field3; + } + if (other.HasField15) { + Field15 = other.Field15; + } + if (other.HasField12) { + Field12 = other.Field12; + } + if (other.HasField13) { + Field13 = other.Field13; + } + if (other.HasField14) { + Field14 = other.Field14; + } + if (other.HasField16) { + Field16 = other.Field16; + } + if (other.HasField19) { + Field19 = other.Field19; + } + if (other.HasField20) { + Field20 = other.Field20; + } + if (other.HasField28) { + Field28 = other.Field28; + } + if (other.HasField21) { + Field21 = other.Field21; + } + if (other.HasField22) { + Field22 = other.Field22; + } + if (other.HasField23) { + Field23 = other.Field23; + } + if (other.HasField206) { + Field206 = other.Field206; + } + if (other.HasField203) { + Field203 = other.Field203; + } + if (other.HasField204) { + Field204 = other.Field204; + } + if (other.HasField205) { + Field205 = other.Field205; + } + if (other.HasField207) { + Field207 = other.Field207; + } + if (other.HasField300) { + Field300 = other.Field300; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_speedMessage1SubMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _speedMessage1SubMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasField1 = input.ReadInt32(ref result.field1_); + break; + } + case 16: { + result.hasField2 = input.ReadInt32(ref result.field2_); + break; + } + case 24: { + result.hasField3 = input.ReadInt32(ref result.field3_); + break; + } + case 96: { + result.hasField12 = input.ReadBool(ref result.field12_); + break; + } + case 104: { + result.hasField13 = input.ReadInt64(ref result.field13_); + break; + } + case 112: { + result.hasField14 = input.ReadInt64(ref result.field14_); + break; + } + case 122: { + result.hasField15 = input.ReadString(ref result.field15_); + break; + } + case 128: { + result.hasField16 = input.ReadInt32(ref result.field16_); + break; + } + case 152: { + result.hasField19 = input.ReadInt32(ref result.field19_); + break; + } + case 160: { + result.hasField20 = input.ReadBool(ref result.field20_); + break; + } + case 169: { + result.hasField21 = input.ReadFixed64(ref result.field21_); + break; + } + case 176: { + result.hasField22 = input.ReadInt32(ref result.field22_); + break; + } + case 184: { + result.hasField23 = input.ReadBool(ref result.field23_); + break; + } + case 224: { + result.hasField28 = input.ReadBool(ref result.field28_); + break; + } + case 1629: { + result.hasField203 = input.ReadFixed32(ref result.field203_); + break; + } + case 1632: { + result.hasField204 = input.ReadInt32(ref result.field204_); + break; + } + case 1642: { + result.hasField205 = input.ReadString(ref result.field205_); + break; + } + case 1648: { + result.hasField206 = input.ReadBool(ref result.field206_); + break; + } + case 1656: { + result.hasField207 = input.ReadUInt64(ref result.field207_); + break; + } + case 2400: { + result.hasField300 = input.ReadUInt64(ref result.field300_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public int Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(int value) { + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = 0; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public int Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(int value) { + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = 0; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public int Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(int value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0; + return this; + } + + public bool HasField15 { + get { return result.hasField15; } + } + public string Field15 { + get { return result.Field15; } + set { SetField15(value); } + } + public Builder SetField15(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = value; + return this; + } + public Builder ClearField15() { + PrepareBuilder(); + result.hasField15 = false; + result.field15_ = ""; + return this; + } + + public bool HasField12 { + get { return result.hasField12; } + } + public bool Field12 { + get { return result.Field12; } + set { SetField12(value); } + } + public Builder SetField12(bool value) { + PrepareBuilder(); + result.hasField12 = true; + result.field12_ = value; + return this; + } + public Builder ClearField12() { + PrepareBuilder(); + result.hasField12 = false; + result.field12_ = true; + return this; + } + + public bool HasField13 { + get { return result.hasField13; } + } + public long Field13 { + get { return result.Field13; } + set { SetField13(value); } + } + public Builder SetField13(long value) { + PrepareBuilder(); + result.hasField13 = true; + result.field13_ = value; + return this; + } + public Builder ClearField13() { + PrepareBuilder(); + result.hasField13 = false; + result.field13_ = 0L; + return this; + } + + public bool HasField14 { + get { return result.hasField14; } + } + public long Field14 { + get { return result.Field14; } + set { SetField14(value); } + } + public Builder SetField14(long value) { + PrepareBuilder(); + result.hasField14 = true; + result.field14_ = value; + return this; + } + public Builder ClearField14() { + PrepareBuilder(); + result.hasField14 = false; + result.field14_ = 0L; + return this; + } + + public bool HasField16 { + get { return result.hasField16; } + } + public int Field16 { + get { return result.Field16; } + set { SetField16(value); } + } + public Builder SetField16(int value) { + PrepareBuilder(); + result.hasField16 = true; + result.field16_ = value; + return this; + } + public Builder ClearField16() { + PrepareBuilder(); + result.hasField16 = false; + result.field16_ = 0; + return this; + } + + public bool HasField19 { + get { return result.hasField19; } + } + public int Field19 { + get { return result.Field19; } + set { SetField19(value); } + } + public Builder SetField19(int value) { + PrepareBuilder(); + result.hasField19 = true; + result.field19_ = value; + return this; + } + public Builder ClearField19() { + PrepareBuilder(); + result.hasField19 = false; + result.field19_ = 2; + return this; + } + + public bool HasField20 { + get { return result.hasField20; } + } + public bool Field20 { + get { return result.Field20; } + set { SetField20(value); } + } + public Builder SetField20(bool value) { + PrepareBuilder(); + result.hasField20 = true; + result.field20_ = value; + return this; + } + public Builder ClearField20() { + PrepareBuilder(); + result.hasField20 = false; + result.field20_ = true; + return this; + } + + public bool HasField28 { + get { return result.hasField28; } + } + public bool Field28 { + get { return result.Field28; } + set { SetField28(value); } + } + public Builder SetField28(bool value) { + PrepareBuilder(); + result.hasField28 = true; + result.field28_ = value; + return this; + } + public Builder ClearField28() { + PrepareBuilder(); + result.hasField28 = false; + result.field28_ = true; + return this; + } + + public bool HasField21 { + get { return result.hasField21; } + } + [global::System.CLSCompliant(false)] + public ulong Field21 { + get { return result.Field21; } + set { SetField21(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField21(ulong value) { + PrepareBuilder(); + result.hasField21 = true; + result.field21_ = value; + return this; + } + public Builder ClearField21() { + PrepareBuilder(); + result.hasField21 = false; + result.field21_ = 0UL; + return this; + } + + public bool HasField22 { + get { return result.hasField22; } + } + public int Field22 { + get { return result.Field22; } + set { SetField22(value); } + } + public Builder SetField22(int value) { + PrepareBuilder(); + result.hasField22 = true; + result.field22_ = value; + return this; + } + public Builder ClearField22() { + PrepareBuilder(); + result.hasField22 = false; + result.field22_ = 0; + return this; + } + + public bool HasField23 { + get { return result.hasField23; } + } + public bool Field23 { + get { return result.Field23; } + set { SetField23(value); } + } + public Builder SetField23(bool value) { + PrepareBuilder(); + result.hasField23 = true; + result.field23_ = value; + return this; + } + public Builder ClearField23() { + PrepareBuilder(); + result.hasField23 = false; + result.field23_ = false; + return this; + } + + public bool HasField206 { + get { return result.hasField206; } + } + public bool Field206 { + get { return result.Field206; } + set { SetField206(value); } + } + public Builder SetField206(bool value) { + PrepareBuilder(); + result.hasField206 = true; + result.field206_ = value; + return this; + } + public Builder ClearField206() { + PrepareBuilder(); + result.hasField206 = false; + result.field206_ = false; + return this; + } + + public bool HasField203 { + get { return result.hasField203; } + } + [global::System.CLSCompliant(false)] + public uint Field203 { + get { return result.Field203; } + set { SetField203(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField203(uint value) { + PrepareBuilder(); + result.hasField203 = true; + result.field203_ = value; + return this; + } + public Builder ClearField203() { + PrepareBuilder(); + result.hasField203 = false; + result.field203_ = 0; + return this; + } + + public bool HasField204 { + get { return result.hasField204; } + } + public int Field204 { + get { return result.Field204; } + set { SetField204(value); } + } + public Builder SetField204(int value) { + PrepareBuilder(); + result.hasField204 = true; + result.field204_ = value; + return this; + } + public Builder ClearField204() { + PrepareBuilder(); + result.hasField204 = false; + result.field204_ = 0; + return this; + } + + public bool HasField205 { + get { return result.hasField205; } + } + public string Field205 { + get { return result.Field205; } + set { SetField205(value); } + } + public Builder SetField205(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField205 = true; + result.field205_ = value; + return this; + } + public Builder ClearField205() { + PrepareBuilder(); + result.hasField205 = false; + result.field205_ = ""; + return this; + } + + public bool HasField207 { + get { return result.hasField207; } + } + [global::System.CLSCompliant(false)] + public ulong Field207 { + get { return result.Field207; } + set { SetField207(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField207(ulong value) { + PrepareBuilder(); + result.hasField207 = true; + result.field207_ = value; + return this; + } + public Builder ClearField207() { + PrepareBuilder(); + result.hasField207 = false; + result.field207_ = 0UL; + return this; + } + + public bool HasField300 { + get { return result.hasField300; } + } + [global::System.CLSCompliant(false)] + public ulong Field300 { + get { return result.Field300; } + set { SetField300(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField300(ulong value) { + PrepareBuilder(); + result.hasField300 = true; + result.field300_ = value; + return this; + } + public Builder ClearField300() { + PrepareBuilder(); + result.hasField300 = false; + result.field300_ = 0UL; + return this; + } + } + static SpeedMessage1SubMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SpeedMessage2 : pb::GeneratedMessage { + private SpeedMessage2() { } + private static readonly SpeedMessage2 defaultInstance = new SpeedMessage2().MakeReadOnly(); + private static readonly string[] _speedMessage2FieldNames = new string[] { "field1", "field109", "field127", "field128", "field129", "field130", "field131", "field2", "field205", "field206", "field21", "field210", "field211", "field212", "field213", "field216", "field217", "field218", "field220", "field221", "field222", "field25", "field3", "field30", "field4", "field6", "field63", "field71", "field75", "group1" }; + private static readonly uint[] _speedMessage2FieldTags = new uint[] { 10, 872, 1018, 1026, 1032, 1040, 1048, 18, 1640, 1648, 168, 1680, 1688, 1696, 1704, 1728, 1736, 1744, 1760, 1768, 1781, 205, 24, 240, 32, 50, 504, 568, 600, 83 }; + public static SpeedMessage2 DefaultInstance { + get { return defaultInstance; } + } + + public override SpeedMessage2 DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SpeedMessage2 ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage2__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage2__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Group1 : pb::GeneratedMessage { + private Group1() { } + private static readonly Group1 defaultInstance = new Group1().MakeReadOnly(); + private static readonly string[] _group1FieldNames = new string[] { "field11", "field12", "field13", "field14", "field15", "field16", "field20", "field22", "field24", "field26", "field27", "field28", "field29", "field31", "field5", "field73" }; + private static readonly uint[] _group1FieldTags = new uint[] { 93, 98, 106, 114, 120, 130, 160, 178, 194, 213, 218, 224, 234, 250, 40, 584 }; + public static Group1 DefaultInstance { + get { return defaultInstance; } + } + + public override Group1 DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Group1 ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage2_Group1__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage2_Group1__FieldAccessorTable; } + } + + public const int Field11FieldNumber = 11; + private bool hasField11; + private float field11_; + public bool HasField11 { + get { return hasField11; } + } + public float Field11 { + get { return field11_; } + } + + public const int Field26FieldNumber = 26; + private bool hasField26; + private float field26_; + public bool HasField26 { + get { return hasField26; } + } + public float Field26 { + get { return field26_; } + } + + public const int Field12FieldNumber = 12; + private bool hasField12; + private string field12_ = ""; + public bool HasField12 { + get { return hasField12; } + } + public string Field12 { + get { return field12_; } + } + + public const int Field13FieldNumber = 13; + private bool hasField13; + private string field13_ = ""; + public bool HasField13 { + get { return hasField13; } + } + public string Field13 { + get { return field13_; } + } + + public const int Field14FieldNumber = 14; + private pbc::PopsicleList field14_ = new pbc::PopsicleList(); + public scg::IList Field14List { + get { return pbc::Lists.AsReadOnly(field14_); } + } + public int Field14Count { + get { return field14_.Count; } + } + public string GetField14(int index) { + return field14_[index]; + } + + public const int Field15FieldNumber = 15; + private bool hasField15; + private ulong field15_; + public bool HasField15 { + get { return hasField15; } + } + [global::System.CLSCompliant(false)] + public ulong Field15 { + get { return field15_; } + } + + public const int Field5FieldNumber = 5; + private bool hasField5; + private int field5_; + public bool HasField5 { + get { return hasField5; } + } + public int Field5 { + get { return field5_; } + } + + public const int Field27FieldNumber = 27; + private bool hasField27; + private string field27_ = ""; + public bool HasField27 { + get { return hasField27; } + } + public string Field27 { + get { return field27_; } + } + + public const int Field28FieldNumber = 28; + private bool hasField28; + private int field28_; + public bool HasField28 { + get { return hasField28; } + } + public int Field28 { + get { return field28_; } + } + + public const int Field29FieldNumber = 29; + private bool hasField29; + private string field29_ = ""; + public bool HasField29 { + get { return hasField29; } + } + public string Field29 { + get { return field29_; } + } + + public const int Field16FieldNumber = 16; + private bool hasField16; + private string field16_ = ""; + public bool HasField16 { + get { return hasField16; } + } + public string Field16 { + get { return field16_; } + } + + public const int Field22FieldNumber = 22; + private pbc::PopsicleList field22_ = new pbc::PopsicleList(); + public scg::IList Field22List { + get { return pbc::Lists.AsReadOnly(field22_); } + } + public int Field22Count { + get { return field22_.Count; } + } + public string GetField22(int index) { + return field22_[index]; + } + + public const int Field73FieldNumber = 73; + private pbc::PopsicleList field73_ = new pbc::PopsicleList(); + public scg::IList Field73List { + get { return pbc::Lists.AsReadOnly(field73_); } + } + public int Field73Count { + get { return field73_.Count; } + } + public int GetField73(int index) { + return field73_[index]; + } + + public const int Field20FieldNumber = 20; + private bool hasField20; + private int field20_; + public bool HasField20 { + get { return hasField20; } + } + public int Field20 { + get { return field20_; } + } + + public const int Field24FieldNumber = 24; + private bool hasField24; + private string field24_ = ""; + public bool HasField24 { + get { return hasField24; } + } + public string Field24 { + get { return field24_; } + } + + public const int Field31FieldNumber = 31; + private bool hasField31; + private global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage field31_; + public bool HasField31 { + get { return hasField31; } + } + public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage Field31 { + get { return field31_ ?? global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasField11) return false; + if (!hasField15) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _group1FieldNames; + if (hasField5) { + output.WriteInt32(5, field_names[14], Field5); + } + if (hasField11) { + output.WriteFloat(11, field_names[0], Field11); + } + if (hasField12) { + output.WriteString(12, field_names[1], Field12); + } + if (hasField13) { + output.WriteString(13, field_names[2], Field13); + } + if (field14_.Count > 0) { + output.WriteStringArray(14, field_names[3], field14_); + } + if (hasField15) { + output.WriteUInt64(15, field_names[4], Field15); + } + if (hasField16) { + output.WriteString(16, field_names[5], Field16); + } + if (hasField20) { + output.WriteInt32(20, field_names[6], Field20); + } + if (field22_.Count > 0) { + output.WriteStringArray(22, field_names[7], field22_); + } + if (hasField24) { + output.WriteString(24, field_names[8], Field24); + } + if (hasField26) { + output.WriteFloat(26, field_names[9], Field26); + } + if (hasField27) { + output.WriteString(27, field_names[10], Field27); + } + if (hasField28) { + output.WriteInt32(28, field_names[11], Field28); + } + if (hasField29) { + output.WriteString(29, field_names[12], Field29); + } + if (hasField31) { + output.WriteMessage(31, field_names[13], Field31); + } + if (field73_.Count > 0) { + output.WriteInt32Array(73, field_names[15], field73_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasField11) { + size += pb::CodedOutputStream.ComputeFloatSize(11, Field11); + } + if (hasField26) { + size += pb::CodedOutputStream.ComputeFloatSize(26, Field26); + } + if (hasField12) { + size += pb::CodedOutputStream.ComputeStringSize(12, Field12); + } + if (hasField13) { + size += pb::CodedOutputStream.ComputeStringSize(13, Field13); + } + { + int dataSize = 0; + foreach (string element in Field14List) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * field14_.Count; + } + if (hasField15) { + size += pb::CodedOutputStream.ComputeUInt64Size(15, Field15); + } + if (hasField5) { + size += pb::CodedOutputStream.ComputeInt32Size(5, Field5); + } + if (hasField27) { + size += pb::CodedOutputStream.ComputeStringSize(27, Field27); + } + if (hasField28) { + size += pb::CodedOutputStream.ComputeInt32Size(28, Field28); + } + if (hasField29) { + size += pb::CodedOutputStream.ComputeStringSize(29, Field29); + } + if (hasField16) { + size += pb::CodedOutputStream.ComputeStringSize(16, Field16); + } + { + int dataSize = 0; + foreach (string element in Field22List) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * field22_.Count; + } + { + int dataSize = 0; + foreach (int element in Field73List) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + size += 2 * field73_.Count; + } + if (hasField20) { + size += pb::CodedOutputStream.ComputeInt32Size(20, Field20); + } + if (hasField24) { + size += pb::CodedOutputStream.ComputeStringSize(24, Field24); + } + if (hasField31) { + size += pb::CodedOutputStream.ComputeMessageSize(31, Field31); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Group1 ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Group1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Group1 ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Group1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Group1 ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Group1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Group1 ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Group1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Group1 ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Group1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Group1 MakeReadOnly() { + field14_.MakeReadOnly(); + field22_.MakeReadOnly(); + field73_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Group1 prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Group1 cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Group1 result; + + private Group1 PrepareBuilder() { + if (resultIsReadOnly) { + Group1 original = result; + result = new Group1(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Group1 MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.Descriptor; } + } + + public override Group1 DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.DefaultInstance; } + } + + public override Group1 BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Group1) { + return MergeFrom((Group1) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Group1 other) { + if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasField11) { + Field11 = other.Field11; + } + if (other.HasField26) { + Field26 = other.Field26; + } + if (other.HasField12) { + Field12 = other.Field12; + } + if (other.HasField13) { + Field13 = other.Field13; + } + if (other.field14_.Count != 0) { + result.field14_.Add(other.field14_); + } + if (other.HasField15) { + Field15 = other.Field15; + } + if (other.HasField5) { + Field5 = other.Field5; + } + if (other.HasField27) { + Field27 = other.Field27; + } + if (other.HasField28) { + Field28 = other.Field28; + } + if (other.HasField29) { + Field29 = other.Field29; + } + if (other.HasField16) { + Field16 = other.Field16; + } + if (other.field22_.Count != 0) { + result.field22_.Add(other.field22_); + } + if (other.field73_.Count != 0) { + result.field73_.Add(other.field73_); + } + if (other.HasField20) { + Field20 = other.Field20; + } + if (other.HasField24) { + Field24 = other.Field24; + } + if (other.HasField31) { + MergeField31(other.Field31); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_group1FieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _group1FieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 40: { + result.hasField5 = input.ReadInt32(ref result.field5_); + break; + } + case 93: { + result.hasField11 = input.ReadFloat(ref result.field11_); + break; + } + case 98: { + result.hasField12 = input.ReadString(ref result.field12_); + break; + } + case 106: { + result.hasField13 = input.ReadString(ref result.field13_); + break; + } + case 114: { + input.ReadStringArray(tag, field_name, result.field14_); + break; + } + case 120: { + result.hasField15 = input.ReadUInt64(ref result.field15_); + break; + } + case 130: { + result.hasField16 = input.ReadString(ref result.field16_); + break; + } + case 160: { + result.hasField20 = input.ReadInt32(ref result.field20_); + break; + } + case 178: { + input.ReadStringArray(tag, field_name, result.field22_); + break; + } + case 194: { + result.hasField24 = input.ReadString(ref result.field24_); + break; + } + case 213: { + result.hasField26 = input.ReadFloat(ref result.field26_); + break; + } + case 218: { + result.hasField27 = input.ReadString(ref result.field27_); + break; + } + case 224: { + result.hasField28 = input.ReadInt32(ref result.field28_); + break; + } + case 234: { + result.hasField29 = input.ReadString(ref result.field29_); + break; + } + case 250: { + global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.CreateBuilder(); + if (result.hasField31) { + subBuilder.MergeFrom(Field31); + } + input.ReadMessage(subBuilder, extensionRegistry); + Field31 = subBuilder.BuildPartial(); + break; + } + case 586: + case 584: { + input.ReadInt32Array(tag, field_name, result.field73_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasField11 { + get { return result.hasField11; } + } + public float Field11 { + get { return result.Field11; } + set { SetField11(value); } + } + public Builder SetField11(float value) { + PrepareBuilder(); + result.hasField11 = true; + result.field11_ = value; + return this; + } + public Builder ClearField11() { + PrepareBuilder(); + result.hasField11 = false; + result.field11_ = 0F; + return this; + } + + public bool HasField26 { + get { return result.hasField26; } + } + public float Field26 { + get { return result.Field26; } + set { SetField26(value); } + } + public Builder SetField26(float value) { + PrepareBuilder(); + result.hasField26 = true; + result.field26_ = value; + return this; + } + public Builder ClearField26() { + PrepareBuilder(); + result.hasField26 = false; + result.field26_ = 0F; + return this; + } + + public bool HasField12 { + get { return result.hasField12; } + } + public string Field12 { + get { return result.Field12; } + set { SetField12(value); } + } + public Builder SetField12(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField12 = true; + result.field12_ = value; + return this; + } + public Builder ClearField12() { + PrepareBuilder(); + result.hasField12 = false; + result.field12_ = ""; + return this; + } + + public bool HasField13 { + get { return result.hasField13; } + } + public string Field13 { + get { return result.Field13; } + set { SetField13(value); } + } + public Builder SetField13(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField13 = true; + result.field13_ = value; + return this; + } + public Builder ClearField13() { + PrepareBuilder(); + result.hasField13 = false; + result.field13_ = ""; + return this; + } + + public pbc::IPopsicleList Field14List { + get { return PrepareBuilder().field14_; } + } + public int Field14Count { + get { return result.Field14Count; } + } + public string GetField14(int index) { + return result.GetField14(index); + } + public Builder SetField14(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field14_[index] = value; + return this; + } + public Builder AddField14(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field14_.Add(value); + return this; + } + public Builder AddRangeField14(scg::IEnumerable values) { + PrepareBuilder(); + result.field14_.Add(values); + return this; + } + public Builder ClearField14() { + PrepareBuilder(); + result.field14_.Clear(); + return this; + } + + public bool HasField15 { + get { return result.hasField15; } + } + [global::System.CLSCompliant(false)] + public ulong Field15 { + get { return result.Field15; } + set { SetField15(value); } + } + [global::System.CLSCompliant(false)] + public Builder SetField15(ulong value) { + PrepareBuilder(); + result.hasField15 = true; + result.field15_ = value; + return this; + } + public Builder ClearField15() { + PrepareBuilder(); + result.hasField15 = false; + result.field15_ = 0UL; + return this; + } + + public bool HasField5 { + get { return result.hasField5; } + } + public int Field5 { + get { return result.Field5; } + set { SetField5(value); } + } + public Builder SetField5(int value) { + PrepareBuilder(); + result.hasField5 = true; + result.field5_ = value; + return this; + } + public Builder ClearField5() { + PrepareBuilder(); + result.hasField5 = false; + result.field5_ = 0; + return this; + } + + public bool HasField27 { + get { return result.hasField27; } + } + public string Field27 { + get { return result.Field27; } + set { SetField27(value); } + } + public Builder SetField27(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField27 = true; + result.field27_ = value; + return this; + } + public Builder ClearField27() { + PrepareBuilder(); + result.hasField27 = false; + result.field27_ = ""; + return this; + } + + public bool HasField28 { + get { return result.hasField28; } + } + public int Field28 { + get { return result.Field28; } + set { SetField28(value); } + } + public Builder SetField28(int value) { + PrepareBuilder(); + result.hasField28 = true; + result.field28_ = value; + return this; + } + public Builder ClearField28() { + PrepareBuilder(); + result.hasField28 = false; + result.field28_ = 0; + return this; + } + + public bool HasField29 { + get { return result.hasField29; } + } + public string Field29 { + get { return result.Field29; } + set { SetField29(value); } + } + public Builder SetField29(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField29 = true; + result.field29_ = value; + return this; + } + public Builder ClearField29() { + PrepareBuilder(); + result.hasField29 = false; + result.field29_ = ""; + return this; + } + + public bool HasField16 { + get { return result.hasField16; } + } + public string Field16 { + get { return result.Field16; } + set { SetField16(value); } + } + public Builder SetField16(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField16 = true; + result.field16_ = value; + return this; + } + public Builder ClearField16() { + PrepareBuilder(); + result.hasField16 = false; + result.field16_ = ""; + return this; + } + + public pbc::IPopsicleList Field22List { + get { return PrepareBuilder().field22_; } + } + public int Field22Count { + get { return result.Field22Count; } + } + public string GetField22(int index) { + return result.GetField22(index); + } + public Builder SetField22(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field22_[index] = value; + return this; + } + public Builder AddField22(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field22_.Add(value); + return this; + } + public Builder AddRangeField22(scg::IEnumerable values) { + PrepareBuilder(); + result.field22_.Add(values); + return this; + } + public Builder ClearField22() { + PrepareBuilder(); + result.field22_.Clear(); + return this; + } + + public pbc::IPopsicleList Field73List { + get { return PrepareBuilder().field73_; } + } + public int Field73Count { + get { return result.Field73Count; } + } + public int GetField73(int index) { + return result.GetField73(index); + } + public Builder SetField73(int index, int value) { + PrepareBuilder(); + result.field73_[index] = value; + return this; + } + public Builder AddField73(int value) { + PrepareBuilder(); + result.field73_.Add(value); + return this; + } + public Builder AddRangeField73(scg::IEnumerable values) { + PrepareBuilder(); + result.field73_.Add(values); + return this; + } + public Builder ClearField73() { + PrepareBuilder(); + result.field73_.Clear(); + return this; + } + + public bool HasField20 { + get { return result.hasField20; } + } + public int Field20 { + get { return result.Field20; } + set { SetField20(value); } + } + public Builder SetField20(int value) { + PrepareBuilder(); + result.hasField20 = true; + result.field20_ = value; + return this; + } + public Builder ClearField20() { + PrepareBuilder(); + result.hasField20 = false; + result.field20_ = 0; + return this; + } + + public bool HasField24 { + get { return result.hasField24; } + } + public string Field24 { + get { return result.Field24; } + set { SetField24(value); } + } + public Builder SetField24(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField24 = true; + result.field24_ = value; + return this; + } + public Builder ClearField24() { + PrepareBuilder(); + result.hasField24 = false; + result.field24_ = ""; + return this; + } + + public bool HasField31 { + get { return result.hasField31; } + } + public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage Field31 { + get { return result.Field31; } + set { SetField31(value); } + } + public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField31 = true; + result.field31_ = value; + return this; + } + public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasField31 = true; + result.field31_ = builderForValue.Build(); + return this; + } + public Builder MergeField31(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasField31 && + result.field31_ != global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance) { + result.field31_ = global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); + } else { + result.field31_ = value; + } + result.hasField31 = true; + return this; + } + public Builder ClearField31() { + PrepareBuilder(); + result.hasField31 = false; + result.field31_ = null; + return this; + } + } + static Group1() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.Descriptor, null); + } + } + + } + #endregion + + public const int Field1FieldNumber = 1; + private bool hasField1; + private string field1_ = ""; + public bool HasField1 { + get { return hasField1; } + } + public string Field1 { + get { return field1_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private long field3_; + public bool HasField3 { + get { return hasField3; } + } + public long Field3 { + get { return field3_; } + } + + public const int Field4FieldNumber = 4; + private bool hasField4; + private long field4_; + public bool HasField4 { + get { return hasField4; } + } + public long Field4 { + get { return field4_; } + } + + public const int Field30FieldNumber = 30; + private bool hasField30; + private long field30_; + public bool HasField30 { + get { return hasField30; } + } + public long Field30 { + get { return field30_; } + } + + public const int Field75FieldNumber = 75; + private bool hasField75; + private bool field75_; + public bool HasField75 { + get { return hasField75; } + } + public bool Field75 { + get { return field75_; } + } + + public const int Field6FieldNumber = 6; + private bool hasField6; + private string field6_ = ""; + public bool HasField6 { + get { return hasField6; } + } + public string Field6 { + get { return field6_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private pb::ByteString field2_ = pb::ByteString.Empty; + public bool HasField2 { + get { return hasField2; } + } + public pb::ByteString Field2 { + get { return field2_; } + } + + public const int Field21FieldNumber = 21; + private bool hasField21; + private int field21_; + public bool HasField21 { + get { return hasField21; } + } + public int Field21 { + get { return field21_; } + } + + public const int Field71FieldNumber = 71; + private bool hasField71; + private int field71_; + public bool HasField71 { + get { return hasField71; } + } + public int Field71 { + get { return field71_; } + } + + public const int Field25FieldNumber = 25; + private bool hasField25; + private float field25_; + public bool HasField25 { + get { return hasField25; } + } + public float Field25 { + get { return field25_; } + } + + public const int Field109FieldNumber = 109; + private bool hasField109; + private int field109_; + public bool HasField109 { + get { return hasField109; } + } + public int Field109 { + get { return field109_; } + } + + public const int Field210FieldNumber = 210; + private bool hasField210; + private int field210_; + public bool HasField210 { + get { return hasField210; } + } + public int Field210 { + get { return field210_; } + } + + public const int Field211FieldNumber = 211; + private bool hasField211; + private int field211_; + public bool HasField211 { + get { return hasField211; } + } + public int Field211 { + get { return field211_; } + } + + public const int Field212FieldNumber = 212; + private bool hasField212; + private int field212_; + public bool HasField212 { + get { return hasField212; } + } + public int Field212 { + get { return field212_; } + } + + public const int Field213FieldNumber = 213; + private bool hasField213; + private int field213_; + public bool HasField213 { + get { return hasField213; } + } + public int Field213 { + get { return field213_; } + } + + public const int Field216FieldNumber = 216; + private bool hasField216; + private int field216_; + public bool HasField216 { + get { return hasField216; } + } + public int Field216 { + get { return field216_; } + } + + public const int Field217FieldNumber = 217; + private bool hasField217; + private int field217_; + public bool HasField217 { + get { return hasField217; } + } + public int Field217 { + get { return field217_; } + } + + public const int Field218FieldNumber = 218; + private bool hasField218; + private int field218_; + public bool HasField218 { + get { return hasField218; } + } + public int Field218 { + get { return field218_; } + } + + public const int Field220FieldNumber = 220; + private bool hasField220; + private int field220_; + public bool HasField220 { + get { return hasField220; } + } + public int Field220 { + get { return field220_; } + } + + public const int Field221FieldNumber = 221; + private bool hasField221; + private int field221_; + public bool HasField221 { + get { return hasField221; } + } + public int Field221 { + get { return field221_; } + } + + public const int Field222FieldNumber = 222; + private bool hasField222; + private float field222_; + public bool HasField222 { + get { return hasField222; } + } + public float Field222 { + get { return field222_; } + } + + public const int Field63FieldNumber = 63; + private bool hasField63; + private int field63_; + public bool HasField63 { + get { return hasField63; } + } + public int Field63 { + get { return field63_; } + } + + public const int Group1FieldNumber = 10; + private pbc::PopsicleList group1_ = new pbc::PopsicleList(); + public scg::IList Group1List { + get { return group1_; } + } + public int Group1Count { + get { return group1_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 GetGroup1(int index) { + return group1_[index]; + } + + public const int Field128FieldNumber = 128; + private pbc::PopsicleList field128_ = new pbc::PopsicleList(); + public scg::IList Field128List { + get { return pbc::Lists.AsReadOnly(field128_); } + } + public int Field128Count { + get { return field128_.Count; } + } + public string GetField128(int index) { + return field128_[index]; + } + + public const int Field131FieldNumber = 131; + private bool hasField131; + private long field131_; + public bool HasField131 { + get { return hasField131; } + } + public long Field131 { + get { return field131_; } + } + + public const int Field127FieldNumber = 127; + private pbc::PopsicleList field127_ = new pbc::PopsicleList(); + public scg::IList Field127List { + get { return pbc::Lists.AsReadOnly(field127_); } + } + public int Field127Count { + get { return field127_.Count; } + } + public string GetField127(int index) { + return field127_[index]; + } + + public const int Field129FieldNumber = 129; + private bool hasField129; + private int field129_; + public bool HasField129 { + get { return hasField129; } + } + public int Field129 { + get { return field129_; } + } + + public const int Field130FieldNumber = 130; + private pbc::PopsicleList field130_ = new pbc::PopsicleList(); + public scg::IList Field130List { + get { return pbc::Lists.AsReadOnly(field130_); } + } + public int Field130Count { + get { return field130_.Count; } + } + public long GetField130(int index) { + return field130_[index]; + } + + public const int Field205FieldNumber = 205; + private bool hasField205; + private bool field205_; + public bool HasField205 { + get { return hasField205; } + } + public bool Field205 { + get { return field205_; } + } + + public const int Field206FieldNumber = 206; + private bool hasField206; + private bool field206_; + public bool HasField206 { + get { return hasField206; } + } + public bool Field206 { + get { return field206_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _speedMessage2FieldNames; + if (hasField1) { + output.WriteString(1, field_names[0], Field1); + } + if (hasField2) { + output.WriteBytes(2, field_names[7], Field2); + } + if (hasField3) { + output.WriteInt64(3, field_names[22], Field3); + } + if (hasField4) { + output.WriteInt64(4, field_names[24], Field4); + } + if (hasField6) { + output.WriteString(6, field_names[25], Field6); + } + if (group1_.Count > 0) { + output.WriteGroupArray(10, field_names[29], group1_); + } + if (hasField21) { + output.WriteInt32(21, field_names[10], Field21); + } + if (hasField25) { + output.WriteFloat(25, field_names[21], Field25); + } + if (hasField30) { + output.WriteInt64(30, field_names[23], Field30); + } + if (hasField63) { + output.WriteInt32(63, field_names[26], Field63); + } + if (hasField71) { + output.WriteInt32(71, field_names[27], Field71); + } + if (hasField75) { + output.WriteBool(75, field_names[28], Field75); + } + if (hasField109) { + output.WriteInt32(109, field_names[1], Field109); + } + if (field127_.Count > 0) { + output.WriteStringArray(127, field_names[2], field127_); + } + if (field128_.Count > 0) { + output.WriteStringArray(128, field_names[3], field128_); + } + if (hasField129) { + output.WriteInt32(129, field_names[4], Field129); + } + if (field130_.Count > 0) { + output.WriteInt64Array(130, field_names[5], field130_); + } + if (hasField131) { + output.WriteInt64(131, field_names[6], Field131); + } + if (hasField205) { + output.WriteBool(205, field_names[8], Field205); + } + if (hasField206) { + output.WriteBool(206, field_names[9], Field206); + } + if (hasField210) { + output.WriteInt32(210, field_names[11], Field210); + } + if (hasField211) { + output.WriteInt32(211, field_names[12], Field211); + } + if (hasField212) { + output.WriteInt32(212, field_names[13], Field212); + } + if (hasField213) { + output.WriteInt32(213, field_names[14], Field213); + } + if (hasField216) { + output.WriteInt32(216, field_names[15], Field216); + } + if (hasField217) { + output.WriteInt32(217, field_names[16], Field217); + } + if (hasField218) { + output.WriteInt32(218, field_names[17], Field218); + } + if (hasField220) { + output.WriteInt32(220, field_names[18], Field220); + } + if (hasField221) { + output.WriteInt32(221, field_names[19], Field221); + } + if (hasField222) { + output.WriteFloat(222, field_names[20], Field222); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasField1) { + size += pb::CodedOutputStream.ComputeStringSize(1, Field1); + } + if (hasField3) { + size += pb::CodedOutputStream.ComputeInt64Size(3, Field3); + } + if (hasField4) { + size += pb::CodedOutputStream.ComputeInt64Size(4, Field4); + } + if (hasField30) { + size += pb::CodedOutputStream.ComputeInt64Size(30, Field30); + } + if (hasField75) { + size += pb::CodedOutputStream.ComputeBoolSize(75, Field75); + } + if (hasField6) { + size += pb::CodedOutputStream.ComputeStringSize(6, Field6); + } + if (hasField2) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Field2); + } + if (hasField21) { + size += pb::CodedOutputStream.ComputeInt32Size(21, Field21); + } + if (hasField71) { + size += pb::CodedOutputStream.ComputeInt32Size(71, Field71); + } + if (hasField25) { + size += pb::CodedOutputStream.ComputeFloatSize(25, Field25); + } + if (hasField109) { + size += pb::CodedOutputStream.ComputeInt32Size(109, Field109); + } + if (hasField210) { + size += pb::CodedOutputStream.ComputeInt32Size(210, Field210); + } + if (hasField211) { + size += pb::CodedOutputStream.ComputeInt32Size(211, Field211); + } + if (hasField212) { + size += pb::CodedOutputStream.ComputeInt32Size(212, Field212); + } + if (hasField213) { + size += pb::CodedOutputStream.ComputeInt32Size(213, Field213); + } + if (hasField216) { + size += pb::CodedOutputStream.ComputeInt32Size(216, Field216); + } + if (hasField217) { + size += pb::CodedOutputStream.ComputeInt32Size(217, Field217); + } + if (hasField218) { + size += pb::CodedOutputStream.ComputeInt32Size(218, Field218); + } + if (hasField220) { + size += pb::CodedOutputStream.ComputeInt32Size(220, Field220); + } + if (hasField221) { + size += pb::CodedOutputStream.ComputeInt32Size(221, Field221); + } + if (hasField222) { + size += pb::CodedOutputStream.ComputeFloatSize(222, Field222); + } + if (hasField63) { + size += pb::CodedOutputStream.ComputeInt32Size(63, Field63); + } + foreach (global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 element in Group1List) { + size += pb::CodedOutputStream.ComputeGroupSize(10, element); + } + { + int dataSize = 0; + foreach (string element in Field128List) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * field128_.Count; + } + if (hasField131) { + size += pb::CodedOutputStream.ComputeInt64Size(131, Field131); + } + { + int dataSize = 0; + foreach (string element in Field127List) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * field127_.Count; + } + if (hasField129) { + size += pb::CodedOutputStream.ComputeInt32Size(129, Field129); + } + { + int dataSize = 0; + foreach (long element in Field130List) { + dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); + } + size += dataSize; + size += 2 * field130_.Count; + } + if (hasField205) { + size += pb::CodedOutputStream.ComputeBoolSize(205, Field205); + } + if (hasField206) { + size += pb::CodedOutputStream.ComputeBoolSize(206, Field206); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SpeedMessage2 ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage2 ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage2 ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage2 ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SpeedMessage2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SpeedMessage2 ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SpeedMessage2 MakeReadOnly() { + group1_.MakeReadOnly(); + field128_.MakeReadOnly(); + field127_.MakeReadOnly(); + field130_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SpeedMessage2 prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SpeedMessage2 cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SpeedMessage2 result; + + private SpeedMessage2 PrepareBuilder() { + if (resultIsReadOnly) { + SpeedMessage2 original = result; + result = new SpeedMessage2(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SpeedMessage2 MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Descriptor; } + } + + public override SpeedMessage2 DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.DefaultInstance; } + } + + public override SpeedMessage2 BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SpeedMessage2) { + return MergeFrom((SpeedMessage2) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SpeedMessage2 other) { + if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasField1) { + Field1 = other.Field1; + } + if (other.HasField3) { + Field3 = other.Field3; + } + if (other.HasField4) { + Field4 = other.Field4; + } + if (other.HasField30) { + Field30 = other.Field30; + } + if (other.HasField75) { + Field75 = other.Field75; + } + if (other.HasField6) { + Field6 = other.Field6; + } + if (other.HasField2) { + Field2 = other.Field2; + } + if (other.HasField21) { + Field21 = other.Field21; + } + if (other.HasField71) { + Field71 = other.Field71; + } + if (other.HasField25) { + Field25 = other.Field25; + } + if (other.HasField109) { + Field109 = other.Field109; + } + if (other.HasField210) { + Field210 = other.Field210; + } + if (other.HasField211) { + Field211 = other.Field211; + } + if (other.HasField212) { + Field212 = other.Field212; + } + if (other.HasField213) { + Field213 = other.Field213; + } + if (other.HasField216) { + Field216 = other.Field216; + } + if (other.HasField217) { + Field217 = other.Field217; + } + if (other.HasField218) { + Field218 = other.Field218; + } + if (other.HasField220) { + Field220 = other.Field220; + } + if (other.HasField221) { + Field221 = other.Field221; + } + if (other.HasField222) { + Field222 = other.Field222; + } + if (other.HasField63) { + Field63 = other.Field63; + } + if (other.group1_.Count != 0) { + result.group1_.Add(other.group1_); + } + if (other.field128_.Count != 0) { + result.field128_.Add(other.field128_); + } + if (other.HasField131) { + Field131 = other.Field131; + } + if (other.field127_.Count != 0) { + result.field127_.Add(other.field127_); + } + if (other.HasField129) { + Field129 = other.Field129; + } + if (other.field130_.Count != 0) { + result.field130_.Add(other.field130_); + } + if (other.HasField205) { + Field205 = other.Field205; + } + if (other.HasField206) { + Field206 = other.Field206; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_speedMessage2FieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _speedMessage2FieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasField1 = input.ReadString(ref result.field1_); + break; + } + case 18: { + result.hasField2 = input.ReadBytes(ref result.field2_); + break; + } + case 24: { + result.hasField3 = input.ReadInt64(ref result.field3_); + break; + } + case 32: { + result.hasField4 = input.ReadInt64(ref result.field4_); + break; + } + case 50: { + result.hasField6 = input.ReadString(ref result.field6_); + break; + } + case 83: { + input.ReadGroupArray(tag, field_name, result.group1_, global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.DefaultInstance, extensionRegistry); + break; + } + case 168: { + result.hasField21 = input.ReadInt32(ref result.field21_); + break; + } + case 205: { + result.hasField25 = input.ReadFloat(ref result.field25_); + break; + } + case 240: { + result.hasField30 = input.ReadInt64(ref result.field30_); + break; + } + case 504: { + result.hasField63 = input.ReadInt32(ref result.field63_); + break; + } + case 568: { + result.hasField71 = input.ReadInt32(ref result.field71_); + break; + } + case 600: { + result.hasField75 = input.ReadBool(ref result.field75_); + break; + } + case 872: { + result.hasField109 = input.ReadInt32(ref result.field109_); + break; + } + case 1018: { + input.ReadStringArray(tag, field_name, result.field127_); + break; + } + case 1026: { + input.ReadStringArray(tag, field_name, result.field128_); + break; + } + case 1032: { + result.hasField129 = input.ReadInt32(ref result.field129_); + break; + } + case 1042: + case 1040: { + input.ReadInt64Array(tag, field_name, result.field130_); + break; + } + case 1048: { + result.hasField131 = input.ReadInt64(ref result.field131_); + break; + } + case 1640: { + result.hasField205 = input.ReadBool(ref result.field205_); + break; + } + case 1648: { + result.hasField206 = input.ReadBool(ref result.field206_); + break; + } + case 1680: { + result.hasField210 = input.ReadInt32(ref result.field210_); + break; + } + case 1688: { + result.hasField211 = input.ReadInt32(ref result.field211_); + break; + } + case 1696: { + result.hasField212 = input.ReadInt32(ref result.field212_); + break; + } + case 1704: { + result.hasField213 = input.ReadInt32(ref result.field213_); + break; + } + case 1728: { + result.hasField216 = input.ReadInt32(ref result.field216_); + break; + } + case 1736: { + result.hasField217 = input.ReadInt32(ref result.field217_); + break; + } + case 1744: { + result.hasField218 = input.ReadInt32(ref result.field218_); + break; + } + case 1760: { + result.hasField220 = input.ReadInt32(ref result.field220_); + break; + } + case 1768: { + result.hasField221 = input.ReadInt32(ref result.field221_); + break; + } + case 1781: { + result.hasField222 = input.ReadFloat(ref result.field222_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public string Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = ""; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public long Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(long value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0L; + return this; + } + + public bool HasField4 { + get { return result.hasField4; } + } + public long Field4 { + get { return result.Field4; } + set { SetField4(value); } + } + public Builder SetField4(long value) { + PrepareBuilder(); + result.hasField4 = true; + result.field4_ = value; + return this; + } + public Builder ClearField4() { + PrepareBuilder(); + result.hasField4 = false; + result.field4_ = 0L; + return this; + } + + public bool HasField30 { + get { return result.hasField30; } + } + public long Field30 { + get { return result.Field30; } + set { SetField30(value); } + } + public Builder SetField30(long value) { + PrepareBuilder(); + result.hasField30 = true; + result.field30_ = value; + return this; + } + public Builder ClearField30() { + PrepareBuilder(); + result.hasField30 = false; + result.field30_ = 0L; + return this; + } + + public bool HasField75 { + get { return result.hasField75; } + } + public bool Field75 { + get { return result.Field75; } + set { SetField75(value); } + } + public Builder SetField75(bool value) { + PrepareBuilder(); + result.hasField75 = true; + result.field75_ = value; + return this; + } + public Builder ClearField75() { + PrepareBuilder(); + result.hasField75 = false; + result.field75_ = false; + return this; + } + + public bool HasField6 { + get { return result.hasField6; } + } + public string Field6 { + get { return result.Field6; } + set { SetField6(value); } + } + public Builder SetField6(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField6 = true; + result.field6_ = value; + return this; + } + public Builder ClearField6() { + PrepareBuilder(); + result.hasField6 = false; + result.field6_ = ""; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public pb::ByteString Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = pb::ByteString.Empty; + return this; + } + + public bool HasField21 { + get { return result.hasField21; } + } + public int Field21 { + get { return result.Field21; } + set { SetField21(value); } + } + public Builder SetField21(int value) { + PrepareBuilder(); + result.hasField21 = true; + result.field21_ = value; + return this; + } + public Builder ClearField21() { + PrepareBuilder(); + result.hasField21 = false; + result.field21_ = 0; + return this; + } + + public bool HasField71 { + get { return result.hasField71; } + } + public int Field71 { + get { return result.Field71; } + set { SetField71(value); } + } + public Builder SetField71(int value) { + PrepareBuilder(); + result.hasField71 = true; + result.field71_ = value; + return this; + } + public Builder ClearField71() { + PrepareBuilder(); + result.hasField71 = false; + result.field71_ = 0; + return this; + } + + public bool HasField25 { + get { return result.hasField25; } + } + public float Field25 { + get { return result.Field25; } + set { SetField25(value); } + } + public Builder SetField25(float value) { + PrepareBuilder(); + result.hasField25 = true; + result.field25_ = value; + return this; + } + public Builder ClearField25() { + PrepareBuilder(); + result.hasField25 = false; + result.field25_ = 0F; + return this; + } + + public bool HasField109 { + get { return result.hasField109; } + } + public int Field109 { + get { return result.Field109; } + set { SetField109(value); } + } + public Builder SetField109(int value) { + PrepareBuilder(); + result.hasField109 = true; + result.field109_ = value; + return this; + } + public Builder ClearField109() { + PrepareBuilder(); + result.hasField109 = false; + result.field109_ = 0; + return this; + } + + public bool HasField210 { + get { return result.hasField210; } + } + public int Field210 { + get { return result.Field210; } + set { SetField210(value); } + } + public Builder SetField210(int value) { + PrepareBuilder(); + result.hasField210 = true; + result.field210_ = value; + return this; + } + public Builder ClearField210() { + PrepareBuilder(); + result.hasField210 = false; + result.field210_ = 0; + return this; + } + + public bool HasField211 { + get { return result.hasField211; } + } + public int Field211 { + get { return result.Field211; } + set { SetField211(value); } + } + public Builder SetField211(int value) { + PrepareBuilder(); + result.hasField211 = true; + result.field211_ = value; + return this; + } + public Builder ClearField211() { + PrepareBuilder(); + result.hasField211 = false; + result.field211_ = 0; + return this; + } + + public bool HasField212 { + get { return result.hasField212; } + } + public int Field212 { + get { return result.Field212; } + set { SetField212(value); } + } + public Builder SetField212(int value) { + PrepareBuilder(); + result.hasField212 = true; + result.field212_ = value; + return this; + } + public Builder ClearField212() { + PrepareBuilder(); + result.hasField212 = false; + result.field212_ = 0; + return this; + } + + public bool HasField213 { + get { return result.hasField213; } + } + public int Field213 { + get { return result.Field213; } + set { SetField213(value); } + } + public Builder SetField213(int value) { + PrepareBuilder(); + result.hasField213 = true; + result.field213_ = value; + return this; + } + public Builder ClearField213() { + PrepareBuilder(); + result.hasField213 = false; + result.field213_ = 0; + return this; + } + + public bool HasField216 { + get { return result.hasField216; } + } + public int Field216 { + get { return result.Field216; } + set { SetField216(value); } + } + public Builder SetField216(int value) { + PrepareBuilder(); + result.hasField216 = true; + result.field216_ = value; + return this; + } + public Builder ClearField216() { + PrepareBuilder(); + result.hasField216 = false; + result.field216_ = 0; + return this; + } + + public bool HasField217 { + get { return result.hasField217; } + } + public int Field217 { + get { return result.Field217; } + set { SetField217(value); } + } + public Builder SetField217(int value) { + PrepareBuilder(); + result.hasField217 = true; + result.field217_ = value; + return this; + } + public Builder ClearField217() { + PrepareBuilder(); + result.hasField217 = false; + result.field217_ = 0; + return this; + } + + public bool HasField218 { + get { return result.hasField218; } + } + public int Field218 { + get { return result.Field218; } + set { SetField218(value); } + } + public Builder SetField218(int value) { + PrepareBuilder(); + result.hasField218 = true; + result.field218_ = value; + return this; + } + public Builder ClearField218() { + PrepareBuilder(); + result.hasField218 = false; + result.field218_ = 0; + return this; + } + + public bool HasField220 { + get { return result.hasField220; } + } + public int Field220 { + get { return result.Field220; } + set { SetField220(value); } + } + public Builder SetField220(int value) { + PrepareBuilder(); + result.hasField220 = true; + result.field220_ = value; + return this; + } + public Builder ClearField220() { + PrepareBuilder(); + result.hasField220 = false; + result.field220_ = 0; + return this; + } + + public bool HasField221 { + get { return result.hasField221; } + } + public int Field221 { + get { return result.Field221; } + set { SetField221(value); } + } + public Builder SetField221(int value) { + PrepareBuilder(); + result.hasField221 = true; + result.field221_ = value; + return this; + } + public Builder ClearField221() { + PrepareBuilder(); + result.hasField221 = false; + result.field221_ = 0; + return this; + } + + public bool HasField222 { + get { return result.hasField222; } + } + public float Field222 { + get { return result.Field222; } + set { SetField222(value); } + } + public Builder SetField222(float value) { + PrepareBuilder(); + result.hasField222 = true; + result.field222_ = value; + return this; + } + public Builder ClearField222() { + PrepareBuilder(); + result.hasField222 = false; + result.field222_ = 0F; + return this; + } + + public bool HasField63 { + get { return result.hasField63; } + } + public int Field63 { + get { return result.Field63; } + set { SetField63(value); } + } + public Builder SetField63(int value) { + PrepareBuilder(); + result.hasField63 = true; + result.field63_ = value; + return this; + } + public Builder ClearField63() { + PrepareBuilder(); + result.hasField63 = false; + result.field63_ = 0; + return this; + } + + public pbc::IPopsicleList Group1List { + get { return PrepareBuilder().group1_; } + } + public int Group1Count { + get { return result.Group1Count; } + } + public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 GetGroup1(int index) { + return result.GetGroup1(index); + } + public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.group1_[index] = value; + return this; + } + public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.group1_[index] = builderForValue.Build(); + return this; + } + public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.group1_.Add(value); + return this; + } + public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.group1_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeGroup1(scg::IEnumerable values) { + PrepareBuilder(); + result.group1_.Add(values); + return this; + } + public Builder ClearGroup1() { + PrepareBuilder(); + result.group1_.Clear(); + return this; + } + + public pbc::IPopsicleList Field128List { + get { return PrepareBuilder().field128_; } + } + public int Field128Count { + get { return result.Field128Count; } + } + public string GetField128(int index) { + return result.GetField128(index); + } + public Builder SetField128(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field128_[index] = value; + return this; + } + public Builder AddField128(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field128_.Add(value); + return this; + } + public Builder AddRangeField128(scg::IEnumerable values) { + PrepareBuilder(); + result.field128_.Add(values); + return this; + } + public Builder ClearField128() { + PrepareBuilder(); + result.field128_.Clear(); + return this; + } + + public bool HasField131 { + get { return result.hasField131; } + } + public long Field131 { + get { return result.Field131; } + set { SetField131(value); } + } + public Builder SetField131(long value) { + PrepareBuilder(); + result.hasField131 = true; + result.field131_ = value; + return this; + } + public Builder ClearField131() { + PrepareBuilder(); + result.hasField131 = false; + result.field131_ = 0L; + return this; + } + + public pbc::IPopsicleList Field127List { + get { return PrepareBuilder().field127_; } + } + public int Field127Count { + get { return result.Field127Count; } + } + public string GetField127(int index) { + return result.GetField127(index); + } + public Builder SetField127(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field127_[index] = value; + return this; + } + public Builder AddField127(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field127_.Add(value); + return this; + } + public Builder AddRangeField127(scg::IEnumerable values) { + PrepareBuilder(); + result.field127_.Add(values); + return this; + } + public Builder ClearField127() { + PrepareBuilder(); + result.field127_.Clear(); + return this; + } + + public bool HasField129 { + get { return result.hasField129; } + } + public int Field129 { + get { return result.Field129; } + set { SetField129(value); } + } + public Builder SetField129(int value) { + PrepareBuilder(); + result.hasField129 = true; + result.field129_ = value; + return this; + } + public Builder ClearField129() { + PrepareBuilder(); + result.hasField129 = false; + result.field129_ = 0; + return this; + } + + public pbc::IPopsicleList Field130List { + get { return PrepareBuilder().field130_; } + } + public int Field130Count { + get { return result.Field130Count; } + } + public long GetField130(int index) { + return result.GetField130(index); + } + public Builder SetField130(int index, long value) { + PrepareBuilder(); + result.field130_[index] = value; + return this; + } + public Builder AddField130(long value) { + PrepareBuilder(); + result.field130_.Add(value); + return this; + } + public Builder AddRangeField130(scg::IEnumerable values) { + PrepareBuilder(); + result.field130_.Add(values); + return this; + } + public Builder ClearField130() { + PrepareBuilder(); + result.field130_.Clear(); + return this; + } + + public bool HasField205 { + get { return result.hasField205; } + } + public bool Field205 { + get { return result.Field205; } + set { SetField205(value); } + } + public Builder SetField205(bool value) { + PrepareBuilder(); + result.hasField205 = true; + result.field205_ = value; + return this; + } + public Builder ClearField205() { + PrepareBuilder(); + result.hasField205 = false; + result.field205_ = false; + return this; + } + + public bool HasField206 { + get { return result.hasField206; } + } + public bool Field206 { + get { return result.Field206; } + set { SetField206(value); } + } + public Builder SetField206(bool value) { + PrepareBuilder(); + result.hasField206 = true; + result.field206_ = value; + return this; + } + public Builder ClearField206() { + PrepareBuilder(); + result.hasField206 = false; + result.field206_ = false; + return this; + } + } + static SpeedMessage2() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SpeedMessage2GroupedMessage : pb::GeneratedMessage { + private SpeedMessage2GroupedMessage() { } + private static readonly SpeedMessage2GroupedMessage defaultInstance = new SpeedMessage2GroupedMessage().MakeReadOnly(); + private static readonly string[] _speedMessage2GroupedMessageFieldNames = new string[] { "field1", "field10", "field11", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9" }; + private static readonly uint[] _speedMessage2GroupedMessageFieldTags = new uint[] { 13, 85, 88, 21, 29, 32, 40, 48, 56, 69, 72 }; + public static SpeedMessage2GroupedMessage DefaultInstance { + get { return defaultInstance; } + } + + public override SpeedMessage2GroupedMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SpeedMessage2GroupedMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.internal__static_benchmarks_SpeedMessage2GroupedMessage__FieldAccessorTable; } + } + + public const int Field1FieldNumber = 1; + private bool hasField1; + private float field1_; + public bool HasField1 { + get { return hasField1; } + } + public float Field1 { + get { return field1_; } + } + + public const int Field2FieldNumber = 2; + private bool hasField2; + private float field2_; + public bool HasField2 { + get { return hasField2; } + } + public float Field2 { + get { return field2_; } + } + + public const int Field3FieldNumber = 3; + private bool hasField3; + private float field3_; + public bool HasField3 { + get { return hasField3; } + } + public float Field3 { + get { return field3_; } + } + + public const int Field4FieldNumber = 4; + private bool hasField4; + private bool field4_; + public bool HasField4 { + get { return hasField4; } + } + public bool Field4 { + get { return field4_; } + } + + public const int Field5FieldNumber = 5; + private bool hasField5; + private bool field5_; + public bool HasField5 { + get { return hasField5; } + } + public bool Field5 { + get { return field5_; } + } + + public const int Field6FieldNumber = 6; + private bool hasField6; + private bool field6_ = true; + public bool HasField6 { + get { return hasField6; } + } + public bool Field6 { + get { return field6_; } + } + + public const int Field7FieldNumber = 7; + private bool hasField7; + private bool field7_; + public bool HasField7 { + get { return hasField7; } + } + public bool Field7 { + get { return field7_; } + } + + public const int Field8FieldNumber = 8; + private bool hasField8; + private float field8_; + public bool HasField8 { + get { return hasField8; } + } + public float Field8 { + get { return field8_; } + } + + public const int Field9FieldNumber = 9; + private bool hasField9; + private bool field9_; + public bool HasField9 { + get { return hasField9; } + } + public bool Field9 { + get { return field9_; } + } + + public const int Field10FieldNumber = 10; + private bool hasField10; + private float field10_; + public bool HasField10 { + get { return hasField10; } + } + public float Field10 { + get { return field10_; } + } + + public const int Field11FieldNumber = 11; + private bool hasField11; + private long field11_; + public bool HasField11 { + get { return hasField11; } + } + public long Field11 { + get { return field11_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _speedMessage2GroupedMessageFieldNames; + if (hasField1) { + output.WriteFloat(1, field_names[0], Field1); + } + if (hasField2) { + output.WriteFloat(2, field_names[3], Field2); + } + if (hasField3) { + output.WriteFloat(3, field_names[4], Field3); + } + if (hasField4) { + output.WriteBool(4, field_names[5], Field4); + } + if (hasField5) { + output.WriteBool(5, field_names[6], Field5); + } + if (hasField6) { + output.WriteBool(6, field_names[7], Field6); + } + if (hasField7) { + output.WriteBool(7, field_names[8], Field7); + } + if (hasField8) { + output.WriteFloat(8, field_names[9], Field8); + } + if (hasField9) { + output.WriteBool(9, field_names[10], Field9); + } + if (hasField10) { + output.WriteFloat(10, field_names[1], Field10); + } + if (hasField11) { + output.WriteInt64(11, field_names[2], Field11); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasField1) { + size += pb::CodedOutputStream.ComputeFloatSize(1, Field1); + } + if (hasField2) { + size += pb::CodedOutputStream.ComputeFloatSize(2, Field2); + } + if (hasField3) { + size += pb::CodedOutputStream.ComputeFloatSize(3, Field3); + } + if (hasField4) { + size += pb::CodedOutputStream.ComputeBoolSize(4, Field4); + } + if (hasField5) { + size += pb::CodedOutputStream.ComputeBoolSize(5, Field5); + } + if (hasField6) { + size += pb::CodedOutputStream.ComputeBoolSize(6, Field6); + } + if (hasField7) { + size += pb::CodedOutputStream.ComputeBoolSize(7, Field7); + } + if (hasField8) { + size += pb::CodedOutputStream.ComputeFloatSize(8, Field8); + } + if (hasField9) { + size += pb::CodedOutputStream.ComputeBoolSize(9, Field9); + } + if (hasField10) { + size += pb::CodedOutputStream.ComputeFloatSize(10, Field10); + } + if (hasField11) { + size += pb::CodedOutputStream.ComputeInt64Size(11, Field11); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SpeedMessage2GroupedMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpeedMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SpeedMessage2GroupedMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SpeedMessage2GroupedMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SpeedMessage2GroupedMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SpeedMessage2GroupedMessage result; + + private SpeedMessage2GroupedMessage PrepareBuilder() { + if (resultIsReadOnly) { + SpeedMessage2GroupedMessage original = result; + result = new SpeedMessage2GroupedMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SpeedMessage2GroupedMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.Descriptor; } + } + + public override SpeedMessage2GroupedMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance; } + } + + public override SpeedMessage2GroupedMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SpeedMessage2GroupedMessage) { + return MergeFrom((SpeedMessage2GroupedMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SpeedMessage2GroupedMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasField1) { + Field1 = other.Field1; + } + if (other.HasField2) { + Field2 = other.Field2; + } + if (other.HasField3) { + Field3 = other.Field3; + } + if (other.HasField4) { + Field4 = other.Field4; + } + if (other.HasField5) { + Field5 = other.Field5; + } + if (other.HasField6) { + Field6 = other.Field6; + } + if (other.HasField7) { + Field7 = other.Field7; + } + if (other.HasField8) { + Field8 = other.Field8; + } + if (other.HasField9) { + Field9 = other.Field9; + } + if (other.HasField10) { + Field10 = other.Field10; + } + if (other.HasField11) { + Field11 = other.Field11; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_speedMessage2GroupedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _speedMessage2GroupedMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasField1 = input.ReadFloat(ref result.field1_); + break; + } + case 21: { + result.hasField2 = input.ReadFloat(ref result.field2_); + break; + } + case 29: { + result.hasField3 = input.ReadFloat(ref result.field3_); + break; + } + case 32: { + result.hasField4 = input.ReadBool(ref result.field4_); + break; + } + case 40: { + result.hasField5 = input.ReadBool(ref result.field5_); + break; + } + case 48: { + result.hasField6 = input.ReadBool(ref result.field6_); + break; + } + case 56: { + result.hasField7 = input.ReadBool(ref result.field7_); + break; + } + case 69: { + result.hasField8 = input.ReadFloat(ref result.field8_); + break; + } + case 72: { + result.hasField9 = input.ReadBool(ref result.field9_); + break; + } + case 85: { + result.hasField10 = input.ReadFloat(ref result.field10_); + break; + } + case 88: { + result.hasField11 = input.ReadInt64(ref result.field11_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasField1 { + get { return result.hasField1; } + } + public float Field1 { + get { return result.Field1; } + set { SetField1(value); } + } + public Builder SetField1(float value) { + PrepareBuilder(); + result.hasField1 = true; + result.field1_ = value; + return this; + } + public Builder ClearField1() { + PrepareBuilder(); + result.hasField1 = false; + result.field1_ = 0F; + return this; + } + + public bool HasField2 { + get { return result.hasField2; } + } + public float Field2 { + get { return result.Field2; } + set { SetField2(value); } + } + public Builder SetField2(float value) { + PrepareBuilder(); + result.hasField2 = true; + result.field2_ = value; + return this; + } + public Builder ClearField2() { + PrepareBuilder(); + result.hasField2 = false; + result.field2_ = 0F; + return this; + } + + public bool HasField3 { + get { return result.hasField3; } + } + public float Field3 { + get { return result.Field3; } + set { SetField3(value); } + } + public Builder SetField3(float value) { + PrepareBuilder(); + result.hasField3 = true; + result.field3_ = value; + return this; + } + public Builder ClearField3() { + PrepareBuilder(); + result.hasField3 = false; + result.field3_ = 0F; + return this; + } + + public bool HasField4 { + get { return result.hasField4; } + } + public bool Field4 { + get { return result.Field4; } + set { SetField4(value); } + } + public Builder SetField4(bool value) { + PrepareBuilder(); + result.hasField4 = true; + result.field4_ = value; + return this; + } + public Builder ClearField4() { + PrepareBuilder(); + result.hasField4 = false; + result.field4_ = false; + return this; + } + + public bool HasField5 { + get { return result.hasField5; } + } + public bool Field5 { + get { return result.Field5; } + set { SetField5(value); } + } + public Builder SetField5(bool value) { + PrepareBuilder(); + result.hasField5 = true; + result.field5_ = value; + return this; + } + public Builder ClearField5() { + PrepareBuilder(); + result.hasField5 = false; + result.field5_ = false; + return this; + } + + public bool HasField6 { + get { return result.hasField6; } + } + public bool Field6 { + get { return result.Field6; } + set { SetField6(value); } + } + public Builder SetField6(bool value) { + PrepareBuilder(); + result.hasField6 = true; + result.field6_ = value; + return this; + } + public Builder ClearField6() { + PrepareBuilder(); + result.hasField6 = false; + result.field6_ = true; + return this; + } + + public bool HasField7 { + get { return result.hasField7; } + } + public bool Field7 { + get { return result.Field7; } + set { SetField7(value); } + } + public Builder SetField7(bool value) { + PrepareBuilder(); + result.hasField7 = true; + result.field7_ = value; + return this; + } + public Builder ClearField7() { + PrepareBuilder(); + result.hasField7 = false; + result.field7_ = false; + return this; + } + + public bool HasField8 { + get { return result.hasField8; } + } + public float Field8 { + get { return result.Field8; } + set { SetField8(value); } + } + public Builder SetField8(float value) { + PrepareBuilder(); + result.hasField8 = true; + result.field8_ = value; + return this; + } + public Builder ClearField8() { + PrepareBuilder(); + result.hasField8 = false; + result.field8_ = 0F; + return this; + } + + public bool HasField9 { + get { return result.hasField9; } + } + public bool Field9 { + get { return result.Field9; } + set { SetField9(value); } + } + public Builder SetField9(bool value) { + PrepareBuilder(); + result.hasField9 = true; + result.field9_ = value; + return this; + } + public Builder ClearField9() { + PrepareBuilder(); + result.hasField9 = false; + result.field9_ = false; + return this; + } + + public bool HasField10 { + get { return result.hasField10; } + } + public float Field10 { + get { return result.Field10; } + set { SetField10(value); } + } + public Builder SetField10(float value) { + PrepareBuilder(); + result.hasField10 = true; + result.field10_ = value; + return this; + } + public Builder ClearField10() { + PrepareBuilder(); + result.hasField10 = false; + result.field10_ = 0F; + return this; + } + + public bool HasField11 { + get { return result.hasField11; } + } + public long Field11 { + get { return result.Field11; } + set { SetField11(value); } + } + public Builder SetField11(long value) { + PrepareBuilder(); + result.hasField11 = true; + result.field11_ = value; + return this; + } + public Builder ClearField11() { + PrepareBuilder(); + result.hasField11 = false; + result.field11_ = 0L; + return this; + } + } + static SpeedMessage2GroupedMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.GoogleSpeed.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/ProtoBench/Properties/AssemblyInfo.cs b/csharp/src/ProtoBench/Properties/AssemblyInfo.cs index 8600c13e..cdffc5e7 100644 --- a/csharp/src/ProtoBench/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtoBench/Properties/AssemblyInfo.cs @@ -15,7 +15,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: CLSCompliant(true)] // Version information for an assembly consists of the following four values: // diff --git a/csharp/src/ProtoBench/ProtoBench.csproj b/csharp/src/ProtoBench/ProtoBench.csproj index 9df47745..280a54a9 100644 --- a/csharp/src/ProtoBench/ProtoBench.csproj +++ b/csharp/src/ProtoBench/ProtoBench.csproj @@ -1,8 +1,6 @@  - CLIENTPROFILE - NET35 Debug AnyCPU 9.0.30729 @@ -12,15 +10,16 @@ Properties Google.ProtocolBuffers.ProtoBench ProtoBench - v3.5 + v4.0 512 + Client true full false - bin\NET35\Debug - obj\NET35\Debug\ + bin\Debug + obj\Debug\ DEBUG;TRACE prompt 4 @@ -31,8 +30,8 @@ pdbonly true - bin\NET35\Release - obj\NET35\Release\ + bin\Release + obj\Release\ TRACE prompt 4 @@ -45,17 +44,16 @@ - - + + - - - - + + + @@ -70,6 +68,7 @@ + Always @@ -77,6 +76,9 @@ Always + + + - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF35.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF35.csproj deleted file mode 100644 index 0c6344ed..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF35.csproj +++ /dev/null @@ -1,191 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET20.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET20.csproj deleted file mode 100644 index f0453fa1..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET20.csproj +++ /dev/null @@ -1,178 +0,0 @@ - - - CLIENTPROFILE - NET20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET35.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET35.csproj deleted file mode 100644 index 33630b44..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET35.csproj +++ /dev/null @@ -1,179 +0,0 @@ - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET40.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET40.csproj deleted file mode 100644 index 74ea7211..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET40.csproj +++ /dev/null @@ -1,179 +0,0 @@ - - - CLIENTPROFILE - NET40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.PL40.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.PL40.csproj deleted file mode 100644 index 018cf9d6..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.PL40.csproj +++ /dev/null @@ -1,213 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - - false - false - true - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v4.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL20.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL20.csproj deleted file mode 100644 index e54fa25c..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL20.csproj +++ /dev/null @@ -1,214 +0,0 @@ - - - SILVERLIGHT - SL20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v2.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL30.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL30.csproj deleted file mode 100644 index 76f6b1a2..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL30.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - SILVERLIGHT - SL30 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v3.5 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL40.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL40.csproj deleted file mode 100644 index ade3dc35..00000000 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL40.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - SILVERLIGHT - SL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - v4.0 - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index 5702c011..8d900266 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -13,18 +13,19 @@ Properties Google.ProtocolBuffers Google.ProtocolBuffers.Test - v3.5 + v4.0 512 true ..\..\keys\Google.ProtocolBuffers.snk 3.5 + Client true full false - bin\NET35\Debug - obj\NET35\Debug\ + bin\Debug + obj\Debug\ DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 @@ -35,8 +36,8 @@ pdbonly true - bin\NET35\Release - obj\NET35\Release\ + bin\Release + obj\Release\ TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 diff --git a/csharp/src/ProtocolBuffers.sln b/csharp/src/ProtocolBuffers.sln index 5eb488cf..6d609dc9 100644 --- a/csharp/src/ProtocolBuffers.sln +++ b/csharp/src/ProtocolBuffers.sln @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoDump", "ProtoDump\Prot EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoMunge", "ProtoMunge\ProtoMunge.csproj", "{8F09AF72-3327-4FA7-BC09-070B80221AB9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoBench", "ProtoBench\ProtoBench.csproj", "{C7A4A435-2813-41C8-AA87-BD914BA5223D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -68,6 +70,10 @@ Global {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU + {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/csharp/src/ProtocolBuffers/FieldSet.cs b/csharp/src/ProtocolBuffers/FieldSet.cs index f3c08cf5..4177400f 100644 --- a/csharp/src/ProtocolBuffers/FieldSet.cs +++ b/csharp/src/ProtocolBuffers/FieldSet.cs @@ -88,7 +88,7 @@ namespace Google.ProtocolBuffers public static FieldSet CreateInstance() { // Use SortedList to keep fields in the canonical order - return new FieldSet(new SortedList()); + return new FieldSet(new SortedDictionary()); } /// @@ -111,7 +111,7 @@ namespace Google.ProtocolBuffers if (hasRepeats) { - var tmp = new SortedList(); + var tmp = new SortedDictionary(); foreach (KeyValuePair entry in fields) { IList list = entry.Value as IList; @@ -151,8 +151,8 @@ namespace Google.ProtocolBuffers { get { - SortedList copy = - new SortedList(); + SortedDictionary copy = + new SortedDictionary(); foreach (KeyValuePair fd in fields) { copy.Add((FieldDescriptor) fd.Key, fd.Value); diff --git a/csharp/src/ProtocolBuffers/GeneratedMessage.cs b/csharp/src/ProtocolBuffers/GeneratedMessage.cs index 6f4b6657..c17c15cf 100644 --- a/csharp/src/ProtocolBuffers/GeneratedMessage.cs +++ b/csharp/src/ProtocolBuffers/GeneratedMessage.cs @@ -75,8 +75,8 @@ namespace Google.ProtocolBuffers internal IDictionary GetMutableFieldMap() { - // Use a SortedList so we'll end up serializing fields in order - var ret = new SortedList(); + // Use a SortedDictionary so we'll end up serializing fields in order + var ret = new SortedDictionary(); MessageDescriptor descriptor = DescriptorForType; foreach (FieldDescriptor field in descriptor.Fields) { diff --git a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs index 063f6666..806bd5d5 100644 --- a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs +++ b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs @@ -65,6 +65,3 @@ using System.Security; [assembly: AssemblyFileVersion("2.4.1.555")] #endif -#if CLIENTPROFILE // ROK - not defined in SL, CF, or PL -[assembly: AllowPartiallyTrustedCallers] -#endif diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj index 5f6404a2..32a343ad 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -1,8 +1,6 @@  - CLIENTPROFILE - NET35 Debug AnyCPU 9.0.30729 @@ -12,18 +10,21 @@ Properties Google.ProtocolBuffers Google.ProtocolBuffers - v3.5 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile92 + v4.0 512 true ..\..\keys\Google.ProtocolBuffers.snk 3.5 + 10.0 true full false - bin\NET35\Debug - obj\NET35\Debug\ + bin\Debug + obj\Debug\ $(OutputPath)\$(AssemblyName).xml 1591, 1570, 1571, 1572, 1573, 1574 DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) @@ -35,8 +36,8 @@ pdbonly true - bin\NET35\Release - obj\NET35\Release\ + bin\Release + obj\Release\ $(OutputPath)\$(AssemblyName).xml 1591, 1570, 1571, 1572, 1573, 1574 TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) @@ -137,7 +138,7 @@ - + - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF35.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF35.csproj deleted file mode 100644 index 74edad11..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF35.csproj +++ /dev/null @@ -1,134 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET20.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET20.csproj deleted file mode 100644 index 59f9375f..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET20.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - CLIENTPROFILE - NET20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET35.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET35.csproj deleted file mode 100644 index e4ebfe1b..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET35.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET40.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET40.csproj deleted file mode 100644 index d02ac774..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET40.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - CLIENTPROFILE - NET40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.PL40.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.PL40.csproj deleted file mode 100644 index b645a01e..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.PL40.csproj +++ /dev/null @@ -1,156 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - - false - false - true - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v4.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL20.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL20.csproj deleted file mode 100644 index b4ad946f..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL20.csproj +++ /dev/null @@ -1,157 +0,0 @@ - - - SILVERLIGHT - SL20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v2.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL30.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL30.csproj deleted file mode 100644 index b5870ede..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL30.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - SILVERLIGHT - SL30 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v3.5 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL40.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL40.csproj deleted file mode 100644 index ef1543ec..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL40.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - SILVERLIGHT - SL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - v4.0 - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj index 7701543c..12315442 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj @@ -13,18 +13,19 @@ Properties Google.ProtocolBuffers Google.ProtocolBuffersLite.Test - v3.5 + v4.0 512 true ..\..\keys\Google.ProtocolBuffers.snk 3.5 + Client true full false - bin\NET35\Debug - obj\NET35\Debug\ + bin\Debug + obj\Debug\ DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 @@ -35,8 +36,8 @@ pdbonly true - bin\NET35\Release - obj\NET35\Release\ + bin\Release + obj\Release\ TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF20.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF20.csproj deleted file mode 100644 index 0ed3b36d..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF20.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF35.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF35.csproj deleted file mode 100644 index 50d4e643..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF35.csproj +++ /dev/null @@ -1,127 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET20.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET20.csproj deleted file mode 100644 index 80593a4d..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET20.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - CLIENTPROFILE - NET20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET35.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET35.csproj deleted file mode 100644 index e8b6d095..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET35.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET40.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET40.csproj deleted file mode 100644 index 16ffefd6..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET40.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - CLIENTPROFILE - NET40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.PL40.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.PL40.csproj deleted file mode 100644 index 3d1a77b5..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.PL40.csproj +++ /dev/null @@ -1,149 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - - false - false - true - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v4.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL20.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL20.csproj deleted file mode 100644 index 22b2c272..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL20.csproj +++ /dev/null @@ -1,150 +0,0 @@ - - - SILVERLIGHT - SL20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v2.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL30.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL30.csproj deleted file mode 100644 index 3627b765..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL30.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - SILVERLIGHT - SL30 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v3.5 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL40.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL40.csproj deleted file mode 100644 index a98c4d38..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL40.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - SILVERLIGHT - SL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - v4.0 - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj index 44b9a290..f7772f39 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj @@ -13,18 +13,19 @@ Properties Google.ProtocolBuffers Google.ProtocolBuffersMixedLite.Test - v3.5 + v4.0 512 true ..\..\keys\Google.ProtocolBuffers.snk 3.5 + Client true full false - bin\NET35\Debug - obj\NET35\Debug\ + bin\Debug + obj\Debug\ DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 @@ -35,8 +36,8 @@ pdbonly true - bin\NET35\Release - obj\NET35\Release\ + bin\Release + obj\Release\ TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 -- cgit v1.2.3 From 4af18b87117ab463042f90e9d3c00c1bb776bcf7 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Wed, 29 Apr 2015 14:20:23 -0700 Subject: rename FieldPResenceTest.cs file --- .../src/ProtocolBuffers.Test/FieldPResenceTest.cs | 187 --------------------- .../src/ProtocolBuffers.Test/FieldPresenceTest.cs | 187 +++++++++++++++++++++ 2 files changed, 187 insertions(+), 187 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs create mode 100644 csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs b/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs deleted file mode 100644 index a4818b63..00000000 --- a/csharp/src/ProtocolBuffers.Test/FieldPResenceTest.cs +++ /dev/null @@ -1,187 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// Author: jieluo@google.com (Jie Luo) -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Reflection; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - class FieldPresenceTest - { - private void CheckHasMethodRemoved(Type proto2Type, Type proto3Type, string name) - { - Assert.NotNull(proto2Type.GetProperty(name)); - Assert.NotNull(proto2Type.GetProperty("Has" + name)); - Assert.NotNull(proto3Type.GetProperty(name)); - Assert.Null(proto3Type.GetProperty("Has" + name)); - } - - [TestMethod] - public void TestHasMethod() - { - // Optional non-message fields don't have HasFoo method generated - Type proto2Type = typeof(TestAllTypes); - Type proto3Type = typeof(FieldPresence.TestAllTypes); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); - - proto2Type = typeof(TestAllTypes.Builder); - proto3Type = typeof(FieldPresence.TestAllTypes.Builder); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); - CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); - - // message fields still have the HasFoo method generated - Assert.False(FieldPresence.TestAllTypes.CreateBuilder().Build().HasOptionalNestedMessage); - Assert.False(FieldPresence.TestAllTypes.CreateBuilder().HasOptionalNestedMessage); - } - - [TestMethod] - public void TestFieldPresence() - { - // Optional non-message fields set to their default value are treated the same - // way as not set. - - // Serialization will ignore such fields. - FieldPresence.TestAllTypes.Builder builder = FieldPresence.TestAllTypes.CreateBuilder(); - builder.SetOptionalInt32(0); - builder.SetOptionalString(""); - builder.SetOptionalBytes(ByteString.Empty); - builder.SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.FOO); - FieldPresence.TestAllTypes message = builder.Build(); - Assert.AreEqual(0, message.SerializedSize); - - // Test merge - FieldPresence.TestAllTypes.Builder a = FieldPresence.TestAllTypes.CreateBuilder(); - a.SetOptionalInt32(1); - a.SetOptionalString("x"); - a.SetOptionalBytes(ByteString.CopyFromUtf8("y")); - a.SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.BAR); - a.MergeFrom(message); - FieldPresence.TestAllTypes messageA = a.Build(); - Assert.AreEqual(1, messageA.OptionalInt32); - Assert.AreEqual("x", messageA.OptionalString); - Assert.AreEqual(ByteString.CopyFromUtf8("y"), messageA.OptionalBytes); - Assert.AreEqual(FieldPresence.TestAllTypes.Types.NestedEnum.BAR, messageA.OptionalNestedEnum); - - // equals/hashCode should produce the same results - FieldPresence.TestAllTypes empty = FieldPresence.TestAllTypes.CreateBuilder().Build(); - Assert.True(empty.Equals(message)); - Assert.True(message.Equals(empty)); - Assert.AreEqual(empty.GetHashCode(), message.GetHashCode()); - } - - [TestMethod] - public void TestFieldPresenceReflection() - { - MessageDescriptor descriptor = FieldPresence.TestAllTypes.Descriptor; - FieldDescriptor optionalInt32Field = descriptor.FindFieldByName("optional_int32"); - FieldDescriptor optionalStringField = descriptor.FindFieldByName("optional_string"); - FieldDescriptor optionalBytesField = descriptor.FindFieldByName("optional_bytes"); - FieldDescriptor optionalNestedEnumField = descriptor.FindFieldByName("optional_nested_enum"); - - FieldPresence.TestAllTypes message = FieldPresence.TestAllTypes.CreateBuilder().Build(); - Assert.False(message.HasField(optionalInt32Field)); - Assert.False(message.HasField(optionalStringField)); - Assert.False(message.HasField(optionalBytesField)); - Assert.False(message.HasField(optionalNestedEnumField)); - - // Set to default value is seen as not present - message = FieldPresence.TestAllTypes.CreateBuilder() - .SetOptionalInt32(0) - .SetOptionalString("") - .SetOptionalBytes(ByteString.Empty) - .SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.FOO) - .Build(); - Assert.False(message.HasField(optionalInt32Field)); - Assert.False(message.HasField(optionalStringField)); - Assert.False(message.HasField(optionalBytesField)); - Assert.False(message.HasField(optionalNestedEnumField)); - Assert.AreEqual(0, message.AllFields.Count); - - // Set t0 non-defalut value is seen as present - message = FieldPresence.TestAllTypes.CreateBuilder() - .SetOptionalInt32(1) - .SetOptionalString("x") - .SetOptionalBytes(ByteString.CopyFromUtf8("y")) - .SetOptionalNestedEnum(FieldPresence.TestAllTypes.Types.NestedEnum.BAR) - .Build(); - Assert.True(message.HasField(optionalInt32Field)); - Assert.True(message.HasField(optionalStringField)); - Assert.True(message.HasField(optionalBytesField)); - Assert.True(message.HasField(optionalNestedEnumField)); - Assert.AreEqual(4, message.AllFields.Count); - } - - [TestMethod] - public void TestMessageField() - { - FieldPresence.TestAllTypes.Builder builder = FieldPresence.TestAllTypes.CreateBuilder(); - Assert.False(builder.HasOptionalNestedMessage); - Assert.False(builder.Build().HasOptionalNestedMessage); - - // Unlike non-message fields, if we set default value to message field, the field - // shoule be seem as present. - builder.SetOptionalNestedMessage(FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance); - Assert.True(builder.HasOptionalNestedMessage); - Assert.True(builder.Build().HasOptionalNestedMessage); - - } - - [TestMethod] - public void TestSeralizeAndParese() - { - FieldPresence.TestAllTypes.Builder builder = FieldPresence.TestAllTypes.CreateBuilder(); - builder.SetOptionalInt32(1234); - builder.SetOptionalString("hello"); - builder.SetOptionalNestedMessage(FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance); - ByteString data = builder.Build().ToByteString(); - - FieldPresence.TestAllTypes message = FieldPresence.TestAllTypes.ParseFrom(data); - Assert.AreEqual(1234, message.OptionalInt32); - Assert.AreEqual("hello", message.OptionalString); - Assert.AreEqual(ByteString.Empty, message.OptionalBytes); - Assert.AreEqual(FieldPresence.TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); - Assert.True(message.HasOptionalNestedMessage); - Assert.AreEqual(0, message.OptionalNestedMessage.Value); - } - } -} diff --git a/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs b/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs new file mode 100644 index 00000000..c08b40b2 --- /dev/null +++ b/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs @@ -0,0 +1,187 @@ +#region Copyright notice and license + +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// Author: jieluo@google.com (Jie Luo) +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Reflection; +using System.Collections.Generic; +using Google.ProtocolBuffers.Descriptors; +using Google.ProtocolBuffers.TestProtos.FieldPresence; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Google.ProtocolBuffers +{ + [TestClass] + class FieldPresenceTest + { + private void CheckHasMethodRemoved(Type proto2Type, Type proto3Type, string name) + { + Assert.NotNull(proto2Type.GetProperty(name)); + Assert.NotNull(proto2Type.GetProperty("Has" + name)); + Assert.NotNull(proto3Type.GetProperty(name)); + Assert.Null(proto3Type.GetProperty("Has" + name)); + } + + [TestMethod] + public void TestHasMethod() + { + // Optional non-message fields don't have HasFoo method generated + Type proto2Type = typeof(Google.ProtocolBuffers.TestProtos.TestAllTypes); + Type proto3Type = typeof(TestAllTypes); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); + + proto2Type = typeof(Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder); + proto3Type = typeof(TestAllTypes.Builder); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalInt32"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalString"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalBytes"); + CheckHasMethodRemoved(proto2Type, proto3Type, "OptionalNestedEnum"); + + // message fields still have the HasFoo method generated + Assert.False(TestAllTypes.CreateBuilder().Build().HasOptionalNestedMessage); + Assert.False(TestAllTypes.CreateBuilder().HasOptionalNestedMessage); + } + + [TestMethod] + public void TestFieldPresence() + { + // Optional non-message fields set to their default value are treated the same + // way as not set. + + // Serialization will ignore such fields. + TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); + builder.SetOptionalInt32(0); + builder.SetOptionalString(""); + builder.SetOptionalBytes(ByteString.Empty); + builder.SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.FOO); + TestAllTypes message = builder.Build(); + Assert.AreEqual(0, message.SerializedSize); + + // Test merge + TestAllTypes.Builder a = TestAllTypes.CreateBuilder(); + a.SetOptionalInt32(1); + a.SetOptionalString("x"); + a.SetOptionalBytes(ByteString.CopyFromUtf8("y")); + a.SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.BAR); + a.MergeFrom(message); + TestAllTypes messageA = a.Build(); + Assert.AreEqual(1, messageA.OptionalInt32); + Assert.AreEqual("x", messageA.OptionalString); + Assert.AreEqual(ByteString.CopyFromUtf8("y"), messageA.OptionalBytes); + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, messageA.OptionalNestedEnum); + + // equals/hashCode should produce the same results + TestAllTypes empty = TestAllTypes.CreateBuilder().Build(); + Assert.True(empty.Equals(message)); + Assert.True(message.Equals(empty)); + Assert.AreEqual(empty.GetHashCode(), message.GetHashCode()); + } + + [TestMethod] + public void TestFieldPresenceReflection() + { + MessageDescriptor descriptor = TestAllTypes.Descriptor; + FieldDescriptor optionalInt32Field = descriptor.FindFieldByName("optional_int32"); + FieldDescriptor optionalStringField = descriptor.FindFieldByName("optional_string"); + FieldDescriptor optionalBytesField = descriptor.FindFieldByName("optional_bytes"); + FieldDescriptor optionalNestedEnumField = descriptor.FindFieldByName("optional_nested_enum"); + + TestAllTypes message = TestAllTypes.CreateBuilder().Build(); + Assert.False(message.HasField(optionalInt32Field)); + Assert.False(message.HasField(optionalStringField)); + Assert.False(message.HasField(optionalBytesField)); + Assert.False(message.HasField(optionalNestedEnumField)); + + // Set to default value is seen as not present + message = TestAllTypes.CreateBuilder() + .SetOptionalInt32(0) + .SetOptionalString("") + .SetOptionalBytes(ByteString.Empty) + .SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.FOO) + .Build(); + Assert.False(message.HasField(optionalInt32Field)); + Assert.False(message.HasField(optionalStringField)); + Assert.False(message.HasField(optionalBytesField)); + Assert.False(message.HasField(optionalNestedEnumField)); + Assert.AreEqual(0, message.AllFields.Count); + + // Set t0 non-defalut value is seen as present + message = TestAllTypes.CreateBuilder() + .SetOptionalInt32(1) + .SetOptionalString("x") + .SetOptionalBytes(ByteString.CopyFromUtf8("y")) + .SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.BAR) + .Build(); + Assert.True(message.HasField(optionalInt32Field)); + Assert.True(message.HasField(optionalStringField)); + Assert.True(message.HasField(optionalBytesField)); + Assert.True(message.HasField(optionalNestedEnumField)); + Assert.AreEqual(4, message.AllFields.Count); + } + + [TestMethod] + public void TestMessageField() + { + TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); + Assert.False(builder.HasOptionalNestedMessage); + Assert.False(builder.Build().HasOptionalNestedMessage); + + // Unlike non-message fields, if we set default value to message field, the field + // shoule be seem as present. + builder.SetOptionalNestedMessage(TestAllTypes.Types.NestedMessage.DefaultInstance); + Assert.True(builder.HasOptionalNestedMessage); + Assert.True(builder.Build().HasOptionalNestedMessage); + + } + + [TestMethod] + public void TestSeralizeAndParese() + { + TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); + builder.SetOptionalInt32(1234); + builder.SetOptionalString("hello"); + builder.SetOptionalNestedMessage(TestAllTypes.Types.NestedMessage.DefaultInstance); + ByteString data = builder.Build().ToByteString(); + + TestAllTypes message = TestAllTypes.ParseFrom(data); + Assert.AreEqual(1234, message.OptionalInt32); + Assert.AreEqual("hello", message.OptionalString); + Assert.AreEqual(ByteString.Empty, message.OptionalBytes); + Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); + Assert.True(message.HasOptionalNestedMessage); + Assert.AreEqual(0, message.OptionalNestedMessage.Value); + } + } +} -- cgit v1.2.3 From c56475088d2d36d29a2640f35b9a8621796c051c Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 30 Apr 2015 11:05:36 +0100 Subject: Change to using xUnit for all unit tests, and fetch that via NuGet. This includes fetching the VS unit test runner package, so that tests can be run from Visual Studio's Test Explorer. --- .gitignore | 3 + .../Microsoft.VisualStudio.TestTools.cs | 54 - csharp/lib/NUnit-config/nunit-console.v2.0.config | 18 - csharp/lib/NUnit-config/nunit-console.v3.5.config | 18 - csharp/lib/NUnit-config/nunit-console.v4.0.config | 18 - .../ProtocolBuffers.Test/AbstractMessageTest.cs | 81 +- csharp/src/ProtocolBuffers.Test/ByteStringTest.cs | 77 +- .../ProtocolBuffers.Test/CodedInputStreamTest.cs | 272 +-- .../ProtocolBuffers.Test/CodedOutputStreamTest.cs | 223 ++- .../Collections/PopsicleListTest.cs | 84 +- .../Compatibility/BinaryCompatibilityTests.cs | 2 - .../Compatibility/CompatibilityTests.cs | 58 +- .../Compatibility/DictionaryCompatibilityTests.cs | 7 +- .../Compatibility/JsonCompatibilityTests.cs | 4 - .../Compatibility/TestResources.cs | 16 +- .../Compatibility/TextCompatibilityTests.cs | 8 +- .../Compatibility/XmlCompatibilityTests.cs | 4 - .../ProtocolBuffers.Test/DeprecatedMemberTest.cs | 21 +- csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs | 264 ++- .../src/ProtocolBuffers.Test/DynamicMessageTest.cs | 62 +- .../ProtocolBuffers.Test/ExtendableMessageTest.cs | 136 +- .../ProtocolBuffers.Test/GeneratedBuilderTest.cs | 85 +- .../ProtocolBuffers.Test/GeneratedMessageTest.cs | 234 ++- csharp/src/ProtocolBuffers.Test/IssuesTest.cs | 13 +- .../MessageStreamIteratorTest.cs | 17 +- .../MessageStreamWriterTest.cs | 5 +- csharp/src/ProtocolBuffers.Test/MessageTest.cs | 219 +-- csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs | 31 +- csharp/src/ProtocolBuffers.Test/NameHelpersTest.cs | 49 +- .../ProtocolBuffers.Test.csproj | 72 +- .../src/ProtocolBuffers.Test/ReflectionTester.cs | 958 +++++----- .../ProtocolBuffers.Test/ReusableBuilderTest.cs | 101 +- csharp/src/ProtocolBuffers.Test/TestCornerCases.cs | 16 +- .../ProtocolBuffers.Test/TestMimeMessageFormats.cs | 120 +- .../TestReaderForUrlEncoded.cs | 55 +- csharp/src/ProtocolBuffers.Test/TestUtil.cs | 1960 ++++++++++---------- .../ProtocolBuffers.Test/TestWriterFormatJson.cs | 146 +- .../ProtocolBuffers.Test/TestWriterFormatXml.cs | 129 +- csharp/src/ProtocolBuffers.Test/TextFormatTest.cs | 240 ++- .../ProtocolBuffers.Test/UnknownFieldSetTest.cs | 130 +- csharp/src/ProtocolBuffers.Test/WireFormatTest.cs | 75 +- csharp/src/ProtocolBuffers.Test/packages.config | 9 + .../AbstractBuilderLiteTest.cs | 128 +- .../AbstractMessageLiteTest.cs | 45 +- .../ExtendableBuilderLiteTest.cs | 127 +- .../ExtendableMessageLiteTest.cs | 217 ++- .../ProtocolBuffersLite.Test/InteropLiteTest.cs | 41 +- csharp/src/ProtocolBuffersLite.Test/LiteTest.cs | 31 +- .../MissingFieldAndExtensionTest.cs | 139 +- .../ProtocolBuffersLite.Test.csproj | 52 +- .../ProtocolBuffersLiteMixed.Test.csproj | 52 +- .../src/ProtocolBuffersLite.Test/TestLiteByApi.cs | 51 +- csharp/src/ProtocolBuffersLite.Test/TestUtil.cs | 31 - .../src/ProtocolBuffersLite.Test/packages.config | 9 + csharp/src/packages/repositories.config | 5 + 55 files changed, 3278 insertions(+), 3744 deletions(-) delete mode 100644 csharp/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs delete mode 100644 csharp/lib/NUnit-config/nunit-console.v2.0.config delete mode 100644 csharp/lib/NUnit-config/nunit-console.v3.5.config delete mode 100644 csharp/lib/NUnit-config/nunit-console.v4.0.config create mode 100644 csharp/src/ProtocolBuffers.Test/packages.config delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestUtil.cs create mode 100644 csharp/src/ProtocolBuffersLite.Test/packages.config create mode 100644 csharp/src/packages/repositories.config (limited to 'csharp/src') diff --git a/.gitignore b/.gitignore index 220e5c38..c21c20cf 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,6 @@ javanano/target vsprojects/Debug vsprojects/Release +# NuGet packages: we want the repository configuration, but not the +# packages themselves. +/csharp/src/packages/*/ diff --git a/csharp/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs b/csharp/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs deleted file mode 100644 index fd151dae..00000000 --- a/csharp/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs +++ /dev/null @@ -1,54 +0,0 @@ - -using System; -#if CLIENTPROFILE -namespace Microsoft.VisualStudio.TestTools.UnitTesting -{ - [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] - public sealed class TestClassAttribute : NUnit.Framework.TestFixtureAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class TestMethodAttribute : NUnit.Framework.TestAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class TestInitializeAttribute : NUnit.Framework.SetUpAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class IgnoreAttribute : NUnit.Framework.IgnoreAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class ExpectedExceptionAttribute : NUnit.Framework.ExpectedExceptionAttribute - { - public ExpectedExceptionAttribute(Type type) : base(type) - { } - } - - public class Assert : NUnit.Framework.Assert - { - [Obsolete("Do not use AreEqual on Byte[], use TestUtil.AssertBytesEqual(,)")] - public static void AreEqual(byte[] b1, byte[] b2) - { - NUnit.Framework.Assert.AreEqual(b1, b2); - } - - [Obsolete("No not use assert with miss-matched types.")] - public static new void AreEqual(object b1, object b2) - { - NUnit.Framework.Assert.AreEqual(b1, b2); - } - - //Allowed if the types match - public static void AreEqual(T b1, T b2) - { - NUnit.Framework.Assert.AreEqual(b1, b2); - } - } -} -#endif \ No newline at end of file diff --git a/csharp/lib/NUnit-config/nunit-console.v2.0.config b/csharp/lib/NUnit-config/nunit-console.v2.0.config deleted file mode 100644 index 30453c9b..00000000 --- a/csharp/lib/NUnit-config/nunit-console.v2.0.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/lib/NUnit-config/nunit-console.v3.5.config b/csharp/lib/NUnit-config/nunit-console.v3.5.config deleted file mode 100644 index 30453c9b..00000000 --- a/csharp/lib/NUnit-config/nunit-console.v3.5.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/lib/NUnit-config/nunit-console.v4.0.config b/csharp/lib/NUnit-config/nunit-console.v4.0.config deleted file mode 100644 index 08ee9547..00000000 --- a/csharp/lib/NUnit-config/nunit-console.v4.0.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs b/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs index 54f400c3..51606a37 100644 --- a/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/AbstractMessageTest.cs @@ -38,15 +38,14 @@ using System; using System.Collections.Generic; using System.IO; using Google.ProtocolBuffers.Descriptors; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class AbstractMessageTest { - [TestMethod] + [Fact] public void Clear() { AbstractMessageWrapper message = @@ -54,7 +53,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertClear((TestAllTypes) message.WrappedMessage); } - [TestMethod] + [Fact] public void Copy() { AbstractMessageWrapper message = @@ -62,31 +61,31 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage); } - [TestMethod] + [Fact] public void CreateAndBuild() { TestAllTypes.CreateBuilder() .Build(); } - [TestMethod] + [Fact] public void SerializedSize() { TestAllTypes message = TestUtil.GetAllSet(); IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetAllSet()); - Assert.AreEqual(message.SerializedSize, abstractMessage.SerializedSize); + Assert.Equal(message.SerializedSize, abstractMessage.SerializedSize); } - [TestMethod] + [Fact] public void Serialization() { IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetAllSet()); TestUtil.AssertAllFieldsSet(TestAllTypes.ParseFrom(abstractMessage.ToByteString())); - Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), abstractMessage.ToByteString()); + Assert.Equal(TestUtil.GetAllSet().ToByteString(), abstractMessage.ToByteString()); } - [TestMethod] + [Fact] public void Parsing() { IBuilder builder = new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder()); @@ -95,15 +94,15 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage); } - [TestMethod] + [Fact] public void PackedSerialization() { IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetPackedSet()); TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseFrom(abstractMessage.ToByteString())); - Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), abstractMessage.ToByteString()); + Assert.Equal(TestUtil.GetPackedSet().ToByteString(), abstractMessage.ToByteString()); } - [TestMethod] + [Fact] public void PackedParsing() { AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestPackedTypes.CreateBuilder()); @@ -111,7 +110,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedFieldsSet((TestPackedTypes)message.WrappedMessage); } - [TestMethod] + [Fact] public void UnpackedParsingOfPackedInput() { byte[] bytes = TestUtil.GetPackedSet().ToByteArray(); @@ -119,7 +118,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertUnpackedFieldsSet(message); } - [TestMethod] + [Fact] public void PackedParsingOfUnpackedInput() { byte[] bytes = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray(); @@ -127,7 +126,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedFieldsSet(message); } - [TestMethod] + [Fact] public void UnpackedParsingOfPackedInputExtensions() { byte[] bytes = TestUtil.GetPackedSet().ToByteArray(); @@ -138,7 +137,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertUnpackedExtensionsSet(message); } - [TestMethod] + [Fact] public void PackedParsingOfUnpackedInputExtensions() { byte[] bytes = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray(); @@ -148,13 +147,13 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedExtensionsSet(message); } - [TestMethod] + [Fact] public void OptimizedForSize() { // We're mostly only Checking that this class was compiled successfully. TestOptimizedForSize message = TestOptimizedForSize.CreateBuilder().SetI(1).Build(); message = TestOptimizedForSize.ParseFrom(message.ToByteString()); - Assert.AreEqual(2, message.SerializedSize); + Assert.Equal(2, message.SerializedSize); } // ----------------------------------------------------------------- @@ -165,40 +164,40 @@ namespace Google.ProtocolBuffers private static readonly TestRequired TestRequiredInitialized = TestRequired.CreateBuilder().SetA(1).SetB(2).SetC(3).Build(); - [TestMethod] + [Fact] public void IsInitialized() { TestRequired.Builder builder = TestRequired.CreateBuilder(); AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder); - Assert.IsFalse(abstractBuilder.IsInitialized); + Assert.False(abstractBuilder.IsInitialized); builder.A = 1; - Assert.IsFalse(abstractBuilder.IsInitialized); + Assert.False(abstractBuilder.IsInitialized); builder.B = 1; - Assert.IsFalse(abstractBuilder.IsInitialized); + Assert.False(abstractBuilder.IsInitialized); builder.C = 1; - Assert.IsTrue(abstractBuilder.IsInitialized); + Assert.True(abstractBuilder.IsInitialized); } - [TestMethod] + [Fact] public void ForeignIsInitialized() { TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder(); AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder); - Assert.IsTrue(abstractBuilder.IsInitialized); + Assert.True(abstractBuilder.IsInitialized); builder.SetOptionalMessage(TestRequiredUninitialized); - Assert.IsFalse(abstractBuilder.IsInitialized); + Assert.False(abstractBuilder.IsInitialized); builder.SetOptionalMessage(TestRequiredInitialized); - Assert.IsTrue(abstractBuilder.IsInitialized); + Assert.True(abstractBuilder.IsInitialized); builder.AddRepeatedMessage(TestRequiredUninitialized); - Assert.IsFalse(abstractBuilder.IsInitialized); + Assert.False(abstractBuilder.IsInitialized); builder.SetRepeatedMessage(0, TestRequiredInitialized); - Assert.IsTrue(abstractBuilder.IsInitialized); + Assert.True(abstractBuilder.IsInitialized); } // ----------------------------------------------------------------- @@ -227,7 +226,7 @@ namespace Google.ProtocolBuffers "repeated_string: \"qux\"\n" + "repeated_string: \"bar\"\n"; - [TestMethod] + [Fact] public void MergeFrom() { AbstractMessageWrapper result = (AbstractMessageWrapper) @@ -235,13 +234,13 @@ namespace Google.ProtocolBuffers .MergeFrom(MergeSource) .Build(); - Assert.AreEqual(MergeResultText, result.ToString()); + Assert.Equal(MergeResultText, result.ToString()); } // ----------------------------------------------------------------- // Tests for equals and hashCode - [TestMethod] + [Fact] public void EqualsAndHashCode() { TestAllTypes a = TestUtil.GetAllSet(); @@ -297,7 +296,7 @@ namespace Google.ProtocolBuffers private static void CheckEqualsIsConsistent(IMessage message) { // Object should be equal to itself. - Assert.AreEqual(message, message); + Assert.Equal(message, message); // Object should be equal to a dynamic copy of itself. DynamicMessage dynamic = DynamicMessage.CreateBuilder(message).Build(); @@ -309,9 +308,11 @@ namespace Google.ProtocolBuffers /// private static void CheckEqualsIsConsistent(IMessage message1, IMessage message2) { - Assert.AreEqual(message1, message2); - Assert.AreEqual(message2, message1); - Assert.AreEqual(message2.GetHashCode(), message1.GetHashCode()); + // Not using Assert.AreEqual as that checks for type equality, which isn't + // what we want bearing in mind the dynamic message checks. + Assert.True(message1.Equals(message2)); + Assert.True(message2.Equals(message1)); + Assert.Equal(message2.GetHashCode(), message1.GetHashCode()); } /// @@ -325,10 +326,10 @@ namespace Google.ProtocolBuffers private static void CheckNotEqual(IMessage m1, IMessage m2) { String equalsError = string.Format("{0} should not be equal to {1}", m1, m2); - Assert.IsFalse(m1.Equals(m2), equalsError); - Assert.IsFalse(m2.Equals(m1), equalsError); + Assert.False(m1.Equals(m2), equalsError); + Assert.False(m2.Equals(m1), equalsError); - Assert.IsFalse(m1.GetHashCode() == m2.GetHashCode(), + Assert.False(m1.GetHashCode() == m2.GetHashCode(), string.Format("{0} should have a different hash code from {1}", m1, m2)); } diff --git a/csharp/src/ProtocolBuffers.Test/ByteStringTest.cs b/csharp/src/ProtocolBuffers.Test/ByteStringTest.cs index 003307ae..92c4ef0b 100644 --- a/csharp/src/ProtocolBuffers.Test/ByteStringTest.cs +++ b/csharp/src/ProtocolBuffers.Test/ByteStringTest.cs @@ -36,113 +36,112 @@ using System; using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class ByteStringTest { - [TestMethod] + [Fact] public void EmptyByteStringHasZeroSize() { - Assert.AreEqual(0, ByteString.Empty.Length); + Assert.Equal(0, ByteString.Empty.Length); } - [TestMethod] + [Fact] public void CopyFromStringWithExplicitEncoding() { ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode); - Assert.AreEqual(4, bs.Length); - Assert.AreEqual(65, bs[0]); - Assert.AreEqual(0, bs[1]); - Assert.AreEqual(66, bs[2]); - Assert.AreEqual(0, bs[3]); + Assert.Equal(4, bs.Length); + Assert.Equal(65, bs[0]); + Assert.Equal(0, bs[1]); + Assert.Equal(66, bs[2]); + Assert.Equal(0, bs[3]); } - [TestMethod] + [Fact] public void IsEmptyWhenEmpty() { - Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty); + Assert.True(ByteString.CopyFromUtf8("").IsEmpty); } - [TestMethod] + [Fact] public void IsEmptyWhenNotEmpty() { - Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty); + Assert.False(ByteString.CopyFromUtf8("X").IsEmpty); } - [TestMethod] + [Fact] public void CopyFromByteArrayCopiesContents() { byte[] data = new byte[1]; data[0] = 10; ByteString bs = ByteString.CopyFrom(data); - Assert.AreEqual(10, bs[0]); + Assert.Equal(10, bs[0]); data[0] = 5; - Assert.AreEqual(10, bs[0]); + Assert.Equal(10, bs[0]); } - [TestMethod] + [Fact] public void ToByteArrayCopiesContents() { ByteString bs = ByteString.CopyFromUtf8("Hello"); byte[] data = bs.ToByteArray(); - Assert.AreEqual((byte)'H', data[0]); - Assert.AreEqual((byte)'H', bs[0]); + Assert.Equal((byte)'H', data[0]); + Assert.Equal((byte)'H', bs[0]); data[0] = 0; - Assert.AreEqual(0, data[0]); - Assert.AreEqual((byte)'H', bs[0]); + Assert.Equal(0, data[0]); + Assert.Equal((byte)'H', bs[0]); } - [TestMethod] + [Fact] public void CopyFromUtf8UsesUtf8() { ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(0xe2, bs[0]); - Assert.AreEqual(0x82, bs[1]); - Assert.AreEqual(0xac, bs[2]); + Assert.Equal(3, bs.Length); + Assert.Equal(0xe2, bs[0]); + Assert.Equal(0x82, bs[1]); + Assert.Equal(0xac, bs[2]); } - [TestMethod] + [Fact] public void CopyFromPortion() { byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; ByteString bs = ByteString.CopyFrom(data, 2, 3); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(2, bs[0]); - Assert.AreEqual(3, bs[1]); + Assert.Equal(3, bs.Length); + Assert.Equal(2, bs[0]); + Assert.Equal(3, bs[1]); } - [TestMethod] + [Fact] public void ToStringUtf8() { ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual("\u20ac", bs.ToStringUtf8()); + Assert.Equal("\u20ac", bs.ToStringUtf8()); } - [TestMethod] + [Fact] public void ToStringWithExplicitEncoding() { ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode); - Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode)); + Assert.Equal("\u20ac", bs.ToString(Encoding.Unicode)); } - [TestMethod] + [Fact] public void FromBase64_WithText() { byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; string base64 = Convert.ToBase64String(data); ByteString bs = ByteString.FromBase64(base64); - TestUtil.AssertBytesEqual(data, bs.ToByteArray()); + Assert.Equal(data, bs.ToByteArray()); } - [TestMethod] + [Fact] public void FromBase64_Empty() { // Optimization which also fixes issue 61. - Assert.AreSame(ByteString.Empty, ByteString.FromBase64("")); + Assert.Same(ByteString.Empty, ByteString.FromBase64("")); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/CodedInputStreamTest.cs b/csharp/src/ProtocolBuffers.Test/CodedInputStreamTest.cs index b09d3340..20bfef9e 100644 --- a/csharp/src/ProtocolBuffers.Test/CodedInputStreamTest.cs +++ b/csharp/src/ProtocolBuffers.Test/CodedInputStreamTest.cs @@ -39,12 +39,10 @@ using System.Collections.Generic; using System.IO; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Diagnostics; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class CodedInputStreamTest { /// @@ -68,21 +66,21 @@ namespace Google.ProtocolBuffers private static void AssertReadVarint(byte[] data, ulong value) { CodedInputStream input = CodedInputStream.CreateInstance(data); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); + Assert.Equal((uint) value, input.ReadRawVarint32()); input = CodedInputStream.CreateInstance(data); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); + Assert.Equal(value, input.ReadRawVarint64()); + Assert.True(input.IsAtEnd); // Try different block sizes. for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) { input = CodedInputStream.CreateInstance(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); + Assert.Equal((uint) value, input.ReadRawVarint32()); input = CodedInputStream.CreateInstance(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); + Assert.Equal(value, input.ReadRawVarint64()); + Assert.True(input.IsAtEnd); } // Try reading directly from a MemoryStream. We want to verify that it @@ -92,8 +90,8 @@ namespace Google.ProtocolBuffers memoryStream.Write(data, 0, data.Length); memoryStream.WriteByte(0); memoryStream.Position = 0; - Assert.AreEqual((uint) value, CodedInputStream.ReadRawVarint32(memoryStream)); - Assert.AreEqual(data.Length, memoryStream.Position); + Assert.Equal((uint) value, CodedInputStream.ReadRawVarint32(memoryStream)); + Assert.Equal(data.Length, memoryStream.Position); } /// @@ -104,40 +102,19 @@ namespace Google.ProtocolBuffers private static void AssertReadVarintFailure(InvalidProtocolBufferException expected, byte[] data) { CodedInputStream input = CodedInputStream.CreateInstance(data); - try - { - input.ReadRawVarint32(); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual(expected.Message, e.Message); - } + var exception = Assert.Throws(() => input.ReadRawVarint32()); + Assert.Equal(expected.Message, exception.Message); input = CodedInputStream.CreateInstance(data); - try - { - input.ReadRawVarint64(); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual(expected.Message, e.Message); - } + exception = Assert.Throws(() => input.ReadRawVarint64()); + Assert.Equal(expected.Message, exception.Message); // Make sure we get the same error when reading directly from a Stream. - try - { - CodedInputStream.ReadRawVarint32(new MemoryStream(data)); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual(expected.Message, e.Message); - } + exception = Assert.Throws(() => CodedInputStream.ReadRawVarint32(new MemoryStream(data))); + Assert.Equal(expected.Message, exception.Message); } - [TestMethod] + [Fact] public void ReadVarint() { AssertReadVarint(Bytes(0x00), 0); @@ -182,16 +159,16 @@ namespace Google.ProtocolBuffers private static void AssertReadLittleEndian32(byte[] data, uint value) { CodedInputStream input = CodedInputStream.CreateInstance(data); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); + Assert.Equal(value, input.ReadRawLittleEndian32()); + Assert.True(input.IsAtEnd); // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { input = CodedInputStream.CreateInstance( new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); + Assert.Equal(value, input.ReadRawLittleEndian32()); + Assert.True(input.IsAtEnd); } } @@ -202,20 +179,20 @@ namespace Google.ProtocolBuffers private static void AssertReadLittleEndian64(byte[] data, ulong value) { CodedInputStream input = CodedInputStream.CreateInstance(data); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); + Assert.Equal(value, input.ReadRawLittleEndian64()); + Assert.True(input.IsAtEnd); // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { input = CodedInputStream.CreateInstance( new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); + Assert.Equal(value, input.ReadRawLittleEndian64()); + Assert.True(input.IsAtEnd); } } - [TestMethod] + [Fact] public void ReadLittleEndian() { AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); @@ -227,41 +204,41 @@ namespace Google.ProtocolBuffers Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL); } - [TestMethod] + [Fact] public void DecodeZigZag32() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3)); - Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE)); - Assert.AreEqual(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE)); - Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF)); + Assert.Equal(0, CodedInputStream.DecodeZigZag32(0)); + Assert.Equal(-1, CodedInputStream.DecodeZigZag32(1)); + Assert.Equal(1, CodedInputStream.DecodeZigZag32(2)); + Assert.Equal(-2, CodedInputStream.DecodeZigZag32(3)); + Assert.Equal(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE)); + Assert.Equal(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF)); + Assert.Equal(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE)); + Assert.Equal(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF)); } - [TestMethod] + [Fact] public void DecodeZigZag64() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3)); - Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL)); - Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL)); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); + Assert.Equal(0, CodedInputStream.DecodeZigZag64(0)); + Assert.Equal(-1, CodedInputStream.DecodeZigZag64(1)); + Assert.Equal(1, CodedInputStream.DecodeZigZag64(2)); + Assert.Equal(-2, CodedInputStream.DecodeZigZag64(3)); + Assert.Equal(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL)); + Assert.Equal(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL)); + Assert.Equal(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL)); + Assert.Equal(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL)); + Assert.Equal(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); + Assert.Equal(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); } - [TestMethod] + [Fact] public void ReadWholeMessage() { TestAllTypes message = TestUtil.GetAllSet(); byte[] rawBytes = message.ToByteArray(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); + Assert.Equal(rawBytes.Length, message.SerializedSize); TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); TestUtil.AssertAllFieldsSet(message2); @@ -273,7 +250,7 @@ namespace Google.ProtocolBuffers } } - [TestMethod] + [Fact] public void SkipWholeMessage() { TestAllTypes message = TestUtil.GetAllSet(); @@ -290,8 +267,8 @@ namespace Google.ProtocolBuffers while (input1.ReadTag(out tag, out name)) { uint tag2; - Assert.IsTrue(input2.ReadTag(out tag2, out name)); - Assert.AreEqual(tag, tag2); + Assert.True(input2.ReadTag(out tag2, out name)); + Assert.Equal(tag, tag2); unknownFields.MergeFieldFrom(tag, input1); input2.SkipField(); @@ -302,7 +279,7 @@ namespace Google.ProtocolBuffers /// Test that a bug in SkipRawBytes has been fixed: if the skip /// skips exactly up to a limit, this should bnot break things /// - [TestMethod] + [Fact] public void SkipRawBytesBug() { byte[] rawBytes = new byte[] {1, 2}; @@ -311,7 +288,7 @@ namespace Google.ProtocolBuffers int limit = input.PushLimit(1); input.SkipRawBytes(1); input.PopLimit(limit); - Assert.AreEqual(2, input.ReadRawByte()); + Assert.Equal(2, input.ReadRawByte()); } public void ReadHugeBlob() @@ -334,7 +311,7 @@ namespace Google.ProtocolBuffers // reading. TestAllTypes message2 = TestAllTypes.ParseFrom(message.ToByteString().CreateCodedInput()); - Assert.AreEqual(message.OptionalBytes, message2.OptionalBytes); + Assert.Equal(message.OptionalBytes, message2.OptionalBytes); // Make sure all the other fields were parsed correctly. TestAllTypes message3 = TestAllTypes.CreateBuilder(message2) @@ -343,7 +320,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(message3); } - [TestMethod] + [Fact] public void ReadMaliciouslyLargeBlob() { MemoryStream ms = new MemoryStream(); @@ -359,19 +336,12 @@ namespace Google.ProtocolBuffers CodedInputStream input = CodedInputStream.CreateInstance(ms); uint testtag; string ignore; - Assert.IsTrue(input.ReadTag(out testtag, out ignore)); - Assert.AreEqual(tag, testtag); + Assert.True(input.ReadTag(out testtag, out ignore)); + Assert.Equal(tag, testtag); - try - { - ByteString bytes = null; - input.ReadBytes(ref bytes); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } + ByteString bytes = null; + // TODO(jonskeet): Should this be ArgumentNullException instead? + Assert.Throws(() => input.ReadBytes(ref bytes)); } private static TestRecursiveMessage MakeRecursiveMessage(int depth) @@ -391,17 +361,17 @@ namespace Google.ProtocolBuffers { if (depth == 0) { - Assert.IsFalse(message.HasA); - Assert.AreEqual(5, message.I); + Assert.False(message.HasA); + Assert.Equal(5, message.I); } else { - Assert.IsTrue(message.HasA); + Assert.True(message.HasA); AssertMessageDepth(message.A, depth - 1); } } - [TestMethod] + [Fact] public void MaliciousRecursion() { ByteString data64 = MakeRecursiveMessage(64).ToByteString(); @@ -409,30 +379,14 @@ namespace Google.ProtocolBuffers AssertMessageDepth(TestRecursiveMessage.ParseFrom(data64), 64); - try - { - TestRecursiveMessage.ParseFrom(data65); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } + Assert.Throws(() => TestRecursiveMessage.ParseFrom(data65)); CodedInputStream input = data64.CreateCodedInput(); input.SetRecursionLimit(8); - try - { - TestRecursiveMessage.ParseFrom(input); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } + Assert.Throws(() => TestRecursiveMessage.ParseFrom(input)); } - [TestMethod] + [Fact] public void SizeLimit() { // Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't @@ -441,18 +395,10 @@ namespace Google.ProtocolBuffers CodedInputStream input = CodedInputStream.CreateInstance(ms); input.SetSizeLimit(16); - try - { - TestAllTypes.ParseFrom(input); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } + Assert.Throws(() => TestAllTypes.ParseFrom(input)); } - [TestMethod] + [Fact] public void ResetSizeCounter() { CodedInputStream input = CodedInputStream.CreateInstance( @@ -460,28 +406,12 @@ namespace Google.ProtocolBuffers input.SetSizeLimit(16); input.ReadRawBytes(16); - try - { - input.ReadRawByte(); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // Success. - } + Assert.Throws(() => input.ReadRawByte()); input.ResetSizeCounter(); input.ReadRawByte(); // No exception thrown. - try - { - input.ReadRawBytes(16); // Hits limit again. - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // Success. - } + Assert.Throws(() => input.ReadRawBytes(16)); } /// @@ -489,7 +419,7 @@ namespace Google.ProtocolBuffers /// is thrown. Instead, the invalid bytes are replaced with the Unicode /// "replacement character" U+FFFD. /// - [TestMethod] + [Fact] public void ReadInvalidUtf8() { MemoryStream ms = new MemoryStream(); @@ -507,11 +437,11 @@ namespace Google.ProtocolBuffers uint testtag; string ignored; - Assert.IsTrue(input.ReadTag(out testtag, out ignored)); - Assert.AreEqual(tag, testtag); + Assert.True(input.ReadTag(out testtag, out ignored)); + Assert.Equal(tag, testtag); string text = null; input.ReadString(ref text); - Assert.AreEqual('\ufffd', text[0]); + Assert.Equal('\ufffd', text[0]); } /// @@ -537,7 +467,7 @@ namespace Google.ProtocolBuffers enum TestNegEnum { None = 0, Value = -2 } - [TestMethod] + [Fact] public void TestNegativeEnum() { byte[] bytes = new byte[10] { 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01 }; @@ -545,12 +475,12 @@ namespace Google.ProtocolBuffers object unk; TestNegEnum val = TestNegEnum.None; - Assert.IsTrue(input.ReadEnum(ref val, out unk)); - Assert.IsTrue(input.IsAtEnd); - Assert.AreEqual(TestNegEnum.Value, val); + Assert.True(input.ReadEnum(ref val, out unk)); + Assert.True(input.IsAtEnd); + Assert.Equal(TestNegEnum.Value, val); } - [TestMethod] + [Fact] public void TestNegativeEnumPackedArray() { int arraySize = 1 + (10 * 5); @@ -559,26 +489,26 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); output.WritePackedInt32Array(8, "", arraySize, new int[] { 0, -1, -2, -3, -4, -5 }); - Assert.AreEqual(0, output.SpaceLeft); + Assert.Equal(0, output.SpaceLeft); CodedInputStream input = CodedInputStream.CreateInstance(bytes); uint tag; string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); + Assert.True(input.ReadTag(out tag, out name)); List values = new List(); ICollection unk; input.ReadEnumArray(tag, name, values, out unk); - Assert.AreEqual(2, values.Count); - Assert.AreEqual(TestNegEnum.None, values[0]); - Assert.AreEqual(TestNegEnum.Value, values[1]); + Assert.Equal(2, values.Count); + Assert.Equal(TestNegEnum.None, values[0]); + Assert.Equal(TestNegEnum.Value, values[1]); - Assert.IsNotNull(unk); - Assert.AreEqual(4, unk.Count); + Assert.NotNull(unk); + Assert.Equal(4, unk.Count); } - [TestMethod] + [Fact] public void TestNegativeEnumArray() { int arraySize = 1 + 1 + (11 * 5); @@ -587,27 +517,27 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); output.WriteInt32Array(8, "", new int[] { 0, -1, -2, -3, -4, -5 }); - Assert.AreEqual(0, output.SpaceLeft); + Assert.Equal(0, output.SpaceLeft); CodedInputStream input = CodedInputStream.CreateInstance(bytes); uint tag; string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); + Assert.True(input.ReadTag(out tag, out name)); List values = new List(); ICollection unk; input.ReadEnumArray(tag, name, values, out unk); - Assert.AreEqual(2, values.Count); - Assert.AreEqual(TestNegEnum.None, values[0]); - Assert.AreEqual(TestNegEnum.Value, values[1]); + Assert.Equal(2, values.Count); + Assert.Equal(TestNegEnum.None, values[0]); + Assert.Equal(TestNegEnum.Value, values[1]); - Assert.IsNotNull(unk); - Assert.AreEqual(4, unk.Count); + Assert.NotNull(unk); + Assert.Equal(4, unk.Count); } //Issue 71: CodedInputStream.ReadBytes go to slow path unnecessarily - [TestMethod] + [Fact] public void TestSlowPathAvoidance() { using (var ms = new MemoryStream()) @@ -624,15 +554,15 @@ namespace Google.ProtocolBuffers string ignore; ByteString value; - Assert.IsTrue(input.ReadTag(out tag, out ignore)); - Assert.AreEqual(1, WireFormat.GetTagFieldNumber(tag)); + Assert.True(input.ReadTag(out tag, out ignore)); + Assert.Equal(1, WireFormat.GetTagFieldNumber(tag)); value = ByteString.Empty; - Assert.IsTrue(input.ReadBytes(ref value) && value.Length == 100); + Assert.True(input.ReadBytes(ref value) && value.Length == 100); - Assert.IsTrue(input.ReadTag(out tag, out ignore)); - Assert.AreEqual(2, WireFormat.GetTagFieldNumber(tag)); + Assert.True(input.ReadTag(out tag, out ignore)); + Assert.Equal(2, WireFormat.GetTagFieldNumber(tag)); value = ByteString.Empty; - Assert.IsTrue(input.ReadBytes(ref value) && value.Length == 100); + Assert.True(input.ReadBytes(ref value) && value.Length == 100); } } } diff --git a/csharp/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs b/csharp/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs index 8e4e9090..d9f53d74 100644 --- a/csharp/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs +++ b/csharp/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs @@ -38,11 +38,10 @@ using System; using System.Collections.Generic; using System.IO; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class CodedOutputStreamTest { /// @@ -58,9 +57,9 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); output.WriteRawVarint32((uint) value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); + Assert.Equal(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); } { @@ -68,10 +67,10 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); output.WriteRawVarint64(value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); + Assert.Equal(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); } // Try different buffer sizes. @@ -85,7 +84,7 @@ namespace Google.ProtocolBuffers CodedOutputStream.CreateInstance(rawOutput, bufferSize); output.WriteRawVarint32((uint) value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); } { @@ -93,7 +92,7 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput, bufferSize); output.WriteRawVarint64(value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); } } } @@ -101,7 +100,7 @@ namespace Google.ProtocolBuffers /// /// Tests WriteRawVarint32() and WriteRawVarint64() /// - [TestMethod] + [Fact] public void WriteVarint() { AssertWriteVarint(new byte[] {0x00}, 0); @@ -143,7 +142,7 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); output.WriteRawLittleEndian32(value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); // Try different buffer sizes. for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) @@ -152,7 +151,7 @@ namespace Google.ProtocolBuffers output = CodedOutputStream.CreateInstance(rawOutput, bufferSize); output.WriteRawLittleEndian32(value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); } } @@ -166,7 +165,7 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); output.WriteRawLittleEndian64(value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) @@ -175,14 +174,14 @@ namespace Google.ProtocolBuffers output = CodedOutputStream.CreateInstance(rawOutput, blockSize); output.WriteRawLittleEndian64(value); output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); + Assert.Equal(data, rawOutput.ToArray()); } } /// /// Tests writeRawLittleEndian32() and writeRawLittleEndian64(). /// - [TestMethod] + [Fact] public void WriteLittleEndian() { AssertWriteLittleEndian32(new byte[] {0x78, 0x56, 0x34, 0x12}, 0x12345678); @@ -196,7 +195,7 @@ namespace Google.ProtocolBuffers 0x9abcdef012345678UL); } - [TestMethod] + [Fact] public void WriteWholeMessage() { TestAllTypes message = TestUtil.GetAllSet(); @@ -220,7 +219,7 @@ namespace Google.ProtocolBuffers /// Tests writing a whole message with every packed field type. Ensures the /// wire format of packed fields is compatible with C++. /// - [TestMethod] + [Fact] public void WriteWholePackedFieldsMessage() { TestPackedTypes message = TestUtil.GetPackedSet(); @@ -230,97 +229,97 @@ namespace Google.ProtocolBuffers rawBytes); } - [TestMethod] + [Fact] public void EncodeZigZag32() { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag32(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag32(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag32(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag32(-2)); - Assert.AreEqual(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF)); - Assert.AreEqual(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000))); - Assert.AreEqual(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000))); + Assert.Equal(0u, CodedOutputStream.EncodeZigZag32(0)); + Assert.Equal(1u, CodedOutputStream.EncodeZigZag32(-1)); + Assert.Equal(2u, CodedOutputStream.EncodeZigZag32(1)); + Assert.Equal(3u, CodedOutputStream.EncodeZigZag32(-2)); + Assert.Equal(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF)); + Assert.Equal(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000))); + Assert.Equal(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF)); + Assert.Equal(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000))); } - [TestMethod] + [Fact] public void EncodeZigZag64() { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag64(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag64(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag64(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag64(-2)); - Assert.AreEqual(0x000000007FFFFFFEuL, + Assert.Equal(0u, CodedOutputStream.EncodeZigZag64(0)); + Assert.Equal(1u, CodedOutputStream.EncodeZigZag64(-1)); + Assert.Equal(2u, CodedOutputStream.EncodeZigZag64(1)); + Assert.Equal(3u, CodedOutputStream.EncodeZigZag64(-2)); + Assert.Equal(0x000000007FFFFFFEuL, CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); - Assert.AreEqual(0x000000007FFFFFFFuL, + Assert.Equal(0x000000007FFFFFFFuL, CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); - Assert.AreEqual(0x00000000FFFFFFFEuL, + Assert.Equal(0x00000000FFFFFFFEuL, CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); - Assert.AreEqual(0x00000000FFFFFFFFuL, + Assert.Equal(0x00000000FFFFFFFFuL, CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, + Assert.Equal(0xFFFFFFFFFFFFFFFEL, CodedOutputStream.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, + Assert.Equal(0xFFFFFFFFFFFFFFFFL, CodedOutputStream.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); } - [TestMethod] + [Fact] public void RoundTripZigZag32() { // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) // were chosen semi-randomly via keyboard bashing. - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612))); + Assert.Equal(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0))); + Assert.Equal(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1))); + Assert.Equal(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1))); + Assert.Equal(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927))); + Assert.Equal(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612))); } - [TestMethod] + [Fact] public void RoundTripZigZag64() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612))); + Assert.Equal(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0))); + Assert.Equal(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1))); + Assert.Equal(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1))); + Assert.Equal(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927))); + Assert.Equal(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612))); - Assert.AreEqual(856912304801416L, + Assert.Equal(856912304801416L, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L))); - Assert.AreEqual(-75123905439571256L, + Assert.Equal(-75123905439571256L, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L))); } - [TestMethod] + [Fact] public void TestNegativeEnumNoTag() { - Assert.AreEqual(10, CodedOutputStream.ComputeInt32SizeNoTag(-2)); - Assert.AreEqual(10, CodedOutputStream.ComputeEnumSizeNoTag(-2)); + Assert.Equal(10, CodedOutputStream.ComputeInt32SizeNoTag(-2)); + Assert.Equal(10, CodedOutputStream.ComputeEnumSizeNoTag(-2)); byte[] bytes = new byte[10]; CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); output.WriteEnumNoTag(-2); - Assert.AreEqual(0, output.SpaceLeft); - Assert.AreEqual("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); + Assert.Equal(0, output.SpaceLeft); + Assert.Equal("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); } - [TestMethod] + [Fact] public void TestNegativeEnumWithTag() { - Assert.AreEqual(11, CodedOutputStream.ComputeInt32Size(8, -2)); - Assert.AreEqual(11, CodedOutputStream.ComputeEnumSize(8, -2)); + Assert.Equal(11, CodedOutputStream.ComputeInt32Size(8, -2)); + Assert.Equal(11, CodedOutputStream.ComputeEnumSize(8, -2)); byte[] bytes = new byte[11]; CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); output.WriteEnum(8, "", -2, -2); - Assert.AreEqual(0, output.SpaceLeft); + Assert.Equal(0, output.SpaceLeft); //fyi, 0x40 == 0x08 << 3 + 0, field num + wire format shift - Assert.AreEqual("40-FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); + Assert.Equal("40-FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); } - [TestMethod] + [Fact] public void TestNegativeEnumArrayPacked() { int arraySize = 1 + (10 * 5); @@ -329,22 +328,22 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); output.WritePackedEnumArray(8, "", arraySize, new int[] { 0, -1, -2, -3, -4, -5 }); - Assert.AreEqual(0, output.SpaceLeft); + Assert.Equal(0, output.SpaceLeft); CodedInputStream input = CodedInputStream.CreateInstance(bytes); uint tag; string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); + Assert.True(input.ReadTag(out tag, out name)); List values = new List(); input.ReadInt32Array(tag, name, values); - Assert.AreEqual(6, values.Count); + Assert.Equal(6, values.Count); for (int i = 0; i > -6; i--) - Assert.AreEqual(i, values[Math.Abs(i)]); + Assert.Equal(i, values[Math.Abs(i)]); } - [TestMethod] + [Fact] public void TestNegativeEnumArray() { int arraySize = 1 + 1 + (11 * 5); @@ -353,22 +352,22 @@ namespace Google.ProtocolBuffers CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); output.WriteEnumArray(8, "", new int[] { 0, -1, -2, -3, -4, -5 }); - Assert.AreEqual(0, output.SpaceLeft); + Assert.Equal(0, output.SpaceLeft); CodedInputStream input = CodedInputStream.CreateInstance(bytes); uint tag; string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); + Assert.True(input.ReadTag(out tag, out name)); List values = new List(); input.ReadInt32Array(tag, name, values); - Assert.AreEqual(6, values.Count); + Assert.Equal(6, values.Count); for (int i = 0; i > -6; i--) - Assert.AreEqual(i, values[Math.Abs(i)]); + Assert.Equal(i, values[Math.Abs(i)]); } - [TestMethod] + [Fact] public void TestCodedInputOutputPosition() { byte[] content = new byte[110]; @@ -381,19 +380,19 @@ namespace Google.ProtocolBuffers CodedOutputStream cout = CodedOutputStream.CreateInstance(ms, 20); // Field 11: numeric value: 500 cout.WriteTag(11, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); + Assert.Equal(1, cout.Position); cout.WriteInt32NoTag(500); - Assert.AreEqual(3, cout.Position); + Assert.Equal(3, cout.Position); //Field 12: length delimited 120 bytes cout.WriteTag(12, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); + Assert.Equal(4, cout.Position); cout.WriteBytesNoTag(ByteString.CopyFrom(content)); - Assert.AreEqual(115, cout.Position); + Assert.Equal(115, cout.Position); // Field 13: fixed numeric value: 501 cout.WriteTag(13, WireFormat.WireType.Fixed32); - Assert.AreEqual(116, cout.Position); + Assert.Equal(116, cout.Position); cout.WriteSFixed32NoTag(501); - Assert.AreEqual(120, cout.Position); + Assert.Equal(120, cout.Position); cout.Flush(); } @@ -402,19 +401,19 @@ namespace Google.ProtocolBuffers CodedOutputStream cout = CodedOutputStream.CreateInstance(bytes); // Field 1: numeric value: 500 cout.WriteTag(1, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); + Assert.Equal(1, cout.Position); cout.WriteInt32NoTag(500); - Assert.AreEqual(3, cout.Position); + Assert.Equal(3, cout.Position); //Field 2: length delimited 120 bytes cout.WriteTag(2, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); + Assert.Equal(4, cout.Position); cout.WriteBytesNoTag(ByteString.CopyFrom(child)); - Assert.AreEqual(125, cout.Position); + Assert.Equal(125, cout.Position); // Field 3: fixed numeric value: 500 cout.WriteTag(3, WireFormat.WireType.Fixed32); - Assert.AreEqual(126, cout.Position); + Assert.Equal(126, cout.Position); cout.WriteSFixed32NoTag(501); - Assert.AreEqual(130, cout.Position); + Assert.Equal(130, cout.Position); cout.Flush(); } //Now test Input stream: @@ -423,49 +422,49 @@ namespace Google.ProtocolBuffers uint tag; int intValue = 0; string ignore; - Assert.AreEqual(0, cin.Position); + Assert.Equal(0, cin.Position); // Field 1: - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 1); - Assert.AreEqual(1, cin.Position); - Assert.IsTrue(cin.ReadInt32(ref intValue) && intValue == 500); - Assert.AreEqual(3, cin.Position); + Assert.True(cin.ReadTag(out tag, out ignore) && tag >> 3 == 1); + Assert.Equal(1, cin.Position); + Assert.True(cin.ReadInt32(ref intValue) && intValue == 500); + Assert.Equal(3, cin.Position); //Field 2: - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 2); - Assert.AreEqual(4, cin.Position); + Assert.True(cin.ReadTag(out tag, out ignore) && tag >> 3 == 2); + Assert.Equal(4, cin.Position); uint childlen = cin.ReadRawVarint32(); - Assert.AreEqual(120u, childlen); - Assert.AreEqual(5, cin.Position); + Assert.Equal(120u, childlen); + Assert.Equal(5, cin.Position); int oldlimit = cin.PushLimit((int)childlen); - Assert.AreEqual(5, cin.Position); + Assert.Equal(5, cin.Position); // Now we are reading child message { // Field 11: numeric value: 500 - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 11); - Assert.AreEqual(6, cin.Position); - Assert.IsTrue(cin.ReadInt32(ref intValue) && intValue == 500); - Assert.AreEqual(8, cin.Position); + Assert.True(cin.ReadTag(out tag, out ignore) && tag >> 3 == 11); + Assert.Equal(6, cin.Position); + Assert.True(cin.ReadInt32(ref intValue) && intValue == 500); + Assert.Equal(8, cin.Position); //Field 12: length delimited 120 bytes - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 12); - Assert.AreEqual(9, cin.Position); + Assert.True(cin.ReadTag(out tag, out ignore) && tag >> 3 == 12); + Assert.Equal(9, cin.Position); ByteString bstr = null; - Assert.IsTrue(cin.ReadBytes(ref bstr) && bstr.Length == 110 && bstr.ToByteArray()[109] == 109); - Assert.AreEqual(120, cin.Position); + Assert.True(cin.ReadBytes(ref bstr) && bstr.Length == 110 && bstr.ToByteArray()[109] == 109); + Assert.Equal(120, cin.Position); // Field 13: fixed numeric value: 501 - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 13); + Assert.True(cin.ReadTag(out tag, out ignore) && tag >> 3 == 13); // ROK - Previously broken here, this returned 126 failing to account for bufferSizeAfterLimit - Assert.AreEqual(121, cin.Position); - Assert.IsTrue(cin.ReadSFixed32(ref intValue) && intValue == 501); - Assert.AreEqual(125, cin.Position); - Assert.IsTrue(cin.IsAtEnd); + Assert.Equal(121, cin.Position); + Assert.True(cin.ReadSFixed32(ref intValue) && intValue == 501); + Assert.Equal(125, cin.Position); + Assert.True(cin.IsAtEnd); } cin.PopLimit(oldlimit); - Assert.AreEqual(125, cin.Position); + Assert.Equal(125, cin.Position); // Field 3: fixed numeric value: 501 - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 3); - Assert.AreEqual(126, cin.Position); - Assert.IsTrue(cin.ReadSFixed32(ref intValue) && intValue == 501); - Assert.AreEqual(130, cin.Position); - Assert.IsTrue(cin.IsAtEnd); + Assert.True(cin.ReadTag(out tag, out ignore) && tag >> 3 == 3); + Assert.Equal(126, cin.Position); + Assert.True(cin.ReadSFixed32(ref intValue) && intValue == 501); + Assert.Equal(130, cin.Position); + Assert.True(cin.IsAtEnd); } } } diff --git a/csharp/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs b/csharp/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs index 0bce60d9..29584705 100644 --- a/csharp/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs +++ b/csharp/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs @@ -36,40 +36,39 @@ using System; using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers.Collections { - [TestClass] public class PopsicleListTest { - [TestMethod] + [Fact] public void MutatingOperationsOnFrozenList() { PopsicleList list = new PopsicleList(); list.MakeReadOnly(); - TestUtil.AssertNotSupported(() => list.Add("")); - TestUtil.AssertNotSupported(() => list.Clear()); - TestUtil.AssertNotSupported(() => list.Insert(0, "")); - TestUtil.AssertNotSupported(() => list.Remove("")); - TestUtil.AssertNotSupported(() => list.RemoveAt(0)); - TestUtil.AssertNotSupported(() => list.Add(new[] { "", "" })); + Assert.Throws(() => list.Add("")); + Assert.Throws(() => list.Clear()); + Assert.Throws(() => list.Insert(0, "")); + Assert.Throws(() => list.Remove("")); + Assert.Throws(() => list.RemoveAt(0)); + Assert.Throws(() => list.Add(new[] { "", "" })); } - [TestMethod] + [Fact] public void NonMutatingOperationsOnFrozenList() { PopsicleList list = new PopsicleList(); list.MakeReadOnly(); - Assert.IsFalse(list.Contains("")); - Assert.AreEqual(0, list.Count); + Assert.False(list.Contains("")); + Assert.Equal(0, list.Count); list.CopyTo(new string[5], 0); list.GetEnumerator(); - Assert.AreEqual(-1, list.IndexOf("")); - Assert.IsTrue(list.IsReadOnly); + Assert.Equal(-1, list.IndexOf("")); + Assert.True(list.IsReadOnly); } - [TestMethod] + [Fact] public void MutatingOperationsOnFluidList() { PopsicleList list = new PopsicleList(); @@ -81,73 +80,46 @@ namespace Google.ProtocolBuffers.Collections list.RemoveAt(0); } - [TestMethod] + [Fact] public void NonMutatingOperationsOnFluidList() { PopsicleList list = new PopsicleList(); - Assert.IsFalse(list.Contains("")); - Assert.AreEqual(0, list.Count); + Assert.False(list.Contains("")); + Assert.Equal(0, list.Count); list.CopyTo(new string[5], 0); list.GetEnumerator(); - Assert.AreEqual(-1, list.IndexOf("")); - Assert.IsFalse(list.IsReadOnly); + Assert.Equal(-1, list.IndexOf("")); + Assert.False(list.IsReadOnly); } - [TestMethod] + [Fact] public void DoesNotAddNullEnumerable() { PopsicleList list = new PopsicleList(); - try - { - list.Add((IEnumerable)null); - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); + Assert.Throws(() => list.Add((IEnumerable) null)); } - [TestMethod] + [Fact] public void DoesNotAddRangeWithNull() { PopsicleList list = new PopsicleList(); - try - { - list.Add(new[] { "a", "b", null }); - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); + // TODO(jonskeet): Change to ArgumentException? The argument isn't null... + Assert.Throws(() => list.Add(new[] {"a", "b", null})); } - [TestMethod] + [Fact] public void DoesNotAddNull() { PopsicleList list = new PopsicleList(); - try - { - list.Add((string)null); - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); + Assert.Throws(() => list.Add((string) null)); } - [TestMethod] + [Fact] public void DoesNotSetNull() { PopsicleList list = new PopsicleList(); list.Add("a"); - try - { - list[0] = null; - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); + Assert.Throws(() => list[0] = null); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs index 9707f8e8..30d257ad 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs @@ -1,9 +1,7 @@ using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers.Compatibility { - [TestClass] public class BinaryCompatibilityTests : CompatibilityTests { protected override object SerializeMessage(TMessage message) diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs index 5befe96f..d918c926 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs @@ -1,6 +1,6 @@ using System; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers.Compatibility @@ -22,10 +22,10 @@ namespace Google.ProtocolBuffers.Compatibility protected virtual void AssertOutputEquals(object lhs, object rhs) { - Assert.AreEqual(lhs, rhs); + Assert.Equal(lhs, rhs); } - [TestMethod] + [Fact] public virtual void RoundTripWithEmptyChildMessageSize() { SizeMessage1 msg = SizeMessage1.CreateBuilder() @@ -37,12 +37,12 @@ namespace Google.ProtocolBuffers.Compatibility SizeMessage1 copy = DeserializeMessage(content, SizeMessage1.CreateBuilder(), ExtensionRegistry.Empty).BuildPartial(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray())); } - [TestMethod] + [Fact] public virtual void RoundTripWithEmptyChildMessageSpeed() { SpeedMessage1 msg = SpeedMessage1.CreateBuilder() @@ -54,12 +54,12 @@ namespace Google.ProtocolBuffers.Compatibility SpeedMessage1 copy = DeserializeMessage(content, SpeedMessage1.CreateBuilder(), ExtensionRegistry.Empty).BuildPartial(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray())); } - [TestMethod] + [Fact] public virtual void RoundTripMessage1OptimizeSize() { SizeMessage1 msg = SizeMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build(); @@ -67,12 +67,12 @@ namespace Google.ProtocolBuffers.Compatibility SizeMessage1 copy = DeserializeMessage(content, SizeMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray())); } - [TestMethod] + [Fact] public virtual void RoundTripMessage2OptimizeSize() { SizeMessage2 msg = SizeMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build(); @@ -80,12 +80,12 @@ namespace Google.ProtocolBuffers.Compatibility SizeMessage2 copy = DeserializeMessage(content, SizeMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray())); } - [TestMethod] + [Fact] public virtual void RoundTripMessage1OptimizeSpeed() { SpeedMessage1 msg = SpeedMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build(); @@ -93,12 +93,12 @@ namespace Google.ProtocolBuffers.Compatibility SpeedMessage1 copy = DeserializeMessage(content, SpeedMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray())); } - [TestMethod] + [Fact] public virtual void RoundTripMessage2OptimizeSpeed() { SpeedMessage2 msg = SpeedMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build(); @@ -106,9 +106,9 @@ namespace Google.ProtocolBuffers.Compatibility SpeedMessage2 copy = DeserializeMessage(content, SpeedMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray())); } #region Test message builders @@ -185,7 +185,7 @@ namespace Google.ProtocolBuffers.Compatibility #endregion - [TestMethod] + [Fact] public void TestRoundTripAllTypes() { TestAllTypes msg = AddAllTypes(new TestAllTypes.Builder()).Build(); @@ -193,12 +193,12 @@ namespace Google.ProtocolBuffers.Compatibility TestAllTypes copy = DeserializeMessage(content, TestAllTypes.CreateBuilder(), ExtensionRegistry.Empty).Build(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); } - [TestMethod] + [Fact] public void TestRoundTripRepeatedTypes() { TestAllTypes msg = AddRepeatedTypes(new TestAllTypes.Builder(), 5).Build(); @@ -206,12 +206,12 @@ namespace Google.ProtocolBuffers.Compatibility TestAllTypes copy = DeserializeMessage(content, TestAllTypes.CreateBuilder(), ExtensionRegistry.Empty).Build(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); } - [TestMethod] + [Fact] public void TestRoundTripPackedTypes() { TestPackedTypes msg = AddPackedTypes(new TestPackedTypes.Builder(), 5).Build(); @@ -219,9 +219,9 @@ namespace Google.ProtocolBuffers.Compatibility TestPackedTypes copy = DeserializeMessage(content, TestPackedTypes.CreateBuilder(), ExtensionRegistry.Empty).Build(); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); + Assert.Equal(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); } } } diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs index 73037cce..f555b101 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs @@ -1,13 +1,10 @@ using System; using System.Collections.Generic; -using System.IO; -using System.Text; using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers.Compatibility { - [TestClass] public class DictionaryCompatibilityTests : CompatibilityTests { protected override object SerializeMessage(TMessage message) @@ -28,7 +25,7 @@ namespace Google.ProtocolBuffers.Compatibility IDictionary left = (IDictionary)lhs; IDictionary right = (IDictionary)rhs; - Assert.AreEqual( + Assert.Equal( String.Join(",", new List(left.Keys).ToArray()), String.Join(",", new List(right.Keys).ToArray()) ); diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs index 74603108..3c943d33 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs @@ -1,11 +1,8 @@ using System.IO; -using System.Text; using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers.Compatibility { - [TestClass] public class JsonCompatibilityTests : CompatibilityTests { protected override object SerializeMessage(TMessage message) @@ -23,7 +20,6 @@ namespace Google.ProtocolBuffers.Compatibility } } - [TestClass] public class JsonCompatibilityFormattedTests : CompatibilityTests { protected override object SerializeMessage(TMessage message) diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs index c3ce5883..4d1187a4 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.IO; +using Xunit; namespace Google.ProtocolBuffers.Compatibility { @@ -15,11 +12,11 @@ namespace Google.ProtocolBuffers.Compatibility Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream( typeof(TestResources).Namespace + ".google_message1.dat"); - Assert.IsNotNull(resource, "Unable to the locate resource: google_message1"); + Assert.NotNull(resource); byte[] bytes = new byte[resource.Length]; int amtRead = resource.Read(bytes, 0, bytes.Length); - Assert.AreEqual(bytes.Length, amtRead); + Assert.Equal(bytes.Length, amtRead); return bytes; } } @@ -30,11 +27,10 @@ namespace Google.ProtocolBuffers.Compatibility Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream( typeof(TestResources).Namespace + ".google_message2.dat"); - Assert.IsNotNull(resource, "Unable to the locate resource: google_message2"); - + Assert.NotNull(resource); byte[] bytes = new byte[resource.Length]; int amtRead = resource.Read(bytes, 0, bytes.Length); - Assert.AreEqual(bytes.Length, amtRead); + Assert.Equal(bytes.Length, amtRead); return bytes; } } diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs index c2eaadf6..2d74cf9f 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs @@ -1,10 +1,8 @@ -using System.ComponentModel; using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers.Compatibility { - [TestClass] public class TextCompatibilityTests : CompatibilityTests { protected override object SerializeMessage(TMessage message) @@ -20,14 +18,14 @@ namespace Google.ProtocolBuffers.Compatibility return builder; } //This test can take a very long time to run. - [TestMethod] + [Fact] public override void RoundTripMessage2OptimizeSize() { //base.RoundTripMessage2OptimizeSize(); } //This test can take a very long time to run. - [TestMethod] + [Fact] public override void RoundTripMessage2OptimizeSpeed() { //base.RoundTripMessage2OptimizeSpeed(); diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs index 70614744..313523eb 100644 --- a/csharp/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs +++ b/csharp/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs @@ -1,12 +1,9 @@ using System.IO; using System.Xml; using Google.ProtocolBuffers.Serialization; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers.Compatibility { - [TestClass] public class XmlCompatibilityTests : CompatibilityTests { protected override object SerializeMessage(TMessage message) @@ -24,7 +21,6 @@ namespace Google.ProtocolBuffers.Compatibility } } - [TestClass] public class XmlCompatibilityFormattedTests : CompatibilityTests { protected override object SerializeMessage(TMessage message) diff --git a/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs b/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs index 0901f043..21d21928 100644 --- a/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs +++ b/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs @@ -1,22 +1,19 @@ using System; -using System.Collections.Generic; using System.Reflection; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; using UnitTest.Issues.TestProtos; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class DeprecatedMemberTest { private static void AssertIsDeprecated(MemberInfo member) { - Assert.IsNotNull(member); - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); + Assert.NotNull(member); + Assert.True(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); } - [TestMethod] + [Fact] public void TestDepreatedPrimitiveValue() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasPrimitiveValue")); @@ -27,7 +24,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveValue")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetPrimitiveValue")); } - [TestMethod] + [Fact] public void TestDepreatedPrimitiveArray() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("PrimitiveArrayList")); @@ -42,7 +39,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangePrimitiveArray")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveArray")); } - [TestMethod] + [Fact] public void TestDepreatedMessageValue() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasMessageValue")); @@ -55,7 +52,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild) })); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild.Builder) })); } - [TestMethod] + [Fact] public void TestDepreatedMessageArray() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("MessageArrayList")); @@ -72,7 +69,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangeMessageArray")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearMessageArray")); } - [TestMethod] + [Fact] public void TestDepreatedEnumValue() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasEnumValue")); @@ -83,7 +80,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearEnumValue")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetEnumValue")); } - [TestMethod] + [Fact] public void TestDepreatedEnumArray() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("EnumArrayList")); diff --git a/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs b/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs index e74236fb..680887d3 100644 --- a/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs +++ b/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs @@ -34,10 +34,9 @@ #endregion -using System.Text; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { @@ -45,106 +44,105 @@ namespace Google.ProtocolBuffers /// Tests for descriptors. (Not in its own namespace or broken up into individual classes as the /// size doesn't warrant it. On the other hand, this makes me feel a bit dirty...) /// - [TestClass] public class DescriptorsTest { - [TestMethod] + [Fact] public void FileDescriptor() { FileDescriptor file = Unittest.Descriptor; - Assert.AreEqual("google/protobuf/unittest.proto", file.Name); - Assert.AreEqual("protobuf_unittest", file.Package); + Assert.Equal("google/protobuf/unittest.proto", file.Name); + Assert.Equal("protobuf_unittest", file.Package); - Assert.AreEqual("UnittestProto", file.Options.JavaOuterClassname); - Assert.AreEqual("google/protobuf/unittest.proto", file.Proto.Name); + Assert.Equal("UnittestProto", file.Options.JavaOuterClassname); + Assert.Equal("google/protobuf/unittest.proto", file.Proto.Name); // unittest.proto doesn't have any public imports, but unittest_import.proto does. - Assert.AreEqual(0, file.PublicDependencies.Count); - Assert.AreEqual(1, UnittestImport.Descriptor.PublicDependencies.Count); - Assert.AreEqual(UnittestImportPublic.Descriptor, UnittestImport.Descriptor.PublicDependencies[0]); + Assert.Equal(0, file.PublicDependencies.Count); + Assert.Equal(1, UnittestImport.Descriptor.PublicDependencies.Count); + Assert.Equal(UnittestImportPublic.Descriptor, UnittestImport.Descriptor.PublicDependencies[0]); - Assert.AreEqual(1, file.Dependencies.Count); - Assert.AreEqual(UnittestImport.Descriptor, file.Dependencies[0]); + Assert.Equal(1, file.Dependencies.Count); + Assert.Equal(UnittestImport.Descriptor, file.Dependencies[0]); MessageDescriptor messageType = TestAllTypes.Descriptor; - Assert.AreEqual(messageType, file.MessageTypes[0]); - Assert.AreEqual(messageType, file.FindTypeByName("TestAllTypes")); - Assert.IsNull(file.FindTypeByName("NoSuchType")); - Assert.IsNull(file.FindTypeByName("protobuf_unittest.TestAllTypes")); + Assert.Equal(messageType, file.MessageTypes[0]); + Assert.Equal(messageType, file.FindTypeByName("TestAllTypes")); + Assert.Null(file.FindTypeByName("NoSuchType")); + Assert.Null(file.FindTypeByName("protobuf_unittest.TestAllTypes")); for (int i = 0; i < file.MessageTypes.Count; i++) { - Assert.AreEqual(i, file.MessageTypes[i].Index); + Assert.Equal(i, file.MessageTypes[i].Index); } - Assert.AreEqual(file.EnumTypes[0], file.FindTypeByName("ForeignEnum")); - Assert.IsNull(file.FindTypeByName("NoSuchType")); - Assert.IsNull(file.FindTypeByName("protobuf_unittest.ForeignEnum")); - Assert.AreEqual(1, UnittestImport.Descriptor.EnumTypes.Count); - Assert.AreEqual("ImportEnum", UnittestImport.Descriptor.EnumTypes[0].Name); + Assert.Equal(file.EnumTypes[0], file.FindTypeByName("ForeignEnum")); + Assert.Null(file.FindTypeByName("NoSuchType")); + Assert.Null(file.FindTypeByName("protobuf_unittest.ForeignEnum")); + Assert.Equal(1, UnittestImport.Descriptor.EnumTypes.Count); + Assert.Equal("ImportEnum", UnittestImport.Descriptor.EnumTypes[0].Name); for (int i = 0; i < file.EnumTypes.Count; i++) { - Assert.AreEqual(i, file.EnumTypes[i].Index); + Assert.Equal(i, file.EnumTypes[i].Index); } FieldDescriptor extension = Unittest.OptionalInt32Extension.Descriptor; - Assert.AreEqual(extension, file.Extensions[0]); - Assert.AreEqual(extension, file.FindTypeByName("optional_int32_extension")); - Assert.IsNull(file.FindTypeByName("no_such_ext")); - Assert.IsNull(file.FindTypeByName("protobuf_unittest.optional_int32_extension")); - Assert.AreEqual(0, UnittestImport.Descriptor.Extensions.Count); + Assert.Equal(extension, file.Extensions[0]); + Assert.Equal(extension, file.FindTypeByName("optional_int32_extension")); + Assert.Null(file.FindTypeByName("no_such_ext")); + Assert.Null(file.FindTypeByName("protobuf_unittest.optional_int32_extension")); + Assert.Equal(0, UnittestImport.Descriptor.Extensions.Count); for (int i = 0; i < file.Extensions.Count; i++) { - Assert.AreEqual(i, file.Extensions[i].Index); + Assert.Equal(i, file.Extensions[i].Index); } } - [TestMethod] + [Fact] public void MessageDescriptor() { MessageDescriptor messageType = TestAllTypes.Descriptor; MessageDescriptor nestedType = TestAllTypes.Types.NestedMessage.Descriptor; - Assert.AreEqual("TestAllTypes", messageType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes", messageType.FullName); - Assert.AreEqual(Unittest.Descriptor, messageType.File); - Assert.IsNull(messageType.ContainingType); - Assert.AreEqual(DescriptorProtos.MessageOptions.DefaultInstance, messageType.Options); - Assert.AreEqual("TestAllTypes", messageType.Proto.Name); + Assert.Equal("TestAllTypes", messageType.Name); + Assert.Equal("protobuf_unittest.TestAllTypes", messageType.FullName); + Assert.Equal(Unittest.Descriptor, messageType.File); + Assert.Null(messageType.ContainingType); + Assert.Equal(DescriptorProtos.MessageOptions.DefaultInstance, messageType.Options); + Assert.Equal("TestAllTypes", messageType.Proto.Name); - Assert.AreEqual("NestedMessage", nestedType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedMessage", nestedType.FullName); - Assert.AreEqual(Unittest.Descriptor, nestedType.File); - Assert.AreEqual(messageType, nestedType.ContainingType); + Assert.Equal("NestedMessage", nestedType.Name); + Assert.Equal("protobuf_unittest.TestAllTypes.NestedMessage", nestedType.FullName); + Assert.Equal(Unittest.Descriptor, nestedType.File); + Assert.Equal(messageType, nestedType.ContainingType); FieldDescriptor field = messageType.Fields[0]; - Assert.AreEqual("optional_int32", field.Name); - Assert.AreEqual(field, messageType.FindDescriptor("optional_int32")); - Assert.IsNull(messageType.FindDescriptor("no_such_field")); - Assert.AreEqual(field, messageType.FindFieldByNumber(1)); - Assert.IsNull(messageType.FindFieldByNumber(571283)); + Assert.Equal("optional_int32", field.Name); + Assert.Equal(field, messageType.FindDescriptor("optional_int32")); + Assert.Null(messageType.FindDescriptor("no_such_field")); + Assert.Equal(field, messageType.FindFieldByNumber(1)); + Assert.Null(messageType.FindFieldByNumber(571283)); for (int i = 0; i < messageType.Fields.Count; i++) { - Assert.AreEqual(i, messageType.Fields[i].Index); + Assert.Equal(i, messageType.Fields[i].Index); } - Assert.AreEqual(nestedType, messageType.NestedTypes[0]); - Assert.AreEqual(nestedType, messageType.FindDescriptor("NestedMessage")); - Assert.IsNull(messageType.FindDescriptor("NoSuchType")); + Assert.Equal(nestedType, messageType.NestedTypes[0]); + Assert.Equal(nestedType, messageType.FindDescriptor("NestedMessage")); + Assert.Null(messageType.FindDescriptor("NoSuchType")); for (int i = 0; i < messageType.NestedTypes.Count; i++) { - Assert.AreEqual(i, messageType.NestedTypes[i].Index); + Assert.Equal(i, messageType.NestedTypes[i].Index); } - Assert.AreEqual(messageType.EnumTypes[0], messageType.FindDescriptor("NestedEnum")); - Assert.IsNull(messageType.FindDescriptor("NoSuchType")); + Assert.Equal(messageType.EnumTypes[0], messageType.FindDescriptor("NestedEnum")); + Assert.Null(messageType.FindDescriptor("NoSuchType")); for (int i = 0; i < messageType.EnumTypes.Count; i++) { - Assert.AreEqual(i, messageType.EnumTypes[i].Index); + Assert.Equal(i, messageType.EnumTypes[i].Index); } } - [TestMethod] + [Fact] public void FieldDescriptor() { MessageDescriptor messageType = TestAllTypes.Descriptor; @@ -155,54 +153,54 @@ namespace Google.ProtocolBuffers FieldDescriptor extension = Unittest.OptionalInt32Extension.Descriptor; FieldDescriptor nestedExtension = TestRequired.Single.Descriptor; - Assert.AreEqual("optional_int32", primitiveField.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.optional_int32", + Assert.Equal("optional_int32", primitiveField.Name); + Assert.Equal("protobuf_unittest.TestAllTypes.optional_int32", primitiveField.FullName); - Assert.AreEqual(1, primitiveField.FieldNumber); - Assert.AreEqual(messageType, primitiveField.ContainingType); - Assert.AreEqual(Unittest.Descriptor, primitiveField.File); - Assert.AreEqual(FieldType.Int32, primitiveField.FieldType); - Assert.AreEqual(MappedType.Int32, primitiveField.MappedType); - Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance, primitiveField.Options); - Assert.IsFalse(primitiveField.IsExtension); - Assert.AreEqual("optional_int32", primitiveField.Proto.Name); - - Assert.AreEqual("optional_nested_enum", enumField.Name); - Assert.AreEqual(FieldType.Enum, enumField.FieldType); - Assert.AreEqual(MappedType.Enum, enumField.MappedType); - // Assert.AreEqual(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType); - - Assert.AreEqual("optional_foreign_message", messageField.Name); - Assert.AreEqual(FieldType.Message, messageField.FieldType); - Assert.AreEqual(MappedType.Message, messageField.MappedType); - Assert.AreEqual(ForeignMessage.Descriptor, messageField.MessageType); - - Assert.AreEqual("optional_cord", cordField.Name); - Assert.AreEqual(FieldType.String, cordField.FieldType); - Assert.AreEqual(MappedType.String, cordField.MappedType); - Assert.AreEqual(DescriptorProtos.FieldOptions.Types.CType.CORD, cordField.Options.Ctype); - - Assert.AreEqual("optional_int32_extension", extension.Name); - Assert.AreEqual("protobuf_unittest.optional_int32_extension", extension.FullName); - Assert.AreEqual(1, extension.FieldNumber); - Assert.AreEqual(TestAllExtensions.Descriptor, extension.ContainingType); - Assert.AreEqual(Unittest.Descriptor, extension.File); - Assert.AreEqual(FieldType.Int32, extension.FieldType); - Assert.AreEqual(MappedType.Int32, extension.MappedType); - Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance, + Assert.Equal(1, primitiveField.FieldNumber); + Assert.Equal(messageType, primitiveField.ContainingType); + Assert.Equal(Unittest.Descriptor, primitiveField.File); + Assert.Equal(FieldType.Int32, primitiveField.FieldType); + Assert.Equal(MappedType.Int32, primitiveField.MappedType); + Assert.Equal(DescriptorProtos.FieldOptions.DefaultInstance, primitiveField.Options); + Assert.False(primitiveField.IsExtension); + Assert.Equal("optional_int32", primitiveField.Proto.Name); + + Assert.Equal("optional_nested_enum", enumField.Name); + Assert.Equal(FieldType.Enum, enumField.FieldType); + Assert.Equal(MappedType.Enum, enumField.MappedType); + // Assert.Equal(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType); + + Assert.Equal("optional_foreign_message", messageField.Name); + Assert.Equal(FieldType.Message, messageField.FieldType); + Assert.Equal(MappedType.Message, messageField.MappedType); + Assert.Equal(ForeignMessage.Descriptor, messageField.MessageType); + + Assert.Equal("optional_cord", cordField.Name); + Assert.Equal(FieldType.String, cordField.FieldType); + Assert.Equal(MappedType.String, cordField.MappedType); + Assert.Equal(DescriptorProtos.FieldOptions.Types.CType.CORD, cordField.Options.Ctype); + + Assert.Equal("optional_int32_extension", extension.Name); + Assert.Equal("protobuf_unittest.optional_int32_extension", extension.FullName); + Assert.Equal(1, extension.FieldNumber); + Assert.Equal(TestAllExtensions.Descriptor, extension.ContainingType); + Assert.Equal(Unittest.Descriptor, extension.File); + Assert.Equal(FieldType.Int32, extension.FieldType); + Assert.Equal(MappedType.Int32, extension.MappedType); + Assert.Equal(DescriptorProtos.FieldOptions.DefaultInstance, extension.Options); - Assert.IsTrue(extension.IsExtension); - Assert.AreEqual(null, extension.ExtensionScope); - Assert.AreEqual("optional_int32_extension", extension.Proto.Name); + Assert.True(extension.IsExtension); + Assert.Equal(null, extension.ExtensionScope); + Assert.Equal("optional_int32_extension", extension.Proto.Name); - Assert.AreEqual("single", nestedExtension.Name); - Assert.AreEqual("protobuf_unittest.TestRequired.single", + Assert.Equal("single", nestedExtension.Name); + Assert.Equal("protobuf_unittest.TestRequired.single", nestedExtension.FullName); - Assert.AreEqual(TestRequired.Descriptor, + Assert.Equal(TestRequired.Descriptor, nestedExtension.ExtensionScope); } - [TestMethod] + [Fact] public void FieldDescriptorLabel() { FieldDescriptor requiredField = @@ -212,76 +210,76 @@ namespace Google.ProtocolBuffers FieldDescriptor repeatedField = TestAllTypes.Descriptor.FindDescriptor("repeated_int32"); - Assert.IsTrue(requiredField.IsRequired); - Assert.IsFalse(requiredField.IsRepeated); - Assert.IsFalse(optionalField.IsRequired); - Assert.IsFalse(optionalField.IsRepeated); - Assert.IsFalse(repeatedField.IsRequired); - Assert.IsTrue(repeatedField.IsRepeated); + Assert.True(requiredField.IsRequired); + Assert.False(requiredField.IsRepeated); + Assert.False(optionalField.IsRequired); + Assert.False(optionalField.IsRepeated); + Assert.False(repeatedField.IsRequired); + Assert.True(repeatedField.IsRepeated); } - [TestMethod] + [Fact] public void FieldDescriptorDefault() { MessageDescriptor d = TestAllTypes.Descriptor; - Assert.IsFalse(d.FindDescriptor("optional_int32").HasDefaultValue); - Assert.AreEqual(0, d.FindDescriptor("optional_int32").DefaultValue); - Assert.IsTrue(d.FindDescriptor("default_int32").HasDefaultValue); - Assert.AreEqual(41, d.FindDescriptor("default_int32").DefaultValue); + Assert.False(d.FindDescriptor("optional_int32").HasDefaultValue); + Assert.Equal(0, d.FindDescriptor("optional_int32").DefaultValue); + Assert.True(d.FindDescriptor("default_int32").HasDefaultValue); + Assert.Equal(41, d.FindDescriptor("default_int32").DefaultValue); d = TestExtremeDefaultValues.Descriptor; - Assert.AreEqual(TestExtremeDefaultValues.DefaultInstance.EscapedBytes, + Assert.Equal(TestExtremeDefaultValues.DefaultInstance.EscapedBytes, d.FindDescriptor("escaped_bytes").DefaultValue); - Assert.AreEqual(uint.MaxValue, d.FindDescriptor("large_uint32").DefaultValue); - Assert.AreEqual(ulong.MaxValue, d.FindDescriptor("large_uint64").DefaultValue); + Assert.Equal(uint.MaxValue, d.FindDescriptor("large_uint32").DefaultValue); + Assert.Equal(ulong.MaxValue, d.FindDescriptor("large_uint64").DefaultValue); } - [TestMethod] + [Fact] public void EnumDescriptor() { // Note: this test is a bit different to the Java version because there's no static way of getting to the descriptor EnumDescriptor enumType = Unittest.Descriptor.FindTypeByName("ForeignEnum"); EnumDescriptor nestedType = TestAllTypes.Descriptor.FindDescriptor("NestedEnum"); - Assert.AreEqual("ForeignEnum", enumType.Name); - Assert.AreEqual("protobuf_unittest.ForeignEnum", enumType.FullName); - Assert.AreEqual(Unittest.Descriptor, enumType.File); - Assert.IsNull(enumType.ContainingType); - Assert.AreEqual(DescriptorProtos.EnumOptions.DefaultInstance, + Assert.Equal("ForeignEnum", enumType.Name); + Assert.Equal("protobuf_unittest.ForeignEnum", enumType.FullName); + Assert.Equal(Unittest.Descriptor, enumType.File); + Assert.Null(enumType.ContainingType); + Assert.Equal(DescriptorProtos.EnumOptions.DefaultInstance, enumType.Options); - Assert.AreEqual("NestedEnum", nestedType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedEnum", + Assert.Equal("NestedEnum", nestedType.Name); + Assert.Equal("protobuf_unittest.TestAllTypes.NestedEnum", nestedType.FullName); - Assert.AreEqual(Unittest.Descriptor, nestedType.File); - Assert.AreEqual(TestAllTypes.Descriptor, nestedType.ContainingType); + Assert.Equal(Unittest.Descriptor, nestedType.File); + Assert.Equal(TestAllTypes.Descriptor, nestedType.ContainingType); EnumValueDescriptor value = enumType.FindValueByName("FOREIGN_FOO"); - Assert.AreEqual(value, enumType.Values[0]); - Assert.AreEqual("FOREIGN_FOO", value.Name); - Assert.AreEqual(4, value.Number); - Assert.AreEqual((int) ForeignEnum.FOREIGN_FOO, value.Number); - Assert.AreEqual(value, enumType.FindValueByNumber(4)); - Assert.IsNull(enumType.FindValueByName("NO_SUCH_VALUE")); + Assert.Equal(value, enumType.Values[0]); + Assert.Equal("FOREIGN_FOO", value.Name); + Assert.Equal(4, value.Number); + Assert.Equal((int) ForeignEnum.FOREIGN_FOO, value.Number); + Assert.Equal(value, enumType.FindValueByNumber(4)); + Assert.Null(enumType.FindValueByName("NO_SUCH_VALUE")); for (int i = 0; i < enumType.Values.Count; i++) { - Assert.AreEqual(i, enumType.Values[i].Index); + Assert.Equal(i, enumType.Values[i].Index); } } - [TestMethod] + [Fact] public void CustomOptions() { MessageDescriptor descriptor = TestMessageWithCustomOptions.Descriptor; - Assert.IsTrue(descriptor.Options.HasExtension(UnittestCustomOptions.MessageOpt1)); - Assert.AreEqual(-56, descriptor.Options.GetExtension(UnittestCustomOptions.MessageOpt1)); + Assert.True(descriptor.Options.HasExtension(UnittestCustomOptions.MessageOpt1)); + Assert.Equal(-56, descriptor.Options.GetExtension(UnittestCustomOptions.MessageOpt1)); FieldDescriptor field = descriptor.FindFieldByName("field1"); - Assert.IsNotNull(field); + Assert.NotNull(field); - Assert.IsTrue(field.Options.HasExtension(UnittestCustomOptions.FieldOpt1)); - Assert.AreEqual(8765432109uL, field.Options.GetExtension(UnittestCustomOptions.FieldOpt1)); + Assert.True(field.Options.HasExtension(UnittestCustomOptions.FieldOpt1)); + Assert.Equal(8765432109uL, field.Options.GetExtension(UnittestCustomOptions.FieldOpt1)); } } diff --git a/csharp/src/ProtocolBuffers.Test/DynamicMessageTest.cs b/csharp/src/ProtocolBuffers.Test/DynamicMessageTest.cs index 92515999..39f122aa 100644 --- a/csharp/src/ProtocolBuffers.Test/DynamicMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/DynamicMessageTest.cs @@ -37,26 +37,24 @@ using System; using System.Collections.Generic; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class DynamicMessageTest { private ReflectionTester reflectionTester; private ReflectionTester extensionsReflectionTester; private ReflectionTester packedReflectionTester; - [TestInitialize] - public void SetUp() + public DynamicMessageTest() { reflectionTester = ReflectionTester.CreateTestAllTypesInstance(); extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance(); packedReflectionTester = ReflectionTester.CreateTestPackedTypesInstance(); } - [TestMethod] + [Fact] public void DynamicMessageAccessors() { IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); @@ -65,30 +63,22 @@ namespace Google.ProtocolBuffers reflectionTester.AssertAllFieldsSetViaReflection(message); } - [TestMethod] + [Fact] public void DoubleBuildError() { DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); builder.Build(); - try - { - builder.Build(); - Assert.Fail("Should have thrown exception."); - } - catch (InvalidOperationException) - { - // Success. - } - } - - [TestMethod] + Assert.Throws(() => builder.Build()); + } + + [Fact] public void DynamicMessageSettersRejectNull() { IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); reflectionTester.AssertReflectionSettersRejectNull(builder); } - [TestMethod] + [Fact] public void DynamicMessageExtensionAccessors() { // We don't need to extensively test DynamicMessage's handling of @@ -100,14 +90,14 @@ namespace Google.ProtocolBuffers extensionsReflectionTester.AssertAllFieldsSetViaReflection(message); } - [TestMethod] + [Fact] public void DynamicMessageExtensionSettersRejectNull() { IBuilder builder = DynamicMessage.CreateBuilder(TestAllExtensions.Descriptor); extensionsReflectionTester.AssertReflectionSettersRejectNull(builder); } - [TestMethod] + [Fact] public void DynamicMessageRepeatedSetters() { IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); @@ -117,21 +107,21 @@ namespace Google.ProtocolBuffers reflectionTester.AssertRepeatedFieldsModifiedViaReflection(message); } - [TestMethod] + [Fact] public void DynamicMessageRepeatedSettersRejectNull() { IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); reflectionTester.AssertReflectionRepeatedSettersRejectNull(builder); } - [TestMethod] + [Fact] public void DynamicMessageDefaults() { reflectionTester.AssertClearViaReflection(DynamicMessage.GetDefaultInstance(TestAllTypes.Descriptor)); reflectionTester.AssertClearViaReflection(DynamicMessage.CreateBuilder(TestAllTypes.Descriptor).Build()); } - [TestMethod] + [Fact] public void DynamicMessageSerializedSize() { TestAllTypes message = TestUtil.GetAllSet(); @@ -140,10 +130,10 @@ namespace Google.ProtocolBuffers reflectionTester.SetAllFieldsViaReflection(dynamicBuilder); IMessage dynamicMessage = dynamicBuilder.WeakBuild(); - Assert.AreEqual(message.SerializedSize, dynamicMessage.SerializedSize); + Assert.Equal(message.SerializedSize, dynamicMessage.SerializedSize); } - [TestMethod] + [Fact] public void DynamicMessageSerialization() { IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); @@ -156,10 +146,10 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(message2); // In fact, the serialized forms should be exactly the same, byte-for-byte. - Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), rawBytes); + Assert.Equal(TestUtil.GetAllSet().ToByteString(), rawBytes); } - [TestMethod] + [Fact] public void DynamicMessageParsing() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -172,7 +162,7 @@ namespace Google.ProtocolBuffers reflectionTester.AssertAllFieldsSetViaReflection(message2); } - [TestMethod] + [Fact] public void DynamicMessagePackedSerialization() { IBuilder builder = DynamicMessage.CreateBuilder(TestPackedTypes.Descriptor); @@ -185,11 +175,11 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedFieldsSet(message2); // In fact, the serialized forms should be exactly the same, byte-for-byte. - Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), rawBytes); + Assert.Equal(TestUtil.GetPackedSet().ToByteString(), rawBytes); } - [TestMethod] - public void testDynamicMessagePackedParsing() + [Fact] + public void DynamicMessagePackedParsing() { TestPackedTypes.Builder builder = TestPackedTypes.CreateBuilder(); TestUtil.SetPackedFields(builder); @@ -201,7 +191,7 @@ namespace Google.ProtocolBuffers packedReflectionTester.AssertPackedFieldsSetViaReflection(message2); } - [TestMethod] + [Fact] public void DynamicMessageCopy() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -212,7 +202,7 @@ namespace Google.ProtocolBuffers reflectionTester.AssertAllFieldsSetViaReflection(copy); } - [TestMethod] + [Fact] public void ToBuilder() { DynamicMessage.Builder builder = @@ -230,8 +220,8 @@ namespace Google.ProtocolBuffers reflectionTester.AssertAllFieldsSetViaReflection(derived); IList values = derived.UnknownFields.FieldDictionary[unknownFieldNum].VarintList; - Assert.AreEqual(1, values.Count); - Assert.AreEqual(unknownFieldVal, values[0]); + Assert.Equal(1, values.Count); + Assert.Equal(unknownFieldVal, values[0]); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs b/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs index 4e0bf8e6..f329270b 100644 --- a/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/ExtendableMessageTest.cs @@ -35,24 +35,22 @@ #endregion using System; -using System.Collections.Generic; -using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class ExtendableMessageTest { - [TestMethod, ExpectedException(typeof(ArgumentException))] + [Fact] public void ExtensionWriterInvalidExtension() { - TestPackedExtensions.CreateBuilder()[Unittest.OptionalForeignMessageExtension.Descriptor] = - ForeignMessage.DefaultInstance; + Assert.Throws(() => + TestPackedExtensions.CreateBuilder()[Unittest.OptionalForeignMessageExtension.Descriptor] = + ForeignMessage.DefaultInstance); } - [TestMethod] + [Fact] public void ExtensionWriterTest() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder() @@ -128,75 +126,75 @@ namespace Google.ProtocolBuffers registry); TestAllExtensions copy = copyBuilder.Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual(true, copy.GetExtension(Unittest.DefaultBoolExtension)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(Unittest.DefaultBytesExtension)); - Assert.AreEqual("123", copy.GetExtension(Unittest.DefaultCordExtension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultDoubleExtension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultFixed32Extension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultFixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultFloatExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(Unittest.DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.DefaultImportEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultInt32Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultInt64Extension)); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, + Assert.Equal(true, copy.GetExtension(Unittest.DefaultBoolExtension)); + Assert.Equal(ByteString.CopyFromUtf8("123"), copy.GetExtension(Unittest.DefaultBytesExtension)); + Assert.Equal("123", copy.GetExtension(Unittest.DefaultCordExtension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultDoubleExtension)); + Assert.Equal(123u, copy.GetExtension(Unittest.DefaultFixed32Extension)); + Assert.Equal(123u, copy.GetExtension(Unittest.DefaultFixed64Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultFloatExtension)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(Unittest.DefaultForeignEnumExtension)); + Assert.Equal(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.DefaultImportEnumExtension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultInt32Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultInt64Extension)); + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, copy.GetExtension(Unittest.DefaultNestedEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSfixed32Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSfixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSint32Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.DefaultSint64Extension)); - Assert.AreEqual("123", copy.GetExtension(Unittest.DefaultStringExtension)); - Assert.AreEqual("123", copy.GetExtension(Unittest.DefaultStringPieceExtension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultUint32Extension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.DefaultUint64Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultSfixed32Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultSfixed64Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultSint32Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.DefaultSint64Extension)); + Assert.Equal("123", copy.GetExtension(Unittest.DefaultStringExtension)); + Assert.Equal("123", copy.GetExtension(Unittest.DefaultStringPieceExtension)); + Assert.Equal(123u, copy.GetExtension(Unittest.DefaultUint32Extension)); + Assert.Equal(123u, copy.GetExtension(Unittest.DefaultUint64Extension)); - Assert.AreEqual(true, copy.GetExtension(Unittest.OptionalBoolExtension)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(Unittest.OptionalBytesExtension)); - Assert.AreEqual("123", copy.GetExtension(Unittest.OptionalCordExtension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalDoubleExtension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalFixed32Extension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalFixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalFloatExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(Unittest.OptionalForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.OptionalImportEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalInt32Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalInt64Extension)); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, + Assert.Equal(true, copy.GetExtension(Unittest.OptionalBoolExtension)); + Assert.Equal(ByteString.CopyFromUtf8("123"), copy.GetExtension(Unittest.OptionalBytesExtension)); + Assert.Equal("123", copy.GetExtension(Unittest.OptionalCordExtension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalDoubleExtension)); + Assert.Equal(123u, copy.GetExtension(Unittest.OptionalFixed32Extension)); + Assert.Equal(123u, copy.GetExtension(Unittest.OptionalFixed64Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalFloatExtension)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(Unittest.OptionalForeignEnumExtension)); + Assert.Equal(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.OptionalImportEnumExtension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalInt32Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalInt64Extension)); + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, copy.GetExtension(Unittest.OptionalNestedEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSfixed32Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSfixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSint32Extension)); - Assert.AreEqual(123, copy.GetExtension(Unittest.OptionalSint64Extension)); - Assert.AreEqual("123", copy.GetExtension(Unittest.OptionalStringExtension)); - Assert.AreEqual("123", copy.GetExtension(Unittest.OptionalStringPieceExtension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalUint32Extension)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.OptionalUint64Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalSfixed32Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalSfixed64Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalSint32Extension)); + Assert.Equal(123, copy.GetExtension(Unittest.OptionalSint64Extension)); + Assert.Equal("123", copy.GetExtension(Unittest.OptionalStringExtension)); + Assert.Equal("123", copy.GetExtension(Unittest.OptionalStringPieceExtension)); + Assert.Equal(123u, copy.GetExtension(Unittest.OptionalUint32Extension)); + Assert.Equal(123u, copy.GetExtension(Unittest.OptionalUint64Extension)); - Assert.AreEqual(true, copy.GetExtension(Unittest.RepeatedBoolExtension, 0)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), + Assert.Equal(true, copy.GetExtension(Unittest.RepeatedBoolExtension, 0)); + Assert.Equal(ByteString.CopyFromUtf8("123"), copy.GetExtension(Unittest.RepeatedBytesExtension, 0)); - Assert.AreEqual("123", copy.GetExtension(Unittest.RepeatedCordExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedDoubleExtension, 0)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedFixed32Extension, 0)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedFixed64Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedFloatExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, + Assert.Equal("123", copy.GetExtension(Unittest.RepeatedCordExtension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedDoubleExtension, 0)); + Assert.Equal(123u, copy.GetExtension(Unittest.RepeatedFixed32Extension, 0)); + Assert.Equal(123u, copy.GetExtension(Unittest.RepeatedFixed64Extension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedFloatExtension, 0)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(Unittest.RepeatedForeignEnumExtension, 0)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.RepeatedImportEnumExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedInt32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedInt64Extension, 0)); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, + Assert.Equal(ImportEnum.IMPORT_BAZ, copy.GetExtension(Unittest.RepeatedImportEnumExtension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedInt32Extension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedInt64Extension, 0)); + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, copy.GetExtension(Unittest.RepeatedNestedEnumExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSint32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(Unittest.RepeatedSint64Extension, 0)); - Assert.AreEqual("123", copy.GetExtension(Unittest.RepeatedStringExtension, 0)); - Assert.AreEqual("123", copy.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedUint32Extension, 0)); - Assert.AreEqual(123u, copy.GetExtension(Unittest.RepeatedUint64Extension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedSint32Extension, 0)); + Assert.Equal(123, copy.GetExtension(Unittest.RepeatedSint64Extension, 0)); + Assert.Equal("123", copy.GetExtension(Unittest.RepeatedStringExtension, 0)); + Assert.Equal("123", copy.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); + Assert.Equal(123u, copy.GetExtension(Unittest.RepeatedUint32Extension, 0)); + Assert.Equal(123u, copy.GetExtension(Unittest.RepeatedUint64Extension, 0)); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs b/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs index 1dcb1c21..692bfd11 100644 --- a/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs +++ b/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; -using System.Text; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class GeneratedBuilderTest { class OneTimeEnumerator : IEnumerable @@ -19,107 +17,86 @@ namespace Google.ProtocolBuffers } public IEnumerator GetEnumerator() { - Assert.IsFalse(_enumerated, "The collection {0} has already been enumerated", GetType()); + Assert.False(_enumerated); _enumerated = true; yield return _item; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { return GetEnumerator(); } + { + return GetEnumerator(); + } } - [TestMethod] + [Fact] public void DoesNotEnumerateTwiceForMessageList() { TestAllTypes.Builder b = new TestAllTypes.Builder(); - b.AddRangeRepeatedForeignMessage( - new OneTimeEnumerator( - ForeignMessage.DefaultInstance)); + b.AddRangeRepeatedForeignMessage(new OneTimeEnumerator(ForeignMessage.DefaultInstance)); } - [TestMethod] + + [Fact] public void DoesNotEnumerateTwiceForPrimitiveList() { TestAllTypes.Builder b = new TestAllTypes.Builder(); b.AddRangeRepeatedInt32(new OneTimeEnumerator(1)); } - [TestMethod] + + [Fact] public void DoesNotEnumerateTwiceForStringList() { TestAllTypes.Builder b = new TestAllTypes.Builder(); b.AddRangeRepeatedString(new OneTimeEnumerator("test")); } - [TestMethod] + + [Fact] public void DoesNotEnumerateTwiceForEnumList() { TestAllTypes.Builder b = new TestAllTypes.Builder(); b.AddRangeRepeatedForeignEnum(new OneTimeEnumerator(ForeignEnum.FOREIGN_BAR)); } - - private delegate void TestMethod(); - - private static void AssertThrows(TestMethod method) where T : Exception - { - try - { - method(); - } - catch (Exception error) - { - if (error is T) - return; - throw; - } - Assert.Fail("Expected exception of type " + typeof(T)); - } - - [TestMethod] + + [Fact] public void DoesNotAddNullToMessageListByAddRange() { TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null }) - ); + Assert.Throws(() => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null })); } - [TestMethod] + + [Fact] public void DoesNotAddNullToMessageListByAdd() { TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRepeatedForeignMessage((ForeignMessage)null) - ); + Assert.Throws(() => b.AddRepeatedForeignMessage((ForeignMessage)null)); } - [TestMethod] + + [Fact] public void DoesNotAddNullToMessageListBySet() { TestAllTypes.Builder b = new TestAllTypes.Builder(); b.AddRepeatedForeignMessage(ForeignMessage.DefaultInstance); - AssertThrows( - () => b.SetRepeatedForeignMessage(0, (ForeignMessage)null) - ); + Assert.Throws(() => b.SetRepeatedForeignMessage(0, (ForeignMessage)null)); } - [TestMethod] + + [Fact] public void DoesNotAddNullToStringListByAddRange() { TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRangeRepeatedString(new String[] { null }) - ); + Assert.Throws(() => b.AddRangeRepeatedString(new String[] { null })); } - [TestMethod] + + [Fact] public void DoesNotAddNullToStringListByAdd() { TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRepeatedString(null) - ); + Assert.Throws(() => b.AddRepeatedString(null)); } - [TestMethod] + + [Fact] public void DoesNotAddNullToStringListBySet() { TestAllTypes.Builder b = new TestAllTypes.Builder(); b.AddRepeatedString("one"); - AssertThrows( - () => b.SetRepeatedString(0, null) - ); + Assert.Throws(() => b.SetRepeatedString(0, null)); } } } diff --git a/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs b/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs index 0e8b9807..a9052954 100644 --- a/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs @@ -38,31 +38,29 @@ using System; using System.Collections.Generic; using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class GeneratedMessageTest { - private ReflectionTester reflectionTester; - private ReflectionTester extensionsReflectionTester; + private readonly ReflectionTester reflectionTester; + private readonly ReflectionTester extensionsReflectionTester; - [TestInitialize] - public void SetUp() + public GeneratedMessageTest() { reflectionTester = ReflectionTester.CreateTestAllTypesInstance(); extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance(); } - [TestMethod] + [Fact] public void RepeatedAddPrimitiveBeforeBuild() { TestAllTypes message = new TestAllTypes.Builder {RepeatedInt32List = {1, 2, 3}}.Build(); TestUtil.AssertEqual(new int[] {1, 2, 3}, message.RepeatedInt32List); } - [TestMethod] + [Fact] public void AddPrimitiveFailsAfterBuild() { TestAllTypes.Builder builder = new TestAllTypes.Builder(); @@ -70,18 +68,10 @@ namespace Google.ProtocolBuffers list.Add(1); // Fine builder.Build(); - try - { - list.Add(2); - Assert.Fail("List should be frozen"); - } - catch (NotSupportedException) - { - // Expected - } + Assert.Throws(() => list.Add(2)); } - [TestMethod] + [Fact] public void RepeatedAddMessageBeforeBuild() { TestAllTypes message = new TestAllTypes.Builder @@ -89,36 +79,28 @@ namespace Google.ProtocolBuffers RepeatedNestedMessageList = {new TestAllTypes.Types.NestedMessage.Builder {Bb = 10}.Build()} }.Build(); - Assert.AreEqual(1, message.RepeatedNestedMessageCount); - Assert.AreEqual(10, message.RepeatedNestedMessageList[0].Bb); + Assert.Equal(1, message.RepeatedNestedMessageCount); + Assert.Equal(10, message.RepeatedNestedMessageList[0].Bb); } - [TestMethod] + [Fact] public void AddMessageFailsAfterBuild() { TestAllTypes.Builder builder = new TestAllTypes.Builder(); IList list = builder.RepeatedNestedMessageList; builder.Build(); - try - { - list.Add(new TestAllTypes.Types.NestedMessage.Builder {Bb = 10}.Build()); - Assert.Fail("List should be frozen"); - } - catch (NotSupportedException) - { - // Expected - } + Assert.Throws(() => list.Add(new TestAllTypes.Types.NestedMessage.Builder { Bb = 10 }.Build())); } - [TestMethod] + [Fact] public void DefaultInstance() { - Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.DefaultInstance.DefaultInstanceForType); - Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().DefaultInstanceForType); + Assert.Same(TestAllTypes.DefaultInstance, TestAllTypes.DefaultInstance.DefaultInstanceForType); + Assert.Same(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().DefaultInstanceForType); } - [TestMethod] + [Fact] public void Accessors() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -127,25 +109,25 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(message); } - [TestMethod] + [Fact] public void SettersRejectNull() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.AssertArgumentNullException(() => builder.SetOptionalString(null)); - TestUtil.AssertArgumentNullException(() => builder.SetOptionalBytes(null)); - TestUtil.AssertArgumentNullException( + Assert.Throws(() => builder.SetOptionalString(null)); + Assert.Throws(() => builder.SetOptionalBytes(null)); + Assert.Throws( () => builder.SetOptionalNestedMessage((TestAllTypes.Types.NestedMessage) null)); - TestUtil.AssertArgumentNullException( + Assert.Throws( () => builder.SetOptionalNestedMessage((TestAllTypes.Types.NestedMessage.Builder) null)); - TestUtil.AssertArgumentNullException(() => builder.AddRepeatedString(null)); - TestUtil.AssertArgumentNullException(() => builder.AddRepeatedBytes(null)); - TestUtil.AssertArgumentNullException( + Assert.Throws(() => builder.AddRepeatedString(null)); + Assert.Throws(() => builder.AddRepeatedBytes(null)); + Assert.Throws( () => builder.AddRepeatedNestedMessage((TestAllTypes.Types.NestedMessage) null)); - TestUtil.AssertArgumentNullException( + Assert.Throws( () => builder.AddRepeatedNestedMessage((TestAllTypes.Types.NestedMessage.Builder) null)); } - [TestMethod] + [Fact] public void RepeatedSetters() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -155,7 +137,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertRepeatedFieldsModified(message); } - [TestMethod] + [Fact] public void RepeatedAppend() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -169,26 +151,26 @@ namespace Google.ProtocolBuffers TestAllTypes message = builder.Build(); TestUtil.AssertEqual(message.RepeatedInt32List, new int[] {1, 2, 3, 4}); TestUtil.AssertEqual(message.RepeatedForeignEnumList, new ForeignEnum[] {ForeignEnum.FOREIGN_BAZ}); - Assert.AreEqual(1, message.RepeatedForeignMessageCount); - Assert.AreEqual(12, message.GetRepeatedForeignMessage(0).C); + Assert.Equal(1, message.RepeatedForeignMessageCount); + Assert.Equal(12, message.GetRepeatedForeignMessage(0).C); } - [TestMethod] + [Fact] public void RepeatedAppendRejectsNull() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); ForeignMessage foreignMessage = ForeignMessage.CreateBuilder().SetC(12).Build(); - TestUtil.AssertArgumentNullException( + Assert.Throws( () => builder.AddRangeRepeatedForeignMessage(new[] {foreignMessage, null})); - TestUtil.AssertArgumentNullException(() => builder.AddRangeRepeatedForeignMessage(null)); - TestUtil.AssertArgumentNullException(() => builder.AddRangeRepeatedForeignEnum(null)); - TestUtil.AssertArgumentNullException(() => builder.AddRangeRepeatedString(new[] {"one", null})); - TestUtil.AssertArgumentNullException( + Assert.Throws(() => builder.AddRangeRepeatedForeignMessage(null)); + Assert.Throws(() => builder.AddRangeRepeatedForeignEnum(null)); + Assert.Throws(() => builder.AddRangeRepeatedString(new[] {"one", null})); + Assert.Throws( () => builder.AddRangeRepeatedBytes(new[] {TestUtil.ToBytes("one"), null})); } - [TestMethod] + [Fact] public void SettingForeignMessageUsingBuilder() { TestAllTypes message = TestAllTypes.CreateBuilder() @@ -199,10 +181,10 @@ namespace Google.ProtocolBuffers // Create expected version passing foreign message instance explicitly. .SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(123).Build()) .Build(); - Assert.AreEqual(expectedMessage, message); + Assert.Equal(expectedMessage, message); } - [TestMethod] + [Fact] public void SettingRepeatedForeignMessageUsingBuilder() { TestAllTypes message = TestAllTypes.CreateBuilder() @@ -213,10 +195,10 @@ namespace Google.ProtocolBuffers // Create expected version passing foreign message instance explicitly. .AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(456).Build()) .Build(); - Assert.AreEqual(expectedMessage, message); + Assert.Equal(expectedMessage, message); } - [TestMethod] + [Fact] public void SettingRepeatedValuesUsingRangeInCollectionInitializer() { int[] values = {1, 2, 3}; @@ -224,29 +206,29 @@ namespace Google.ProtocolBuffers { RepeatedSint32List = {values} }.Build(); - Assert.IsTrue(Lists.Equals(values, message.RepeatedSint32List)); + Assert.True(Lists.Equals(values, message.RepeatedSint32List)); } - [TestMethod] + [Fact] public void SettingRepeatedValuesUsingIndividualValuesInCollectionInitializer() { TestAllTypes message = new TestAllTypes.Builder { RepeatedSint32List = {6, 7} }.Build(); - Assert.IsTrue(Lists.Equals(new int[] {6, 7}, message.RepeatedSint32List)); + Assert.True(Lists.Equals(new int[] {6, 7}, message.RepeatedSint32List)); } - [TestMethod] + [Fact] public void Defaults() { TestUtil.AssertClear(TestAllTypes.DefaultInstance); TestUtil.AssertClear(TestAllTypes.CreateBuilder().Build()); - Assert.AreEqual("\u1234", TestExtremeDefaultValues.DefaultInstance.Utf8String); + Assert.Equal("\u1234", TestExtremeDefaultValues.DefaultInstance.Utf8String); } - [TestMethod] + [Fact] public void ReflectionGetters() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -255,7 +237,7 @@ namespace Google.ProtocolBuffers reflectionTester.AssertAllFieldsSetViaReflection(message); } - [TestMethod] + [Fact] public void ReflectionSetters() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -264,7 +246,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(message); } - [TestMethod] + [Fact] public void ReflectionClear() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -274,14 +256,14 @@ namespace Google.ProtocolBuffers TestUtil.AssertClear(message); } - [TestMethod] + [Fact] public void ReflectionSettersRejectNull() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); reflectionTester.AssertReflectionSettersRejectNull(builder); } - [TestMethod] + [Fact] public void ReflectionRepeatedSetters() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -291,14 +273,14 @@ namespace Google.ProtocolBuffers TestUtil.AssertRepeatedFieldsModified(message); } - [TestMethod] + [Fact] public void TestReflectionRepeatedSettersRejectNull() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); reflectionTester.AssertReflectionRepeatedSettersRejectNull(builder); } - [TestMethod] + [Fact] public void ReflectionDefaults() { TestUtil.TestInMultipleCultures(() => @@ -313,7 +295,7 @@ namespace Google.ProtocolBuffers // ================================================================= // Extensions. - [TestMethod] + [Fact] public void ExtensionAccessors() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -322,7 +304,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(message); } - [TestMethod] + [Fact] public void ExtensionRepeatedSetters() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -332,14 +314,14 @@ namespace Google.ProtocolBuffers TestUtil.AssertRepeatedExtensionsModified(message); } - [TestMethod] + [Fact] public void ExtensionDefaults() { TestUtil.AssertExtensionsClear(TestAllExtensions.DefaultInstance); TestUtil.AssertExtensionsClear(TestAllExtensions.CreateBuilder().Build()); } - [TestMethod] + [Fact] public void ExtensionReflectionGetters() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -348,7 +330,7 @@ namespace Google.ProtocolBuffers extensionsReflectionTester.AssertAllFieldsSetViaReflection(message); } - [TestMethod] + [Fact] public void ExtensionReflectionSetters() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -357,14 +339,14 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(message); } - [TestMethod] + [Fact] public void ExtensionReflectionSettersRejectNull() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); extensionsReflectionTester.AssertReflectionSettersRejectNull(builder); } - [TestMethod] + [Fact] public void ExtensionReflectionRepeatedSetters() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -374,14 +356,14 @@ namespace Google.ProtocolBuffers TestUtil.AssertRepeatedExtensionsModified(message); } - [TestMethod] + [Fact] public void ExtensionReflectionRepeatedSettersRejectNull() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); extensionsReflectionTester.AssertReflectionRepeatedSettersRejectNull(builder); } - [TestMethod] + [Fact] public void ExtensionReflectionDefaults() { TestUtil.TestInMultipleCultures(() => @@ -393,33 +375,33 @@ namespace Google.ProtocolBuffers }); } - [TestMethod] + [Fact] public void ClearExtension() { // ClearExtension() is not actually used in TestUtil, so try it manually. - Assert.IsFalse(TestAllExtensions.CreateBuilder() + Assert.False(TestAllExtensions.CreateBuilder() .SetExtension(Unittest.OptionalInt32Extension, 1) .ClearExtension(Unittest.OptionalInt32Extension) .HasExtension(Unittest.OptionalInt32Extension)); - Assert.AreEqual(0, TestAllExtensions.CreateBuilder() + Assert.Equal(0, TestAllExtensions.CreateBuilder() .AddExtension(Unittest.RepeatedInt32Extension, 1) .ClearExtension(Unittest.RepeatedInt32Extension) .GetExtensionCount(Unittest.RepeatedInt32Extension)); } - [TestMethod] + [Fact] public void ExtensionMergeFrom() { TestAllExtensions original = TestAllExtensions.CreateBuilder() .SetExtension(Unittest.OptionalInt32Extension, 1).Build(); TestAllExtensions merged = TestAllExtensions.CreateBuilder().MergeFrom(original).Build(); - Assert.IsTrue((merged.HasExtension(Unittest.OptionalInt32Extension))); - Assert.AreEqual(1, (int) merged.GetExtension(Unittest.OptionalInt32Extension)); + Assert.True((merged.HasExtension(Unittest.OptionalInt32Extension))); + Assert.Equal(1, (int) merged.GetExtension(Unittest.OptionalInt32Extension)); } /* Removed multiple files option for the moment - [TestMethod] + [Fact] public void MultipleFilesOption() { // We mostly just want to check that things compile. MessageWithNoOuter message = MessageWithNoOuter.CreateBuilder() @@ -428,63 +410,63 @@ namespace Google.ProtocolBuffers .SetNestedEnum(MessageWithNoOuter.Types.NestedEnum.BAZ) .SetForeignEnum(EnumWithNoOuter.BAR) .Build(); - Assert.AreEqual(message, MessageWithNoOuter.ParseFrom(message.ToByteString())); + Assert.Equal(message, MessageWithNoOuter.ParseFrom(message.ToByteString())); - Assert.AreEqual(MultiFileProto.DescriptorProtoFile, MessageWithNoOuter.DescriptorProtoFile.File); + Assert.Equal(MultiFileProto.DescriptorProtoFile, MessageWithNoOuter.DescriptorProtoFile.File); FieldDescriptor field = MessageWithNoOuter.DescriptorProtoFile.FindDescriptor("foreign_enum"); - Assert.AreEqual(MultiFileProto.DescriptorProtoFile.FindTypeByName("EnumWithNoOuter") + Assert.Equal(MultiFileProto.DescriptorProtoFile.FindTypeByName("EnumWithNoOuter") .FindValueByNumber((int)EnumWithNoOuter.BAR), message[field]); - Assert.AreEqual(MultiFileProto.DescriptorProtoFile, ServiceWithNoOuter.DescriptorProtoFile.File); + Assert.Equal(MultiFileProto.DescriptorProtoFile, ServiceWithNoOuter.DescriptorProtoFile.File); - Assert.IsFalse(TestAllExtensions.DefaultInstance.HasExtension(MultiFileProto.ExtensionWithOuter)); + Assert.False(TestAllExtensions.DefaultInstance.HasExtension(MultiFileProto.ExtensionWithOuter)); }*/ - [TestMethod] + [Fact] public void OptionalFieldWithRequiredSubfieldsOptimizedForSize() { TestOptionalOptimizedForSize message = TestOptionalOptimizedForSize.DefaultInstance; - Assert.IsTrue(message.IsInitialized); + Assert.True(message.IsInitialized); message = TestOptionalOptimizedForSize.CreateBuilder().SetO( TestRequiredOptimizedForSize.CreateBuilder().BuildPartial() ).BuildPartial(); - Assert.IsFalse(message.IsInitialized); + Assert.False(message.IsInitialized); message = TestOptionalOptimizedForSize.CreateBuilder().SetO( TestRequiredOptimizedForSize.CreateBuilder().SetX(5).BuildPartial() ).BuildPartial(); - Assert.IsTrue(message.IsInitialized); + Assert.True(message.IsInitialized); } - [TestMethod] + [Fact] public void OptimizedForSizeMergeUsesAllFieldsFromTarget() { TestOptimizedForSize withFieldSet = new TestOptimizedForSize.Builder {I = 10}.Build(); TestOptimizedForSize.Builder builder = new TestOptimizedForSize.Builder(); builder.MergeFrom(withFieldSet); TestOptimizedForSize built = builder.Build(); - Assert.AreEqual(10, built.I); + Assert.Equal(10, built.I); } - [TestMethod] + [Fact] public void UninitializedExtensionInOptimizedForSizeMakesMessageUninitialized() { TestOptimizedForSize.Builder builder = new TestOptimizedForSize.Builder(); builder.SetExtension(TestOptimizedForSize.TestExtension2, new TestRequiredOptimizedForSize.Builder().BuildPartial()); - Assert.IsFalse(builder.IsInitialized); - Assert.IsFalse(builder.BuildPartial().IsInitialized); + Assert.False(builder.IsInitialized); + Assert.False(builder.BuildPartial().IsInitialized); builder = new TestOptimizedForSize.Builder(); builder.SetExtension(TestOptimizedForSize.TestExtension2, new TestRequiredOptimizedForSize.Builder {X = 10}.BuildPartial()); - Assert.IsTrue(builder.IsInitialized); - Assert.IsTrue(builder.BuildPartial().IsInitialized); + Assert.True(builder.IsInitialized); + Assert.True(builder.BuildPartial().IsInitialized); } - [TestMethod] + [Fact] public void ToBuilder() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -493,40 +475,40 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(message.ToBuilder().Build()); } - [TestMethod] + [Fact] public void FieldConstantValues() { - Assert.AreEqual(TestAllTypes.Types.NestedMessage.BbFieldNumber, 1); - Assert.AreEqual(TestAllTypes.OptionalInt32FieldNumber, 1); - Assert.AreEqual(TestAllTypes.OptionalGroupFieldNumber, 16); - Assert.AreEqual(TestAllTypes.OptionalNestedMessageFieldNumber, 18); - Assert.AreEqual(TestAllTypes.OptionalNestedEnumFieldNumber, 21); - Assert.AreEqual(TestAllTypes.RepeatedInt32FieldNumber, 31); - Assert.AreEqual(TestAllTypes.RepeatedGroupFieldNumber, 46); - Assert.AreEqual(TestAllTypes.RepeatedNestedMessageFieldNumber, 48); - Assert.AreEqual(TestAllTypes.RepeatedNestedEnumFieldNumber, 51); + Assert.Equal(TestAllTypes.Types.NestedMessage.BbFieldNumber, 1); + Assert.Equal(TestAllTypes.OptionalInt32FieldNumber, 1); + Assert.Equal(TestAllTypes.OptionalGroupFieldNumber, 16); + Assert.Equal(TestAllTypes.OptionalNestedMessageFieldNumber, 18); + Assert.Equal(TestAllTypes.OptionalNestedEnumFieldNumber, 21); + Assert.Equal(TestAllTypes.RepeatedInt32FieldNumber, 31); + Assert.Equal(TestAllTypes.RepeatedGroupFieldNumber, 46); + Assert.Equal(TestAllTypes.RepeatedNestedMessageFieldNumber, 48); + Assert.Equal(TestAllTypes.RepeatedNestedEnumFieldNumber, 51); } - [TestMethod] + [Fact] public void ExtensionConstantValues() { - Assert.AreEqual(TestRequired.SingleFieldNumber, 1000); - Assert.AreEqual(TestRequired.MultiFieldNumber, 1001); - Assert.AreEqual(Unittest.OptionalInt32ExtensionFieldNumber, 1); - Assert.AreEqual(Unittest.OptionalGroupExtensionFieldNumber, 16); - Assert.AreEqual(Unittest.OptionalNestedMessageExtensionFieldNumber, 18); - Assert.AreEqual(Unittest.OptionalNestedEnumExtensionFieldNumber, 21); - Assert.AreEqual(Unittest.RepeatedInt32ExtensionFieldNumber, 31); - Assert.AreEqual(Unittest.RepeatedGroupExtensionFieldNumber, 46); - Assert.AreEqual(Unittest.RepeatedNestedMessageExtensionFieldNumber, 48); - Assert.AreEqual(Unittest.RepeatedNestedEnumExtensionFieldNumber, 51); + Assert.Equal(TestRequired.SingleFieldNumber, 1000); + Assert.Equal(TestRequired.MultiFieldNumber, 1001); + Assert.Equal(Unittest.OptionalInt32ExtensionFieldNumber, 1); + Assert.Equal(Unittest.OptionalGroupExtensionFieldNumber, 16); + Assert.Equal(Unittest.OptionalNestedMessageExtensionFieldNumber, 18); + Assert.Equal(Unittest.OptionalNestedEnumExtensionFieldNumber, 21); + Assert.Equal(Unittest.RepeatedInt32ExtensionFieldNumber, 31); + Assert.Equal(Unittest.RepeatedGroupExtensionFieldNumber, 46); + Assert.Equal(Unittest.RepeatedNestedMessageExtensionFieldNumber, 48); + Assert.Equal(Unittest.RepeatedNestedEnumExtensionFieldNumber, 51); } - [TestMethod] + [Fact] public void EmptyPackedValue() { TestPackedTypes empty = new TestPackedTypes.Builder().Build(); - Assert.AreEqual(0, empty.SerializedSize); + Assert.Equal(0, empty.SerializedSize); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/IssuesTest.cs b/csharp/src/ProtocolBuffers.Test/IssuesTest.cs index a80021c5..afd93f86 100644 --- a/csharp/src/ProtocolBuffers.Test/IssuesTest.cs +++ b/csharp/src/ProtocolBuffers.Test/IssuesTest.cs @@ -35,13 +35,9 @@ #endregion -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; using UnitTest.Issues.TestProtos; +using Xunit; namespace Google.ProtocolBuffers @@ -49,17 +45,16 @@ namespace Google.ProtocolBuffers /// /// Tests for issues which aren't easily compartmentalized into other unit tests. /// - [TestClass] public class IssuesTest { // Issue 45 - [TestMethod] + [Fact] public void FieldCalledItem() { ItemField message = new ItemField.Builder { Item = 3 }.Build(); FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item"); - Assert.IsNotNull(field); - Assert.AreEqual(3, (int)message[field]); + Assert.NotNull(field); + Assert.Equal(3, (int)message[field]); } } } diff --git a/csharp/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs b/csharp/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs index 78f059f7..7304861a 100644 --- a/csharp/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs +++ b/csharp/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs @@ -37,28 +37,27 @@ using System.Collections.Generic; using System.IO; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage; namespace Google.ProtocolBuffers { - [TestClass] public class MessageStreamIteratorTest { - [TestMethod] + [Fact] public void ThreeMessagesInMemory() { MemoryStream stream = new MemoryStream(MessageStreamWriterTest.ThreeMessageData); IEnumerable iterator = MessageStreamIterator.FromStreamProvider(() => stream); List messages = new List(iterator); - Assert.AreEqual(3, messages.Count); - Assert.AreEqual(5, messages[0].Bb); - Assert.AreEqual(1500, messages[1].Bb); - Assert.IsFalse(messages[2].HasBb); + Assert.Equal(3, messages.Count); + Assert.Equal(5, messages[0].Bb); + Assert.Equal(1500, messages[1].Bb); + Assert.False(messages[2].HasBb); } - [TestMethod] + [Fact] public void ManyMessagesShouldNotTriggerSizeAlert() { int messageSize = TestUtil.GetAllSet().SerializedSize; @@ -84,7 +83,7 @@ namespace Google.ProtocolBuffers count++; TestUtil.AssertAllFieldsSet(message); } - Assert.AreEqual(correctCount, count); + Assert.Equal(correctCount, count); } } } diff --git a/csharp/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs b/csharp/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs index 53772523..3bcc5ff6 100644 --- a/csharp/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs +++ b/csharp/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs @@ -35,12 +35,11 @@ #endregion using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage; namespace Google.ProtocolBuffers { - [TestClass] public class MessageStreamWriterTest { internal static readonly byte[] ThreeMessageData = new byte[] @@ -55,7 +54,7 @@ namespace Google.ProtocolBuffers (1 << 3) | 2, 0, // Field 1, no data (third message) }; - [TestMethod] + [Fact] public void ThreeMessages() { NestedMessage message1 = new NestedMessage.Builder {Bb = 5}.Build(); diff --git a/csharp/src/ProtocolBuffers.Test/MessageTest.cs b/csharp/src/ProtocolBuffers.Test/MessageTest.cs index 8bb0fac7..8c8e6445 100644 --- a/csharp/src/ProtocolBuffers.Test/MessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/MessageTest.cs @@ -37,7 +37,7 @@ using System.IO; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { @@ -45,7 +45,6 @@ namespace Google.ProtocolBuffers /// Miscellaneous tests for message operations that apply to both /// generated and dynamic messages. /// - [TestClass] public class MessageTest { // ================================================================= @@ -77,12 +76,12 @@ namespace Google.ProtocolBuffers "repeated_string: \"qux\"\n" + "repeated_string: \"bar\"\n"; - [TestMethod] + [Fact] public void MergeFrom() { TestAllTypes result = TestAllTypes.CreateBuilder(MergeDest).MergeFrom(MergeSource).Build(); - Assert.AreEqual(MergeResultText, result.ToString()); + Assert.Equal(MergeResultText, result.ToString()); } /// @@ -90,20 +89,20 @@ namespace Google.ProtocolBuffers /// As long as they have the same descriptor, this should work, but it is an /// entirely different code path. /// - [TestMethod] + [Fact] public void MergeFromDynamic() { TestAllTypes result = (TestAllTypes) TestAllTypes.CreateBuilder(MergeDest) .MergeFrom(DynamicMessage.CreateBuilder(MergeSource).Build()) .Build(); - Assert.AreEqual(MergeResultText, result.ToString()); + Assert.Equal(MergeResultText, result.ToString()); } /// /// Test merging two DynamicMessages. /// - [TestMethod] + [Fact] public void DynamicMergeFrom() { DynamicMessage result = (DynamicMessage) DynamicMessage.CreateBuilder(MergeDest) @@ -112,7 +111,7 @@ namespace Google.ProtocolBuffers DynamicMessage.CreateBuilder(MergeSource).Build()) .Build(); - Assert.AreEqual(MergeResultText, result.ToString()); + Assert.Equal(MergeResultText, result.ToString()); } // ================================================================= @@ -127,157 +126,143 @@ namespace Google.ProtocolBuffers C = 3 }.Build(); - [TestMethod] + [Fact] public void Initialization() { TestRequired.Builder builder = TestRequired.CreateBuilder(); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.A = 1; - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.B = 1; - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.C = 1; - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); } - [TestMethod] + [Fact] public void UninitializedBuilderToString() { TestRequired.Builder builder = TestRequired.CreateBuilder().SetA(1); - Assert.AreEqual("a: 1\n", builder.ToString()); + Assert.Equal("a: 1\n", builder.ToString()); } - [TestMethod] + [Fact] public void RequiredForeign() { TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder(); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); builder.SetOptionalMessage(TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.SetOptionalMessage(TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); builder.AddRepeatedMessage(TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.SetRepeatedMessage(0, TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); } - [TestMethod] + [Fact] public void RequiredExtension() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); builder.SetExtension(TestRequired.Single, TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.SetExtension(TestRequired.Single, TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); builder.AddExtension(TestRequired.Multi, TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.SetExtension(TestRequired.Multi, 0, TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); } - [TestMethod] + [Fact] public void RequiredDynamic() { MessageDescriptor descriptor = TestRequired.Descriptor; DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(descriptor); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder[descriptor.FindDescriptor("a")] = 1; - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder[descriptor.FindDescriptor("b")] = 1; - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder[descriptor.FindDescriptor("c")] = 1; - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); } - [TestMethod] + [Fact] public void RequiredDynamicForeign() { MessageDescriptor descriptor = TestRequiredForeign.Descriptor; DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(descriptor); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); builder[descriptor.FindDescriptor("optional_message")] = TestRequiredUninitialized; - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder[descriptor.FindDescriptor("optional_message")] = TestRequiredInitialized; - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); builder.AddRepeatedField(descriptor.FindDescriptor("repeated_message"), TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); builder.SetRepeatedField(descriptor.FindDescriptor("repeated_message"), 0, TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); } - [TestMethod] + [Fact] public void UninitializedException() { - try - { - TestRequired.CreateBuilder().Build(); - Assert.Fail("Should have thrown an exception."); - } - catch (UninitializedMessageException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } + var e = Assert.Throws(() => TestRequired.CreateBuilder().Build()); + Assert.Equal("Message missing required fields: a, b, c", e.Message); } - [TestMethod] + [Fact] public void BuildPartial() { // We're mostly testing that no exception is thrown. TestRequired message = TestRequired.CreateBuilder().BuildPartial(); - Assert.IsFalse(message.IsInitialized); + Assert.False(message.IsInitialized); } - [TestMethod] + [Fact] public void NestedUninitializedException() { - try - { - TestRequiredForeign.CreateBuilder() + var e = Assert.Throws(() => TestRequiredForeign.CreateBuilder() .SetOptionalMessage(TestRequiredUninitialized) .AddRepeatedMessage(TestRequiredUninitialized) .AddRepeatedMessage(TestRequiredUninitialized) - .Build(); - Assert.Fail("Should have thrown an exception."); - } - catch (UninitializedMessageException e) - { - Assert.AreEqual( - "Message missing required fields: " + - "optional_message.a, " + - "optional_message.b, " + - "optional_message.c, " + - "repeated_message[0].a, " + - "repeated_message[0].b, " + - "repeated_message[0].c, " + - "repeated_message[1].a, " + - "repeated_message[1].b, " + - "repeated_message[1].c", - e.Message); - } + .Build()); + Assert.Equal( + "Message missing required fields: " + + "optional_message.a, " + + "optional_message.b, " + + "optional_message.c, " + + "repeated_message[0].a, " + + "repeated_message[0].b, " + + "repeated_message[0].c, " + + "repeated_message[1].a, " + + "repeated_message[1].b, " + + "repeated_message[1].c", + e.Message); } - [TestMethod] + [Fact] public void BuildNestedPartial() { // We're mostly testing that no exception is thrown. @@ -287,24 +272,17 @@ namespace Google.ProtocolBuffers .AddRepeatedMessage(TestRequiredUninitialized) .AddRepeatedMessage(TestRequiredUninitialized) .BuildPartial(); - Assert.IsFalse(message.IsInitialized); + Assert.False(message.IsInitialized); } - [TestMethod] - public void ParseUnititialized() + [Fact] + public void ParseUninitialized() { - try - { - TestRequired.ParseFrom(ByteString.Empty); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } + var e = Assert.Throws(() => TestRequired.ParseFrom(ByteString.Empty)); + Assert.Equal("Message missing required fields: a, b, c", e.Message); } - [TestMethod] + [Fact] public void ParseNestedUnititialized() { ByteString data = @@ -314,66 +292,45 @@ namespace Google.ProtocolBuffers .AddRepeatedMessage(TestRequiredUninitialized) .BuildPartial().ToByteString(); - try - { - TestRequiredForeign.ParseFrom(data); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual( - "Message missing required fields: " + - "optional_message.a, " + - "optional_message.b, " + - "optional_message.c, " + - "repeated_message[0].a, " + - "repeated_message[0].b, " + - "repeated_message[0].c, " + - "repeated_message[1].a, " + - "repeated_message[1].b, " + - "repeated_message[1].c", - e.Message); - } + var e = Assert.Throws(() => TestRequiredForeign.ParseFrom(data)); + Assert.Equal( + "Message missing required fields: " + + "optional_message.a, " + + "optional_message.b, " + + "optional_message.c, " + + "repeated_message[0].a, " + + "repeated_message[0].b, " + + "repeated_message[0].c, " + + "repeated_message[1].a, " + + "repeated_message[1].b, " + + "repeated_message[1].c", + e.Message); } - [TestMethod] + [Fact] public void DynamicUninitializedException() { - try - { - DynamicMessage.CreateBuilder(TestRequired.Descriptor).Build(); - Assert.Fail("Should have thrown an exception."); - } - catch (UninitializedMessageException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } + var e = Assert.Throws(() => DynamicMessage.CreateBuilder(TestRequired.Descriptor).Build()); + Assert.Equal("Message missing required fields: a, b, c", e.Message); } - [TestMethod] + [Fact] public void DynamicBuildPartial() { // We're mostly testing that no exception is thrown. DynamicMessage message = DynamicMessage.CreateBuilder(TestRequired.Descriptor).BuildPartial(); - Assert.IsFalse(message.Initialized); + Assert.False(message.Initialized); } - [TestMethod] + [Fact] public void DynamicParseUnititialized() { - try - { - MessageDescriptor descriptor = TestRequired.Descriptor; - DynamicMessage.ParseFrom(descriptor, ByteString.Empty); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } + MessageDescriptor descriptor = TestRequired.Descriptor; + var e = Assert.Throws(() => DynamicMessage.ParseFrom(descriptor, ByteString.Empty)); + Assert.Equal("Message missing required fields: a, b, c", e.Message); } - [TestMethod] + [Fact] public void PackedTypesWrittenDirectlyToStream() { TestPackedTypes message = new TestPackedTypes.Builder {PackedInt32List = {0, 1, 2}}.Build(); @@ -381,7 +338,7 @@ namespace Google.ProtocolBuffers message.WriteTo(stream); stream.Position = 0; TestPackedTypes readMessage = TestPackedTypes.ParseFrom(stream); - Assert.AreEqual(message, readMessage); + Assert.Equal(message, readMessage); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs b/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs index 4c33dbbd..186d9399 100644 --- a/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs +++ b/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs @@ -36,52 +36,47 @@ using System; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class MessageUtilTest { - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Fact] public void NullTypeName() { - MessageUtil.GetDefaultMessage((string) null); + Assert.Throws(() => MessageUtil.GetDefaultMessage((string) null)); } - [TestMethod] - [ExpectedException(typeof(ArgumentException))] + [Fact] public void InvalidTypeName() { - MessageUtil.GetDefaultMessage("invalidtypename"); + Assert.Throws(() => MessageUtil.GetDefaultMessage("invalidtypename")); } - [TestMethod] + [Fact] public void ValidTypeName() { - Assert.AreSame(TestAllTypes.DefaultInstance, + Assert.Same(TestAllTypes.DefaultInstance, MessageUtil.GetDefaultMessage(typeof(TestAllTypes).AssemblyQualifiedName)); } - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] + [Fact] public void NullType() { - MessageUtil.GetDefaultMessage((Type) null); + Assert.Throws(() => MessageUtil.GetDefaultMessage((Type)null)); } - [TestMethod] - [ExpectedException(typeof(ArgumentException))] + [Fact] public void NonMessageType() { - MessageUtil.GetDefaultMessage(typeof(string)); + Assert.Throws(() => MessageUtil.GetDefaultMessage(typeof(string))); } - [TestMethod] + [Fact] public void ValidType() { - Assert.AreSame(TestAllTypes.DefaultInstance, MessageUtil.GetDefaultMessage(typeof(TestAllTypes))); + Assert.Same(TestAllTypes.DefaultInstance, MessageUtil.GetDefaultMessage(typeof(TestAllTypes))); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/NameHelpersTest.cs b/csharp/src/ProtocolBuffers.Test/NameHelpersTest.cs index 50ab373d..034bbf1c 100644 --- a/csharp/src/ProtocolBuffers.Test/NameHelpersTest.cs +++ b/csharp/src/ProtocolBuffers.Test/NameHelpersTest.cs @@ -34,49 +34,48 @@ #endregion -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class NameHelpersTest { - [TestMethod] + [Fact] public void UnderscoresToPascalCase() { - Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_bar")); - Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("foo_bar")); - Assert.AreEqual("Foo0Bar", NameHelpers.UnderscoresToPascalCase("Foo0bar")); - Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_+_Bar")); + Assert.Equal("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_bar")); + Assert.Equal("FooBar", NameHelpers.UnderscoresToPascalCase("foo_bar")); + Assert.Equal("Foo0Bar", NameHelpers.UnderscoresToPascalCase("Foo0bar")); + Assert.Equal("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_+_Bar")); - Assert.AreEqual("Bar", NameHelpers.UnderscoresToPascalCase("__+bar")); - Assert.AreEqual("Bar", NameHelpers.UnderscoresToPascalCase("bar_")); - Assert.AreEqual("_0Bar", NameHelpers.UnderscoresToPascalCase("_0bar")); - Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToPascalCase("_1_bar")); + Assert.Equal("Bar", NameHelpers.UnderscoresToPascalCase("__+bar")); + Assert.Equal("Bar", NameHelpers.UnderscoresToPascalCase("bar_")); + Assert.Equal("_0Bar", NameHelpers.UnderscoresToPascalCase("_0bar")); + Assert.Equal("_1Bar", NameHelpers.UnderscoresToPascalCase("_1_bar")); } - [TestMethod] + [Fact] public void UnderscoresToCamelCase() { - Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_bar")); - Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("foo_bar")); - Assert.AreEqual("foo0Bar", NameHelpers.UnderscoresToCamelCase("Foo0bar")); - Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_+_Bar")); + Assert.Equal("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_bar")); + Assert.Equal("fooBar", NameHelpers.UnderscoresToCamelCase("foo_bar")); + Assert.Equal("foo0Bar", NameHelpers.UnderscoresToCamelCase("Foo0bar")); + Assert.Equal("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_+_Bar")); - Assert.AreEqual("bar", NameHelpers.UnderscoresToCamelCase("__+bar")); - Assert.AreEqual("bar", NameHelpers.UnderscoresToCamelCase("bar_")); - Assert.AreEqual("_0Bar", NameHelpers.UnderscoresToCamelCase("_0bar")); - Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToCamelCase("_1_bar")); + Assert.Equal("bar", NameHelpers.UnderscoresToCamelCase("__+bar")); + Assert.Equal("bar", NameHelpers.UnderscoresToCamelCase("bar_")); + Assert.Equal("_0Bar", NameHelpers.UnderscoresToCamelCase("_0bar")); + Assert.Equal("_1Bar", NameHelpers.UnderscoresToCamelCase("_1_bar")); } - [TestMethod] + [Fact] public void StripSuffix() { string text = "FooBar"; - Assert.IsFalse(NameHelpers.StripSuffix(ref text, "Foo")); - Assert.AreEqual("FooBar", text); - Assert.IsTrue(NameHelpers.StripSuffix(ref text, "Bar")); - Assert.AreEqual("Foo", text); + Assert.False(NameHelpers.StripSuffix(ref text, "Foo")); + Assert.Equal("FooBar", text); + Assert.True(NameHelpers.StripSuffix(ref text, "Bar")); + Assert.Equal("Foo", text); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index 8d900266..50c0b63e 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -1,9 +1,8 @@  + + - CLIENTPROFILE - NET35 - TEST Debug AnyCPU 9.0.30729 @@ -13,12 +12,14 @@ Properties Google.ProtocolBuffers Google.ProtocolBuffers.Test - v4.0 + v4.5 512 true ..\..\keys\Google.ProtocolBuffers.snk 3.5 - Client + + + d37384c8 true @@ -32,6 +33,7 @@ true true Off + false pdbonly @@ -44,32 +46,23 @@ true true Off + false - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll + + ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll + + ..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll + + ..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll - - Microsoft.VisualStudio.TestTools.cs - @@ -131,28 +124,16 @@ ProtocolBuffers - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - + + + + + + - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs b/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs index 5385d316..5fa22fef 100644 --- a/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs +++ b/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs @@ -37,7 +37,7 @@ using System; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; #pragma warning disable 618 // Disable warning about obsolete use miss-matched assert arguments @@ -97,7 +97,7 @@ namespace Google.ProtocolBuffers this.extensionRegistry = extensionRegistry; this.file = baseDescriptor.File; - Assert.AreEqual(1, file.Dependencies.Count); + Assert.Equal(1, file.Dependencies.Count); this.importFile = file.Dependencies[0]; MessageDescriptor testAllTypes; @@ -108,7 +108,7 @@ namespace Google.ProtocolBuffers else { testAllTypes = file.FindTypeByName("TestAllTypes"); - Assert.IsNotNull(testAllTypes); + Assert.NotNull(testAllTypes); } if (extensionRegistry == null) @@ -136,14 +136,14 @@ namespace Google.ProtocolBuffers this.foreignEnum = file.FindTypeByName("ForeignEnum"); this.importEnum = importFile.FindTypeByName("ImportEnum"); - Assert.IsNotNull(optionalGroup); - Assert.IsNotNull(repeatedGroup); - Assert.IsNotNull(nestedMessage); - Assert.IsNotNull(foreignMessage); - Assert.IsNotNull(importMessage); - Assert.IsNotNull(nestedEnum); - Assert.IsNotNull(foreignEnum); - Assert.IsNotNull(importEnum); + Assert.NotNull(optionalGroup); + Assert.NotNull(repeatedGroup); + Assert.NotNull(nestedMessage); + Assert.NotNull(foreignMessage); + Assert.NotNull(importMessage); + Assert.NotNull(nestedEnum); + Assert.NotNull(foreignEnum); + Assert.NotNull(importEnum); this.nestedB = nestedMessage.FindDescriptor("bb"); this.foreignC = foreignMessage.FindDescriptor("c"); @@ -161,20 +161,20 @@ namespace Google.ProtocolBuffers this.groupA = optionalGroup.FindDescriptor("a"); this.repeatedGroupA = repeatedGroup.FindDescriptor("a"); - Assert.IsNotNull(groupA); - Assert.IsNotNull(repeatedGroupA); - Assert.IsNotNull(nestedB); - Assert.IsNotNull(foreignC); - Assert.IsNotNull(importD); - Assert.IsNotNull(nestedFoo); - Assert.IsNotNull(nestedBar); - Assert.IsNotNull(nestedBaz); - Assert.IsNotNull(foreignFoo); - Assert.IsNotNull(foreignBar); - Assert.IsNotNull(foreignBaz); - Assert.IsNotNull(importFoo); - Assert.IsNotNull(importBar); - Assert.IsNotNull(importBaz); + Assert.NotNull(groupA); + Assert.NotNull(repeatedGroupA); + Assert.NotNull(nestedB); + Assert.NotNull(foreignC); + Assert.NotNull(importD); + Assert.NotNull(nestedFoo); + Assert.NotNull(nestedBar); + Assert.NotNull(nestedBaz); + Assert.NotNull(foreignFoo); + Assert.NotNull(foreignBar); + Assert.NotNull(foreignBaz); + Assert.NotNull(importFoo); + Assert.NotNull(importBar); + Assert.NotNull(importBaz); } /// @@ -216,7 +216,7 @@ namespace Google.ProtocolBuffers { result = file.FindTypeByName(name + "_extension"); } - Assert.IsNotNull(result); + Assert.NotNull(result); return result; } @@ -233,8 +233,8 @@ namespace Google.ProtocolBuffers else { ExtensionInfo extension = extensionRegistry[field.ContainingType, field.FieldNumber]; - Assert.IsNotNull(extension); - Assert.IsNotNull(extension.DefaultInstance); + Assert.NotNull(extension); + Assert.NotNull(extension.DefaultInstance); return (IBuilder) extension.DefaultInstance.WeakCreateBuilderForType(); } } @@ -449,199 +449,199 @@ namespace Google.ProtocolBuffers /// public void AssertAllFieldsSetViaReflection(IMessage message) { - Assert.IsTrue(message.HasField(f("optional_int32"))); - Assert.IsTrue(message.HasField(f("optional_int64"))); - Assert.IsTrue(message.HasField(f("optional_uint32"))); - Assert.IsTrue(message.HasField(f("optional_uint64"))); - Assert.IsTrue(message.HasField(f("optional_sint32"))); - Assert.IsTrue(message.HasField(f("optional_sint64"))); - Assert.IsTrue(message.HasField(f("optional_fixed32"))); - Assert.IsTrue(message.HasField(f("optional_fixed64"))); - Assert.IsTrue(message.HasField(f("optional_sfixed32"))); - Assert.IsTrue(message.HasField(f("optional_sfixed64"))); - Assert.IsTrue(message.HasField(f("optional_float"))); - Assert.IsTrue(message.HasField(f("optional_double"))); - Assert.IsTrue(message.HasField(f("optional_bool"))); - Assert.IsTrue(message.HasField(f("optional_string"))); - Assert.IsTrue(message.HasField(f("optional_bytes"))); - - Assert.IsTrue(message.HasField(f("optionalgroup"))); - Assert.IsTrue(message.HasField(f("optional_nested_message"))); - Assert.IsTrue(message.HasField(f("optional_foreign_message"))); - Assert.IsTrue(message.HasField(f("optional_import_message"))); - - Assert.IsTrue(((IMessage) message[f("optionalgroup")]).HasField(groupA)); - Assert.IsTrue(((IMessage) message[f("optional_nested_message")]).HasField(nestedB)); - Assert.IsTrue(((IMessage) message[f("optional_foreign_message")]).HasField(foreignC)); - Assert.IsTrue(((IMessage) message[f("optional_import_message")]).HasField(importD)); - - Assert.IsTrue(message.HasField(f("optional_nested_enum"))); - Assert.IsTrue(message.HasField(f("optional_foreign_enum"))); - Assert.IsTrue(message.HasField(f("optional_import_enum"))); - - Assert.IsTrue(message.HasField(f("optional_string_piece"))); - Assert.IsTrue(message.HasField(f("optional_cord"))); - - Assert.AreEqual(101, message[f("optional_int32")]); - Assert.AreEqual(102L, message[f("optional_int64")]); - Assert.AreEqual(103u, message[f("optional_uint32")]); - Assert.AreEqual(104UL, message[f("optional_uint64")]); - Assert.AreEqual(105, message[f("optional_sint32")]); - Assert.AreEqual(106L, message[f("optional_sint64")]); - Assert.AreEqual(107U, message[f("optional_fixed32")]); - Assert.AreEqual(108UL, message[f("optional_fixed64")]); - Assert.AreEqual(109, message[f("optional_sfixed32")]); - Assert.AreEqual(110L, message[f("optional_sfixed64")]); - Assert.AreEqual(111F, message[f("optional_float")]); - Assert.AreEqual(112D, message[f("optional_double")]); - Assert.AreEqual(true, message[f("optional_bool")]); - Assert.AreEqual("115", message[f("optional_string")]); - Assert.AreEqual(TestUtil.ToBytes("116"), message[f("optional_bytes")]); - - Assert.AreEqual(117, ((IMessage) message[f("optionalgroup")])[groupA]); - Assert.AreEqual(118, ((IMessage) message[f("optional_nested_message")])[nestedB]); - Assert.AreEqual(119, ((IMessage) message[f("optional_foreign_message")])[foreignC]); - Assert.AreEqual(120, ((IMessage) message[f("optional_import_message")])[importD]); - - Assert.AreEqual(nestedBaz, message[f("optional_nested_enum")]); - Assert.AreEqual(foreignBaz, message[f("optional_foreign_enum")]); - Assert.AreEqual(importBaz, message[f("optional_import_enum")]); - - Assert.AreEqual("124", message[f("optional_string_piece")]); - Assert.AreEqual("125", message[f("optional_cord")]); + Assert.True(message.HasField(f("optional_int32"))); + Assert.True(message.HasField(f("optional_int64"))); + Assert.True(message.HasField(f("optional_uint32"))); + Assert.True(message.HasField(f("optional_uint64"))); + Assert.True(message.HasField(f("optional_sint32"))); + Assert.True(message.HasField(f("optional_sint64"))); + Assert.True(message.HasField(f("optional_fixed32"))); + Assert.True(message.HasField(f("optional_fixed64"))); + Assert.True(message.HasField(f("optional_sfixed32"))); + Assert.True(message.HasField(f("optional_sfixed64"))); + Assert.True(message.HasField(f("optional_float"))); + Assert.True(message.HasField(f("optional_double"))); + Assert.True(message.HasField(f("optional_bool"))); + Assert.True(message.HasField(f("optional_string"))); + Assert.True(message.HasField(f("optional_bytes"))); + + Assert.True(message.HasField(f("optionalgroup"))); + Assert.True(message.HasField(f("optional_nested_message"))); + Assert.True(message.HasField(f("optional_foreign_message"))); + Assert.True(message.HasField(f("optional_import_message"))); + + Assert.True(((IMessage) message[f("optionalgroup")]).HasField(groupA)); + Assert.True(((IMessage) message[f("optional_nested_message")]).HasField(nestedB)); + Assert.True(((IMessage) message[f("optional_foreign_message")]).HasField(foreignC)); + Assert.True(((IMessage) message[f("optional_import_message")]).HasField(importD)); + + Assert.True(message.HasField(f("optional_nested_enum"))); + Assert.True(message.HasField(f("optional_foreign_enum"))); + Assert.True(message.HasField(f("optional_import_enum"))); + + Assert.True(message.HasField(f("optional_string_piece"))); + Assert.True(message.HasField(f("optional_cord"))); + + Assert.Equal(101, message[f("optional_int32")]); + Assert.Equal(102L, message[f("optional_int64")]); + Assert.Equal(103u, message[f("optional_uint32")]); + Assert.Equal(104UL, message[f("optional_uint64")]); + Assert.Equal(105, message[f("optional_sint32")]); + Assert.Equal(106L, message[f("optional_sint64")]); + Assert.Equal(107U, message[f("optional_fixed32")]); + Assert.Equal(108UL, message[f("optional_fixed64")]); + Assert.Equal(109, message[f("optional_sfixed32")]); + Assert.Equal(110L, message[f("optional_sfixed64")]); + Assert.Equal(111F, message[f("optional_float")]); + Assert.Equal(112D, message[f("optional_double")]); + Assert.Equal(true, message[f("optional_bool")]); + Assert.Equal("115", message[f("optional_string")]); + Assert.Equal(TestUtil.ToBytes("116"), message[f("optional_bytes")]); + + Assert.Equal(117, ((IMessage) message[f("optionalgroup")])[groupA]); + Assert.Equal(118, ((IMessage) message[f("optional_nested_message")])[nestedB]); + Assert.Equal(119, ((IMessage) message[f("optional_foreign_message")])[foreignC]); + Assert.Equal(120, ((IMessage) message[f("optional_import_message")])[importD]); + + Assert.Equal(nestedBaz, message[f("optional_nested_enum")]); + Assert.Equal(foreignBaz, message[f("optional_foreign_enum")]); + Assert.Equal(importBaz, message[f("optional_import_enum")]); + + Assert.Equal("124", message[f("optional_string_piece")]); + Assert.Equal("125", message[f("optional_cord")]); // ----------------------------------------------------------------- - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord"))); - - Assert.AreEqual(201, message[f("repeated_int32"), 0]); - Assert.AreEqual(202L, message[f("repeated_int64"), 0]); - Assert.AreEqual(203U, message[f("repeated_uint32"), 0]); - Assert.AreEqual(204UL, message[f("repeated_uint64"), 0]); - Assert.AreEqual(205, message[f("repeated_sint32"), 0]); - Assert.AreEqual(206L, message[f("repeated_sint64"), 0]); - Assert.AreEqual(207U, message[f("repeated_fixed32"), 0]); - Assert.AreEqual(208UL, message[f("repeated_fixed64"), 0]); - Assert.AreEqual(209, message[f("repeated_sfixed32"), 0]); - Assert.AreEqual(210L, message[f("repeated_sfixed64"), 0]); - Assert.AreEqual(211F, message[f("repeated_float"), 0]); - Assert.AreEqual(212D, message[f("repeated_double"), 0]); - Assert.AreEqual(true, message[f("repeated_bool"), 0]); - Assert.AreEqual("215", message[f("repeated_string"), 0]); - Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); - - Assert.AreEqual(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); - Assert.AreEqual(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); - Assert.AreEqual(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); - Assert.AreEqual(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); - - Assert.AreEqual(nestedBar, message[f("repeated_nested_enum"), 0]); - Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"), 0]); - Assert.AreEqual(importBar, message[f("repeated_import_enum"), 0]); - - Assert.AreEqual("224", message[f("repeated_string_piece"), 0]); - Assert.AreEqual("225", message[f("repeated_cord"), 0]); - - Assert.AreEqual(301, message[f("repeated_int32"), 1]); - Assert.AreEqual(302L, message[f("repeated_int64"), 1]); - Assert.AreEqual(303U, message[f("repeated_uint32"), 1]); - Assert.AreEqual(304UL, message[f("repeated_uint64"), 1]); - Assert.AreEqual(305, message[f("repeated_sint32"), 1]); - Assert.AreEqual(306L, message[f("repeated_sint64"), 1]); - Assert.AreEqual(307U, message[f("repeated_fixed32"), 1]); - Assert.AreEqual(308UL, message[f("repeated_fixed64"), 1]); - Assert.AreEqual(309, message[f("repeated_sfixed32"), 1]); - Assert.AreEqual(310L, message[f("repeated_sfixed64"), 1]); - Assert.AreEqual(311F, message[f("repeated_float"), 1]); - Assert.AreEqual(312D, message[f("repeated_double"), 1]); - Assert.AreEqual(false, message[f("repeated_bool"), 1]); - Assert.AreEqual("315", message[f("repeated_string"), 1]); - Assert.AreEqual(TestUtil.ToBytes("316"), message[f("repeated_bytes"), 1]); - - Assert.AreEqual(317, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); - Assert.AreEqual(318, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); - Assert.AreEqual(319, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); - Assert.AreEqual(320, ((IMessage) message[f("repeated_import_message"), 1])[importD]); - - Assert.AreEqual(nestedBaz, message[f("repeated_nested_enum"), 1]); - Assert.AreEqual(foreignBaz, message[f("repeated_foreign_enum"), 1]); - Assert.AreEqual(importBaz, message[f("repeated_import_enum"), 1]); - - Assert.AreEqual("324", message[f("repeated_string_piece"), 1]); - Assert.AreEqual("325", message[f("repeated_cord"), 1]); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_float"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_double"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bool"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); + + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); + + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_cord"))); + + Assert.Equal(201, message[f("repeated_int32"), 0]); + Assert.Equal(202L, message[f("repeated_int64"), 0]); + Assert.Equal(203U, message[f("repeated_uint32"), 0]); + Assert.Equal(204UL, message[f("repeated_uint64"), 0]); + Assert.Equal(205, message[f("repeated_sint32"), 0]); + Assert.Equal(206L, message[f("repeated_sint64"), 0]); + Assert.Equal(207U, message[f("repeated_fixed32"), 0]); + Assert.Equal(208UL, message[f("repeated_fixed64"), 0]); + Assert.Equal(209, message[f("repeated_sfixed32"), 0]); + Assert.Equal(210L, message[f("repeated_sfixed64"), 0]); + Assert.Equal(211F, message[f("repeated_float"), 0]); + Assert.Equal(212D, message[f("repeated_double"), 0]); + Assert.Equal(true, message[f("repeated_bool"), 0]); + Assert.Equal("215", message[f("repeated_string"), 0]); + Assert.Equal(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); + + Assert.Equal(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); + Assert.Equal(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); + Assert.Equal(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); + Assert.Equal(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); + + Assert.Equal(nestedBar, message[f("repeated_nested_enum"), 0]); + Assert.Equal(foreignBar, message[f("repeated_foreign_enum"), 0]); + Assert.Equal(importBar, message[f("repeated_import_enum"), 0]); + + Assert.Equal("224", message[f("repeated_string_piece"), 0]); + Assert.Equal("225", message[f("repeated_cord"), 0]); + + Assert.Equal(301, message[f("repeated_int32"), 1]); + Assert.Equal(302L, message[f("repeated_int64"), 1]); + Assert.Equal(303U, message[f("repeated_uint32"), 1]); + Assert.Equal(304UL, message[f("repeated_uint64"), 1]); + Assert.Equal(305, message[f("repeated_sint32"), 1]); + Assert.Equal(306L, message[f("repeated_sint64"), 1]); + Assert.Equal(307U, message[f("repeated_fixed32"), 1]); + Assert.Equal(308UL, message[f("repeated_fixed64"), 1]); + Assert.Equal(309, message[f("repeated_sfixed32"), 1]); + Assert.Equal(310L, message[f("repeated_sfixed64"), 1]); + Assert.Equal(311F, message[f("repeated_float"), 1]); + Assert.Equal(312D, message[f("repeated_double"), 1]); + Assert.Equal(false, message[f("repeated_bool"), 1]); + Assert.Equal("315", message[f("repeated_string"), 1]); + Assert.Equal(TestUtil.ToBytes("316"), message[f("repeated_bytes"), 1]); + + Assert.Equal(317, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); + Assert.Equal(318, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); + Assert.Equal(319, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); + Assert.Equal(320, ((IMessage) message[f("repeated_import_message"), 1])[importD]); + + Assert.Equal(nestedBaz, message[f("repeated_nested_enum"), 1]); + Assert.Equal(foreignBaz, message[f("repeated_foreign_enum"), 1]); + Assert.Equal(importBaz, message[f("repeated_import_enum"), 1]); + + Assert.Equal("324", message[f("repeated_string_piece"), 1]); + Assert.Equal("325", message[f("repeated_cord"), 1]); // ----------------------------------------------------------------- - Assert.IsTrue(message.HasField(f("default_int32"))); - Assert.IsTrue(message.HasField(f("default_int64"))); - Assert.IsTrue(message.HasField(f("default_uint32"))); - Assert.IsTrue(message.HasField(f("default_uint64"))); - Assert.IsTrue(message.HasField(f("default_sint32"))); - Assert.IsTrue(message.HasField(f("default_sint64"))); - Assert.IsTrue(message.HasField(f("default_fixed32"))); - Assert.IsTrue(message.HasField(f("default_fixed64"))); - Assert.IsTrue(message.HasField(f("default_sfixed32"))); - Assert.IsTrue(message.HasField(f("default_sfixed64"))); - Assert.IsTrue(message.HasField(f("default_float"))); - Assert.IsTrue(message.HasField(f("default_double"))); - Assert.IsTrue(message.HasField(f("default_bool"))); - Assert.IsTrue(message.HasField(f("default_string"))); - Assert.IsTrue(message.HasField(f("default_bytes"))); - - Assert.IsTrue(message.HasField(f("default_nested_enum"))); - Assert.IsTrue(message.HasField(f("default_foreign_enum"))); - Assert.IsTrue(message.HasField(f("default_import_enum"))); - - Assert.IsTrue(message.HasField(f("default_string_piece"))); - Assert.IsTrue(message.HasField(f("default_cord"))); - - Assert.AreEqual(401, message[f("default_int32")]); - Assert.AreEqual(402L, message[f("default_int64")]); - Assert.AreEqual(403U, message[f("default_uint32")]); - Assert.AreEqual(404UL, message[f("default_uint64")]); - Assert.AreEqual(405, message[f("default_sint32")]); - Assert.AreEqual(406L, message[f("default_sint64")]); - Assert.AreEqual(407U, message[f("default_fixed32")]); - Assert.AreEqual(408UL, message[f("default_fixed64")]); - Assert.AreEqual(409, message[f("default_sfixed32")]); - Assert.AreEqual(410L, message[f("default_sfixed64")]); - Assert.AreEqual(411F, message[f("default_float")]); - Assert.AreEqual(412D, message[f("default_double")]); - Assert.AreEqual(false, message[f("default_bool")]); - Assert.AreEqual("415", message[f("default_string")]); - Assert.AreEqual(TestUtil.ToBytes("416"), message[f("default_bytes")]); - - Assert.AreEqual(nestedFoo, message[f("default_nested_enum")]); - Assert.AreEqual(foreignFoo, message[f("default_foreign_enum")]); - Assert.AreEqual(importFoo, message[f("default_import_enum")]); - - Assert.AreEqual("424", message[f("default_string_piece")]); - Assert.AreEqual("425", message[f("default_cord")]); + Assert.True(message.HasField(f("default_int32"))); + Assert.True(message.HasField(f("default_int64"))); + Assert.True(message.HasField(f("default_uint32"))); + Assert.True(message.HasField(f("default_uint64"))); + Assert.True(message.HasField(f("default_sint32"))); + Assert.True(message.HasField(f("default_sint64"))); + Assert.True(message.HasField(f("default_fixed32"))); + Assert.True(message.HasField(f("default_fixed64"))); + Assert.True(message.HasField(f("default_sfixed32"))); + Assert.True(message.HasField(f("default_sfixed64"))); + Assert.True(message.HasField(f("default_float"))); + Assert.True(message.HasField(f("default_double"))); + Assert.True(message.HasField(f("default_bool"))); + Assert.True(message.HasField(f("default_string"))); + Assert.True(message.HasField(f("default_bytes"))); + + Assert.True(message.HasField(f("default_nested_enum"))); + Assert.True(message.HasField(f("default_foreign_enum"))); + Assert.True(message.HasField(f("default_import_enum"))); + + Assert.True(message.HasField(f("default_string_piece"))); + Assert.True(message.HasField(f("default_cord"))); + + Assert.Equal(401, message[f("default_int32")]); + Assert.Equal(402L, message[f("default_int64")]); + Assert.Equal(403U, message[f("default_uint32")]); + Assert.Equal(404UL, message[f("default_uint64")]); + Assert.Equal(405, message[f("default_sint32")]); + Assert.Equal(406L, message[f("default_sint64")]); + Assert.Equal(407U, message[f("default_fixed32")]); + Assert.Equal(408UL, message[f("default_fixed64")]); + Assert.Equal(409, message[f("default_sfixed32")]); + Assert.Equal(410L, message[f("default_sfixed64")]); + Assert.Equal(411F, message[f("default_float")]); + Assert.Equal(412D, message[f("default_double")]); + Assert.Equal(false, message[f("default_bool")]); + Assert.Equal("415", message[f("default_string")]); + Assert.Equal(TestUtil.ToBytes("416"), message[f("default_bytes")]); + + Assert.Equal(nestedFoo, message[f("default_nested_enum")]); + Assert.Equal(foreignFoo, message[f("default_foreign_enum")]); + Assert.Equal(importFoo, message[f("default_import_enum")]); + + Assert.Equal("424", message[f("default_string_piece")]); + Assert.Equal("425", message[f("default_cord")]); } /// @@ -651,148 +651,148 @@ namespace Google.ProtocolBuffers public void AssertClearViaReflection(IMessage message) { // has_blah() should initially be false for all optional fields. - Assert.IsFalse(message.HasField(f("optional_int32"))); - Assert.IsFalse(message.HasField(f("optional_int64"))); - Assert.IsFalse(message.HasField(f("optional_uint32"))); - Assert.IsFalse(message.HasField(f("optional_uint64"))); - Assert.IsFalse(message.HasField(f("optional_sint32"))); - Assert.IsFalse(message.HasField(f("optional_sint64"))); - Assert.IsFalse(message.HasField(f("optional_fixed32"))); - Assert.IsFalse(message.HasField(f("optional_fixed64"))); - Assert.IsFalse(message.HasField(f("optional_sfixed32"))); - Assert.IsFalse(message.HasField(f("optional_sfixed64"))); - Assert.IsFalse(message.HasField(f("optional_float"))); - Assert.IsFalse(message.HasField(f("optional_double"))); - Assert.IsFalse(message.HasField(f("optional_bool"))); - Assert.IsFalse(message.HasField(f("optional_string"))); - Assert.IsFalse(message.HasField(f("optional_bytes"))); - - Assert.IsFalse(message.HasField(f("optionalgroup"))); - Assert.IsFalse(message.HasField(f("optional_nested_message"))); - Assert.IsFalse(message.HasField(f("optional_foreign_message"))); - Assert.IsFalse(message.HasField(f("optional_import_message"))); - - Assert.IsFalse(message.HasField(f("optional_nested_enum"))); - Assert.IsFalse(message.HasField(f("optional_foreign_enum"))); - Assert.IsFalse(message.HasField(f("optional_import_enum"))); - - Assert.IsFalse(message.HasField(f("optional_string_piece"))); - Assert.IsFalse(message.HasField(f("optional_cord"))); + Assert.False(message.HasField(f("optional_int32"))); + Assert.False(message.HasField(f("optional_int64"))); + Assert.False(message.HasField(f("optional_uint32"))); + Assert.False(message.HasField(f("optional_uint64"))); + Assert.False(message.HasField(f("optional_sint32"))); + Assert.False(message.HasField(f("optional_sint64"))); + Assert.False(message.HasField(f("optional_fixed32"))); + Assert.False(message.HasField(f("optional_fixed64"))); + Assert.False(message.HasField(f("optional_sfixed32"))); + Assert.False(message.HasField(f("optional_sfixed64"))); + Assert.False(message.HasField(f("optional_float"))); + Assert.False(message.HasField(f("optional_double"))); + Assert.False(message.HasField(f("optional_bool"))); + Assert.False(message.HasField(f("optional_string"))); + Assert.False(message.HasField(f("optional_bytes"))); + + Assert.False(message.HasField(f("optionalgroup"))); + Assert.False(message.HasField(f("optional_nested_message"))); + Assert.False(message.HasField(f("optional_foreign_message"))); + Assert.False(message.HasField(f("optional_import_message"))); + + Assert.False(message.HasField(f("optional_nested_enum"))); + Assert.False(message.HasField(f("optional_foreign_enum"))); + Assert.False(message.HasField(f("optional_import_enum"))); + + Assert.False(message.HasField(f("optional_string_piece"))); + Assert.False(message.HasField(f("optional_cord"))); // Optional fields without defaults are set to zero or something like it. - Assert.AreEqual(0, message[f("optional_int32")]); - Assert.AreEqual(0L, message[f("optional_int64")]); - Assert.AreEqual(0U, message[f("optional_uint32")]); - Assert.AreEqual(0UL, message[f("optional_uint64")]); - Assert.AreEqual(0, message[f("optional_sint32")]); - Assert.AreEqual(0L, message[f("optional_sint64")]); - Assert.AreEqual(0U, message[f("optional_fixed32")]); - Assert.AreEqual(0UL, message[f("optional_fixed64")]); - Assert.AreEqual(0, message[f("optional_sfixed32")]); - Assert.AreEqual(0L, message[f("optional_sfixed64")]); - Assert.AreEqual(0F, message[f("optional_float")]); - Assert.AreEqual(0D, message[f("optional_double")]); - Assert.AreEqual(false, message[f("optional_bool")]); - Assert.AreEqual("", message[f("optional_string")]); - Assert.AreEqual(ByteString.Empty, message[f("optional_bytes")]); + Assert.Equal(0, message[f("optional_int32")]); + Assert.Equal(0L, message[f("optional_int64")]); + Assert.Equal(0U, message[f("optional_uint32")]); + Assert.Equal(0UL, message[f("optional_uint64")]); + Assert.Equal(0, message[f("optional_sint32")]); + Assert.Equal(0L, message[f("optional_sint64")]); + Assert.Equal(0U, message[f("optional_fixed32")]); + Assert.Equal(0UL, message[f("optional_fixed64")]); + Assert.Equal(0, message[f("optional_sfixed32")]); + Assert.Equal(0L, message[f("optional_sfixed64")]); + Assert.Equal(0F, message[f("optional_float")]); + Assert.Equal(0D, message[f("optional_double")]); + Assert.Equal(false, message[f("optional_bool")]); + Assert.Equal("", message[f("optional_string")]); + Assert.Equal(ByteString.Empty, message[f("optional_bytes")]); // Embedded messages should also be clear. - Assert.IsFalse(((IMessage) message[f("optionalgroup")]).HasField(groupA)); - Assert.IsFalse(((IMessage) message[f("optional_nested_message")]) + Assert.False(((IMessage) message[f("optionalgroup")]).HasField(groupA)); + Assert.False(((IMessage) message[f("optional_nested_message")]) .HasField(nestedB)); - Assert.IsFalse(((IMessage) message[f("optional_foreign_message")]) + Assert.False(((IMessage) message[f("optional_foreign_message")]) .HasField(foreignC)); - Assert.IsFalse(((IMessage) message[f("optional_import_message")]) + Assert.False(((IMessage) message[f("optional_import_message")]) .HasField(importD)); - Assert.AreEqual(0, ((IMessage) message[f("optionalgroup")])[groupA]); - Assert.AreEqual(0, ((IMessage) message[f("optional_nested_message")])[nestedB]); - Assert.AreEqual(0, ((IMessage) message[f("optional_foreign_message")])[foreignC]); - Assert.AreEqual(0, ((IMessage) message[f("optional_import_message")])[importD]); + Assert.Equal(0, ((IMessage) message[f("optionalgroup")])[groupA]); + Assert.Equal(0, ((IMessage) message[f("optional_nested_message")])[nestedB]); + Assert.Equal(0, ((IMessage) message[f("optional_foreign_message")])[foreignC]); + Assert.Equal(0, ((IMessage) message[f("optional_import_message")])[importD]); // Enums without defaults are set to the first value in the enum. - Assert.AreEqual(nestedFoo, message[f("optional_nested_enum")]); - Assert.AreEqual(foreignFoo, message[f("optional_foreign_enum")]); - Assert.AreEqual(importFoo, message[f("optional_import_enum")]); + Assert.Equal(nestedFoo, message[f("optional_nested_enum")]); + Assert.Equal(foreignFoo, message[f("optional_foreign_enum")]); + Assert.Equal(importFoo, message[f("optional_import_enum")]); - Assert.AreEqual("", message[f("optional_string_piece")]); - Assert.AreEqual("", message[f("optional_cord")]); + Assert.Equal("", message[f("optional_string_piece")]); + Assert.Equal("", message[f("optional_cord")]); // Repeated fields are empty. - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_cord"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_int32"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_int64"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_uint32"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_uint64"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sint32"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sint64"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_fixed32"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_fixed64"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_float"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_double"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_bool"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_string"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_bytes"))); + + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeatedgroup"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_nested_message"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_import_message"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_import_enum"))); + + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_string_piece"))); + Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_cord"))); // has_blah() should also be false for all default fields. - Assert.IsFalse(message.HasField(f("default_int32"))); - Assert.IsFalse(message.HasField(f("default_int64"))); - Assert.IsFalse(message.HasField(f("default_uint32"))); - Assert.IsFalse(message.HasField(f("default_uint64"))); - Assert.IsFalse(message.HasField(f("default_sint32"))); - Assert.IsFalse(message.HasField(f("default_sint64"))); - Assert.IsFalse(message.HasField(f("default_fixed32"))); - Assert.IsFalse(message.HasField(f("default_fixed64"))); - Assert.IsFalse(message.HasField(f("default_sfixed32"))); - Assert.IsFalse(message.HasField(f("default_sfixed64"))); - Assert.IsFalse(message.HasField(f("default_float"))); - Assert.IsFalse(message.HasField(f("default_double"))); - Assert.IsFalse(message.HasField(f("default_bool"))); - Assert.IsFalse(message.HasField(f("default_string"))); - Assert.IsFalse(message.HasField(f("default_bytes"))); - - Assert.IsFalse(message.HasField(f("default_nested_enum"))); - Assert.IsFalse(message.HasField(f("default_foreign_enum"))); - Assert.IsFalse(message.HasField(f("default_import_enum"))); - - Assert.IsFalse(message.HasField(f("default_string_piece"))); - Assert.IsFalse(message.HasField(f("default_cord"))); + Assert.False(message.HasField(f("default_int32"))); + Assert.False(message.HasField(f("default_int64"))); + Assert.False(message.HasField(f("default_uint32"))); + Assert.False(message.HasField(f("default_uint64"))); + Assert.False(message.HasField(f("default_sint32"))); + Assert.False(message.HasField(f("default_sint64"))); + Assert.False(message.HasField(f("default_fixed32"))); + Assert.False(message.HasField(f("default_fixed64"))); + Assert.False(message.HasField(f("default_sfixed32"))); + Assert.False(message.HasField(f("default_sfixed64"))); + Assert.False(message.HasField(f("default_float"))); + Assert.False(message.HasField(f("default_double"))); + Assert.False(message.HasField(f("default_bool"))); + Assert.False(message.HasField(f("default_string"))); + Assert.False(message.HasField(f("default_bytes"))); + + Assert.False(message.HasField(f("default_nested_enum"))); + Assert.False(message.HasField(f("default_foreign_enum"))); + Assert.False(message.HasField(f("default_import_enum"))); + + Assert.False(message.HasField(f("default_string_piece"))); + Assert.False(message.HasField(f("default_cord"))); // Fields with defaults have their default values (duh). - Assert.AreEqual(41, message[f("default_int32")]); - Assert.AreEqual(42L, message[f("default_int64")]); - Assert.AreEqual(43U, message[f("default_uint32")]); - Assert.AreEqual(44UL, message[f("default_uint64")]); - Assert.AreEqual(-45, message[f("default_sint32")]); - Assert.AreEqual(46L, message[f("default_sint64")]); - Assert.AreEqual(47U, message[f("default_fixed32")]); - Assert.AreEqual(48UL, message[f("default_fixed64")]); - Assert.AreEqual(49, message[f("default_sfixed32")]); - Assert.AreEqual(-50L, message[f("default_sfixed64")]); - Assert.AreEqual(51.5F, message[f("default_float")]); - Assert.AreEqual(52e3D, message[f("default_double")]); - Assert.AreEqual(true, message[f("default_bool")]); - Assert.AreEqual("hello", message[f("default_string")]); - Assert.AreEqual(TestUtil.ToBytes("world"), message[f("default_bytes")]); - - Assert.AreEqual(nestedBar, message[f("default_nested_enum")]); - Assert.AreEqual(foreignBar, message[f("default_foreign_enum")]); - Assert.AreEqual(importBar, message[f("default_import_enum")]); - - Assert.AreEqual("abc", message[f("default_string_piece")]); - Assert.AreEqual("123", message[f("default_cord")]); + Assert.Equal(41, message[f("default_int32")]); + Assert.Equal(42L, message[f("default_int64")]); + Assert.Equal(43U, message[f("default_uint32")]); + Assert.Equal(44UL, message[f("default_uint64")]); + Assert.Equal(-45, message[f("default_sint32")]); + Assert.Equal(46L, message[f("default_sint64")]); + Assert.Equal(47U, message[f("default_fixed32")]); + Assert.Equal(48UL, message[f("default_fixed64")]); + Assert.Equal(49, message[f("default_sfixed32")]); + Assert.Equal(-50L, message[f("default_sfixed64")]); + Assert.Equal(51.5F, message[f("default_float")]); + Assert.Equal(52e3D, message[f("default_double")]); + Assert.Equal(true, message[f("default_bool")]); + Assert.Equal("hello", message[f("default_string")]); + Assert.Equal(TestUtil.ToBytes("world"), message[f("default_bytes")]); + + Assert.Equal(nestedBar, message[f("default_nested_enum")]); + Assert.Equal(foreignBar, message[f("default_foreign_enum")]); + Assert.Equal(importBar, message[f("default_import_enum")]); + + Assert.Equal("abc", message[f("default_string_piece")]); + Assert.Equal("123", message[f("default_cord")]); } // --------------------------------------------------------------- @@ -802,88 +802,88 @@ namespace Google.ProtocolBuffers // ModifyRepeatedFields only sets the second repeated element of each // field. In addition to verifying this, we also verify that the first // element and size were *not* modified. - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord"))); - - Assert.AreEqual(201, message[f("repeated_int32"), 0]); - Assert.AreEqual(202L, message[f("repeated_int64"), 0]); - Assert.AreEqual(203U, message[f("repeated_uint32"), 0]); - Assert.AreEqual(204UL, message[f("repeated_uint64"), 0]); - Assert.AreEqual(205, message[f("repeated_sint32"), 0]); - Assert.AreEqual(206L, message[f("repeated_sint64"), 0]); - Assert.AreEqual(207U, message[f("repeated_fixed32"), 0]); - Assert.AreEqual(208UL, message[f("repeated_fixed64"), 0]); - Assert.AreEqual(209, message[f("repeated_sfixed32"), 0]); - Assert.AreEqual(210L, message[f("repeated_sfixed64"), 0]); - Assert.AreEqual(211F, message[f("repeated_float"), 0]); - Assert.AreEqual(212D, message[f("repeated_double"), 0]); - Assert.AreEqual(true, message[f("repeated_bool"), 0]); - Assert.AreEqual("215", message[f("repeated_string"), 0]); - Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); - - Assert.AreEqual(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); - Assert.AreEqual(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); - Assert.AreEqual(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); - Assert.AreEqual(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); - - Assert.AreEqual(nestedBar, message[f("repeated_nested_enum"), 0]); - Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"), 0]); - Assert.AreEqual(importBar, message[f("repeated_import_enum"), 0]); - - Assert.AreEqual("224", message[f("repeated_string_piece"), 0]); - Assert.AreEqual("225", message[f("repeated_cord"), 0]); - - Assert.AreEqual(501, message[f("repeated_int32"), 1]); - Assert.AreEqual(502L, message[f("repeated_int64"), 1]); - Assert.AreEqual(503U, message[f("repeated_uint32"), 1]); - Assert.AreEqual(504UL, message[f("repeated_uint64"), 1]); - Assert.AreEqual(505, message[f("repeated_sint32"), 1]); - Assert.AreEqual(506L, message[f("repeated_sint64"), 1]); - Assert.AreEqual(507U, message[f("repeated_fixed32"), 1]); - Assert.AreEqual(508UL, message[f("repeated_fixed64"), 1]); - Assert.AreEqual(509, message[f("repeated_sfixed32"), 1]); - Assert.AreEqual(510L, message[f("repeated_sfixed64"), 1]); - Assert.AreEqual(511F, message[f("repeated_float"), 1]); - Assert.AreEqual(512D, message[f("repeated_double"), 1]); - Assert.AreEqual(true, message[f("repeated_bool"), 1]); - Assert.AreEqual("515", message[f("repeated_string"), 1]); - Assert.AreEqual(TestUtil.ToBytes("516"), message[f("repeated_bytes"), 1]); - - Assert.AreEqual(517, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); - Assert.AreEqual(518, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); - Assert.AreEqual(519, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); - Assert.AreEqual(520, ((IMessage) message[f("repeated_import_message"), 1])[importD]); - - Assert.AreEqual(nestedFoo, message[f("repeated_nested_enum"), 1]); - Assert.AreEqual(foreignFoo, message[f("repeated_foreign_enum"), 1]); - Assert.AreEqual(importFoo, message[f("repeated_import_enum"), 1]); - - Assert.AreEqual("524", message[f("repeated_string_piece"), 1]); - Assert.AreEqual("525", message[f("repeated_cord"), 1]); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_float"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_double"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bool"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); + + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); + + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_cord"))); + + Assert.Equal(201, message[f("repeated_int32"), 0]); + Assert.Equal(202L, message[f("repeated_int64"), 0]); + Assert.Equal(203U, message[f("repeated_uint32"), 0]); + Assert.Equal(204UL, message[f("repeated_uint64"), 0]); + Assert.Equal(205, message[f("repeated_sint32"), 0]); + Assert.Equal(206L, message[f("repeated_sint64"), 0]); + Assert.Equal(207U, message[f("repeated_fixed32"), 0]); + Assert.Equal(208UL, message[f("repeated_fixed64"), 0]); + Assert.Equal(209, message[f("repeated_sfixed32"), 0]); + Assert.Equal(210L, message[f("repeated_sfixed64"), 0]); + Assert.Equal(211F, message[f("repeated_float"), 0]); + Assert.Equal(212D, message[f("repeated_double"), 0]); + Assert.Equal(true, message[f("repeated_bool"), 0]); + Assert.Equal("215", message[f("repeated_string"), 0]); + Assert.Equal(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); + + Assert.Equal(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); + Assert.Equal(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); + Assert.Equal(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); + Assert.Equal(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); + + Assert.Equal(nestedBar, message[f("repeated_nested_enum"), 0]); + Assert.Equal(foreignBar, message[f("repeated_foreign_enum"), 0]); + Assert.Equal(importBar, message[f("repeated_import_enum"), 0]); + + Assert.Equal("224", message[f("repeated_string_piece"), 0]); + Assert.Equal("225", message[f("repeated_cord"), 0]); + + Assert.Equal(501, message[f("repeated_int32"), 1]); + Assert.Equal(502L, message[f("repeated_int64"), 1]); + Assert.Equal(503U, message[f("repeated_uint32"), 1]); + Assert.Equal(504UL, message[f("repeated_uint64"), 1]); + Assert.Equal(505, message[f("repeated_sint32"), 1]); + Assert.Equal(506L, message[f("repeated_sint64"), 1]); + Assert.Equal(507U, message[f("repeated_fixed32"), 1]); + Assert.Equal(508UL, message[f("repeated_fixed64"), 1]); + Assert.Equal(509, message[f("repeated_sfixed32"), 1]); + Assert.Equal(510L, message[f("repeated_sfixed64"), 1]); + Assert.Equal(511F, message[f("repeated_float"), 1]); + Assert.Equal(512D, message[f("repeated_double"), 1]); + Assert.Equal(true, message[f("repeated_bool"), 1]); + Assert.Equal("515", message[f("repeated_string"), 1]); + Assert.Equal(TestUtil.ToBytes("516"), message[f("repeated_bytes"), 1]); + + Assert.Equal(517, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); + Assert.Equal(518, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); + Assert.Equal(519, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); + Assert.Equal(520, ((IMessage) message[f("repeated_import_message"), 1])[importD]); + + Assert.Equal(nestedFoo, message[f("repeated_nested_enum"), 1]); + Assert.Equal(foreignFoo, message[f("repeated_foreign_enum"), 1]); + Assert.Equal(importFoo, message[f("repeated_import_enum"), 1]); + + Assert.Equal("524", message[f("repeated_string_piece"), 1]); + Assert.Equal("525", message[f("repeated_cord"), 1]); } /// @@ -892,15 +892,15 @@ namespace Google.ProtocolBuffers /// public void AssertReflectionSettersRejectNull(IBuilder builder) { - TestUtil.AssertArgumentNullException(() => builder[f("optional_string")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_bytes")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_nested_enum")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_nested_message")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_nested_message")] = null); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_string"), null)); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_bytes"), null)); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_nested_enum"), null)); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_nested_message"), null)); + Assert.Throws(() => builder[f("optional_string")] = null); + Assert.Throws(() => builder[f("optional_bytes")] = null); + Assert.Throws(() => builder[f("optional_nested_enum")] = null); + Assert.Throws(() => builder[f("optional_nested_message")] = null); + Assert.Throws(() => builder[f("optional_nested_message")] = null); + Assert.Throws(() => builder.WeakAddRepeatedField(f("repeated_string"), null)); + Assert.Throws(() => builder.WeakAddRepeatedField(f("repeated_bytes"), null)); + Assert.Throws(() => builder.WeakAddRepeatedField(f("repeated_nested_enum"), null)); + Assert.Throws(() => builder.WeakAddRepeatedField(f("repeated_nested_message"), null)); } /// @@ -910,14 +910,14 @@ namespace Google.ProtocolBuffers public void AssertReflectionRepeatedSettersRejectNull(IBuilder builder) { builder.WeakAddRepeatedField(f("repeated_string"), "one"); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_string"), 0, null)); + Assert.Throws(() => builder.SetRepeatedField(f("repeated_string"), 0, null)); builder.WeakAddRepeatedField(f("repeated_bytes"), TestUtil.ToBytes("one")); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_bytes"), 0, null)); + Assert.Throws(() => builder.SetRepeatedField(f("repeated_bytes"), 0, null)); builder.WeakAddRepeatedField(f("repeated_nested_enum"), nestedBaz); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_nested_enum"), 0, null)); + Assert.Throws(() => builder.SetRepeatedField(f("repeated_nested_enum"), 0, null)); builder.WeakAddRepeatedField(f("repeated_nested_message"), new TestAllTypes.Types.NestedMessage.Builder {Bb = 218}.Build()); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_nested_message"), 0, null)); + Assert.Throws(() => builder.SetRepeatedField(f("repeated_nested_message"), 0, null)); } public void SetPackedFieldsViaReflection(IBuilder message) @@ -955,50 +955,50 @@ namespace Google.ProtocolBuffers public void AssertPackedFieldsSetViaReflection(IMessage message) { - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_int32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_int64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_uint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_uint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_fixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_fixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sfixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sfixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_float"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_double"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_bool"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_enum"))); - - Assert.AreEqual(601, message[f("packed_int32"), 0]); - Assert.AreEqual(602L, message[f("packed_int64"), 0]); - Assert.AreEqual(603u, message[f("packed_uint32"), 0]); - Assert.AreEqual(604uL, message[f("packed_uint64"), 0]); - Assert.AreEqual(605, message[f("packed_sint32"), 0]); - Assert.AreEqual(606L, message[f("packed_sint64"), 0]); - Assert.AreEqual(607u, message[f("packed_fixed32"), 0]); - Assert.AreEqual(608uL, message[f("packed_fixed64"), 0]); - Assert.AreEqual(609, message[f("packed_sfixed32"), 0]); - Assert.AreEqual(610L, message[f("packed_sfixed64"), 0]); - Assert.AreEqual(611F, message[f("packed_float"), 0]); - Assert.AreEqual(612D, message[f("packed_double"), 0]); - Assert.AreEqual(true, message[f("packed_bool"), 0]); - Assert.AreEqual(foreignBar, message[f("packed_enum"), 0]); - - Assert.AreEqual(701, message[f("packed_int32"), 1]); - Assert.AreEqual(702L, message[f("packed_int64"), 1]); - Assert.AreEqual(703u, message[f("packed_uint32"), 1]); - Assert.AreEqual(704uL, message[f("packed_uint64"), 1]); - Assert.AreEqual(705, message[f("packed_sint32"), 1]); - Assert.AreEqual(706L, message[f("packed_sint64"), 1]); - Assert.AreEqual(707u, message[f("packed_fixed32"), 1]); - Assert.AreEqual(708uL, message[f("packed_fixed64"), 1]); - Assert.AreEqual(709, message[f("packed_sfixed32"), 1]); - Assert.AreEqual(710L, message[f("packed_sfixed64"), 1]); - Assert.AreEqual(711F, message[f("packed_float"), 1]); - Assert.AreEqual(712D, message[f("packed_double"), 1]); - Assert.AreEqual(false, message[f("packed_bool"), 1]); - Assert.AreEqual(foreignBaz, message[f("packed_enum"), 1]); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_int32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_int64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_uint32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_uint64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sint32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sint64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_fixed32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_fixed64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sfixed32"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sfixed64"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_float"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_double"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_bool"))); + Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_enum"))); + + Assert.Equal(601, message[f("packed_int32"), 0]); + Assert.Equal(602L, message[f("packed_int64"), 0]); + Assert.Equal(603u, message[f("packed_uint32"), 0]); + Assert.Equal(604uL, message[f("packed_uint64"), 0]); + Assert.Equal(605, message[f("packed_sint32"), 0]); + Assert.Equal(606L, message[f("packed_sint64"), 0]); + Assert.Equal(607u, message[f("packed_fixed32"), 0]); + Assert.Equal(608uL, message[f("packed_fixed64"), 0]); + Assert.Equal(609, message[f("packed_sfixed32"), 0]); + Assert.Equal(610L, message[f("packed_sfixed64"), 0]); + Assert.Equal(611F, message[f("packed_float"), 0]); + Assert.Equal(612D, message[f("packed_double"), 0]); + Assert.Equal(true, message[f("packed_bool"), 0]); + Assert.Equal(foreignBar, message[f("packed_enum"), 0]); + + Assert.Equal(701, message[f("packed_int32"), 1]); + Assert.Equal(702L, message[f("packed_int64"), 1]); + Assert.Equal(703u, message[f("packed_uint32"), 1]); + Assert.Equal(704uL, message[f("packed_uint64"), 1]); + Assert.Equal(705, message[f("packed_sint32"), 1]); + Assert.Equal(706L, message[f("packed_sint64"), 1]); + Assert.Equal(707u, message[f("packed_fixed32"), 1]); + Assert.Equal(708uL, message[f("packed_fixed64"), 1]); + Assert.Equal(709, message[f("packed_sfixed32"), 1]); + Assert.Equal(710L, message[f("packed_sfixed64"), 1]); + Assert.Equal(711F, message[f("packed_float"), 1]); + Assert.Equal(712D, message[f("packed_double"), 1]); + Assert.Equal(false, message[f("packed_bool"), 1]); + Assert.Equal(foreignBaz, message[f("packed_enum"), 1]); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs b/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs index a63f6575..e6b6a1b3 100644 --- a/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs +++ b/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs @@ -1,48 +1,43 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Text; using Google.ProtocolBuffers.Collections; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; -using Google.ProtocolBuffers.Serialization; using UnitTest.Issues.TestProtos; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class ReusableBuilderTest { //Issue 28: Circular message dependencies result in null defaults for DefaultInstance - [TestMethod] + [Fact] public void EnsureStaticCicularReference() { MyMessageAReferenceB ab = MyMessageAReferenceB.DefaultInstance; - Assert.IsNotNull(ab); - Assert.IsNotNull(ab.Value); + Assert.NotNull(ab); + Assert.NotNull(ab.Value); MyMessageBReferenceA ba = MyMessageBReferenceA.DefaultInstance; - Assert.IsNotNull(ba); - Assert.IsNotNull(ba.Value); + Assert.NotNull(ba); + Assert.NotNull(ba.Value); } - [TestMethod] + [Fact] public void TestModifyDefaultInstance() { //verify that the default instance has correctly been marked as read-only - Assert.AreEqual(typeof(PopsicleList), TestAllTypes.DefaultInstance.RepeatedBoolList.GetType()); + Assert.Equal(typeof(PopsicleList), TestAllTypes.DefaultInstance.RepeatedBoolList.GetType()); PopsicleList list = (PopsicleList)TestAllTypes.DefaultInstance.RepeatedBoolList; - Assert.IsTrue(list.IsReadOnly); + Assert.True(list.IsReadOnly); } - [TestMethod] + [Fact] public void TestUnmodifiedDefaultInstance() { //Simply calling ToBuilder().Build() no longer creates a copy of the message TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void BuildMultipleWithoutChange() { //Calling Build() or BuildPartial() does not require a copy of the message @@ -51,31 +46,31 @@ namespace Google.ProtocolBuffers TestAllTypes first = builder.BuildPartial(); //Still the same instance? - Assert.IsTrue(ReferenceEquals(first, builder.Build())); + Assert.True(ReferenceEquals(first, builder.Build())); //Still the same instance? - Assert.IsTrue(ReferenceEquals(first, builder.BuildPartial().ToBuilder().Build())); + Assert.True(ReferenceEquals(first, builder.BuildPartial().ToBuilder().Build())); } - [TestMethod] + [Fact] public void MergeFromDefaultInstance() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.MergeFrom(TestAllTypes.DefaultInstance); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void BuildNewBuilderIsDefaultInstance() { - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, new TestAllTypes.Builder().Build())); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, new TestAllTypes.Builder().Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().Build())); //last test, if you clear a builder it reverts to default instance - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().SetOptionalBool(true).Build().ToBuilder().Clear().Build())); } - [TestMethod] + [Fact] public void BuildModifyAndRebuild() { TestAllTypes.Builder b1 = new TestAllTypes.Builder(); @@ -91,80 +86,80 @@ namespace Google.ProtocolBuffers TestAllTypes m2 = b1.Build(); - Assert.AreEqual("{\"optional_foreign_message\":{},\"repeated_int32\":[2],\"default_int32\":1}", Extensions.ToJson(m1)); - Assert.AreEqual("{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}", Extensions.ToJson(m2)); + Assert.Equal("{\"optional_foreign_message\":{},\"repeated_int32\":[2],\"default_int32\":1}", Extensions.ToJson(m1)); + Assert.Equal("{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}", Extensions.ToJson(m2)); } - [TestMethod] + [Fact] public void CloneOnChangePrimitive() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.SetDefaultBool(true); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void CloneOnAddRepeatedBool() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.AddRepeatedBool(true); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void CloneOnGetRepeatedBoolList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); GC.KeepAlive(builder.RepeatedBoolList); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void CloneOnChangeMessage() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.SetOptionalForeignMessage(new ForeignMessage.Builder()); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void CloneOnClearMessage() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.ClearOptionalForeignMessage(); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void CloneOnGetRepeatedForeignMessageList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); GC.KeepAlive(builder.RepeatedForeignMessageList); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void CloneOnChangeEnumValue() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.SetOptionalForeignEnum(ForeignEnum.FOREIGN_BAR); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [TestMethod] + [Fact] public void CloneOnGetRepeatedForeignEnumList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); GC.KeepAlive(builder.RepeatedForeignEnumList); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } } diff --git a/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs b/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs index 0be4e1d4..5bec24f1 100644 --- a/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs +++ b/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using UnitTest.Issues.TestProtos; +using UnitTest.Issues.TestProtos; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class TestCornerCases { - [TestMethod] + [Fact] public void TestRoundTripNegativeEnums() { NegativeEnumMessage msg = NegativeEnumMessage.CreateBuilder() @@ -23,16 +19,16 @@ namespace Google.ProtocolBuffers .AddPackedValues(NegativeEnum.FiveBelow) //10 .Build(); - Assert.AreEqual(58, msg.SerializedSize); + Assert.Equal(58, msg.SerializedSize); byte[] bytes = new byte[58]; CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); msg.WriteTo(output); - Assert.AreEqual(0, output.SpaceLeft); + Assert.Equal(0, output.SpaceLeft); NegativeEnumMessage copy = NegativeEnumMessage.ParseFrom(bytes); - Assert.AreEqual(msg, copy); + Assert.Equal(msg, copy); } } } diff --git a/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs b/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs index c16f567f..5caa2e23 100644 --- a/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs +++ b/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs @@ -5,11 +5,10 @@ using System.Text; using Google.ProtocolBuffers.Serialization; using Google.ProtocolBuffers.Serialization.Http; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class TestMimeMessageFormats { // There is a whole host of various json mime types in use around the net, this is the set we accept... @@ -17,85 +16,91 @@ namespace Google.ProtocolBuffers readonly IEnumerable XmlTypes = new string[] { "text/xml", "application/xml" }; readonly IEnumerable ProtobufTypes = new string[] { "application/binary", "application/x-protobuf", "application/vnd.google.protobuf" }; - [TestMethod] + [Fact] public void TestReadJsonMimeTypes() { foreach (string type in JsonTypes) { - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) is JsonFormatReader); } - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) is JsonFormatReader); } - [TestMethod] + + [Fact] public void TestWriteJsonMimeTypes() { foreach (string type in JsonTypes) { - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) is JsonFormatWriter); } - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) is JsonFormatWriter); } - [TestMethod] + + [Fact] public void TestReadXmlMimeTypes() { foreach (string type in XmlTypes) { - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) is XmlFormatReader); } - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) is XmlFormatReader); } - [TestMethod] + + [Fact] public void TestWriteXmlMimeTypes() { foreach (string type in XmlTypes) { - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) is XmlFormatWriter); } - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) is XmlFormatWriter); } - [TestMethod] + + [Fact] public void TestReadProtoMimeTypes() { foreach (string type in ProtobufTypes) { - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) is CodedInputStream); } - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) is CodedInputStream); } - [TestMethod] + + [Fact] public void TestWriteProtoMimeTypes() { foreach (string type in ProtobufTypes) { - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) is CodedOutputStream); } - Assert.IsTrue( + Assert.True( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) is CodedOutputStream); } - [TestMethod] + + [Fact] public void TestMergeFromJsonType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), @@ -103,10 +108,11 @@ namespace Google.ProtocolBuffers Extensions.ToJson(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) ))) .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); + Assert.Equal("a", msg.Text); + Assert.Equal(1, msg.Number); } - [TestMethod] + + [Fact] public void TestMergeFromXmlType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), @@ -114,10 +120,10 @@ namespace Google.ProtocolBuffers Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) ))) .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); + Assert.Equal("a", msg.Text); + Assert.Equal(1, msg.Number); } - [TestMethod] + [Fact] public void TestMergeFromProtoType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), @@ -125,28 +131,30 @@ namespace Google.ProtocolBuffers TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray() )) .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); + Assert.Equal("a", msg.Text); + Assert.Equal(1, msg.Number); } - [TestMethod] + + [Fact] public void TestWriteToJsonType() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions(), "application/json", ms); - Assert.AreEqual(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.Equal(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [TestMethod] + + [Fact] public void TestWriteToXmlType() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions(), "application/xml", ms); - Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.Equal("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [TestMethod] + [Fact] public void TestWriteToProtoType() { MemoryStream ms = new MemoryStream(); @@ -154,9 +162,10 @@ namespace Google.ProtocolBuffers new MessageFormatOptions(), "application/vnd.google.protobuf", ms); byte[] bytes = TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray(); - TestUtil.AssertBytesEqual(bytes, ms.ToArray()); + Assert.Equal(bytes, ms.ToArray()); } - [TestMethod] + + [Fact] public void TestXmlReaderOptions() { MemoryStream ms = new MemoryStream(); @@ -175,12 +184,13 @@ namespace Google.ProtocolBuffers options, "application/xml", ms) .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.NumbersList[0]); - Assert.AreEqual(2, msg.NumbersList[1]); + Assert.Equal("a", msg.Text); + Assert.Equal(1, msg.NumbersList[0]); + Assert.Equal(2, msg.NumbersList[1]); } - [TestMethod] + + [Fact] public void TestXmlWriterOptions() { TestXmlMessage message = TestXmlMessage.CreateBuilder().SetText("a").AddNumbers(1).AddNumbers(2).Build(); @@ -199,30 +209,32 @@ namespace Google.ProtocolBuffers .SetOptions(XmlReaderOptions.ReadNestedArrays) .Merge("root-node", builder); - Assert.AreEqual("a", builder.Text); - Assert.AreEqual(1, builder.NumbersList[0]); - Assert.AreEqual(2, builder.NumbersList[1]); + Assert.Equal("a", builder.Text); + Assert.Equal(1, builder.NumbersList[0]); + Assert.Equal(2, builder.NumbersList[1]); } - [TestMethod] + + [Fact] public void TestJsonFormatted() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions() { FormattedOutput = true }, "application/json", ms); - Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.Equal("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [TestMethod] + + [Fact] public void TestXmlFormatted() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions() { FormattedOutput = true }, "application/xml", ms); - Assert.AreEqual("\r\n a\r\n 1\r\n", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.Equal("\r\n a\r\n 1\r\n", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [TestMethod] + [Fact] public void TestReadCustomMimeTypes() { var options = new MessageFormatOptions(); @@ -230,7 +242,7 @@ namespace Google.ProtocolBuffers options.MimeInputTypes.Clear(); //Add our own options.MimeInputTypes.Add("-custom-XML-mime-type-", XmlFormatReader.CreateInstance); - Assert.AreEqual(1, options.MimeInputTypes.Count); + Assert.Equal(1, options.MimeInputTypes.Count); Stream xmlStream = new MemoryStream(Encoding.UTF8.GetBytes( Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) @@ -239,11 +251,11 @@ namespace Google.ProtocolBuffers TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), options, "-custom-XML-mime-type-", xmlStream) .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); + Assert.Equal("a", msg.Text); + Assert.Equal(1, msg.Number); } - [TestMethod] + [Fact] public void TestWriteToCustomType() { var options = new MessageFormatOptions(); @@ -252,13 +264,13 @@ namespace Google.ProtocolBuffers //Add our own options.MimeOutputTypes.Add("-custom-XML-mime-type-", XmlFormatWriter.CreateInstance); - Assert.AreEqual(1, options.MimeOutputTypes.Count); + Assert.Equal(1, options.MimeOutputTypes.Count); MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), options, "-custom-XML-mime-type-", ms); - Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.Equal("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs b/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs index 1c43e24d..b262667a 100644 --- a/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs +++ b/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs @@ -1,16 +1,15 @@ using System; using System.IO; using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.Serialization.Http; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class TestReaderForUrlEncoded { - [TestMethod] + [Fact] public void Example_FromQueryString() { Uri sampleUri = new Uri("http://sample.com/Path/File.ext?text=two+three%20four&valid=true&numbers=1&numbers=2", UriKind.Absolute); @@ -21,14 +20,14 @@ namespace Google.ProtocolBuffers builder.MergeFrom(input); TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); - Assert.AreEqual("two three four", message.Text); - Assert.AreEqual(2, message.NumbersCount); - Assert.AreEqual(1, message.NumbersList[0]); - Assert.AreEqual(2, message.NumbersList[1]); + Assert.Equal(true, message.Valid); + Assert.Equal("two three four", message.Text); + Assert.Equal(2, message.NumbersCount); + Assert.Equal(1, message.NumbersList[0]); + Assert.Equal(2, message.NumbersList[1]); } - [TestMethod] + [Fact] public void Example_FromFormData() { Stream rawPost = new MemoryStream(Encoding.UTF8.GetBytes("text=two+three%20four&valid=true&numbers=1&numbers=2"), false); @@ -39,46 +38,46 @@ namespace Google.ProtocolBuffers builder.MergeFrom(input); TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); - Assert.AreEqual("two three four", message.Text); - Assert.AreEqual(2, message.NumbersCount); - Assert.AreEqual(1, message.NumbersList[0]); - Assert.AreEqual(2, message.NumbersList[1]); + Assert.Equal(true, message.Valid); + Assert.Equal("two three four", message.Text); + Assert.Equal(2, message.NumbersCount); + Assert.Equal(1, message.NumbersList[0]); + Assert.Equal(2, message.NumbersList[1]); } - [TestMethod] + [Fact] public void TestEmptyValues() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text=&numbers=1"); TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); builder.MergeFrom(input); - Assert.IsTrue(builder.Valid); - Assert.IsTrue(builder.HasText); - Assert.AreEqual("", builder.Text); - Assert.AreEqual(1, builder.NumbersCount); - Assert.AreEqual(1, builder.NumbersList[0]); + Assert.True(builder.Valid); + Assert.True(builder.HasText); + Assert.Equal("", builder.Text); + Assert.Equal(1, builder.NumbersCount); + Assert.Equal(1, builder.NumbersList[0]); } - [TestMethod] + [Fact] public void TestNoValue() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text&numbers=1"); TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); builder.MergeFrom(input); - Assert.IsTrue(builder.Valid); - Assert.IsTrue(builder.HasText); - Assert.AreEqual("", builder.Text); - Assert.AreEqual(1, builder.NumbersCount); - Assert.AreEqual(1, builder.NumbersList[0]); + Assert.True(builder.Valid); + Assert.True(builder.HasText); + Assert.Equal("", builder.Text); + Assert.Equal(1, builder.NumbersCount); + Assert.Equal(1, builder.NumbersList[0]); } - [TestMethod, ExpectedException(typeof(NotSupportedException))] + [Fact] public void FormUrlEncodedReaderDoesNotSupportChildren() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("child=uh0"); - TestXmlMessage.CreateBuilder().MergeFrom(input); + Assert.Throws(() => TestXmlMessage.CreateBuilder().MergeFrom(input)); } } } diff --git a/csharp/src/ProtocolBuffers.Test/TestUtil.cs b/csharp/src/ProtocolBuffers.Test/TestUtil.cs index ec30cbcd..83509c18 100644 --- a/csharp/src/ProtocolBuffers.Test/TestUtil.cs +++ b/csharp/src/ProtocolBuffers.Test/TestUtil.cs @@ -41,7 +41,7 @@ using System.IO; using System.Text; using System.Threading; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { @@ -324,343 +324,343 @@ namespace Google.ProtocolBuffers /// internal static void AssertAllFieldsSet(TestAllTypes message) { - Assert.IsTrue(message.HasOptionalInt32); - Assert.IsTrue(message.HasOptionalInt64); - Assert.IsTrue(message.HasOptionalUint32); - Assert.IsTrue(message.HasOptionalUint64); - Assert.IsTrue(message.HasOptionalSint32); - Assert.IsTrue(message.HasOptionalSint64); - Assert.IsTrue(message.HasOptionalFixed32); - Assert.IsTrue(message.HasOptionalFixed64); - Assert.IsTrue(message.HasOptionalSfixed32); - Assert.IsTrue(message.HasOptionalSfixed64); - Assert.IsTrue(message.HasOptionalFloat); - Assert.IsTrue(message.HasOptionalDouble); - Assert.IsTrue(message.HasOptionalBool); - Assert.IsTrue(message.HasOptionalString); - Assert.IsTrue(message.HasOptionalBytes); - - Assert.IsTrue(message.HasOptionalGroup); - Assert.IsTrue(message.HasOptionalNestedMessage); - Assert.IsTrue(message.HasOptionalForeignMessage); - Assert.IsTrue(message.HasOptionalImportMessage); - - Assert.IsTrue(message.OptionalGroup.HasA); - Assert.IsTrue(message.OptionalNestedMessage.HasBb); - Assert.IsTrue(message.OptionalForeignMessage.HasC); - Assert.IsTrue(message.OptionalImportMessage.HasD); - - Assert.IsTrue(message.HasOptionalNestedEnum); - Assert.IsTrue(message.HasOptionalForeignEnum); - Assert.IsTrue(message.HasOptionalImportEnum); - - Assert.IsTrue(message.HasOptionalStringPiece); - Assert.IsTrue(message.HasOptionalCord); - - Assert.AreEqual(101, message.OptionalInt32); - Assert.AreEqual(102, message.OptionalInt64); - Assert.AreEqual(103u, message.OptionalUint32); - Assert.AreEqual(104u, message.OptionalUint64); - Assert.AreEqual(105, message.OptionalSint32); - Assert.AreEqual(106, message.OptionalSint64); - Assert.AreEqual(107u, message.OptionalFixed32); - Assert.AreEqual(108u, message.OptionalFixed64); - Assert.AreEqual(109, message.OptionalSfixed32); - Assert.AreEqual(110, message.OptionalSfixed64); - Assert.AreEqual(111, message.OptionalFloat); - Assert.AreEqual(112, message.OptionalDouble); - Assert.AreEqual(true, message.OptionalBool); - Assert.AreEqual("115", message.OptionalString); - Assert.AreEqual(ToBytes("116"), message.OptionalBytes); - - Assert.AreEqual(117, message.OptionalGroup.A); - Assert.AreEqual(118, message.OptionalNestedMessage.Bb); - Assert.AreEqual(119, message.OptionalForeignMessage.C); - Assert.AreEqual(120, message.OptionalImportMessage.D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.OptionalNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.OptionalForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.OptionalImportEnum); - - Assert.AreEqual("124", message.OptionalStringPiece); - Assert.AreEqual("125", message.OptionalCord); + Assert.True(message.HasOptionalInt32); + Assert.True(message.HasOptionalInt64); + Assert.True(message.HasOptionalUint32); + Assert.True(message.HasOptionalUint64); + Assert.True(message.HasOptionalSint32); + Assert.True(message.HasOptionalSint64); + Assert.True(message.HasOptionalFixed32); + Assert.True(message.HasOptionalFixed64); + Assert.True(message.HasOptionalSfixed32); + Assert.True(message.HasOptionalSfixed64); + Assert.True(message.HasOptionalFloat); + Assert.True(message.HasOptionalDouble); + Assert.True(message.HasOptionalBool); + Assert.True(message.HasOptionalString); + Assert.True(message.HasOptionalBytes); + + Assert.True(message.HasOptionalGroup); + Assert.True(message.HasOptionalNestedMessage); + Assert.True(message.HasOptionalForeignMessage); + Assert.True(message.HasOptionalImportMessage); + + Assert.True(message.OptionalGroup.HasA); + Assert.True(message.OptionalNestedMessage.HasBb); + Assert.True(message.OptionalForeignMessage.HasC); + Assert.True(message.OptionalImportMessage.HasD); + + Assert.True(message.HasOptionalNestedEnum); + Assert.True(message.HasOptionalForeignEnum); + Assert.True(message.HasOptionalImportEnum); + + Assert.True(message.HasOptionalStringPiece); + Assert.True(message.HasOptionalCord); + + Assert.Equal(101, message.OptionalInt32); + Assert.Equal(102, message.OptionalInt64); + Assert.Equal(103u, message.OptionalUint32); + Assert.Equal(104u, message.OptionalUint64); + Assert.Equal(105, message.OptionalSint32); + Assert.Equal(106, message.OptionalSint64); + Assert.Equal(107u, message.OptionalFixed32); + Assert.Equal(108u, message.OptionalFixed64); + Assert.Equal(109, message.OptionalSfixed32); + Assert.Equal(110, message.OptionalSfixed64); + Assert.Equal(111, message.OptionalFloat); + Assert.Equal(112, message.OptionalDouble); + Assert.Equal(true, message.OptionalBool); + Assert.Equal("115", message.OptionalString); + Assert.Equal(ToBytes("116"), message.OptionalBytes); + + Assert.Equal(117, message.OptionalGroup.A); + Assert.Equal(118, message.OptionalNestedMessage.Bb); + Assert.Equal(119, message.OptionalForeignMessage.C); + Assert.Equal(120, message.OptionalImportMessage.D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, message.OptionalNestedEnum); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.OptionalForeignEnum); + Assert.Equal(ImportEnum.IMPORT_BAZ, message.OptionalImportEnum); + + Assert.Equal("124", message.OptionalStringPiece); + Assert.Equal("125", message.OptionalCord); // ----------------------------------------------------------------- - Assert.AreEqual(2, message.RepeatedInt32Count); - Assert.AreEqual(2, message.RepeatedInt64Count); - Assert.AreEqual(2, message.RepeatedUint32Count); - Assert.AreEqual(2, message.RepeatedUint64Count); - Assert.AreEqual(2, message.RepeatedSint32Count); - Assert.AreEqual(2, message.RepeatedSint64Count); - Assert.AreEqual(2, message.RepeatedFixed32Count); - Assert.AreEqual(2, message.RepeatedFixed64Count); - Assert.AreEqual(2, message.RepeatedSfixed32Count); - Assert.AreEqual(2, message.RepeatedSfixed64Count); - Assert.AreEqual(2, message.RepeatedFloatCount); - Assert.AreEqual(2, message.RepeatedDoubleCount); - Assert.AreEqual(2, message.RepeatedBoolCount); - Assert.AreEqual(2, message.RepeatedStringCount); - Assert.AreEqual(2, message.RepeatedBytesCount); - - Assert.AreEqual(2, message.RepeatedGroupCount); - Assert.AreEqual(2, message.RepeatedNestedMessageCount); - Assert.AreEqual(2, message.RepeatedForeignMessageCount); - Assert.AreEqual(2, message.RepeatedImportMessageCount); - Assert.AreEqual(2, message.RepeatedNestedEnumCount); - Assert.AreEqual(2, message.RepeatedForeignEnumCount); - Assert.AreEqual(2, message.RepeatedImportEnumCount); - - Assert.AreEqual(2, message.RepeatedStringPieceCount); - Assert.AreEqual(2, message.RepeatedCordCount); - - Assert.AreEqual(201, message.GetRepeatedInt32(0)); - Assert.AreEqual(202, message.GetRepeatedInt64(0)); - Assert.AreEqual(203u, message.GetRepeatedUint32(0)); - Assert.AreEqual(204u, message.GetRepeatedUint64(0)); - Assert.AreEqual(205, message.GetRepeatedSint32(0)); - Assert.AreEqual(206, message.GetRepeatedSint64(0)); - Assert.AreEqual(207u, message.GetRepeatedFixed32(0)); - Assert.AreEqual(208u, message.GetRepeatedFixed64(0)); - Assert.AreEqual(209, message.GetRepeatedSfixed32(0)); - Assert.AreEqual(210, message.GetRepeatedSfixed64(0)); - Assert.AreEqual(211, message.GetRepeatedFloat(0)); - Assert.AreEqual(212, message.GetRepeatedDouble(0)); - Assert.AreEqual(true, message.GetRepeatedBool(0)); - Assert.AreEqual("215", message.GetRepeatedString(0)); - Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0)); - - Assert.AreEqual(217, message.GetRepeatedGroup(0).A); - Assert.AreEqual(218, message.GetRepeatedNestedMessage(0).Bb); - Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C); - Assert.AreEqual(220, message.GetRepeatedImportMessage(0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); - - Assert.AreEqual("224", message.GetRepeatedStringPiece(0)); - Assert.AreEqual("225", message.GetRepeatedCord(0)); - - Assert.AreEqual(301, message.GetRepeatedInt32(1)); - Assert.AreEqual(302, message.GetRepeatedInt64(1)); - Assert.AreEqual(303u, message.GetRepeatedUint32(1)); - Assert.AreEqual(304u, message.GetRepeatedUint64(1)); - Assert.AreEqual(305, message.GetRepeatedSint32(1)); - Assert.AreEqual(306, message.GetRepeatedSint64(1)); - Assert.AreEqual(307u, message.GetRepeatedFixed32(1)); - Assert.AreEqual(308u, message.GetRepeatedFixed64(1)); - Assert.AreEqual(309, message.GetRepeatedSfixed32(1)); - Assert.AreEqual(310, message.GetRepeatedSfixed64(1)); - Assert.AreEqual(311, message.GetRepeatedFloat(1), 0.0); - Assert.AreEqual(312, message.GetRepeatedDouble(1), 0.0); - Assert.AreEqual(false, message.GetRepeatedBool(1)); - Assert.AreEqual("315", message.GetRepeatedString(1)); - Assert.AreEqual(ToBytes("316"), message.GetRepeatedBytes(1)); - - Assert.AreEqual(317, message.GetRepeatedGroup(1).A); - Assert.AreEqual(318, message.GetRepeatedNestedMessage(1).Bb); - Assert.AreEqual(319, message.GetRepeatedForeignMessage(1).C); - Assert.AreEqual(320, message.GetRepeatedImportMessage(1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetRepeatedNestedEnum(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetRepeatedForeignEnum(1)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetRepeatedImportEnum(1)); - - Assert.AreEqual("324", message.GetRepeatedStringPiece(1)); - Assert.AreEqual("325", message.GetRepeatedCord(1)); + Assert.Equal(2, message.RepeatedInt32Count); + Assert.Equal(2, message.RepeatedInt64Count); + Assert.Equal(2, message.RepeatedUint32Count); + Assert.Equal(2, message.RepeatedUint64Count); + Assert.Equal(2, message.RepeatedSint32Count); + Assert.Equal(2, message.RepeatedSint64Count); + Assert.Equal(2, message.RepeatedFixed32Count); + Assert.Equal(2, message.RepeatedFixed64Count); + Assert.Equal(2, message.RepeatedSfixed32Count); + Assert.Equal(2, message.RepeatedSfixed64Count); + Assert.Equal(2, message.RepeatedFloatCount); + Assert.Equal(2, message.RepeatedDoubleCount); + Assert.Equal(2, message.RepeatedBoolCount); + Assert.Equal(2, message.RepeatedStringCount); + Assert.Equal(2, message.RepeatedBytesCount); + + Assert.Equal(2, message.RepeatedGroupCount); + Assert.Equal(2, message.RepeatedNestedMessageCount); + Assert.Equal(2, message.RepeatedForeignMessageCount); + Assert.Equal(2, message.RepeatedImportMessageCount); + Assert.Equal(2, message.RepeatedNestedEnumCount); + Assert.Equal(2, message.RepeatedForeignEnumCount); + Assert.Equal(2, message.RepeatedImportEnumCount); + + Assert.Equal(2, message.RepeatedStringPieceCount); + Assert.Equal(2, message.RepeatedCordCount); + + Assert.Equal(201, message.GetRepeatedInt32(0)); + Assert.Equal(202, message.GetRepeatedInt64(0)); + Assert.Equal(203u, message.GetRepeatedUint32(0)); + Assert.Equal(204u, message.GetRepeatedUint64(0)); + Assert.Equal(205, message.GetRepeatedSint32(0)); + Assert.Equal(206, message.GetRepeatedSint64(0)); + Assert.Equal(207u, message.GetRepeatedFixed32(0)); + Assert.Equal(208u, message.GetRepeatedFixed64(0)); + Assert.Equal(209, message.GetRepeatedSfixed32(0)); + Assert.Equal(210, message.GetRepeatedSfixed64(0)); + Assert.Equal(211, message.GetRepeatedFloat(0)); + Assert.Equal(212, message.GetRepeatedDouble(0)); + Assert.Equal(true, message.GetRepeatedBool(0)); + Assert.Equal("215", message.GetRepeatedString(0)); + Assert.Equal(ToBytes("216"), message.GetRepeatedBytes(0)); + + Assert.Equal(217, message.GetRepeatedGroup(0).A); + Assert.Equal(218, message.GetRepeatedNestedMessage(0).Bb); + Assert.Equal(219, message.GetRepeatedForeignMessage(0).C); + Assert.Equal(220, message.GetRepeatedImportMessage(0).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); + Assert.Equal(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); + + Assert.Equal("224", message.GetRepeatedStringPiece(0)); + Assert.Equal("225", message.GetRepeatedCord(0)); + + Assert.Equal(301, message.GetRepeatedInt32(1)); + Assert.Equal(302, message.GetRepeatedInt64(1)); + Assert.Equal(303u, message.GetRepeatedUint32(1)); + Assert.Equal(304u, message.GetRepeatedUint64(1)); + Assert.Equal(305, message.GetRepeatedSint32(1)); + Assert.Equal(306, message.GetRepeatedSint64(1)); + Assert.Equal(307u, message.GetRepeatedFixed32(1)); + Assert.Equal(308u, message.GetRepeatedFixed64(1)); + Assert.Equal(309, message.GetRepeatedSfixed32(1)); + Assert.Equal(310, message.GetRepeatedSfixed64(1)); + Assert.Equal(311f, message.GetRepeatedFloat(1)); + Assert.Equal(312d, message.GetRepeatedDouble(1)); + Assert.Equal(false, message.GetRepeatedBool(1)); + Assert.Equal("315", message.GetRepeatedString(1)); + Assert.Equal(ToBytes("316"), message.GetRepeatedBytes(1)); + + Assert.Equal(317, message.GetRepeatedGroup(1).A); + Assert.Equal(318, message.GetRepeatedNestedMessage(1).Bb); + Assert.Equal(319, message.GetRepeatedForeignMessage(1).C); + Assert.Equal(320, message.GetRepeatedImportMessage(1).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, message.GetRepeatedNestedEnum(1)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetRepeatedForeignEnum(1)); + Assert.Equal(ImportEnum.IMPORT_BAZ, message.GetRepeatedImportEnum(1)); + + Assert.Equal("324", message.GetRepeatedStringPiece(1)); + Assert.Equal("325", message.GetRepeatedCord(1)); // ----------------------------------------------------------------- - Assert.IsTrue(message.HasDefaultInt32); - Assert.IsTrue(message.HasDefaultInt64); - Assert.IsTrue(message.HasDefaultUint32); - Assert.IsTrue(message.HasDefaultUint64); - Assert.IsTrue(message.HasDefaultSint32); - Assert.IsTrue(message.HasDefaultSint64); - Assert.IsTrue(message.HasDefaultFixed32); - Assert.IsTrue(message.HasDefaultFixed64); - Assert.IsTrue(message.HasDefaultSfixed32); - Assert.IsTrue(message.HasDefaultSfixed64); - Assert.IsTrue(message.HasDefaultFloat); - Assert.IsTrue(message.HasDefaultDouble); - Assert.IsTrue(message.HasDefaultBool); - Assert.IsTrue(message.HasDefaultString); - Assert.IsTrue(message.HasDefaultBytes); - - Assert.IsTrue(message.HasDefaultNestedEnum); - Assert.IsTrue(message.HasDefaultForeignEnum); - Assert.IsTrue(message.HasDefaultImportEnum); - - Assert.IsTrue(message.HasDefaultStringPiece); - Assert.IsTrue(message.HasDefaultCord); - - Assert.AreEqual(401, message.DefaultInt32); - Assert.AreEqual(402, message.DefaultInt64); - Assert.AreEqual(403u, message.DefaultUint32); - Assert.AreEqual(404u, message.DefaultUint64); - Assert.AreEqual(405, message.DefaultSint32); - Assert.AreEqual(406, message.DefaultSint64); - Assert.AreEqual(407u, message.DefaultFixed32); - Assert.AreEqual(408u, message.DefaultFixed64); - Assert.AreEqual(409, message.DefaultSfixed32); - Assert.AreEqual(410, message.DefaultSfixed64); - Assert.AreEqual(411, message.DefaultFloat); - Assert.AreEqual(412, message.DefaultDouble); - Assert.AreEqual(false, message.DefaultBool); - Assert.AreEqual("415", message.DefaultString); - Assert.AreEqual(ToBytes("416"), message.DefaultBytes); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.DefaultNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.DefaultForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.DefaultImportEnum); - - Assert.AreEqual("424", message.DefaultStringPiece); - Assert.AreEqual("425", message.DefaultCord); + Assert.True(message.HasDefaultInt32); + Assert.True(message.HasDefaultInt64); + Assert.True(message.HasDefaultUint32); + Assert.True(message.HasDefaultUint64); + Assert.True(message.HasDefaultSint32); + Assert.True(message.HasDefaultSint64); + Assert.True(message.HasDefaultFixed32); + Assert.True(message.HasDefaultFixed64); + Assert.True(message.HasDefaultSfixed32); + Assert.True(message.HasDefaultSfixed64); + Assert.True(message.HasDefaultFloat); + Assert.True(message.HasDefaultDouble); + Assert.True(message.HasDefaultBool); + Assert.True(message.HasDefaultString); + Assert.True(message.HasDefaultBytes); + + Assert.True(message.HasDefaultNestedEnum); + Assert.True(message.HasDefaultForeignEnum); + Assert.True(message.HasDefaultImportEnum); + + Assert.True(message.HasDefaultStringPiece); + Assert.True(message.HasDefaultCord); + + Assert.Equal(401, message.DefaultInt32); + Assert.Equal(402, message.DefaultInt64); + Assert.Equal(403u, message.DefaultUint32); + Assert.Equal(404u, message.DefaultUint64); + Assert.Equal(405, message.DefaultSint32); + Assert.Equal(406, message.DefaultSint64); + Assert.Equal(407u, message.DefaultFixed32); + Assert.Equal(408u, message.DefaultFixed64); + Assert.Equal(409, message.DefaultSfixed32); + Assert.Equal(410, message.DefaultSfixed64); + Assert.Equal(411, message.DefaultFloat); + Assert.Equal(412, message.DefaultDouble); + Assert.Equal(false, message.DefaultBool); + Assert.Equal("415", message.DefaultString); + Assert.Equal(ToBytes("416"), message.DefaultBytes); + + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.DefaultNestedEnum); + Assert.Equal(ForeignEnum.FOREIGN_FOO, message.DefaultForeignEnum); + Assert.Equal(ImportEnum.IMPORT_FOO, message.DefaultImportEnum); + + Assert.Equal("424", message.DefaultStringPiece); + Assert.Equal("425", message.DefaultCord); } internal static void AssertClear(TestAllTypes message) { // HasBlah() should initially be false for all optional fields. - Assert.IsFalse(message.HasOptionalInt32); - Assert.IsFalse(message.HasOptionalInt64); - Assert.IsFalse(message.HasOptionalUint32); - Assert.IsFalse(message.HasOptionalUint64); - Assert.IsFalse(message.HasOptionalSint32); - Assert.IsFalse(message.HasOptionalSint64); - Assert.IsFalse(message.HasOptionalFixed32); - Assert.IsFalse(message.HasOptionalFixed64); - Assert.IsFalse(message.HasOptionalSfixed32); - Assert.IsFalse(message.HasOptionalSfixed64); - Assert.IsFalse(message.HasOptionalFloat); - Assert.IsFalse(message.HasOptionalDouble); - Assert.IsFalse(message.HasOptionalBool); - Assert.IsFalse(message.HasOptionalString); - Assert.IsFalse(message.HasOptionalBytes); - - Assert.IsFalse(message.HasOptionalGroup); - Assert.IsFalse(message.HasOptionalNestedMessage); - Assert.IsFalse(message.HasOptionalForeignMessage); - Assert.IsFalse(message.HasOptionalImportMessage); - - Assert.IsFalse(message.HasOptionalNestedEnum); - Assert.IsFalse(message.HasOptionalForeignEnum); - Assert.IsFalse(message.HasOptionalImportEnum); - - Assert.IsFalse(message.HasOptionalStringPiece); - Assert.IsFalse(message.HasOptionalCord); + Assert.False(message.HasOptionalInt32); + Assert.False(message.HasOptionalInt64); + Assert.False(message.HasOptionalUint32); + Assert.False(message.HasOptionalUint64); + Assert.False(message.HasOptionalSint32); + Assert.False(message.HasOptionalSint64); + Assert.False(message.HasOptionalFixed32); + Assert.False(message.HasOptionalFixed64); + Assert.False(message.HasOptionalSfixed32); + Assert.False(message.HasOptionalSfixed64); + Assert.False(message.HasOptionalFloat); + Assert.False(message.HasOptionalDouble); + Assert.False(message.HasOptionalBool); + Assert.False(message.HasOptionalString); + Assert.False(message.HasOptionalBytes); + + Assert.False(message.HasOptionalGroup); + Assert.False(message.HasOptionalNestedMessage); + Assert.False(message.HasOptionalForeignMessage); + Assert.False(message.HasOptionalImportMessage); + + Assert.False(message.HasOptionalNestedEnum); + Assert.False(message.HasOptionalForeignEnum); + Assert.False(message.HasOptionalImportEnum); + + Assert.False(message.HasOptionalStringPiece); + Assert.False(message.HasOptionalCord); // Optional fields without defaults are set to zero or something like it. - Assert.AreEqual(0, message.OptionalInt32); - Assert.AreEqual(0, message.OptionalInt64); - Assert.AreEqual(0u, message.OptionalUint32); - Assert.AreEqual(0u, message.OptionalUint64); - Assert.AreEqual(0, message.OptionalSint32); - Assert.AreEqual(0, message.OptionalSint64); - Assert.AreEqual(0u, message.OptionalFixed32); - Assert.AreEqual(0u, message.OptionalFixed64); - Assert.AreEqual(0, message.OptionalSfixed32); - Assert.AreEqual(0, message.OptionalSfixed64); - Assert.AreEqual(0, message.OptionalFloat); - Assert.AreEqual(0, message.OptionalDouble); - Assert.AreEqual(false, message.OptionalBool); - Assert.AreEqual("", message.OptionalString); - Assert.AreEqual(ByteString.Empty, message.OptionalBytes); + Assert.Equal(0, message.OptionalInt32); + Assert.Equal(0, message.OptionalInt64); + Assert.Equal(0u, message.OptionalUint32); + Assert.Equal(0u, message.OptionalUint64); + Assert.Equal(0, message.OptionalSint32); + Assert.Equal(0, message.OptionalSint64); + Assert.Equal(0u, message.OptionalFixed32); + Assert.Equal(0u, message.OptionalFixed64); + Assert.Equal(0, message.OptionalSfixed32); + Assert.Equal(0, message.OptionalSfixed64); + Assert.Equal(0, message.OptionalFloat); + Assert.Equal(0, message.OptionalDouble); + Assert.Equal(false, message.OptionalBool); + Assert.Equal("", message.OptionalString); + Assert.Equal(ByteString.Empty, message.OptionalBytes); // Embedded messages should also be clear. - Assert.IsFalse(message.OptionalGroup.HasA); - Assert.IsFalse(message.OptionalNestedMessage.HasBb); - Assert.IsFalse(message.OptionalForeignMessage.HasC); - Assert.IsFalse(message.OptionalImportMessage.HasD); + Assert.False(message.OptionalGroup.HasA); + Assert.False(message.OptionalNestedMessage.HasBb); + Assert.False(message.OptionalForeignMessage.HasC); + Assert.False(message.OptionalImportMessage.HasD); - Assert.AreEqual(0, message.OptionalGroup.A); - Assert.AreEqual(0, message.OptionalNestedMessage.Bb); - Assert.AreEqual(0, message.OptionalForeignMessage.C); - Assert.AreEqual(0, message.OptionalImportMessage.D); + Assert.Equal(0, message.OptionalGroup.A); + Assert.Equal(0, message.OptionalNestedMessage.Bb); + Assert.Equal(0, message.OptionalForeignMessage.C); + Assert.Equal(0, message.OptionalImportMessage.D); // Enums without defaults are set to the first value in the enum. - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.OptionalForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.OptionalImportEnum); + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); + Assert.Equal(ForeignEnum.FOREIGN_FOO, message.OptionalForeignEnum); + Assert.Equal(ImportEnum.IMPORT_FOO, message.OptionalImportEnum); - Assert.AreEqual("", message.OptionalStringPiece); - Assert.AreEqual("", message.OptionalCord); + Assert.Equal("", message.OptionalStringPiece); + Assert.Equal("", message.OptionalCord); // Repeated fields are empty. - Assert.AreEqual(0, message.RepeatedInt32Count); - Assert.AreEqual(0, message.RepeatedInt64Count); - Assert.AreEqual(0, message.RepeatedUint32Count); - Assert.AreEqual(0, message.RepeatedUint64Count); - Assert.AreEqual(0, message.RepeatedSint32Count); - Assert.AreEqual(0, message.RepeatedSint64Count); - Assert.AreEqual(0, message.RepeatedFixed32Count); - Assert.AreEqual(0, message.RepeatedFixed64Count); - Assert.AreEqual(0, message.RepeatedSfixed32Count); - Assert.AreEqual(0, message.RepeatedSfixed64Count); - Assert.AreEqual(0, message.RepeatedFloatCount); - Assert.AreEqual(0, message.RepeatedDoubleCount); - Assert.AreEqual(0, message.RepeatedBoolCount); - Assert.AreEqual(0, message.RepeatedStringCount); - Assert.AreEqual(0, message.RepeatedBytesCount); - - Assert.AreEqual(0, message.RepeatedGroupCount); - Assert.AreEqual(0, message.RepeatedNestedMessageCount); - Assert.AreEqual(0, message.RepeatedForeignMessageCount); - Assert.AreEqual(0, message.RepeatedImportMessageCount); - Assert.AreEqual(0, message.RepeatedNestedEnumCount); - Assert.AreEqual(0, message.RepeatedForeignEnumCount); - Assert.AreEqual(0, message.RepeatedImportEnumCount); - - Assert.AreEqual(0, message.RepeatedStringPieceCount); - Assert.AreEqual(0, message.RepeatedCordCount); + Assert.Equal(0, message.RepeatedInt32Count); + Assert.Equal(0, message.RepeatedInt64Count); + Assert.Equal(0, message.RepeatedUint32Count); + Assert.Equal(0, message.RepeatedUint64Count); + Assert.Equal(0, message.RepeatedSint32Count); + Assert.Equal(0, message.RepeatedSint64Count); + Assert.Equal(0, message.RepeatedFixed32Count); + Assert.Equal(0, message.RepeatedFixed64Count); + Assert.Equal(0, message.RepeatedSfixed32Count); + Assert.Equal(0, message.RepeatedSfixed64Count); + Assert.Equal(0, message.RepeatedFloatCount); + Assert.Equal(0, message.RepeatedDoubleCount); + Assert.Equal(0, message.RepeatedBoolCount); + Assert.Equal(0, message.RepeatedStringCount); + Assert.Equal(0, message.RepeatedBytesCount); + + Assert.Equal(0, message.RepeatedGroupCount); + Assert.Equal(0, message.RepeatedNestedMessageCount); + Assert.Equal(0, message.RepeatedForeignMessageCount); + Assert.Equal(0, message.RepeatedImportMessageCount); + Assert.Equal(0, message.RepeatedNestedEnumCount); + Assert.Equal(0, message.RepeatedForeignEnumCount); + Assert.Equal(0, message.RepeatedImportEnumCount); + + Assert.Equal(0, message.RepeatedStringPieceCount); + Assert.Equal(0, message.RepeatedCordCount); // HasBlah() should also be false for all default fields. - Assert.IsFalse(message.HasDefaultInt32); - Assert.IsFalse(message.HasDefaultInt64); - Assert.IsFalse(message.HasDefaultUint32); - Assert.IsFalse(message.HasDefaultUint64); - Assert.IsFalse(message.HasDefaultSint32); - Assert.IsFalse(message.HasDefaultSint64); - Assert.IsFalse(message.HasDefaultFixed32); - Assert.IsFalse(message.HasDefaultFixed64); - Assert.IsFalse(message.HasDefaultSfixed32); - Assert.IsFalse(message.HasDefaultSfixed64); - Assert.IsFalse(message.HasDefaultFloat); - Assert.IsFalse(message.HasDefaultDouble); - Assert.IsFalse(message.HasDefaultBool); - Assert.IsFalse(message.HasDefaultString); - Assert.IsFalse(message.HasDefaultBytes); - - Assert.IsFalse(message.HasDefaultNestedEnum); - Assert.IsFalse(message.HasDefaultForeignEnum); - Assert.IsFalse(message.HasDefaultImportEnum); - - Assert.IsFalse(message.HasDefaultStringPiece); - Assert.IsFalse(message.HasDefaultCord); + Assert.False(message.HasDefaultInt32); + Assert.False(message.HasDefaultInt64); + Assert.False(message.HasDefaultUint32); + Assert.False(message.HasDefaultUint64); + Assert.False(message.HasDefaultSint32); + Assert.False(message.HasDefaultSint64); + Assert.False(message.HasDefaultFixed32); + Assert.False(message.HasDefaultFixed64); + Assert.False(message.HasDefaultSfixed32); + Assert.False(message.HasDefaultSfixed64); + Assert.False(message.HasDefaultFloat); + Assert.False(message.HasDefaultDouble); + Assert.False(message.HasDefaultBool); + Assert.False(message.HasDefaultString); + Assert.False(message.HasDefaultBytes); + + Assert.False(message.HasDefaultNestedEnum); + Assert.False(message.HasDefaultForeignEnum); + Assert.False(message.HasDefaultImportEnum); + + Assert.False(message.HasDefaultStringPiece); + Assert.False(message.HasDefaultCord); // Fields with defaults have their default values (duh). - Assert.AreEqual(41, message.DefaultInt32); - Assert.AreEqual(42, message.DefaultInt64); - Assert.AreEqual(43u, message.DefaultUint32); - Assert.AreEqual(44u, message.DefaultUint64); - Assert.AreEqual(-45, message.DefaultSint32); - Assert.AreEqual(46, message.DefaultSint64); - Assert.AreEqual(47u, message.DefaultFixed32); - Assert.AreEqual(48u, message.DefaultFixed64); - Assert.AreEqual(49, message.DefaultSfixed32); - Assert.AreEqual(-50, message.DefaultSfixed64); - Assert.AreEqual(51.5, message.DefaultFloat, 0.0); - Assert.AreEqual(52e3, message.DefaultDouble, 0.0); - Assert.AreEqual(true, message.DefaultBool); - Assert.AreEqual("hello", message.DefaultString); - Assert.AreEqual(ToBytes("world"), message.DefaultBytes); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.DefaultNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.DefaultForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.DefaultImportEnum); - - Assert.AreEqual("abc", message.DefaultStringPiece); - Assert.AreEqual("123", message.DefaultCord); + Assert.Equal(41, message.DefaultInt32); + Assert.Equal(42, message.DefaultInt64); + Assert.Equal(43u, message.DefaultUint32); + Assert.Equal(44u, message.DefaultUint64); + Assert.Equal(-45, message.DefaultSint32); + Assert.Equal(46, message.DefaultSint64); + Assert.Equal(47u, message.DefaultFixed32); + Assert.Equal(48u, message.DefaultFixed64); + Assert.Equal(49, message.DefaultSfixed32); + Assert.Equal(-50, message.DefaultSfixed64); + Assert.Equal(51.5f, message.DefaultFloat); + Assert.Equal(52e3d, message.DefaultDouble); + Assert.Equal(true, message.DefaultBool); + Assert.Equal("hello", message.DefaultString); + Assert.Equal(ToBytes("world"), message.DefaultBytes); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.DefaultNestedEnum); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.DefaultForeignEnum); + Assert.Equal(ImportEnum.IMPORT_BAR, message.DefaultImportEnum); + + Assert.Equal("abc", message.DefaultStringPiece); + Assert.Equal("123", message.DefaultCord); } /// @@ -855,89 +855,89 @@ namespace Google.ProtocolBuffers // ModifyRepeatedFields only sets the second repeated element of each // field. In addition to verifying this, we also verify that the first // element and size were *not* modified. - Assert.AreEqual(2, message.RepeatedInt32Count); - Assert.AreEqual(2, message.RepeatedInt64Count); - Assert.AreEqual(2, message.RepeatedUint32Count); - Assert.AreEqual(2, message.RepeatedUint64Count); - Assert.AreEqual(2, message.RepeatedSint32Count); - Assert.AreEqual(2, message.RepeatedSint64Count); - Assert.AreEqual(2, message.RepeatedFixed32Count); - Assert.AreEqual(2, message.RepeatedFixed64Count); - Assert.AreEqual(2, message.RepeatedSfixed32Count); - Assert.AreEqual(2, message.RepeatedSfixed64Count); - Assert.AreEqual(2, message.RepeatedFloatCount); - Assert.AreEqual(2, message.RepeatedDoubleCount); - Assert.AreEqual(2, message.RepeatedBoolCount); - Assert.AreEqual(2, message.RepeatedStringCount); - Assert.AreEqual(2, message.RepeatedBytesCount); - - Assert.AreEqual(2, message.RepeatedGroupCount); - Assert.AreEqual(2, message.RepeatedNestedMessageCount); - Assert.AreEqual(2, message.RepeatedForeignMessageCount); - Assert.AreEqual(2, message.RepeatedImportMessageCount); - Assert.AreEqual(2, message.RepeatedNestedEnumCount); - Assert.AreEqual(2, message.RepeatedForeignEnumCount); - Assert.AreEqual(2, message.RepeatedImportEnumCount); - - Assert.AreEqual(2, message.RepeatedStringPieceCount); - Assert.AreEqual(2, message.RepeatedCordCount); - - Assert.AreEqual(201, message.GetRepeatedInt32(0)); - Assert.AreEqual(202L, message.GetRepeatedInt64(0)); - Assert.AreEqual(203U, message.GetRepeatedUint32(0)); - Assert.AreEqual(204UL, message.GetRepeatedUint64(0)); - Assert.AreEqual(205, message.GetRepeatedSint32(0)); - Assert.AreEqual(206L, message.GetRepeatedSint64(0)); - Assert.AreEqual(207U, message.GetRepeatedFixed32(0)); - Assert.AreEqual(208UL, message.GetRepeatedFixed64(0)); - Assert.AreEqual(209, message.GetRepeatedSfixed32(0)); - Assert.AreEqual(210L, message.GetRepeatedSfixed64(0)); - Assert.AreEqual(211F, message.GetRepeatedFloat(0)); - Assert.AreEqual(212D, message.GetRepeatedDouble(0)); - Assert.AreEqual(true, message.GetRepeatedBool(0)); - Assert.AreEqual("215", message.GetRepeatedString(0)); - Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0)); - - Assert.AreEqual(217, message.GetRepeatedGroup(0).A); - Assert.AreEqual(218, message.GetRepeatedNestedMessage(0).Bb); - Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C); - Assert.AreEqual(220, message.GetRepeatedImportMessage(0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); - - Assert.AreEqual("224", message.GetRepeatedStringPiece(0)); - Assert.AreEqual("225", message.GetRepeatedCord(0)); + Assert.Equal(2, message.RepeatedInt32Count); + Assert.Equal(2, message.RepeatedInt64Count); + Assert.Equal(2, message.RepeatedUint32Count); + Assert.Equal(2, message.RepeatedUint64Count); + Assert.Equal(2, message.RepeatedSint32Count); + Assert.Equal(2, message.RepeatedSint64Count); + Assert.Equal(2, message.RepeatedFixed32Count); + Assert.Equal(2, message.RepeatedFixed64Count); + Assert.Equal(2, message.RepeatedSfixed32Count); + Assert.Equal(2, message.RepeatedSfixed64Count); + Assert.Equal(2, message.RepeatedFloatCount); + Assert.Equal(2, message.RepeatedDoubleCount); + Assert.Equal(2, message.RepeatedBoolCount); + Assert.Equal(2, message.RepeatedStringCount); + Assert.Equal(2, message.RepeatedBytesCount); + + Assert.Equal(2, message.RepeatedGroupCount); + Assert.Equal(2, message.RepeatedNestedMessageCount); + Assert.Equal(2, message.RepeatedForeignMessageCount); + Assert.Equal(2, message.RepeatedImportMessageCount); + Assert.Equal(2, message.RepeatedNestedEnumCount); + Assert.Equal(2, message.RepeatedForeignEnumCount); + Assert.Equal(2, message.RepeatedImportEnumCount); + + Assert.Equal(2, message.RepeatedStringPieceCount); + Assert.Equal(2, message.RepeatedCordCount); + + Assert.Equal(201, message.GetRepeatedInt32(0)); + Assert.Equal(202L, message.GetRepeatedInt64(0)); + Assert.Equal(203U, message.GetRepeatedUint32(0)); + Assert.Equal(204UL, message.GetRepeatedUint64(0)); + Assert.Equal(205, message.GetRepeatedSint32(0)); + Assert.Equal(206L, message.GetRepeatedSint64(0)); + Assert.Equal(207U, message.GetRepeatedFixed32(0)); + Assert.Equal(208UL, message.GetRepeatedFixed64(0)); + Assert.Equal(209, message.GetRepeatedSfixed32(0)); + Assert.Equal(210L, message.GetRepeatedSfixed64(0)); + Assert.Equal(211F, message.GetRepeatedFloat(0)); + Assert.Equal(212D, message.GetRepeatedDouble(0)); + Assert.Equal(true, message.GetRepeatedBool(0)); + Assert.Equal("215", message.GetRepeatedString(0)); + Assert.Equal(ToBytes("216"), message.GetRepeatedBytes(0)); + + Assert.Equal(217, message.GetRepeatedGroup(0).A); + Assert.Equal(218, message.GetRepeatedNestedMessage(0).Bb); + Assert.Equal(219, message.GetRepeatedForeignMessage(0).C); + Assert.Equal(220, message.GetRepeatedImportMessage(0).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); + Assert.Equal(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); + + Assert.Equal("224", message.GetRepeatedStringPiece(0)); + Assert.Equal("225", message.GetRepeatedCord(0)); // Actually verify the second (modified) elements now. - Assert.AreEqual(501, message.GetRepeatedInt32(1)); - Assert.AreEqual(502L, message.GetRepeatedInt64(1)); - Assert.AreEqual(503U, message.GetRepeatedUint32(1)); - Assert.AreEqual(504UL, message.GetRepeatedUint64(1)); - Assert.AreEqual(505, message.GetRepeatedSint32(1)); - Assert.AreEqual(506L, message.GetRepeatedSint64(1)); - Assert.AreEqual(507U, message.GetRepeatedFixed32(1)); - Assert.AreEqual(508UL, message.GetRepeatedFixed64(1)); - Assert.AreEqual(509, message.GetRepeatedSfixed32(1)); - Assert.AreEqual(510L, message.GetRepeatedSfixed64(1)); - Assert.AreEqual(511F, message.GetRepeatedFloat(1)); - Assert.AreEqual(512D, message.GetRepeatedDouble(1)); - Assert.AreEqual(true, message.GetRepeatedBool(1)); - Assert.AreEqual("515", message.GetRepeatedString(1)); - Assert.AreEqual(ToBytes("516"), message.GetRepeatedBytes(1)); - - Assert.AreEqual(517, message.GetRepeatedGroup(1).A); - Assert.AreEqual(518, message.GetRepeatedNestedMessage(1).Bb); - Assert.AreEqual(519, message.GetRepeatedForeignMessage(1).C); - Assert.AreEqual(520, message.GetRepeatedImportMessage(1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetRepeatedNestedEnum(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetRepeatedForeignEnum(1)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetRepeatedImportEnum(1)); - - Assert.AreEqual("524", message.GetRepeatedStringPiece(1)); - Assert.AreEqual("525", message.GetRepeatedCord(1)); + Assert.Equal(501, message.GetRepeatedInt32(1)); + Assert.Equal(502L, message.GetRepeatedInt64(1)); + Assert.Equal(503U, message.GetRepeatedUint32(1)); + Assert.Equal(504UL, message.GetRepeatedUint64(1)); + Assert.Equal(505, message.GetRepeatedSint32(1)); + Assert.Equal(506L, message.GetRepeatedSint64(1)); + Assert.Equal(507U, message.GetRepeatedFixed32(1)); + Assert.Equal(508UL, message.GetRepeatedFixed64(1)); + Assert.Equal(509, message.GetRepeatedSfixed32(1)); + Assert.Equal(510L, message.GetRepeatedSfixed64(1)); + Assert.Equal(511F, message.GetRepeatedFloat(1)); + Assert.Equal(512D, message.GetRepeatedDouble(1)); + Assert.Equal(true, message.GetRepeatedBool(1)); + Assert.Equal("515", message.GetRepeatedString(1)); + Assert.Equal(ToBytes("516"), message.GetRepeatedBytes(1)); + + Assert.Equal(517, message.GetRepeatedGroup(1).A); + Assert.Equal(518, message.GetRepeatedNestedMessage(1).Bb); + Assert.Equal(519, message.GetRepeatedForeignMessage(1).C); + Assert.Equal(520, message.GetRepeatedImportMessage(1).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.GetRepeatedNestedEnum(1)); + Assert.Equal(ForeignEnum.FOREIGN_FOO, message.GetRepeatedForeignEnum(1)); + Assert.Equal(ImportEnum.IMPORT_FOO, message.GetRepeatedImportEnum(1)); + + Assert.Equal("524", message.GetRepeatedStringPiece(1)); + Assert.Equal("525", message.GetRepeatedCord(1)); } /// @@ -949,222 +949,222 @@ namespace Google.ProtocolBuffers { foreach (T secondElement in second) { - Assert.IsTrue(firstEnumerator.MoveNext(), "First enumerator ran out of elements too early."); - Assert.AreEqual(firstEnumerator.Current, secondElement); + Assert.True(firstEnumerator.MoveNext(), "First enumerator ran out of elements too early."); + Assert.Equal(firstEnumerator.Current, secondElement); } - Assert.IsFalse(firstEnumerator.MoveNext(), "Second enumerator ran out of elements too early."); + Assert.False(firstEnumerator.MoveNext(), "Second enumerator ran out of elements too early."); } } internal static void AssertEqualBytes(byte[] expected, byte[] actual) { - Assert.AreEqual(ByteString.CopyFrom(expected), ByteString.CopyFrom(actual)); + Assert.Equal(ByteString.CopyFrom(expected), ByteString.CopyFrom(actual)); } internal static void AssertAllExtensionsSet(TestAllExtensions message) { - Assert.IsTrue(message.HasExtension(Unittest.OptionalInt32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalInt64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalUint32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalUint64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalSint32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalSint64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalFixed32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalFixed64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalSfixed32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalSfixed64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalFloatExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalDoubleExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalBoolExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalStringExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalBytesExtension)); - - Assert.IsTrue(message.HasExtension(Unittest.OptionalGroupExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalNestedMessageExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalForeignMessageExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalImportMessageExtension)); - - Assert.IsTrue(message.GetExtension(Unittest.OptionalGroupExtension).HasA); - Assert.IsTrue(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); - Assert.IsTrue(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); - Assert.IsTrue(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); - - Assert.IsTrue(message.HasExtension(Unittest.OptionalNestedEnumExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalForeignEnumExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalImportEnumExtension)); - - Assert.IsTrue(message.HasExtension(Unittest.OptionalStringPieceExtension)); - Assert.IsTrue(message.HasExtension(Unittest.OptionalCordExtension)); - - Assert.AreEqual(101, message.GetExtension(Unittest.OptionalInt32Extension)); - Assert.AreEqual(102L, message.GetExtension(Unittest.OptionalInt64Extension)); - Assert.AreEqual(103U, message.GetExtension(Unittest.OptionalUint32Extension)); - Assert.AreEqual(104UL, message.GetExtension(Unittest.OptionalUint64Extension)); - Assert.AreEqual(105, message.GetExtension(Unittest.OptionalSint32Extension)); - Assert.AreEqual(106L, message.GetExtension(Unittest.OptionalSint64Extension)); - Assert.AreEqual(107U, message.GetExtension(Unittest.OptionalFixed32Extension)); - Assert.AreEqual(108UL, message.GetExtension(Unittest.OptionalFixed64Extension)); - Assert.AreEqual(109, message.GetExtension(Unittest.OptionalSfixed32Extension)); - Assert.AreEqual(110L, message.GetExtension(Unittest.OptionalSfixed64Extension)); - Assert.AreEqual(111F, message.GetExtension(Unittest.OptionalFloatExtension)); - Assert.AreEqual(112D, message.GetExtension(Unittest.OptionalDoubleExtension)); - Assert.AreEqual(true, message.GetExtension(Unittest.OptionalBoolExtension)); - Assert.AreEqual("115", message.GetExtension(Unittest.OptionalStringExtension)); - Assert.AreEqual(ToBytes("116"), message.GetExtension(Unittest.OptionalBytesExtension)); - - Assert.AreEqual(117, message.GetExtension(Unittest.OptionalGroupExtension).A); - Assert.AreEqual(118, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); - Assert.AreEqual(119, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); - Assert.AreEqual(120, message.GetExtension(Unittest.OptionalImportMessageExtension).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, + Assert.True(message.HasExtension(Unittest.OptionalInt32Extension)); + Assert.True(message.HasExtension(Unittest.OptionalInt64Extension)); + Assert.True(message.HasExtension(Unittest.OptionalUint32Extension)); + Assert.True(message.HasExtension(Unittest.OptionalUint64Extension)); + Assert.True(message.HasExtension(Unittest.OptionalSint32Extension)); + Assert.True(message.HasExtension(Unittest.OptionalSint64Extension)); + Assert.True(message.HasExtension(Unittest.OptionalFixed32Extension)); + Assert.True(message.HasExtension(Unittest.OptionalFixed64Extension)); + Assert.True(message.HasExtension(Unittest.OptionalSfixed32Extension)); + Assert.True(message.HasExtension(Unittest.OptionalSfixed64Extension)); + Assert.True(message.HasExtension(Unittest.OptionalFloatExtension)); + Assert.True(message.HasExtension(Unittest.OptionalDoubleExtension)); + Assert.True(message.HasExtension(Unittest.OptionalBoolExtension)); + Assert.True(message.HasExtension(Unittest.OptionalStringExtension)); + Assert.True(message.HasExtension(Unittest.OptionalBytesExtension)); + + Assert.True(message.HasExtension(Unittest.OptionalGroupExtension)); + Assert.True(message.HasExtension(Unittest.OptionalNestedMessageExtension)); + Assert.True(message.HasExtension(Unittest.OptionalForeignMessageExtension)); + Assert.True(message.HasExtension(Unittest.OptionalImportMessageExtension)); + + Assert.True(message.GetExtension(Unittest.OptionalGroupExtension).HasA); + Assert.True(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); + Assert.True(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); + Assert.True(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); + + Assert.True(message.HasExtension(Unittest.OptionalNestedEnumExtension)); + Assert.True(message.HasExtension(Unittest.OptionalForeignEnumExtension)); + Assert.True(message.HasExtension(Unittest.OptionalImportEnumExtension)); + + Assert.True(message.HasExtension(Unittest.OptionalStringPieceExtension)); + Assert.True(message.HasExtension(Unittest.OptionalCordExtension)); + + Assert.Equal(101, message.GetExtension(Unittest.OptionalInt32Extension)); + Assert.Equal(102L, message.GetExtension(Unittest.OptionalInt64Extension)); + Assert.Equal(103U, message.GetExtension(Unittest.OptionalUint32Extension)); + Assert.Equal(104UL, message.GetExtension(Unittest.OptionalUint64Extension)); + Assert.Equal(105, message.GetExtension(Unittest.OptionalSint32Extension)); + Assert.Equal(106L, message.GetExtension(Unittest.OptionalSint64Extension)); + Assert.Equal(107U, message.GetExtension(Unittest.OptionalFixed32Extension)); + Assert.Equal(108UL, message.GetExtension(Unittest.OptionalFixed64Extension)); + Assert.Equal(109, message.GetExtension(Unittest.OptionalSfixed32Extension)); + Assert.Equal(110L, message.GetExtension(Unittest.OptionalSfixed64Extension)); + Assert.Equal(111F, message.GetExtension(Unittest.OptionalFloatExtension)); + Assert.Equal(112D, message.GetExtension(Unittest.OptionalDoubleExtension)); + Assert.Equal(true, message.GetExtension(Unittest.OptionalBoolExtension)); + Assert.Equal("115", message.GetExtension(Unittest.OptionalStringExtension)); + Assert.Equal(ToBytes("116"), message.GetExtension(Unittest.OptionalBytesExtension)); + + Assert.Equal(117, message.GetExtension(Unittest.OptionalGroupExtension).A); + Assert.Equal(118, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); + Assert.Equal(119, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); + Assert.Equal(120, message.GetExtension(Unittest.OptionalImportMessageExtension).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, message.GetExtension(Unittest.OptionalNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.OptionalForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetExtension(Unittest.OptionalImportEnumExtension)); + Assert.Equal(ImportEnum.IMPORT_BAZ, message.GetExtension(Unittest.OptionalImportEnumExtension)); - Assert.AreEqual("124", message.GetExtension(Unittest.OptionalStringPieceExtension)); - Assert.AreEqual("125", message.GetExtension(Unittest.OptionalCordExtension)); + Assert.Equal("124", message.GetExtension(Unittest.OptionalStringPieceExtension)); + Assert.Equal("125", message.GetExtension(Unittest.OptionalCordExtension)); // ----------------------------------------------------------------- - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); - - Assert.AreEqual(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); - Assert.AreEqual(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); - Assert.AreEqual(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); - Assert.AreEqual(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); - Assert.AreEqual(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); - Assert.AreEqual(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); - Assert.AreEqual(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); - Assert.AreEqual(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); - Assert.AreEqual(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); - Assert.AreEqual(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); - Assert.AreEqual(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); - Assert.AreEqual(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); - Assert.AreEqual("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); - Assert.AreEqual(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); - - Assert.AreEqual(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); - Assert.AreEqual(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); - Assert.AreEqual(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); - Assert.AreEqual(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); + + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); + + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); + + Assert.Equal(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); + Assert.Equal(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); + Assert.Equal(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); + Assert.Equal(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); + Assert.Equal(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); + Assert.Equal(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); + Assert.Equal(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); + Assert.Equal(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); + Assert.Equal(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); + Assert.Equal(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); + Assert.Equal(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); + Assert.Equal(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); + Assert.Equal(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); + Assert.Equal("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); + Assert.Equal(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); + + Assert.Equal(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); + Assert.Equal(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); + Assert.Equal(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); + Assert.Equal(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, + Assert.Equal(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.RepeatedImportEnumExtension, 0)); - Assert.AreEqual("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); - Assert.AreEqual("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); - - Assert.AreEqual(301, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); - Assert.AreEqual(302L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); - Assert.AreEqual(303U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); - Assert.AreEqual(304UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); - Assert.AreEqual(305, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); - Assert.AreEqual(306L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); - Assert.AreEqual(307U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); - Assert.AreEqual(308UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); - Assert.AreEqual(309, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); - Assert.AreEqual(310L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); - Assert.AreEqual(311F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); - Assert.AreEqual(312D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); - Assert.AreEqual(false, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); - Assert.AreEqual("315", message.GetExtension(Unittest.RepeatedStringExtension, 1)); - Assert.AreEqual(ToBytes("316"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); - - Assert.AreEqual(317, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); - Assert.AreEqual(318, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); - Assert.AreEqual(319, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); - Assert.AreEqual(320, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, + Assert.Equal("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); + Assert.Equal("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); + + Assert.Equal(301, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); + Assert.Equal(302L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); + Assert.Equal(303U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); + Assert.Equal(304UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); + Assert.Equal(305, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); + Assert.Equal(306L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); + Assert.Equal(307U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); + Assert.Equal(308UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); + Assert.Equal(309, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); + Assert.Equal(310L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); + Assert.Equal(311F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); + Assert.Equal(312D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); + Assert.Equal(false, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); + Assert.Equal("315", message.GetExtension(Unittest.RepeatedStringExtension, 1)); + Assert.Equal(ToBytes("316"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); + + Assert.Equal(317, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); + Assert.Equal(318, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); + Assert.Equal(319, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); + Assert.Equal(320, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 1)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, + Assert.Equal(ImportEnum.IMPORT_BAZ, message.GetExtension(Unittest.RepeatedImportEnumExtension, 1)); - Assert.AreEqual("324", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); - Assert.AreEqual("325", message.GetExtension(Unittest.RepeatedCordExtension, 1)); + Assert.Equal("324", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); + Assert.Equal("325", message.GetExtension(Unittest.RepeatedCordExtension, 1)); // ----------------------------------------------------------------- - Assert.IsTrue(message.HasExtension(Unittest.DefaultInt32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultInt64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultUint32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultUint64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultSint32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultSint64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultFixed32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultFixed64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultSfixed32Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultSfixed64Extension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultFloatExtension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultDoubleExtension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultBoolExtension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultStringExtension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultBytesExtension)); - - Assert.IsTrue(message.HasExtension(Unittest.DefaultNestedEnumExtension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultForeignEnumExtension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultImportEnumExtension)); - - Assert.IsTrue(message.HasExtension(Unittest.DefaultStringPieceExtension)); - Assert.IsTrue(message.HasExtension(Unittest.DefaultCordExtension)); - - Assert.AreEqual(401, message.GetExtension(Unittest.DefaultInt32Extension)); - Assert.AreEqual(402L, message.GetExtension(Unittest.DefaultInt64Extension)); - Assert.AreEqual(403U, message.GetExtension(Unittest.DefaultUint32Extension)); - Assert.AreEqual(404UL, message.GetExtension(Unittest.DefaultUint64Extension)); - Assert.AreEqual(405, message.GetExtension(Unittest.DefaultSint32Extension)); - Assert.AreEqual(406L, message.GetExtension(Unittest.DefaultSint64Extension)); - Assert.AreEqual(407U, message.GetExtension(Unittest.DefaultFixed32Extension)); - Assert.AreEqual(408UL, message.GetExtension(Unittest.DefaultFixed64Extension)); - Assert.AreEqual(409, message.GetExtension(Unittest.DefaultSfixed32Extension)); - Assert.AreEqual(410L, message.GetExtension(Unittest.DefaultSfixed64Extension)); - Assert.AreEqual(411F, message.GetExtension(Unittest.DefaultFloatExtension)); - Assert.AreEqual(412D, message.GetExtension(Unittest.DefaultDoubleExtension)); - Assert.AreEqual(false, message.GetExtension(Unittest.DefaultBoolExtension)); - Assert.AreEqual("415", message.GetExtension(Unittest.DefaultStringExtension)); - Assert.AreEqual(ToBytes("416"), message.GetExtension(Unittest.DefaultBytesExtension)); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, + Assert.True(message.HasExtension(Unittest.DefaultInt32Extension)); + Assert.True(message.HasExtension(Unittest.DefaultInt64Extension)); + Assert.True(message.HasExtension(Unittest.DefaultUint32Extension)); + Assert.True(message.HasExtension(Unittest.DefaultUint64Extension)); + Assert.True(message.HasExtension(Unittest.DefaultSint32Extension)); + Assert.True(message.HasExtension(Unittest.DefaultSint64Extension)); + Assert.True(message.HasExtension(Unittest.DefaultFixed32Extension)); + Assert.True(message.HasExtension(Unittest.DefaultFixed64Extension)); + Assert.True(message.HasExtension(Unittest.DefaultSfixed32Extension)); + Assert.True(message.HasExtension(Unittest.DefaultSfixed64Extension)); + Assert.True(message.HasExtension(Unittest.DefaultFloatExtension)); + Assert.True(message.HasExtension(Unittest.DefaultDoubleExtension)); + Assert.True(message.HasExtension(Unittest.DefaultBoolExtension)); + Assert.True(message.HasExtension(Unittest.DefaultStringExtension)); + Assert.True(message.HasExtension(Unittest.DefaultBytesExtension)); + + Assert.True(message.HasExtension(Unittest.DefaultNestedEnumExtension)); + Assert.True(message.HasExtension(Unittest.DefaultForeignEnumExtension)); + Assert.True(message.HasExtension(Unittest.DefaultImportEnumExtension)); + + Assert.True(message.HasExtension(Unittest.DefaultStringPieceExtension)); + Assert.True(message.HasExtension(Unittest.DefaultCordExtension)); + + Assert.Equal(401, message.GetExtension(Unittest.DefaultInt32Extension)); + Assert.Equal(402L, message.GetExtension(Unittest.DefaultInt64Extension)); + Assert.Equal(403U, message.GetExtension(Unittest.DefaultUint32Extension)); + Assert.Equal(404UL, message.GetExtension(Unittest.DefaultUint64Extension)); + Assert.Equal(405, message.GetExtension(Unittest.DefaultSint32Extension)); + Assert.Equal(406L, message.GetExtension(Unittest.DefaultSint64Extension)); + Assert.Equal(407U, message.GetExtension(Unittest.DefaultFixed32Extension)); + Assert.Equal(408UL, message.GetExtension(Unittest.DefaultFixed64Extension)); + Assert.Equal(409, message.GetExtension(Unittest.DefaultSfixed32Extension)); + Assert.Equal(410L, message.GetExtension(Unittest.DefaultSfixed64Extension)); + Assert.Equal(411F, message.GetExtension(Unittest.DefaultFloatExtension)); + Assert.Equal(412D, message.GetExtension(Unittest.DefaultDoubleExtension)); + Assert.Equal(false, message.GetExtension(Unittest.DefaultBoolExtension)); + Assert.Equal("415", message.GetExtension(Unittest.DefaultStringExtension)); + Assert.Equal(ToBytes("416"), message.GetExtension(Unittest.DefaultBytesExtension)); + + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(Unittest.DefaultNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.DefaultImportEnumExtension)); + Assert.Equal(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.DefaultForeignEnumExtension)); + Assert.Equal(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.DefaultImportEnumExtension)); - Assert.AreEqual("424", message.GetExtension(Unittest.DefaultStringPieceExtension)); - Assert.AreEqual("425", message.GetExtension(Unittest.DefaultCordExtension)); + Assert.Equal("424", message.GetExtension(Unittest.DefaultStringPieceExtension)); + Assert.Equal("425", message.GetExtension(Unittest.DefaultCordExtension)); } /// @@ -1215,242 +1215,242 @@ namespace Google.ProtocolBuffers // ModifyRepeatedFields only sets the second repeated element of each // field. In addition to verifying this, we also verify that the first // element and size were *not* modified. - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); - - Assert.AreEqual(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); - Assert.AreEqual(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); - Assert.AreEqual(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); - Assert.AreEqual(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); - Assert.AreEqual(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); - Assert.AreEqual(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); - Assert.AreEqual(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); - Assert.AreEqual(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); - Assert.AreEqual(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); - Assert.AreEqual(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); - Assert.AreEqual(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); - Assert.AreEqual(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); - Assert.AreEqual("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); - Assert.AreEqual(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); - - Assert.AreEqual(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); - Assert.AreEqual(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); - Assert.AreEqual(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); - Assert.AreEqual(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); + + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); + + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); + + Assert.Equal(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); + Assert.Equal(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); + Assert.Equal(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); + Assert.Equal(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); + Assert.Equal(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); + Assert.Equal(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); + Assert.Equal(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); + Assert.Equal(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); + Assert.Equal(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); + Assert.Equal(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); + Assert.Equal(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); + Assert.Equal(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); + Assert.Equal(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); + Assert.Equal("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); + Assert.Equal(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); + + Assert.Equal(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); + Assert.Equal(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); + Assert.Equal(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); + Assert.Equal(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, + Assert.Equal(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.RepeatedImportEnumExtension, 0)); - Assert.AreEqual("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); - Assert.AreEqual("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); + Assert.Equal("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); + Assert.Equal("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); // Actually verify the second (modified) elements now. - Assert.AreEqual(501, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); - Assert.AreEqual(502L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); - Assert.AreEqual(503U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); - Assert.AreEqual(504UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); - Assert.AreEqual(505, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); - Assert.AreEqual(506L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); - Assert.AreEqual(507U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); - Assert.AreEqual(508UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); - Assert.AreEqual(509, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); - Assert.AreEqual(510L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); - Assert.AreEqual(511F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); - Assert.AreEqual(512D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); - Assert.AreEqual(true, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); - Assert.AreEqual("515", message.GetExtension(Unittest.RepeatedStringExtension, 1)); - Assert.AreEqual(ToBytes("516"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); - - Assert.AreEqual(517, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); - Assert.AreEqual(518, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); - Assert.AreEqual(519, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); - Assert.AreEqual(520, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, + Assert.Equal(501, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); + Assert.Equal(502L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); + Assert.Equal(503U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); + Assert.Equal(504UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); + Assert.Equal(505, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); + Assert.Equal(506L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); + Assert.Equal(507U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); + Assert.Equal(508UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); + Assert.Equal(509, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); + Assert.Equal(510L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); + Assert.Equal(511F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); + Assert.Equal(512D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); + Assert.Equal(true, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); + Assert.Equal("515", message.GetExtension(Unittest.RepeatedStringExtension, 1)); + Assert.Equal(ToBytes("516"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); + + Assert.Equal(517, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); + Assert.Equal(518, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); + Assert.Equal(519, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); + Assert.Equal(520, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); + + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 1)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, + Assert.Equal(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 1)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, + Assert.Equal(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.RepeatedImportEnumExtension, 1)); - Assert.AreEqual("524", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); - Assert.AreEqual("525", message.GetExtension(Unittest.RepeatedCordExtension, 1)); + Assert.Equal("524", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); + Assert.Equal("525", message.GetExtension(Unittest.RepeatedCordExtension, 1)); } internal static void AssertExtensionsClear(TestAllExtensions message) { // HasBlah() should initially be false for all optional fields. - Assert.IsFalse(message.HasExtension(Unittest.OptionalInt32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalInt64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalUint32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalUint64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalSint32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalSint64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalFixed32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalFixed64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalSfixed32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalSfixed64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalFloatExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalDoubleExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalBoolExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalStringExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalBytesExtension)); - - Assert.IsFalse(message.HasExtension(Unittest.OptionalGroupExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalNestedMessageExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalForeignMessageExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalImportMessageExtension)); - - Assert.IsFalse(message.HasExtension(Unittest.OptionalNestedEnumExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalForeignEnumExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalImportEnumExtension)); - - Assert.IsFalse(message.HasExtension(Unittest.OptionalStringPieceExtension)); - Assert.IsFalse(message.HasExtension(Unittest.OptionalCordExtension)); + Assert.False(message.HasExtension(Unittest.OptionalInt32Extension)); + Assert.False(message.HasExtension(Unittest.OptionalInt64Extension)); + Assert.False(message.HasExtension(Unittest.OptionalUint32Extension)); + Assert.False(message.HasExtension(Unittest.OptionalUint64Extension)); + Assert.False(message.HasExtension(Unittest.OptionalSint32Extension)); + Assert.False(message.HasExtension(Unittest.OptionalSint64Extension)); + Assert.False(message.HasExtension(Unittest.OptionalFixed32Extension)); + Assert.False(message.HasExtension(Unittest.OptionalFixed64Extension)); + Assert.False(message.HasExtension(Unittest.OptionalSfixed32Extension)); + Assert.False(message.HasExtension(Unittest.OptionalSfixed64Extension)); + Assert.False(message.HasExtension(Unittest.OptionalFloatExtension)); + Assert.False(message.HasExtension(Unittest.OptionalDoubleExtension)); + Assert.False(message.HasExtension(Unittest.OptionalBoolExtension)); + Assert.False(message.HasExtension(Unittest.OptionalStringExtension)); + Assert.False(message.HasExtension(Unittest.OptionalBytesExtension)); + + Assert.False(message.HasExtension(Unittest.OptionalGroupExtension)); + Assert.False(message.HasExtension(Unittest.OptionalNestedMessageExtension)); + Assert.False(message.HasExtension(Unittest.OptionalForeignMessageExtension)); + Assert.False(message.HasExtension(Unittest.OptionalImportMessageExtension)); + + Assert.False(message.HasExtension(Unittest.OptionalNestedEnumExtension)); + Assert.False(message.HasExtension(Unittest.OptionalForeignEnumExtension)); + Assert.False(message.HasExtension(Unittest.OptionalImportEnumExtension)); + + Assert.False(message.HasExtension(Unittest.OptionalStringPieceExtension)); + Assert.False(message.HasExtension(Unittest.OptionalCordExtension)); // Optional fields without defaults are set to zero or something like it. - Assert.AreEqual(0, message.GetExtension(Unittest.OptionalInt32Extension)); - Assert.AreEqual(0L, message.GetExtension(Unittest.OptionalInt64Extension)); - Assert.AreEqual(0U, message.GetExtension(Unittest.OptionalUint32Extension)); - Assert.AreEqual(0UL, message.GetExtension(Unittest.OptionalUint64Extension)); - Assert.AreEqual(0, message.GetExtension(Unittest.OptionalSint32Extension)); - Assert.AreEqual(0L, message.GetExtension(Unittest.OptionalSint64Extension)); - Assert.AreEqual(0U, message.GetExtension(Unittest.OptionalFixed32Extension)); - Assert.AreEqual(0UL, message.GetExtension(Unittest.OptionalFixed64Extension)); - Assert.AreEqual(0, message.GetExtension(Unittest.OptionalSfixed32Extension)); - Assert.AreEqual(0L, message.GetExtension(Unittest.OptionalSfixed64Extension)); - Assert.AreEqual(0F, message.GetExtension(Unittest.OptionalFloatExtension)); - Assert.AreEqual(0D, message.GetExtension(Unittest.OptionalDoubleExtension)); - Assert.AreEqual(false, message.GetExtension(Unittest.OptionalBoolExtension)); - Assert.AreEqual("", message.GetExtension(Unittest.OptionalStringExtension)); - Assert.AreEqual(ByteString.Empty, message.GetExtension(Unittest.OptionalBytesExtension)); + Assert.Equal(0, message.GetExtension(Unittest.OptionalInt32Extension)); + Assert.Equal(0L, message.GetExtension(Unittest.OptionalInt64Extension)); + Assert.Equal(0U, message.GetExtension(Unittest.OptionalUint32Extension)); + Assert.Equal(0UL, message.GetExtension(Unittest.OptionalUint64Extension)); + Assert.Equal(0, message.GetExtension(Unittest.OptionalSint32Extension)); + Assert.Equal(0L, message.GetExtension(Unittest.OptionalSint64Extension)); + Assert.Equal(0U, message.GetExtension(Unittest.OptionalFixed32Extension)); + Assert.Equal(0UL, message.GetExtension(Unittest.OptionalFixed64Extension)); + Assert.Equal(0, message.GetExtension(Unittest.OptionalSfixed32Extension)); + Assert.Equal(0L, message.GetExtension(Unittest.OptionalSfixed64Extension)); + Assert.Equal(0F, message.GetExtension(Unittest.OptionalFloatExtension)); + Assert.Equal(0D, message.GetExtension(Unittest.OptionalDoubleExtension)); + Assert.Equal(false, message.GetExtension(Unittest.OptionalBoolExtension)); + Assert.Equal("", message.GetExtension(Unittest.OptionalStringExtension)); + Assert.Equal(ByteString.Empty, message.GetExtension(Unittest.OptionalBytesExtension)); // Embedded messages should also be clear. - Assert.IsFalse(message.GetExtension(Unittest.OptionalGroupExtension).HasA); - Assert.IsFalse(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); - Assert.IsFalse(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); - Assert.IsFalse(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); + Assert.False(message.GetExtension(Unittest.OptionalGroupExtension).HasA); + Assert.False(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); + Assert.False(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); + Assert.False(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); - Assert.AreEqual(0, message.GetExtension(Unittest.OptionalGroupExtension).A); - Assert.AreEqual(0, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); - Assert.AreEqual(0, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); - Assert.AreEqual(0, message.GetExtension(Unittest.OptionalImportMessageExtension).D); + Assert.Equal(0, message.GetExtension(Unittest.OptionalGroupExtension).A); + Assert.Equal(0, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); + Assert.Equal(0, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); + Assert.Equal(0, message.GetExtension(Unittest.OptionalImportMessageExtension).D); // Enums without defaults are set to the first value in the enum. - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, + Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(Unittest.OptionalNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, + Assert.Equal(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.OptionalForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.OptionalImportEnumExtension)); + Assert.Equal(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.OptionalImportEnumExtension)); - Assert.AreEqual("", message.GetExtension(Unittest.OptionalStringPieceExtension)); - Assert.AreEqual("", message.GetExtension(Unittest.OptionalCordExtension)); + Assert.Equal("", message.GetExtension(Unittest.OptionalStringPieceExtension)); + Assert.Equal("", message.GetExtension(Unittest.OptionalCordExtension)); // Repeated fields are empty. - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedStringExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); - - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); - - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); - Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedCordExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedStringExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); + + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); + + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); + Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedCordExtension)); // HasBlah() should also be false for all default fields. - Assert.IsFalse(message.HasExtension(Unittest.DefaultInt32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultInt64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultUint32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultUint64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultSint32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultSint64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultFixed32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultFixed64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultSfixed32Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultSfixed64Extension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultFloatExtension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultDoubleExtension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultBoolExtension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultStringExtension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultBytesExtension)); - - Assert.IsFalse(message.HasExtension(Unittest.DefaultNestedEnumExtension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultForeignEnumExtension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultImportEnumExtension)); - - Assert.IsFalse(message.HasExtension(Unittest.DefaultStringPieceExtension)); - Assert.IsFalse(message.HasExtension(Unittest.DefaultCordExtension)); + Assert.False(message.HasExtension(Unittest.DefaultInt32Extension)); + Assert.False(message.HasExtension(Unittest.DefaultInt64Extension)); + Assert.False(message.HasExtension(Unittest.DefaultUint32Extension)); + Assert.False(message.HasExtension(Unittest.DefaultUint64Extension)); + Assert.False(message.HasExtension(Unittest.DefaultSint32Extension)); + Assert.False(message.HasExtension(Unittest.DefaultSint64Extension)); + Assert.False(message.HasExtension(Unittest.DefaultFixed32Extension)); + Assert.False(message.HasExtension(Unittest.DefaultFixed64Extension)); + Assert.False(message.HasExtension(Unittest.DefaultSfixed32Extension)); + Assert.False(message.HasExtension(Unittest.DefaultSfixed64Extension)); + Assert.False(message.HasExtension(Unittest.DefaultFloatExtension)); + Assert.False(message.HasExtension(Unittest.DefaultDoubleExtension)); + Assert.False(message.HasExtension(Unittest.DefaultBoolExtension)); + Assert.False(message.HasExtension(Unittest.DefaultStringExtension)); + Assert.False(message.HasExtension(Unittest.DefaultBytesExtension)); + + Assert.False(message.HasExtension(Unittest.DefaultNestedEnumExtension)); + Assert.False(message.HasExtension(Unittest.DefaultForeignEnumExtension)); + Assert.False(message.HasExtension(Unittest.DefaultImportEnumExtension)); + + Assert.False(message.HasExtension(Unittest.DefaultStringPieceExtension)); + Assert.False(message.HasExtension(Unittest.DefaultCordExtension)); // Fields with defaults have their default values (duh). - Assert.AreEqual(41, message.GetExtension(Unittest.DefaultInt32Extension)); - Assert.AreEqual(42L, message.GetExtension(Unittest.DefaultInt64Extension)); - Assert.AreEqual(43U, message.GetExtension(Unittest.DefaultUint32Extension)); - Assert.AreEqual(44UL, message.GetExtension(Unittest.DefaultUint64Extension)); - Assert.AreEqual(-45, message.GetExtension(Unittest.DefaultSint32Extension)); - Assert.AreEqual(46L, message.GetExtension(Unittest.DefaultSint64Extension)); - Assert.AreEqual(47U, message.GetExtension(Unittest.DefaultFixed32Extension)); - Assert.AreEqual(48UL, message.GetExtension(Unittest.DefaultFixed64Extension)); - Assert.AreEqual(49, message.GetExtension(Unittest.DefaultSfixed32Extension)); - Assert.AreEqual(-50L, message.GetExtension(Unittest.DefaultSfixed64Extension)); - Assert.AreEqual(51.5F, message.GetExtension(Unittest.DefaultFloatExtension)); - Assert.AreEqual(52e3D, message.GetExtension(Unittest.DefaultDoubleExtension)); - Assert.AreEqual(true, message.GetExtension(Unittest.DefaultBoolExtension)); - Assert.AreEqual("hello", message.GetExtension(Unittest.DefaultStringExtension)); - Assert.AreEqual(ToBytes("world"), message.GetExtension(Unittest.DefaultBytesExtension)); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, + Assert.Equal(41, message.GetExtension(Unittest.DefaultInt32Extension)); + Assert.Equal(42L, message.GetExtension(Unittest.DefaultInt64Extension)); + Assert.Equal(43U, message.GetExtension(Unittest.DefaultUint32Extension)); + Assert.Equal(44UL, message.GetExtension(Unittest.DefaultUint64Extension)); + Assert.Equal(-45, message.GetExtension(Unittest.DefaultSint32Extension)); + Assert.Equal(46L, message.GetExtension(Unittest.DefaultSint64Extension)); + Assert.Equal(47U, message.GetExtension(Unittest.DefaultFixed32Extension)); + Assert.Equal(48UL, message.GetExtension(Unittest.DefaultFixed64Extension)); + Assert.Equal(49, message.GetExtension(Unittest.DefaultSfixed32Extension)); + Assert.Equal(-50L, message.GetExtension(Unittest.DefaultSfixed64Extension)); + Assert.Equal(51.5F, message.GetExtension(Unittest.DefaultFloatExtension)); + Assert.Equal(52e3D, message.GetExtension(Unittest.DefaultDoubleExtension)); + Assert.Equal(true, message.GetExtension(Unittest.DefaultBoolExtension)); + Assert.Equal("hello", message.GetExtension(Unittest.DefaultStringExtension)); + Assert.Equal(ToBytes("world"), message.GetExtension(Unittest.DefaultBytesExtension)); + + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.DefaultNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.DefaultImportEnumExtension)); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.DefaultForeignEnumExtension)); + Assert.Equal(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.DefaultImportEnumExtension)); - Assert.AreEqual("abc", message.GetExtension(Unittest.DefaultStringPieceExtension)); - Assert.AreEqual("123", message.GetExtension(Unittest.DefaultCordExtension)); + Assert.Equal("abc", message.GetExtension(Unittest.DefaultStringPieceExtension)); + Assert.Equal("123", message.GetExtension(Unittest.DefaultCordExtension)); } /// @@ -1495,48 +1495,48 @@ namespace Google.ProtocolBuffers /// public static void AssertPackedFieldsSet(TestPackedTypes message) { - Assert.AreEqual(2, message.PackedInt32Count); - Assert.AreEqual(2, message.PackedInt64Count); - Assert.AreEqual(2, message.PackedUint32Count); - Assert.AreEqual(2, message.PackedUint64Count); - Assert.AreEqual(2, message.PackedSint32Count); - Assert.AreEqual(2, message.PackedSint64Count); - Assert.AreEqual(2, message.PackedFixed32Count); - Assert.AreEqual(2, message.PackedFixed64Count); - Assert.AreEqual(2, message.PackedSfixed32Count); - Assert.AreEqual(2, message.PackedSfixed64Count); - Assert.AreEqual(2, message.PackedFloatCount); - Assert.AreEqual(2, message.PackedDoubleCount); - Assert.AreEqual(2, message.PackedBoolCount); - Assert.AreEqual(2, message.PackedEnumCount); - Assert.AreEqual(601, message.GetPackedInt32(0)); - Assert.AreEqual(602, message.GetPackedInt64(0)); - Assert.AreEqual(603u, message.GetPackedUint32(0)); - Assert.AreEqual(604u, message.GetPackedUint64(0)); - Assert.AreEqual(605, message.GetPackedSint32(0)); - Assert.AreEqual(606, message.GetPackedSint64(0)); - Assert.AreEqual(607u, message.GetPackedFixed32(0)); - Assert.AreEqual(608u, message.GetPackedFixed64(0)); - Assert.AreEqual(609, message.GetPackedSfixed32(0)); - Assert.AreEqual(610, message.GetPackedSfixed64(0)); - Assert.AreEqual(611, message.GetPackedFloat(0), 0.0); - Assert.AreEqual(612, message.GetPackedDouble(0), 0.0); - Assert.AreEqual(true, message.GetPackedBool(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetPackedEnum(0)); - Assert.AreEqual(701, message.GetPackedInt32(1)); - Assert.AreEqual(702, message.GetPackedInt64(1)); - Assert.AreEqual(703u, message.GetPackedUint32(1)); - Assert.AreEqual(704u, message.GetPackedUint64(1)); - Assert.AreEqual(705, message.GetPackedSint32(1)); - Assert.AreEqual(706, message.GetPackedSint64(1)); - Assert.AreEqual(707u, message.GetPackedFixed32(1)); - Assert.AreEqual(708u, message.GetPackedFixed64(1)); - Assert.AreEqual(709, message.GetPackedSfixed32(1)); - Assert.AreEqual(710, message.GetPackedSfixed64(1)); - Assert.AreEqual(711, message.GetPackedFloat(1), 0.0); - Assert.AreEqual(712, message.GetPackedDouble(1), 0.0); - Assert.AreEqual(false, message.GetPackedBool(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetPackedEnum(1)); + Assert.Equal(2, message.PackedInt32Count); + Assert.Equal(2, message.PackedInt64Count); + Assert.Equal(2, message.PackedUint32Count); + Assert.Equal(2, message.PackedUint64Count); + Assert.Equal(2, message.PackedSint32Count); + Assert.Equal(2, message.PackedSint64Count); + Assert.Equal(2, message.PackedFixed32Count); + Assert.Equal(2, message.PackedFixed64Count); + Assert.Equal(2, message.PackedSfixed32Count); + Assert.Equal(2, message.PackedSfixed64Count); + Assert.Equal(2, message.PackedFloatCount); + Assert.Equal(2, message.PackedDoubleCount); + Assert.Equal(2, message.PackedBoolCount); + Assert.Equal(2, message.PackedEnumCount); + Assert.Equal(601, message.GetPackedInt32(0)); + Assert.Equal(602, message.GetPackedInt64(0)); + Assert.Equal(603u, message.GetPackedUint32(0)); + Assert.Equal(604u, message.GetPackedUint64(0)); + Assert.Equal(605, message.GetPackedSint32(0)); + Assert.Equal(606, message.GetPackedSint64(0)); + Assert.Equal(607u, message.GetPackedFixed32(0)); + Assert.Equal(608u, message.GetPackedFixed64(0)); + Assert.Equal(609, message.GetPackedSfixed32(0)); + Assert.Equal(610, message.GetPackedSfixed64(0)); + Assert.Equal(611f, message.GetPackedFloat(0)); + Assert.Equal(612d, message.GetPackedDouble(0)); + Assert.Equal(true, message.GetPackedBool(0)); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetPackedEnum(0)); + Assert.Equal(701, message.GetPackedInt32(1)); + Assert.Equal(702, message.GetPackedInt64(1)); + Assert.Equal(703u, message.GetPackedUint32(1)); + Assert.Equal(704u, message.GetPackedUint64(1)); + Assert.Equal(705, message.GetPackedSint32(1)); + Assert.Equal(706, message.GetPackedSint64(1)); + Assert.Equal(707u, message.GetPackedFixed32(1)); + Assert.Equal(708u, message.GetPackedFixed64(1)); + Assert.Equal(709, message.GetPackedSfixed32(1)); + Assert.Equal(710, message.GetPackedSfixed64(1)); + Assert.Equal(711f, message.GetPackedFloat(1)); + Assert.Equal(712d, message.GetPackedDouble(1)); + Assert.Equal(false, message.GetPackedBool(1)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetPackedEnum(1)); } /// /// Asserts that all the fields of the specified message are set to the values assigned @@ -1544,48 +1544,48 @@ namespace Google.ProtocolBuffers /// public static void AssertUnpackedFieldsSet(TestUnpackedTypes message) { - Assert.AreEqual(2, message.UnpackedInt32Count); - Assert.AreEqual(2, message.UnpackedInt64Count); - Assert.AreEqual(2, message.UnpackedUint32Count); - Assert.AreEqual(2, message.UnpackedUint64Count); - Assert.AreEqual(2, message.UnpackedSint32Count); - Assert.AreEqual(2, message.UnpackedSint64Count); - Assert.AreEqual(2, message.UnpackedFixed32Count); - Assert.AreEqual(2, message.UnpackedFixed64Count); - Assert.AreEqual(2, message.UnpackedSfixed32Count); - Assert.AreEqual(2, message.UnpackedSfixed64Count); - Assert.AreEqual(2, message.UnpackedFloatCount); - Assert.AreEqual(2, message.UnpackedDoubleCount); - Assert.AreEqual(2, message.UnpackedBoolCount); - Assert.AreEqual(2, message.UnpackedEnumCount); - Assert.AreEqual(601, message.GetUnpackedInt32(0)); - Assert.AreEqual(602, message.GetUnpackedInt64(0)); - Assert.AreEqual(603u, message.GetUnpackedUint32(0)); - Assert.AreEqual(604u, message.GetUnpackedUint64(0)); - Assert.AreEqual(605, message.GetUnpackedSint32(0)); - Assert.AreEqual(606, message.GetUnpackedSint64(0)); - Assert.AreEqual(607u, message.GetUnpackedFixed32(0)); - Assert.AreEqual(608u, message.GetUnpackedFixed64(0)); - Assert.AreEqual(609, message.GetUnpackedSfixed32(0)); - Assert.AreEqual(610, message.GetUnpackedSfixed64(0)); - Assert.AreEqual(611, message.GetUnpackedFloat(0), 0.0); - Assert.AreEqual(612, message.GetUnpackedDouble(0), 0.0); - Assert.AreEqual(true, message.GetUnpackedBool(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetUnpackedEnum(0)); - Assert.AreEqual(701, message.GetUnpackedInt32(1)); - Assert.AreEqual(702, message.GetUnpackedInt64(1)); - Assert.AreEqual(703u, message.GetUnpackedUint32(1)); - Assert.AreEqual(704u, message.GetUnpackedUint64(1)); - Assert.AreEqual(705, message.GetUnpackedSint32(1)); - Assert.AreEqual(706, message.GetUnpackedSint64(1)); - Assert.AreEqual(707u, message.GetUnpackedFixed32(1)); - Assert.AreEqual(708u, message.GetUnpackedFixed64(1)); - Assert.AreEqual(709, message.GetUnpackedSfixed32(1)); - Assert.AreEqual(710, message.GetUnpackedSfixed64(1)); - Assert.AreEqual(711, message.GetUnpackedFloat(1), 0.0); - Assert.AreEqual(712, message.GetUnpackedDouble(1), 0.0); - Assert.AreEqual(false, message.GetUnpackedBool(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetUnpackedEnum(1)); + Assert.Equal(2, message.UnpackedInt32Count); + Assert.Equal(2, message.UnpackedInt64Count); + Assert.Equal(2, message.UnpackedUint32Count); + Assert.Equal(2, message.UnpackedUint64Count); + Assert.Equal(2, message.UnpackedSint32Count); + Assert.Equal(2, message.UnpackedSint64Count); + Assert.Equal(2, message.UnpackedFixed32Count); + Assert.Equal(2, message.UnpackedFixed64Count); + Assert.Equal(2, message.UnpackedSfixed32Count); + Assert.Equal(2, message.UnpackedSfixed64Count); + Assert.Equal(2, message.UnpackedFloatCount); + Assert.Equal(2, message.UnpackedDoubleCount); + Assert.Equal(2, message.UnpackedBoolCount); + Assert.Equal(2, message.UnpackedEnumCount); + Assert.Equal(601, message.GetUnpackedInt32(0)); + Assert.Equal(602, message.GetUnpackedInt64(0)); + Assert.Equal(603u, message.GetUnpackedUint32(0)); + Assert.Equal(604u, message.GetUnpackedUint64(0)); + Assert.Equal(605, message.GetUnpackedSint32(0)); + Assert.Equal(606, message.GetUnpackedSint64(0)); + Assert.Equal(607u, message.GetUnpackedFixed32(0)); + Assert.Equal(608u, message.GetUnpackedFixed64(0)); + Assert.Equal(609, message.GetUnpackedSfixed32(0)); + Assert.Equal(610, message.GetUnpackedSfixed64(0)); + Assert.Equal(611f, message.GetUnpackedFloat(0)); + Assert.Equal(612d, message.GetUnpackedDouble(0)); + Assert.Equal(true, message.GetUnpackedBool(0)); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetUnpackedEnum(0)); + Assert.Equal(701, message.GetUnpackedInt32(1)); + Assert.Equal(702, message.GetUnpackedInt64(1)); + Assert.Equal(703u, message.GetUnpackedUint32(1)); + Assert.Equal(704u, message.GetUnpackedUint64(1)); + Assert.Equal(705, message.GetUnpackedSint32(1)); + Assert.Equal(706, message.GetUnpackedSint64(1)); + Assert.Equal(707u, message.GetUnpackedFixed32(1)); + Assert.Equal(708u, message.GetUnpackedFixed64(1)); + Assert.Equal(709, message.GetUnpackedSfixed32(1)); + Assert.Equal(710, message.GetUnpackedSfixed64(1)); + Assert.Equal(711f, message.GetUnpackedFloat(1)); + Assert.Equal(712d, message.GetUnpackedDouble(1)); + Assert.Equal(false, message.GetUnpackedBool(1)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetUnpackedEnum(1)); } public static void SetPackedExtensions(TestPackedExtensions.Builder message) @@ -1623,95 +1623,95 @@ namespace Google.ProtocolBuffers public static void AssertPackedExtensionsSet(TestPackedExtensions message) { - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedEnumExtension)); - Assert.AreEqual(601, message.GetExtension(Unittest.PackedInt32Extension, 0)); - Assert.AreEqual(602L, message.GetExtension(Unittest.PackedInt64Extension, 0)); - Assert.AreEqual(603u, message.GetExtension(Unittest.PackedUint32Extension, 0)); - Assert.AreEqual(604uL, message.GetExtension(Unittest.PackedUint64Extension, 0)); - Assert.AreEqual(605, message.GetExtension(Unittest.PackedSint32Extension, 0)); - Assert.AreEqual(606L, message.GetExtension(Unittest.PackedSint64Extension, 0)); - Assert.AreEqual(607u, message.GetExtension(Unittest.PackedFixed32Extension, 0)); - Assert.AreEqual(608uL, message.GetExtension(Unittest.PackedFixed64Extension, 0)); - Assert.AreEqual(609, message.GetExtension(Unittest.PackedSfixed32Extension, 0)); - Assert.AreEqual(610L, message.GetExtension(Unittest.PackedSfixed64Extension, 0)); - Assert.AreEqual(611F, message.GetExtension(Unittest.PackedFloatExtension, 0)); - Assert.AreEqual(612D, message.GetExtension(Unittest.PackedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(Unittest.PackedBoolExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedInt32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedInt64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedUint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedUint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedFixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedFixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSfixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSfixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedFloatExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedDoubleExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedBoolExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.PackedEnumExtension)); + Assert.Equal(601, message.GetExtension(Unittest.PackedInt32Extension, 0)); + Assert.Equal(602L, message.GetExtension(Unittest.PackedInt64Extension, 0)); + Assert.Equal(603u, message.GetExtension(Unittest.PackedUint32Extension, 0)); + Assert.Equal(604uL, message.GetExtension(Unittest.PackedUint64Extension, 0)); + Assert.Equal(605, message.GetExtension(Unittest.PackedSint32Extension, 0)); + Assert.Equal(606L, message.GetExtension(Unittest.PackedSint64Extension, 0)); + Assert.Equal(607u, message.GetExtension(Unittest.PackedFixed32Extension, 0)); + Assert.Equal(608uL, message.GetExtension(Unittest.PackedFixed64Extension, 0)); + Assert.Equal(609, message.GetExtension(Unittest.PackedSfixed32Extension, 0)); + Assert.Equal(610L, message.GetExtension(Unittest.PackedSfixed64Extension, 0)); + Assert.Equal(611F, message.GetExtension(Unittest.PackedFloatExtension, 0)); + Assert.Equal(612D, message.GetExtension(Unittest.PackedDoubleExtension, 0)); + Assert.Equal(true, message.GetExtension(Unittest.PackedBoolExtension, 0)); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.PackedEnumExtension, 0)); - Assert.AreEqual(701, message.GetExtension(Unittest.PackedInt32Extension, 1)); - Assert.AreEqual(702L, message.GetExtension(Unittest.PackedInt64Extension, 1)); - Assert.AreEqual(703u, message.GetExtension(Unittest.PackedUint32Extension, 1)); - Assert.AreEqual(704uL, message.GetExtension(Unittest.PackedUint64Extension, 1)); - Assert.AreEqual(705, message.GetExtension(Unittest.PackedSint32Extension, 1)); - Assert.AreEqual(706L, message.GetExtension(Unittest.PackedSint64Extension, 1)); - Assert.AreEqual(707u, message.GetExtension(Unittest.PackedFixed32Extension, 1)); - Assert.AreEqual(708uL, message.GetExtension(Unittest.PackedFixed64Extension, 1)); - Assert.AreEqual(709, message.GetExtension(Unittest.PackedSfixed32Extension, 1)); - Assert.AreEqual(710L, message.GetExtension(Unittest.PackedSfixed64Extension, 1)); - Assert.AreEqual(711F, message.GetExtension(Unittest.PackedFloatExtension, 1)); - Assert.AreEqual(712D, message.GetExtension(Unittest.PackedDoubleExtension, 1)); - Assert.AreEqual(false, message.GetExtension(Unittest.PackedBoolExtension, 1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.PackedEnumExtension, 1)); + Assert.Equal(701, message.GetExtension(Unittest.PackedInt32Extension, 1)); + Assert.Equal(702L, message.GetExtension(Unittest.PackedInt64Extension, 1)); + Assert.Equal(703u, message.GetExtension(Unittest.PackedUint32Extension, 1)); + Assert.Equal(704uL, message.GetExtension(Unittest.PackedUint64Extension, 1)); + Assert.Equal(705, message.GetExtension(Unittest.PackedSint32Extension, 1)); + Assert.Equal(706L, message.GetExtension(Unittest.PackedSint64Extension, 1)); + Assert.Equal(707u, message.GetExtension(Unittest.PackedFixed32Extension, 1)); + Assert.Equal(708uL, message.GetExtension(Unittest.PackedFixed64Extension, 1)); + Assert.Equal(709, message.GetExtension(Unittest.PackedSfixed32Extension, 1)); + Assert.Equal(710L, message.GetExtension(Unittest.PackedSfixed64Extension, 1)); + Assert.Equal(711F, message.GetExtension(Unittest.PackedFloatExtension, 1)); + Assert.Equal(712D, message.GetExtension(Unittest.PackedDoubleExtension, 1)); + Assert.Equal(false, message.GetExtension(Unittest.PackedBoolExtension, 1)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.PackedEnumExtension, 1)); } public static void AssertUnpackedExtensionsSet(TestUnpackedExtensions message) { - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedEnumExtension)); - Assert.AreEqual(601, message.GetExtension(Unittest.UnpackedInt32Extension, 0)); - Assert.AreEqual(602L, message.GetExtension(Unittest.UnpackedInt64Extension, 0)); - Assert.AreEqual(603u, message.GetExtension(Unittest.UnpackedUint32Extension, 0)); - Assert.AreEqual(604uL, message.GetExtension(Unittest.UnpackedUint64Extension, 0)); - Assert.AreEqual(605, message.GetExtension(Unittest.UnpackedSint32Extension, 0)); - Assert.AreEqual(606L, message.GetExtension(Unittest.UnpackedSint64Extension, 0)); - Assert.AreEqual(607u, message.GetExtension(Unittest.UnpackedFixed32Extension, 0)); - Assert.AreEqual(608uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 0)); - Assert.AreEqual(609, message.GetExtension(Unittest.UnpackedSfixed32Extension, 0)); - Assert.AreEqual(610L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 0)); - Assert.AreEqual(611F, message.GetExtension(Unittest.UnpackedFloatExtension, 0)); - Assert.AreEqual(612D, message.GetExtension(Unittest.UnpackedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(Unittest.UnpackedBoolExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.UnpackedEnumExtension, 0)); - Assert.AreEqual(701, message.GetExtension(Unittest.UnpackedInt32Extension, 1)); - Assert.AreEqual(702L, message.GetExtension(Unittest.UnpackedInt64Extension, 1)); - Assert.AreEqual(703u, message.GetExtension(Unittest.UnpackedUint32Extension, 1)); - Assert.AreEqual(704uL, message.GetExtension(Unittest.UnpackedUint64Extension, 1)); - Assert.AreEqual(705, message.GetExtension(Unittest.UnpackedSint32Extension, 1)); - Assert.AreEqual(706L, message.GetExtension(Unittest.UnpackedSint64Extension, 1)); - Assert.AreEqual(707u, message.GetExtension(Unittest.UnpackedFixed32Extension, 1)); - Assert.AreEqual(708uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 1)); - Assert.AreEqual(709, message.GetExtension(Unittest.UnpackedSfixed32Extension, 1)); - Assert.AreEqual(710L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 1)); - Assert.AreEqual(711F, message.GetExtension(Unittest.UnpackedFloatExtension, 1)); - Assert.AreEqual(712D, message.GetExtension(Unittest.UnpackedDoubleExtension, 1)); - Assert.AreEqual(false, message.GetExtension(Unittest.UnpackedBoolExtension, 1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.UnpackedEnumExtension, 1)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedInt32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedInt64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedUint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedUint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSint32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSint64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedFixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedFixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSfixed32Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSfixed64Extension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedFloatExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedDoubleExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedBoolExtension)); + Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedEnumExtension)); + Assert.Equal(601, message.GetExtension(Unittest.UnpackedInt32Extension, 0)); + Assert.Equal(602L, message.GetExtension(Unittest.UnpackedInt64Extension, 0)); + Assert.Equal(603u, message.GetExtension(Unittest.UnpackedUint32Extension, 0)); + Assert.Equal(604uL, message.GetExtension(Unittest.UnpackedUint64Extension, 0)); + Assert.Equal(605, message.GetExtension(Unittest.UnpackedSint32Extension, 0)); + Assert.Equal(606L, message.GetExtension(Unittest.UnpackedSint64Extension, 0)); + Assert.Equal(607u, message.GetExtension(Unittest.UnpackedFixed32Extension, 0)); + Assert.Equal(608uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 0)); + Assert.Equal(609, message.GetExtension(Unittest.UnpackedSfixed32Extension, 0)); + Assert.Equal(610L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 0)); + Assert.Equal(611F, message.GetExtension(Unittest.UnpackedFloatExtension, 0)); + Assert.Equal(612D, message.GetExtension(Unittest.UnpackedDoubleExtension, 0)); + Assert.Equal(true, message.GetExtension(Unittest.UnpackedBoolExtension, 0)); + Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.UnpackedEnumExtension, 0)); + Assert.Equal(701, message.GetExtension(Unittest.UnpackedInt32Extension, 1)); + Assert.Equal(702L, message.GetExtension(Unittest.UnpackedInt64Extension, 1)); + Assert.Equal(703u, message.GetExtension(Unittest.UnpackedUint32Extension, 1)); + Assert.Equal(704uL, message.GetExtension(Unittest.UnpackedUint64Extension, 1)); + Assert.Equal(705, message.GetExtension(Unittest.UnpackedSint32Extension, 1)); + Assert.Equal(706L, message.GetExtension(Unittest.UnpackedSint64Extension, 1)); + Assert.Equal(707u, message.GetExtension(Unittest.UnpackedFixed32Extension, 1)); + Assert.Equal(708uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 1)); + Assert.Equal(709, message.GetExtension(Unittest.UnpackedSfixed32Extension, 1)); + Assert.Equal(710L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 1)); + Assert.Equal(711F, message.GetExtension(Unittest.UnpackedFloatExtension, 1)); + Assert.Equal(712D, message.GetExtension(Unittest.UnpackedDoubleExtension, 1)); + Assert.Equal(false, message.GetExtension(Unittest.UnpackedBoolExtension, 1)); + Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.UnpackedEnumExtension, 1)); } private static readonly string[] TestCultures = {"en-US", "en-GB", "fr-FR", "de-DE"}; @@ -1751,61 +1751,5 @@ namespace Google.ProtocolBuffers } return bytes; } - - - internal delegate void Action(); - - internal static void AssertNotSupported(Action action) - { - try - { - action(); - Assert.Fail("Expected NotSupportedException"); - } - catch (NotSupportedException) - { - // Expected - } - } - - internal static void AssertArgumentNullException(Action action) - { - try - { - action(); - Assert.Fail("Exception was not thrown"); - } - // Not a general case, however, Compact Framework v2 does use Invoke - catch (System.Reflection.TargetInvocationException te) - { - if (te.InnerException.GetType() != typeof(ArgumentNullException)) - throw; - } - // Normally expected exception - catch (ArgumentNullException) - { - // We expect this exception. - } - } - - internal static void AssertBytesEqual(byte[] a, byte[]b) - { - if (a == null || b == null) - { - Assert.AreEqual(a, b); - } - else - { - Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length."); - - for (int i = 0; i < a.Length; i++) - { - if (a[i] != b[i]) - { - Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i); - } - } - } - } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs b/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs index b4472a60..ad5c052e 100644 --- a/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs +++ b/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs @@ -1,18 +1,18 @@ using System; using System.IO; +using System.Runtime.InteropServices; using System.Text; +using EnumOptions = Google.ProtocolBuffers.TestProtos.EnumOptions; using Google.ProtocolBuffers.DescriptorProtos; using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; -using EnumOptions = Google.ProtocolBuffers.TestProtos.EnumOptions; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class TestWriterFormatJson { - [TestMethod] + [Fact] public void Example_FromJson() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -21,10 +21,10 @@ namespace Google.ProtocolBuffers Extensions.MergeFromJson(builder, @"{""valid"":true}"); TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); + Assert.Equal(true, message.Valid); } - [TestMethod] + [Fact] public void Example_ToJson() { TestXmlMessage message = @@ -35,10 +35,10 @@ namespace Google.ProtocolBuffers //3.5: string json = message.ToJson(); string json = Extensions.ToJson(message); - Assert.AreEqual(@"{""valid"":true}", json); + Assert.Equal(@"{""valid"":true}", json); } - [TestMethod] + [Fact] public void Example_WriteJsonUsingICodedOutputStream() { TestXmlMessage message = @@ -52,20 +52,20 @@ namespace Google.ProtocolBuffers writer.WriteMessageStart(); //manually begin the message, output is '{' writer.Flush(); - Assert.AreEqual("{", output.ToString()); + Assert.Equal("{", output.ToString()); ICodedOutputStream stream = writer; message.WriteTo(stream); //write the message normally writer.Flush(); - Assert.AreEqual(@"{""valid"":true", output.ToString()); + Assert.Equal(@"{""valid"":true", output.ToString()); writer.WriteMessageEnd(); //manually write the end message '}' - Assert.AreEqual(@"{""valid"":true}", output.ToString()); + Assert.Equal(@"{""valid"":true}", output.ToString()); } } - [TestMethod] + [Fact] public void Example_ReadJsonUsingICodedInputStream() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -94,35 +94,37 @@ namespace Google.ProtocolBuffers JsonFormatReader.CreateInstance(Content) .Merge(message.WeakCreateBuilderForType(), registry).WeakBuild(); - Assert.AreEqual(typeof(TMessage), copy.GetType()); - Assert.AreEqual(message, copy); + Assert.Equal(typeof(TMessage), copy.GetType()); + Assert.Equal(message, copy); foreach (string expect in expecting) - Assert.IsTrue(Content.IndexOf(expect) >= 0, "Expected to find content '{0}' in: \r\n{1}", expect, Content); + { + Assert.True(Content.IndexOf(expect) >= 0); + } } - [TestMethod] + [Fact] public void TestToJsonParseFromJson() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string json = Extensions.ToJson(msg); - Assert.AreEqual("{\"default_bool\":true}", json); + Assert.Equal("{\"default_bool\":true}", json); TestAllTypes copy = Extensions.MergeFromJson(new TestAllTypes.Builder(), json).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); + Assert.True(copy.HasDefaultBool && copy.DefaultBool); + Assert.Equal(msg, copy); } - [TestMethod] + [Fact] public void TestToJsonParseFromJsonReader() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string json = Extensions.ToJson(msg); - Assert.AreEqual("{\"default_bool\":true}", json); + Assert.Equal("{\"default_bool\":true}", json); TestAllTypes copy = Extensions.MergeFromJson(new TestAllTypes.Builder(), new StringReader(json)).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); + Assert.True(copy.HasDefaultBool && copy.DefaultBool); + Assert.Equal(msg, copy); } - [TestMethod] + [Fact] public void TestJsonFormatted() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -142,10 +144,10 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = JsonFormatReader.CreateInstance(json) .Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + [Fact] public void TestEmptyMessage() { FormatterAssert( @@ -155,7 +157,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestRepeatedField() { FormatterAssert( @@ -167,7 +169,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestNestedEmptyMessage() { FormatterAssert( @@ -178,7 +180,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestNestedMessage() { FormatterAssert( @@ -189,7 +191,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestBooleanTypes() { FormatterAssert( @@ -200,7 +202,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestFullMessage() { FormatterAssert( @@ -230,7 +232,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestMessageWithXmlText() { FormatterAssert( @@ -241,7 +243,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestWithEscapeChars() { FormatterAssert( @@ -252,7 +254,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestWithExtensionText() { FormatterAssert( @@ -264,7 +266,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestWithExtensionNumber() { FormatterAssert( @@ -276,7 +278,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestWithExtensionArray() { FormatterAssert( @@ -289,7 +291,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestWithExtensionEnum() { FormatterAssert( @@ -300,7 +302,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestMessageWithExtensions() { FormatterAssert( @@ -323,7 +325,7 @@ namespace Google.ProtocolBuffers ); } - [TestMethod] + [Fact] public void TestMessageMissingExtensions() { TestXmlMessage original = TestXmlMessage.CreateBuilder() @@ -351,23 +353,23 @@ namespace Google.ProtocolBuffers IMessageLite copy = JsonFormatReader.CreateInstance(Content) .Merge(message.CreateBuilderForType()).Build(); - Assert.AreNotEqual(original, message); - Assert.AreNotEqual(original, copy); - Assert.AreEqual(message, copy); + Assert.NotEqual(original, message); + Assert.NotEqual(original, copy); + Assert.Equal(message, copy); } - [TestMethod] + [Fact] public void TestMergeFields() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); builder.MergeFrom(JsonFormatReader.CreateInstance("\"valid\": true")); builder.MergeFrom(JsonFormatReader.CreateInstance("\"text\": \"text\", \"number\": \"411\"")); - Assert.AreEqual(true, builder.Valid); - Assert.AreEqual("text", builder.Text); - Assert.AreEqual(411, builder.Number); + Assert.Equal(true, builder.Valid); + Assert.Equal("text", builder.Text); + Assert.Equal(411, builder.Number); } - [TestMethod] + [Fact] public void TestMessageArray() { JsonFormatWriter writer = JsonFormatWriter.CreateInstance().Formatted(); @@ -386,13 +388,13 @@ namespace Google.ProtocolBuffers foreach (JsonFormatReader r in reader.EnumerateArray()) { r.Merge(builder); - Assert.AreEqual(++ordinal, builder.Number); + Assert.Equal(++ordinal, builder.Number); } - Assert.AreEqual(3, ordinal); - Assert.AreEqual(3, builder.TextlinesCount); + Assert.Equal(3, ordinal); + Assert.Equal(3, builder.TextlinesCount); } - [TestMethod] + [Fact] public void TestNestedMessageArray() { JsonFormatWriter writer = JsonFormatWriter.CreateInstance(); @@ -416,13 +418,13 @@ namespace Google.ProtocolBuffers foreach (JsonFormatReader r2 in r.EnumerateArray()) { r2.Merge(builder); - Assert.AreEqual(++ordinal, builder.Number); + Assert.Equal(++ordinal, builder.Number); } - Assert.AreEqual(3, ordinal); - Assert.AreEqual(3, builder.TextlinesCount); + Assert.Equal(3, ordinal); + Assert.Equal(3, builder.TextlinesCount); } - [TestMethod] + [Fact] public void TestReadWriteJsonWithoutRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -437,53 +439,51 @@ namespace Google.ProtocolBuffers output.Flush(); Json = sw.ToString(); } - Assert.AreEqual(@"""text"":""abc"",""number"":123", Json); + Assert.Equal(@"""text"":""abc"",""number"":123", Json); ICodedInputStream input = JsonFormatReader.CreateInstance(Json); TestXmlMessage copy = TestXmlMessage.CreateBuilder().MergeFrom(input).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod,ExpectedException(typeof(RecursionLimitExceededException))] + [Fact] public void TestRecursiveLimit() { StringBuilder sb = new StringBuilder(8192); for (int i = 0; i < 80; i++) + { sb.Append("{\"child\":"); - TestXmlRescursive msg = Extensions.MergeFromJson(new TestXmlRescursive.Builder(), sb.ToString()).Build(); + } + Assert.Throws(() => Extensions.MergeFromJson(new TestXmlRescursive.Builder(), sb.ToString()).Build()); } - [TestMethod, ExpectedException(typeof(FormatException))] + [Fact] public void FailWithEmptyText() { - JsonFormatReader.CreateInstance("") - .Merge(TestXmlMessage.CreateBuilder()); + Assert.Throws(() => JsonFormatReader.CreateInstance("").Merge(TestXmlMessage.CreateBuilder())); } - [TestMethod, ExpectedException(typeof(FormatException))] + [Fact] public void FailWithUnexpectedValue() { - JsonFormatReader.CreateInstance("{{}}") - .Merge(TestXmlMessage.CreateBuilder()); + Assert.Throws(() => JsonFormatReader.CreateInstance("{{}}").Merge(TestXmlMessage.CreateBuilder())); } - [TestMethod, ExpectedException(typeof(FormatException))] + [Fact] public void FailWithUnQuotedName() { - JsonFormatReader.CreateInstance("{name:{}}") - .Merge(TestXmlMessage.CreateBuilder()); + Assert.Throws(() => JsonFormatReader.CreateInstance("{name:{}}").Merge(TestXmlMessage.CreateBuilder())); } - [TestMethod, ExpectedException(typeof(FormatException))] + [Fact] public void FailWithUnexpectedType() { - JsonFormatReader.CreateInstance("{\"valid\":{}}") - .Merge(TestXmlMessage.CreateBuilder()); + Assert.Throws(() => JsonFormatReader.CreateInstance("{\"valid\":{}}").Merge(TestXmlMessage.CreateBuilder())); } // See issue 64 for background. - [TestMethod] + [Fact] public void ToJsonRequiringBufferExpansion() { string s = new string('.', 4086); @@ -492,7 +492,7 @@ namespace Google.ProtocolBuffers .SetPackage("package") .BuildPartial(); - Assert.IsNotNull(Extensions.ToJson(opts)); + Assert.NotNull(Extensions.ToJson(opts)); } } } diff --git a/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs b/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs index 695daa84..78e6bb27 100644 --- a/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs +++ b/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs @@ -1,18 +1,16 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class TestWriterFormatXml { - [TestMethod] + [Fact] public void Example_FromXml() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -22,10 +20,10 @@ namespace Google.ProtocolBuffers Extensions.MergeFromXml(builder, rdr); TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); + Assert.Equal(true, message.Valid); } - [TestMethod] + [Fact] public void Example_ToXml() { TestXmlMessage message = @@ -36,10 +34,10 @@ namespace Google.ProtocolBuffers //3.5: string Xml = message.ToXml(); string Xml = Extensions.ToXml(message); - Assert.AreEqual(@"true", Xml); + Assert.Equal(@"true", Xml); } - [TestMethod] + [Fact] public void Example_WriteXmlUsingICodedOutputStream() { TestXmlMessage message = @@ -56,11 +54,11 @@ namespace Google.ProtocolBuffers message.WriteTo(stream); //write the message normally writer.WriteMessageEnd(); //manually write the end message '}' - Assert.AreEqual(@"true", output.ToString()); + Assert.Equal(@"true", output.ToString()); } } - [TestMethod] + [Fact] public void Example_ReadXmlUsingICodedInputStream() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -73,29 +71,29 @@ namespace Google.ProtocolBuffers reader.ReadMessageEnd(); //manually read the end message '}' } - [TestMethod] + [Fact] public void TestToXmlParseFromXml() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string xml = Extensions.ToXml(msg); - Assert.AreEqual("true", xml); + Assert.Equal("true", xml); TestAllTypes copy = Extensions.MergeFromXml(new TestAllTypes.Builder(), XmlReader.Create(new StringReader(xml))).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); + Assert.True(copy.HasDefaultBool && copy.DefaultBool); + Assert.Equal(msg, copy); } - [TestMethod] + [Fact] public void TestToXmlParseFromXmlWithRootName() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string xml = Extensions.ToXml(msg, "message"); - Assert.AreEqual("true", xml); + Assert.Equal("true", xml); TestAllTypes copy = Extensions.MergeFromXml(new TestAllTypes.Builder(), "message", XmlReader.Create(new StringReader(xml))).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); + Assert.True(copy.HasDefaultBool && copy.DefaultBool); + Assert.Equal(msg, copy); } - [TestMethod] + [Fact] public void TestEmptyMessage() { TestXmlChild message = TestXmlChild.CreateBuilder() @@ -113,9 +111,9 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + [Fact] public void TestRepeatedField() { TestXmlChild message = TestXmlChild.CreateBuilder() @@ -130,9 +128,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestNestedEmptyMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -145,9 +144,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestNestedMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -160,9 +160,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestBooleanTypes() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -175,9 +176,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestFullMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -204,9 +206,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestFullMessageWithRichTypes() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -236,9 +239,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); rdr.Options = XmlReaderOptions.ReadNestedArrays; TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestFullMessageWithUnknownFields() { TestXmlMessage origial = TestXmlMessage.CreateBuilder() @@ -257,7 +261,7 @@ namespace Google.ProtocolBuffers .Build(); TestXmlNoFields message = TestXmlNoFields.CreateBuilder().MergeFrom(origial.ToByteArray()).Build(); - Assert.AreEqual(0, message.AllFields.Count); + Assert.Equal(0, message.AllFields.Count); StringWriter sw = new StringWriter(); XmlFormatWriter.CreateInstance(sw) @@ -269,9 +273,9 @@ namespace Google.ProtocolBuffers using (XmlReader x = XmlReader.Create(new StringReader(xml))) { x.MoveToContent(); - Assert.AreEqual(XmlNodeType.Element, x.NodeType); + Assert.Equal(XmlNodeType.Element, x.NodeType); //should always be empty - Assert.IsTrue(x.IsEmptyElement || + Assert.True(x.IsEmptyElement || (x.Read() && x.NodeType == XmlNodeType.EndElement) ); } @@ -279,9 +283,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); rdr.Options = XmlReaderOptions.ReadNestedArrays; TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(TestXmlMessage.DefaultInstance, copy); + Assert.Equal(TestXmlMessage.DefaultInstance, copy); } - [TestMethod] + + [Fact] public void TestMessageWithXmlText() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -294,9 +299,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestXmlWithWhitespace() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -309,9 +315,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestXmlWithExtensionText() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -328,9 +335,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestXmlWithExtensionMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -347,9 +355,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestXmlWithExtensionArray() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -368,9 +377,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestXmlWithExtensionEnum() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -387,9 +397,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod] + + [Fact] public void TestXmlReadEmptyRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -402,7 +413,7 @@ namespace Google.ProtocolBuffers reader.ReadMessageEnd(); //manually read the end message '}' } - [TestMethod] + [Fact] public void TestXmlReadEmptyChild() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -411,11 +422,11 @@ namespace Google.ProtocolBuffers reader.ReadMessageStart(); //manually read the begin the message '{' builder.MergeFrom(reader); //write the message normally - Assert.IsTrue(builder.HasText); - Assert.AreEqual(String.Empty, builder.Text); + Assert.True(builder.HasText); + Assert.Equal(String.Empty, builder.Text); } - [TestMethod] + [Fact] public void TestXmlReadWriteWithoutRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -431,7 +442,7 @@ namespace Google.ProtocolBuffers output.Flush(); xml = sw.ToString(); } - Assert.AreEqual("abc123", xml); + Assert.Equal("abc123", xml); TestXmlMessage copy; using (XmlReader xr = XmlReader.Create(new StringReader(xml), new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Fragment })) @@ -440,16 +451,18 @@ namespace Google.ProtocolBuffers copy = TestXmlMessage.CreateBuilder().MergeFrom(input).Build(); } - Assert.AreEqual(message, copy); + Assert.Equal(message, copy); } - [TestMethod, ExpectedException(typeof(RecursionLimitExceededException))] + [Fact] public void TestRecursiveLimit() { StringBuilder sb = new StringBuilder(8192); for (int i = 0; i < 80; i++) + { sb.Append(""); - TestXmlRescursive msg = Extensions.MergeFromXml(new TestXmlRescursive.Builder(), "child", XmlReader.Create(new StringReader(sb.ToString()))).Build(); + } + Assert.Throws(() => Extensions.MergeFromXml(new TestXmlRescursive.Builder(), "child", XmlReader.Create(new StringReader(sb.ToString()))).Build()); } } } diff --git a/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs b/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs index 37a4192a..1e083c6b 100644 --- a/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs +++ b/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs @@ -36,15 +36,11 @@ using System; using System.IO; -using System.Text; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Globalization; -using System.Threading; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class TextFormatTest { private static readonly string AllFieldsSetText = TestResources.text_format_unittest_data; @@ -88,46 +84,46 @@ namespace Google.ProtocolBuffers /// /// Print TestAllTypes and compare with golden file. /// - [TestMethod] + [Fact] public void PrintMessage() { TestUtil.TestInMultipleCultures(() => - { - string text = TextFormat.PrintToString(TestUtil.GetAllSet()); - Assert.AreEqual(AllFieldsSetText.Replace("\r\n", "\n").Trim(), - text.Replace("\r\n", "\n").Trim()); - }); + { + string text = TextFormat.PrintToString(TestUtil.GetAllSet()); + Assert.Equal(AllFieldsSetText.Replace("\r\n", "\n").Trim(), + text.Replace("\r\n", "\n").Trim()); + }); } /// /// Tests that a builder prints the same way as a message. /// - [TestMethod] + [Fact] public void PrintBuilder() { TestUtil.TestInMultipleCultures(() => { string messageText = TextFormat.PrintToString(TestUtil.GetAllSet()); string builderText = TextFormat.PrintToString(TestUtil.GetAllSet().ToBuilder()); - Assert.AreEqual(messageText, builderText); + Assert.Equal(messageText, builderText); }); } /// /// Print TestAllExtensions and compare with golden file. /// - [TestMethod] + [Fact] public void PrintExtensions() { string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet()); - Assert.AreEqual(AllExtensionsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim()); + Assert.Equal(AllExtensionsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim()); } /// /// Test printing of unknown fields in a message. /// - [TestMethod] + [Fact] public void PrintUnknownFields() { TestEmptyMessage message = @@ -163,7 +159,7 @@ namespace Google.ProtocolBuffers .Build()) .Build(); - Assert.AreEqual( + Assert.Equal( "5: 1\n" + "5: 0x00000002\n" + "5: 0x0000000000000003\n" + @@ -193,7 +189,7 @@ namespace Google.ProtocolBuffers return ByteString.CopyFrom(bytes); } - [TestMethod] + [Fact] public void PrintExotic() { IMessage message = TestAllTypes.CreateBuilder() @@ -224,10 +220,10 @@ namespace Google.ProtocolBuffers .AddRepeatedBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\"\u00fe")) .Build(); - Assert.AreEqual(ExoticText, message.ToString()); + Assert.Equal(ExoticText, message.ToString()); } - [TestMethod] + [Fact] public void PrintMessageSet() { TestMessageSet messageSet = @@ -240,12 +236,12 @@ namespace Google.ProtocolBuffers TestMessageSetExtension2.CreateBuilder().SetStr("foo").Build()) .Build(); - Assert.AreEqual(MessageSetText, messageSet.ToString()); + Assert.Equal(MessageSetText, messageSet.ToString()); } // ================================================================= - [TestMethod] + [Fact] public void Parse() { TestUtil.TestInMultipleCultures(() => @@ -256,7 +252,7 @@ namespace Google.ProtocolBuffers }); } - [TestMethod] + [Fact] public void ParseReader() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -264,7 +260,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(builder.Build()); } - [TestMethod] + [Fact] public void ParseExtensions() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -274,7 +270,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(builder.Build()); } - [TestMethod] + [Fact] public void ParseCompatibility() { string original = "repeated_float: inf\n" + @@ -303,10 +299,10 @@ namespace Google.ProtocolBuffers "repeated_double: NaN\n"; TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge(original, builder); - Assert.AreEqual(canonical, builder.Build().ToString()); + Assert.Equal(canonical, builder.Build().ToString()); } - [TestMethod] + [Fact] public void ParseExotic() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -314,10 +310,10 @@ namespace Google.ProtocolBuffers // Too lazy to check things individually. Don't try to debug this // if testPrintExotic() is Assert.Failing. - Assert.AreEqual(ExoticText, builder.Build().ToString()); + Assert.Equal(ExoticText, builder.Build().ToString()); } - [TestMethod] + [Fact] public void ParseMessageSet() { ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); @@ -328,30 +324,30 @@ namespace Google.ProtocolBuffers TextFormat.Merge(MessageSetText, extensionRegistry, builder); TestMessageSet messageSet = builder.Build(); - Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension1.MessageSetExtension)); - Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); - Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension2.MessageSetExtension)); - Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); + Assert.True(messageSet.HasExtension(TestMessageSetExtension1.MessageSetExtension)); + Assert.Equal(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); + Assert.True(messageSet.HasExtension(TestMessageSetExtension2.MessageSetExtension)); + Assert.Equal("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); } - [TestMethod] + [Fact] public void ParseNumericEnum() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge("optional_nested_enum: 2", builder); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum); + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum); } - [TestMethod] + [Fact] public void ParseAngleBrackets() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge("OptionalGroup: < a: 1 >", builder); - Assert.IsTrue(builder.HasOptionalGroup); - Assert.AreEqual(1, builder.OptionalGroup.A); + Assert.True(builder.HasOptionalGroup); + Assert.Equal(1, builder.OptionalGroup.A); } - [TestMethod] + [Fact] public void ParseComment() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -360,26 +356,19 @@ namespace Google.ProtocolBuffers "optional_int32: 1 # another comment\n" + "optional_int64: 2\n" + "# EOF comment", builder); - Assert.AreEqual(1, builder.OptionalInt32); - Assert.AreEqual(2, builder.OptionalInt64); + Assert.Equal(1, builder.OptionalInt32); + Assert.Equal(2, builder.OptionalInt64); } private static void AssertParseError(string error, string text) { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - try - { - TextFormat.Merge(text, TestUtil.CreateExtensionRegistry(), builder); - Assert.Fail("Expected parse exception."); - } - catch (FormatException e) - { - Assert.AreEqual(error, e.Message); - } + Exception exception = Assert.Throws(() => TextFormat.Merge(text, TestUtil.CreateExtensionRegistry(), builder)); + Assert.Equal(error, exception.Message); } - [TestMethod] + [Fact] public void ParseErrors() { AssertParseError( @@ -454,111 +443,96 @@ namespace Google.ProtocolBuffers return ByteString.CopyFrom(bytes); } - private delegate void FormattingAction(); - - private static void AssertFormatException(FormattingAction action) - { - try - { - action(); - Assert.Fail("Should have thrown an exception."); - } - catch (FormatException) - { - // success - } - } - - [TestMethod] + [Fact] public void Escape() { // Escape sequences. - Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", + Assert.Equal("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", TextFormat.EscapeBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""))); - Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", + Assert.Equal("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", TextFormat.EscapeText("\0\u0001\u0007\b\f\n\r\t\v\\\'\"")); - Assert.AreEqual(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""), + Assert.Equal(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""), TextFormat.UnescapeBytes("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); - Assert.AreEqual("\0\u0001\u0007\b\f\n\r\t\v\\\'\"", + Assert.Equal("\0\u0001\u0007\b\f\n\r\t\v\\\'\"", TextFormat.UnescapeText("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); // Unicode handling. - Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeText("\u1234")); - Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeBytes(Bytes(0xe1, 0x88, 0xb4))); - Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\341\\210\\264")); - Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\341\\210\\264")); - Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\xe1\\x88\\xb4")); - Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\xe1\\x88\\xb4")); + Assert.Equal("\\341\\210\\264", TextFormat.EscapeText("\u1234")); + Assert.Equal("\\341\\210\\264", TextFormat.EscapeBytes(Bytes(0xe1, 0x88, 0xb4))); + Assert.Equal("\u1234", TextFormat.UnescapeText("\\341\\210\\264")); + Assert.Equal(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\341\\210\\264")); + Assert.Equal("\u1234", TextFormat.UnescapeText("\\xe1\\x88\\xb4")); + Assert.Equal(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\xe1\\x88\\xb4")); // Errors. - AssertFormatException(() => TextFormat.UnescapeText("\\x")); - AssertFormatException(() => TextFormat.UnescapeText("\\z")); - AssertFormatException(() => TextFormat.UnescapeText("\\")); + Assert.Throws(() => TextFormat.UnescapeText("\\x")); + Assert.Throws(() => TextFormat.UnescapeText("\\z")); + Assert.Throws(() => TextFormat.UnescapeText("\\")); } - [TestMethod] + [Fact] public void ParseInteger() { - Assert.AreEqual(0, TextFormat.ParseInt32("0")); - Assert.AreEqual(1, TextFormat.ParseInt32("1")); - Assert.AreEqual(-1, TextFormat.ParseInt32("-1")); - Assert.AreEqual(12345, TextFormat.ParseInt32("12345")); - Assert.AreEqual(-12345, TextFormat.ParseInt32("-12345")); - Assert.AreEqual(2147483647, TextFormat.ParseInt32("2147483647")); - Assert.AreEqual(-2147483648, TextFormat.ParseInt32("-2147483648")); - - Assert.AreEqual(0u, TextFormat.ParseUInt32("0")); - Assert.AreEqual(1u, TextFormat.ParseUInt32("1")); - Assert.AreEqual(12345u, TextFormat.ParseUInt32("12345")); - Assert.AreEqual(2147483647u, TextFormat.ParseUInt32("2147483647")); - Assert.AreEqual(2147483648U, TextFormat.ParseUInt32("2147483648")); - Assert.AreEqual(4294967295U, TextFormat.ParseUInt32("4294967295")); - - Assert.AreEqual(0L, TextFormat.ParseInt64("0")); - Assert.AreEqual(1L, TextFormat.ParseInt64("1")); - Assert.AreEqual(-1L, TextFormat.ParseInt64("-1")); - Assert.AreEqual(12345L, TextFormat.ParseInt64("12345")); - Assert.AreEqual(-12345L, TextFormat.ParseInt64("-12345")); - Assert.AreEqual(2147483647L, TextFormat.ParseInt64("2147483647")); - Assert.AreEqual(-2147483648L, TextFormat.ParseInt64("-2147483648")); - Assert.AreEqual(4294967295L, TextFormat.ParseInt64("4294967295")); - Assert.AreEqual(4294967296L, TextFormat.ParseInt64("4294967296")); - Assert.AreEqual(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807")); - Assert.AreEqual(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808")); - - Assert.AreEqual(0uL, TextFormat.ParseUInt64("0")); - Assert.AreEqual(1uL, TextFormat.ParseUInt64("1")); - Assert.AreEqual(12345uL, TextFormat.ParseUInt64("12345")); - Assert.AreEqual(2147483647uL, TextFormat.ParseUInt64("2147483647")); - Assert.AreEqual(4294967295uL, TextFormat.ParseUInt64("4294967295")); - Assert.AreEqual(4294967296uL, TextFormat.ParseUInt64("4294967296")); - Assert.AreEqual(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807")); - Assert.AreEqual(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808")); - Assert.AreEqual(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615")); + Assert.Equal(0, TextFormat.ParseInt32("0")); + Assert.Equal(1, TextFormat.ParseInt32("1")); + Assert.Equal(-1, TextFormat.ParseInt32("-1")); + Assert.Equal(12345, TextFormat.ParseInt32("12345")); + Assert.Equal(-12345, TextFormat.ParseInt32("-12345")); + Assert.Equal(2147483647, TextFormat.ParseInt32("2147483647")); + Assert.Equal(-2147483648, TextFormat.ParseInt32("-2147483648")); + + Assert.Equal(0u, TextFormat.ParseUInt32("0")); + Assert.Equal(1u, TextFormat.ParseUInt32("1")); + Assert.Equal(12345u, TextFormat.ParseUInt32("12345")); + Assert.Equal(2147483647u, TextFormat.ParseUInt32("2147483647")); + Assert.Equal(2147483648U, TextFormat.ParseUInt32("2147483648")); + Assert.Equal(4294967295U, TextFormat.ParseUInt32("4294967295")); + + Assert.Equal(0L, TextFormat.ParseInt64("0")); + Assert.Equal(1L, TextFormat.ParseInt64("1")); + Assert.Equal(-1L, TextFormat.ParseInt64("-1")); + Assert.Equal(12345L, TextFormat.ParseInt64("12345")); + Assert.Equal(-12345L, TextFormat.ParseInt64("-12345")); + Assert.Equal(2147483647L, TextFormat.ParseInt64("2147483647")); + Assert.Equal(-2147483648L, TextFormat.ParseInt64("-2147483648")); + Assert.Equal(4294967295L, TextFormat.ParseInt64("4294967295")); + Assert.Equal(4294967296L, TextFormat.ParseInt64("4294967296")); + Assert.Equal(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807")); + Assert.Equal(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808")); + + Assert.Equal(0uL, TextFormat.ParseUInt64("0")); + Assert.Equal(1uL, TextFormat.ParseUInt64("1")); + Assert.Equal(12345uL, TextFormat.ParseUInt64("12345")); + Assert.Equal(2147483647uL, TextFormat.ParseUInt64("2147483647")); + Assert.Equal(4294967295uL, TextFormat.ParseUInt64("4294967295")); + Assert.Equal(4294967296uL, TextFormat.ParseUInt64("4294967296")); + Assert.Equal(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807")); + Assert.Equal(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808")); + Assert.Equal(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615")); // Hex - Assert.AreEqual(0x1234abcd, TextFormat.ParseInt32("0x1234abcd")); - Assert.AreEqual(-0x1234abcd, TextFormat.ParseInt32("-0x1234abcd")); - Assert.AreEqual(0xffffffffffffffffUL, TextFormat.ParseUInt64("0xffffffffffffffff")); - Assert.AreEqual(0x7fffffffffffffffL, + Assert.Equal(0x1234abcd, TextFormat.ParseInt32("0x1234abcd")); + Assert.Equal(-0x1234abcd, TextFormat.ParseInt32("-0x1234abcd")); + Assert.Equal(0xffffffffffffffffUL, TextFormat.ParseUInt64("0xffffffffffffffff")); + Assert.Equal(0x7fffffffffffffffL, TextFormat.ParseInt64("0x7fffffffffffffff")); // Octal - Assert.AreEqual(342391, TextFormat.ParseInt32("01234567")); + Assert.Equal(342391, TextFormat.ParseInt32("01234567")); // Out-of-range - AssertFormatException(() => TextFormat.ParseInt32("2147483648")); - AssertFormatException(() => TextFormat.ParseInt32("-2147483649")); - AssertFormatException(() => TextFormat.ParseUInt32("4294967296")); - AssertFormatException(() => TextFormat.ParseUInt32("-1")); - AssertFormatException(() => TextFormat.ParseInt64("9223372036854775808")); - AssertFormatException(() => TextFormat.ParseInt64("-9223372036854775809")); - AssertFormatException(() => TextFormat.ParseUInt64("18446744073709551616")); - AssertFormatException(() => TextFormat.ParseUInt64("-1")); - AssertFormatException(() => TextFormat.ParseInt32("abcd")); + Assert.Throws(() => TextFormat.ParseInt32("2147483648")); + Assert.Throws(() => TextFormat.ParseInt32("-2147483649")); + Assert.Throws(() => TextFormat.ParseUInt32("4294967296")); + Assert.Throws(() => TextFormat.ParseUInt32("-1")); + Assert.Throws(() => TextFormat.ParseInt64("9223372036854775808")); + Assert.Throws(() => TextFormat.ParseInt64("-9223372036854775809")); + Assert.Throws(() => TextFormat.ParseUInt64("18446744073709551616")); + Assert.Throws(() => TextFormat.ParseUInt64("-1")); + Assert.Throws(() => TextFormat.ParseInt32("abcd")); } - [TestMethod] + [Fact] public void ParseLongString() { string longText = @@ -580,7 +554,7 @@ namespace Google.ProtocolBuffers "123456789012345678901234567890123456789012345678901234567890"; TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge("optional_string: \"" + longText + "\"", builder); - Assert.AreEqual(longText, builder.OptionalString); + Assert.Equal(longText, builder.OptionalString); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs b/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs index b5fc606d..f20ba7cb 100644 --- a/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs +++ b/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs @@ -38,27 +38,25 @@ using System; using System.Collections.Generic; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class UnknownFieldSetTest { - private MessageDescriptor descriptor; - private TestAllTypes allFields; - private ByteString allFieldsData; + private readonly MessageDescriptor descriptor; + private readonly TestAllTypes allFields; + private readonly ByteString allFieldsData; /// /// An empty message that has been parsed from allFieldsData. So, it has /// unknown fields of every type. /// - private TestEmptyMessage emptyMessage; + private readonly TestEmptyMessage emptyMessage; - private UnknownFieldSet unknownFields; + private readonly UnknownFieldSet unknownFields; - [TestInitialize] - public void SetUp() + public UnknownFieldSetTest() { descriptor = TestAllTypes.Descriptor; allFields = TestUtil.GetAllSet(); @@ -70,7 +68,7 @@ namespace Google.ProtocolBuffers private UnknownField GetField(String name) { FieldDescriptor field = descriptor.FindDescriptor(name); - Assert.IsNotNull(field); + Assert.NotNull(field); return unknownFields.FieldDictionary[field.FieldNumber]; } @@ -105,75 +103,75 @@ namespace Google.ProtocolBuffers // ================================================================= - [TestMethod] + [Fact] public void Varint() { UnknownField field = GetField("optional_int32"); - Assert.AreEqual(1, field.VarintList.Count); - Assert.AreEqual(allFields.OptionalInt32, (long) field.VarintList[0]); + Assert.Equal(1, field.VarintList.Count); + Assert.Equal(allFields.OptionalInt32, (long) field.VarintList[0]); } - [TestMethod] + [Fact] public void Fixed32() { UnknownField field = GetField("optional_fixed32"); - Assert.AreEqual(1, field.Fixed32List.Count); - Assert.AreEqual(allFields.OptionalFixed32, (int) field.Fixed32List[0]); + Assert.Equal(1, field.Fixed32List.Count); + Assert.Equal(allFields.OptionalFixed32, (int) field.Fixed32List[0]); } - [TestMethod] + [Fact] public void Fixed64() { UnknownField field = GetField("optional_fixed64"); - Assert.AreEqual(1, field.Fixed64List.Count); - Assert.AreEqual((long)allFields.OptionalFixed64, (long)field.Fixed64List[0]); + Assert.Equal(1, field.Fixed64List.Count); + Assert.Equal((long)allFields.OptionalFixed64, (long)field.Fixed64List[0]); } - [TestMethod] + [Fact] public void LengthDelimited() { UnknownField field = GetField("optional_bytes"); - Assert.AreEqual(1, field.LengthDelimitedList.Count); - Assert.AreEqual(allFields.OptionalBytes, field.LengthDelimitedList[0]); + Assert.Equal(1, field.LengthDelimitedList.Count); + Assert.Equal(allFields.OptionalBytes, field.LengthDelimitedList[0]); } - [TestMethod] + [Fact] public void Group() { FieldDescriptor nestedFieldDescriptor = TestAllTypes.Types.OptionalGroup.Descriptor.FindDescriptor("a"); - Assert.IsNotNull(nestedFieldDescriptor); + Assert.NotNull(nestedFieldDescriptor); UnknownField field = GetField("optionalgroup"); - Assert.AreEqual(1, field.GroupList.Count); + Assert.Equal(1, field.GroupList.Count); UnknownFieldSet group = field.GroupList[0]; - Assert.AreEqual(1, group.FieldDictionary.Count); - Assert.IsTrue(group.HasField(nestedFieldDescriptor.FieldNumber)); + Assert.Equal(1, group.FieldDictionary.Count); + Assert.True(group.HasField(nestedFieldDescriptor.FieldNumber)); UnknownField nestedField = group[nestedFieldDescriptor.FieldNumber]; - Assert.AreEqual(1, nestedField.VarintList.Count); - Assert.AreEqual(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]); + Assert.Equal(1, nestedField.VarintList.Count); + Assert.Equal(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]); } - [TestMethod] + [Fact] public void Serialize() { // Check that serializing the UnknownFieldSet produces the original data again. ByteString data = emptyMessage.ToByteString(); - Assert.AreEqual(allFieldsData, data); + Assert.Equal(allFieldsData, data); } - [TestMethod] + [Fact] public void CopyFrom() { TestEmptyMessage message = TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Build(); - Assert.AreEqual(emptyMessage.ToString(), message.ToString()); + Assert.Equal(emptyMessage.ToString(), message.ToString()); } - [TestMethod] + [Fact] public void MergeFrom() { TestEmptyMessage source = @@ -202,7 +200,7 @@ namespace Google.ProtocolBuffers .MergeFrom(source) .Build(); - Assert.AreEqual( + Assert.Equal( "1: 1\n" + "2: 2\n" + "3: 3\n" + @@ -210,23 +208,23 @@ namespace Google.ProtocolBuffers destination.ToString()); } - [TestMethod] + [Fact] public void Clear() { UnknownFieldSet fields = UnknownFieldSet.CreateBuilder().MergeFrom(unknownFields).Clear().Build(); - Assert.AreEqual(0, fields.FieldDictionary.Count); + Assert.Equal(0, fields.FieldDictionary.Count); } - [TestMethod] + [Fact] public void ClearMessage() { TestEmptyMessage message = TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Clear().Build(); - Assert.AreEqual(0, message.SerializedSize); + Assert.Equal(0, message.SerializedSize); } - [TestMethod] + [Fact] public void ParseKnownAndUnknown() { // Test mixing known and unknown fields when parsing. @@ -241,14 +239,14 @@ namespace Google.ProtocolBuffers TestAllTypes destination = TestAllTypes.ParseFrom(data); TestUtil.AssertAllFieldsSet(destination); - Assert.AreEqual(1, destination.UnknownFields.FieldDictionary.Count); + Assert.Equal(1, destination.UnknownFields.FieldDictionary.Count); UnknownField field = destination.UnknownFields[123456]; - Assert.AreEqual(1, field.VarintList.Count); - Assert.AreEqual(654321, (long) field.VarintList[0]); + Assert.Equal(1, field.VarintList.Count); + Assert.Equal(654321, (long) field.VarintList[0]); } - [TestMethod] + [Fact] public void WrongTypeTreatedAsUnknown() { // Test that fields of the wrong wire type are treated like unknown fields @@ -260,10 +258,10 @@ namespace Google.ProtocolBuffers // All fields should have been interpreted as unknown, so the debug strings // should be the same. - Assert.AreEqual(emptyMessage.ToString(), allTypesMessage.ToString()); + Assert.Equal(emptyMessage.ToString(), allTypesMessage.ToString()); } - [TestMethod] + [Fact] public void UnknownExtensions() { // Make sure fields are properly parsed to the UnknownFieldSet even when @@ -272,12 +270,12 @@ namespace Google.ProtocolBuffers TestEmptyMessageWithExtensions message = TestEmptyMessageWithExtensions.ParseFrom(allFieldsData); - Assert.AreEqual(unknownFields.FieldDictionary.Count, + Assert.Equal(unknownFields.FieldDictionary.Count, message.UnknownFields.FieldDictionary.Count); - Assert.AreEqual(allFieldsData, message.ToByteString()); + Assert.Equal(allFieldsData, message.ToByteString()); } - [TestMethod] + [Fact] public void WrongExtensionTypeTreatedAsUnknown() { // Test that fields of the wrong wire type are treated like unknown fields @@ -289,19 +287,19 @@ namespace Google.ProtocolBuffers // All fields should have been interpreted as unknown, so the debug strings // should be the same. - Assert.AreEqual(emptyMessage.ToString(), + Assert.Equal(emptyMessage.ToString(), allExtensionsMessage.ToString()); } - [TestMethod] + [Fact] public void ParseUnknownEnumValue() { FieldDescriptor singularField = TestAllTypes.Descriptor.FindDescriptor("optional_nested_enum"); FieldDescriptor repeatedField = TestAllTypes.Descriptor.FindDescriptor("repeated_nested_enum"); - Assert.IsNotNull(singularField); - Assert.IsNotNull(repeatedField); + Assert.NotNull(singularField); + Assert.NotNull(repeatedField); ByteString data = UnknownFieldSet.CreateBuilder() @@ -322,7 +320,7 @@ namespace Google.ProtocolBuffers { TestAllTypes message = TestAllTypes.ParseFrom(data); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.OptionalNestedEnum); TestUtil.AssertEqual(new[] {TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ}, message.RepeatedNestedEnumList); @@ -333,7 +331,7 @@ namespace Google.ProtocolBuffers { TestAllExtensions message = TestAllExtensions.ParseFrom(data, TestUtil.CreateExtensionRegistry()); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, + Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.OptionalNestedEnumExtension)); TestUtil.AssertEqual(new[] {TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ}, message.GetExtension(Unittest.RepeatedNestedEnumExtension)); @@ -342,7 +340,7 @@ namespace Google.ProtocolBuffers } } - [TestMethod] + [Fact] public void LargeVarint() { ByteString data = @@ -355,11 +353,11 @@ namespace Google.ProtocolBuffers .ToByteString(); UnknownFieldSet parsed = UnknownFieldSet.ParseFrom(data); UnknownField field = parsed[1]; - Assert.AreEqual(1, field.VarintList.Count); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]); + Assert.Equal(1, field.VarintList.Count); + Assert.Equal(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]); } - [TestMethod] + [Fact] public void EqualsAndHashCode() { UnknownField fixed32Field = UnknownField.CreateBuilder().AddFixed32(1).Build(); @@ -407,10 +405,10 @@ namespace Google.ProtocolBuffers private static void CheckNotEqual(UnknownFieldSet s1, UnknownFieldSet s2) { String equalsError = string.Format("{0} should not be equal to {1}", s1, s2); - Assert.IsFalse(s1.Equals(s2), equalsError); - Assert.IsFalse(s2.Equals(s1), equalsError); + Assert.False(s1.Equals(s2), equalsError); + Assert.False(s2.Equals(s1), equalsError); - Assert.IsFalse(s1.GetHashCode() == s2.GetHashCode(), + Assert.False(s1.GetHashCode() == s2.GetHashCode(), string.Format("{0} should have a different hash code from {1}", s1, s2)); } @@ -421,13 +419,13 @@ namespace Google.ProtocolBuffers private static void CheckEqualsIsConsistent(UnknownFieldSet set) { // Object should be equal to itself. - Assert.AreEqual(set, set); + Assert.Equal(set, set); // Object should be equal to a copy of itself. UnknownFieldSet copy = UnknownFieldSet.CreateBuilder(set).Build(); - Assert.AreEqual(set, copy); - Assert.AreEqual(copy, set); - Assert.AreEqual(set.GetHashCode(), copy.GetHashCode()); + Assert.Equal(set, copy); + Assert.Equal(copy, set); + Assert.Equal(set.GetHashCode(), copy.GetHashCode()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs b/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs index 05241965..12a9d236 100644 --- a/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs +++ b/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs @@ -38,17 +38,16 @@ using System.IO; using System.Reflection; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class WireFormatTest { /// /// Keeps the attributes on FieldType and the switch statement in WireFormat in sync. /// - [TestMethod] + [Fact] public void FieldTypeToWireTypeMapping() { foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) @@ -56,34 +55,34 @@ namespace Google.ProtocolBuffers FieldType fieldType = (FieldType) field.GetValue(null); FieldMappingAttribute mapping = (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0]; - Assert.AreEqual(mapping.WireType, WireFormat.GetWireType(fieldType)); + Assert.Equal(mapping.WireType, WireFormat.GetWireType(fieldType)); } } - [TestMethod] + [Fact] public void Serialization() { TestAllTypes message = TestUtil.GetAllSet(); ByteString rawBytes = message.ToByteString(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); + Assert.Equal(rawBytes.Length, message.SerializedSize); TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); TestUtil.AssertAllFieldsSet(message2); } - [TestMethod] + [Fact] public void SerializationPacked() { TestPackedTypes message = TestUtil.GetPackedSet(); ByteString rawBytes = message.ToByteString(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); + Assert.Equal(rawBytes.Length, message.SerializedSize); TestPackedTypes message2 = TestPackedTypes.ParseFrom(rawBytes); TestUtil.AssertPackedFieldsSet(message2); } - [TestMethod] + [Fact] public void SerializeExtensions() { // TestAllTypes and TestAllExtensions should have compatible wire formats, @@ -91,14 +90,14 @@ namespace Google.ProtocolBuffers // it should work. TestAllExtensions message = TestUtil.GetAllExtensionsSet(); ByteString rawBytes = message.ToByteString(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); + Assert.Equal(rawBytes.Length, message.SerializedSize); TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); TestUtil.AssertAllFieldsSet(message2); } - [TestMethod] + [Fact] public void SerializePackedExtensions() { // TestPackedTypes and TestPackedExtensions should have compatible wire @@ -109,10 +108,10 @@ namespace Google.ProtocolBuffers TestPackedTypes message2 = TestUtil.GetPackedSet(); ByteString rawBytes2 = message2.ToByteString(); - Assert.AreEqual(rawBytes, rawBytes2); + Assert.Equal(rawBytes, rawBytes2); } - [TestMethod] + [Fact] public void SerializeDelimited() { MemoryStream stream = new MemoryStream(); @@ -124,13 +123,13 @@ namespace Google.ProtocolBuffers stream.Position = 0; TestUtil.AssertAllFieldsSet(TestAllTypes.ParseDelimitedFrom(stream)); - Assert.AreEqual(12, stream.ReadByte()); + Assert.Equal(12, stream.ReadByte()); TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseDelimitedFrom(stream)); - Assert.AreEqual(34, stream.ReadByte()); - Assert.AreEqual(-1, stream.ReadByte()); + Assert.Equal(34, stream.ReadByte()); + Assert.Equal(-1, stream.ReadByte()); } - [TestMethod] + [Fact] public void ParseExtensions() { // TestAllTypes and TestAllExtensions should have compatible wire formats, @@ -149,7 +148,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(message2); } - [TestMethod] + [Fact] public void ParsePackedExtensions() { // Ensure that packed extensions can be properly parsed. @@ -162,10 +161,10 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedExtensionsSet(message2); } - [TestMethod] + [Fact] public void ExtensionsSerializedSize() { - Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize); + Assert.Equal(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize); } private static void AssertFieldsInOrder(ByteString data) @@ -177,13 +176,13 @@ namespace Google.ProtocolBuffers string name; while (input.ReadTag(out tag, out name)) { - Assert.IsTrue(tag > previousTag); + Assert.True(tag > previousTag); previousTag = tag; input.SkipField(); } } - [TestMethod] + [Fact] public void InterleavedFieldsAndExtensions() { // Tests that fields are written in order even when extension ranges @@ -214,7 +213,7 @@ namespace Google.ProtocolBuffers private static readonly int TypeId1 = TestMessageSetExtension1.Descriptor.Extensions[0].FieldNumber; private static readonly int TypeId2 = TestMessageSetExtension2.Descriptor.Extensions[0].FieldNumber; - [TestMethod] + [Fact] public void SerializeMessageSet() { // Set up a TestMessageSet with two known messages and an unknown one. @@ -240,23 +239,23 @@ namespace Google.ProtocolBuffers // Parse back using RawMessageSet and check the contents. RawMessageSet raw = RawMessageSet.ParseFrom(data); - Assert.AreEqual(0, raw.UnknownFields.FieldDictionary.Count); + Assert.Equal(0, raw.UnknownFields.FieldDictionary.Count); - Assert.AreEqual(3, raw.ItemCount); - Assert.AreEqual(TypeId1, raw.ItemList[0].TypeId); - Assert.AreEqual(TypeId2, raw.ItemList[1].TypeId); - Assert.AreEqual(UnknownTypeId, raw.ItemList[2].TypeId); + Assert.Equal(3, raw.ItemCount); + Assert.Equal(TypeId1, raw.ItemList[0].TypeId); + Assert.Equal(TypeId2, raw.ItemList[1].TypeId); + Assert.Equal(UnknownTypeId, raw.ItemList[2].TypeId); TestMessageSetExtension1 message1 = TestMessageSetExtension1.ParseFrom(raw.GetItem(0).Message.ToByteArray()); - Assert.AreEqual(123, message1.I); + Assert.Equal(123, message1.I); TestMessageSetExtension2 message2 = TestMessageSetExtension2.ParseFrom(raw.GetItem(1).Message.ToByteArray()); - Assert.AreEqual("foo", message2.Str); + Assert.Equal("foo", message2.Str); - Assert.AreEqual("bar", raw.GetItem(2).Message.ToStringUtf8()); + Assert.Equal("bar", raw.GetItem(2).Message.ToStringUtf8()); } - [TestMethod] + [Fact] public void ParseMessageSet() { ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); @@ -295,18 +294,18 @@ namespace Google.ProtocolBuffers TestMessageSet messageSet = TestMessageSet.ParseFrom(data, extensionRegistry); - Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); - Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); + Assert.Equal(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); + Assert.Equal("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); // Check for unknown field with type LENGTH_DELIMITED, // number UNKNOWN_TYPE_ID, and contents "bar". UnknownFieldSet unknownFields = messageSet.UnknownFields; - Assert.AreEqual(1, unknownFields.FieldDictionary.Count); - Assert.IsTrue(unknownFields.HasField(UnknownTypeId)); + Assert.Equal(1, unknownFields.FieldDictionary.Count); + Assert.True(unknownFields.HasField(UnknownTypeId)); UnknownField field = unknownFields[UnknownTypeId]; - Assert.AreEqual(1, field.LengthDelimitedList.Count); - Assert.AreEqual("bar", field.LengthDelimitedList[0].ToStringUtf8()); + Assert.Equal(1, field.LengthDelimitedList.Count); + Assert.Equal("bar", field.LengthDelimitedList[0].ToStringUtf8()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/packages.config b/csharp/src/ProtocolBuffers.Test/packages.config new file mode 100644 index 00000000..6f1fb7f5 --- /dev/null +++ b/csharp/src/ProtocolBuffers.Test/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs index f3a7789e..e0199202 100644 --- a/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs @@ -34,19 +34,15 @@ #endregion -using System; -using System.Collections.Generic; using System.IO; -using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class AbstractBuilderLiteTest { - [TestMethod] + [Fact] public void TestMergeFromCodedInputStream() { TestAllTypesLite copy, @@ -54,7 +50,7 @@ namespace Google.ProtocolBuffers .SetOptionalUint32(uint.MaxValue).Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); using (MemoryStream ms = new MemoryStream(msg.ToByteArray())) { @@ -62,22 +58,22 @@ namespace Google.ProtocolBuffers copy = copy.ToBuilder().MergeFrom(ci).Build(); } - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakClear() { TestAllTypesLite copy, msg = TestAllTypesLite.DefaultInstance; copy = msg.ToBuilder().SetOptionalString("Should be removed.").Build(); - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakClear().WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestBuilderLiteMergeFromCodedInputStream() { TestAllTypesLite copy, @@ -85,14 +81,14 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = copy.ToBuilder().MergeFrom(CodedInputStream.CreateInstance(new MemoryStream(msg.ToByteArray()))).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestBuilderLiteMergeDelimitedFrom() { TestAllTypesLite copy, @@ -100,15 +96,15 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteDelimitedTo(s); s.Position = 0; copy = copy.ToBuilder().MergeDelimitedFrom(s).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestBuilderLiteMergeDelimitedFromExtensions() { TestAllExtensionsLite copy, @@ -117,7 +113,7 @@ namespace Google.ProtocolBuffers "Should be merged.").Build(); copy = TestAllExtensionsLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteDelimitedTo(s); @@ -127,11 +123,11 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = copy.ToBuilder().MergeDelimitedFrom(s, registry).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); } - [TestMethod] + [Fact] public void TestBuilderLiteMergeFromStream() { TestAllTypesLite copy, @@ -139,15 +135,15 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteTo(s); s.Position = 0; copy = copy.ToBuilder().MergeFrom(s).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestBuilderLiteMergeFromStreamExtensions() { TestAllExtensionsLite copy, @@ -156,7 +152,7 @@ namespace Google.ProtocolBuffers "Should be merged.").Build(); copy = TestAllExtensionsLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteTo(s); @@ -166,11 +162,11 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = copy.ToBuilder().MergeFrom(s, registry).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakMergeFromIMessageLite() { TestAllTypesLite copy, @@ -178,13 +174,13 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom((IMessageLite) msg).WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakMergeFromByteString() { TestAllTypesLite copy, @@ -192,13 +188,13 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString()).WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakMergeFromByteStringExtensions() { TestAllExtensionsLite copy, @@ -207,12 +203,12 @@ namespace Google.ProtocolBuffers "Should be merged.").Build(); copy = TestAllExtensionsLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllExtensionsLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), ExtensionRegistry.Empty).WeakBuild(); - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestLite.RegisterAllExtensions(registry); @@ -220,11 +216,11 @@ namespace Google.ProtocolBuffers copy = (TestAllExtensionsLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), registry).WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakMergeFromCodedInputStream() { TestAllTypesLite copy, @@ -232,7 +228,7 @@ namespace Google.ProtocolBuffers .SetOptionalUint32(uint.MaxValue).Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); using (MemoryStream ms = new MemoryStream(msg.ToByteArray())) { @@ -240,58 +236,58 @@ namespace Google.ProtocolBuffers copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(ci).WeakBuild(); } - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakBuildPartial() { IBuilderLite builder = TestRequiredLite.CreateBuilder(); - Assert.IsFalse(builder.IsInitialized); + Assert.False(builder.IsInitialized); IMessageLite msg = builder.WeakBuildPartial(); - Assert.IsFalse(msg.IsInitialized); + Assert.False(msg.IsInitialized); - TestUtil.AssertBytesEqual(msg.ToByteArray(), TestRequiredLite.DefaultInstance.ToByteArray()); + Assert.Equal(msg.ToByteArray(), TestRequiredLite.DefaultInstance.ToByteArray()); } - [TestMethod, ExpectedException(typeof(UninitializedMessageException))] + [Fact] public void TestIBuilderLiteWeakBuildUninitialized() { IBuilderLite builder = TestRequiredLite.CreateBuilder(); - Assert.IsFalse(builder.IsInitialized); - builder.WeakBuild(); + Assert.False(builder.IsInitialized); + Assert.Throws(() => builder.WeakBuild()); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakBuild() { IBuilderLite builder = TestRequiredLite.CreateBuilder() .SetD(0) .SetEn(ExtraEnum.EXLITE_BAZ); - Assert.IsTrue(builder.IsInitialized); + Assert.True(builder.IsInitialized); builder.WeakBuild(); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakClone() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() .SetD(1).SetEn(ExtraEnum.EXLITE_BAR).Build(); - Assert.IsTrue(msg.IsInitialized); + Assert.True(msg.IsInitialized); IMessageLite copy = ((IBuilderLite) msg.ToBuilder()).WeakClone().WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestIBuilderLiteWeakDefaultInstance() { - Assert.IsTrue(ReferenceEquals(TestRequiredLite.DefaultInstance, + Assert.True(ReferenceEquals(TestRequiredLite.DefaultInstance, ((IBuilderLite) TestRequiredLite.CreateBuilder()).WeakDefaultInstanceForType)); } - [TestMethod] + [Fact] public void TestGeneratedBuilderLiteAddRange() { TestAllTypesLite copy, @@ -303,11 +299,11 @@ namespace Google.ProtocolBuffers .Build(); copy = msg.DefaultInstanceForType.ToBuilder().MergeFrom(msg).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } // ROK 5/7/2013 Issue #54: should retire all bytes in buffer (bufferSize) - [TestMethod] + [Fact] public void TestBufferRefillIssue() { var ms = new MemoryStream(); @@ -326,15 +322,15 @@ namespace Google.ProtocolBuffers var input = CodedInputStream.CreateInstance(ms); var builder = BucketOfBytes.CreateBuilder(); input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.AreEqual(3005L, input.Position); - Assert.AreEqual(3000, builder.Value.Length); + Assert.Equal(3005L, input.Position); + Assert.Equal(3000, builder.Value.Length); input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.AreEqual(5114, input.Position); - Assert.AreEqual(1000, builder.Value.Length); + Assert.Equal(5114, input.Position); + Assert.Equal(1000, builder.Value.Length); input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.AreEqual(5217L, input.Position); - Assert.AreEqual(input.Position, ms.Length); - Assert.AreEqual(100, builder.Value.Length); + Assert.Equal(5217L, input.Position); + Assert.Equal(input.Position, ms.Length); + Assert.Equal(100, builder.Value.Length); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs index bead60fb..f6a4e94b 100644 --- a/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs @@ -35,18 +35,15 @@ #endregion using System; -using System.Collections.Generic; using System.IO; -using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class AbstractMessageLiteTest { - [TestMethod] + [Fact] public void TestMessageLiteToByteString() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -55,14 +52,14 @@ namespace Google.ProtocolBuffers .Build(); ByteString b = msg.ToByteString(); - Assert.AreEqual(4, b.Length); - Assert.AreEqual(TestRequiredLite.DFieldNumber << 3, b[0]); - Assert.AreEqual(42, b[1]); - Assert.AreEqual(TestRequiredLite.EnFieldNumber << 3, b[2]); - Assert.AreEqual((int) ExtraEnum.EXLITE_BAZ, b[3]); + Assert.Equal(4, b.Length); + Assert.Equal(TestRequiredLite.DFieldNumber << 3, b[0]); + Assert.Equal(42, b[1]); + Assert.Equal(TestRequiredLite.EnFieldNumber << 3, b[2]); + Assert.Equal((int) ExtraEnum.EXLITE_BAZ, b[3]); } - [TestMethod] + [Fact] public void TestMessageLiteToByteArray() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -72,10 +69,10 @@ namespace Google.ProtocolBuffers ByteString b = msg.ToByteString(); ByteString copy = ByteString.CopyFrom(msg.ToByteArray()); - Assert.AreEqual(b, copy); + Assert.Equal(b, copy); } - [TestMethod] + [Fact] public void TestMessageLiteWriteTo() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -85,10 +82,10 @@ namespace Google.ProtocolBuffers MemoryStream ms = new MemoryStream(); msg.WriteTo(ms); - TestUtil.AssertBytesEqual(msg.ToByteArray(), ms.ToArray()); + Assert.Equal(msg.ToByteArray(), ms.ToArray()); } - [TestMethod] + [Fact] public void TestMessageLiteWriteDelimitedTo() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -100,21 +97,21 @@ namespace Google.ProtocolBuffers msg.WriteDelimitedTo(ms); byte[] buffer = ms.ToArray(); - Assert.AreEqual(5, buffer.Length); - Assert.AreEqual(4, buffer[0]); + Assert.Equal(5, buffer.Length); + Assert.Equal(4, buffer[0]); byte[] msgBytes = new byte[4]; Array.Copy(buffer, 1, msgBytes, 0, 4); - TestUtil.AssertBytesEqual(msg.ToByteArray(), msgBytes); + Assert.Equal(msg.ToByteArray(), msgBytes); } - [TestMethod] + [Fact] public void TestIMessageLiteWeakCreateBuilderForType() { IMessageLite msg = TestRequiredLite.DefaultInstance; - Assert.AreEqual(typeof(TestRequiredLite.Builder), msg.WeakCreateBuilderForType().GetType()); + Assert.Equal(typeof(TestRequiredLite.Builder), msg.WeakCreateBuilderForType().GetType()); } - [TestMethod] + [Fact] public void TestMessageLiteWeakToBuilder() { IMessageLite msg = TestRequiredLite.CreateBuilder() @@ -123,14 +120,14 @@ namespace Google.ProtocolBuffers .Build(); IMessageLite copy = msg.WeakToBuilder().WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestMessageLiteWeakDefaultInstanceForType() { IMessageLite msg = TestRequiredLite.DefaultInstance; - Assert.IsTrue(Object.ReferenceEquals(TestRequiredLite.DefaultInstance, msg.WeakDefaultInstanceForType)); + Assert.True(Object.ReferenceEquals(TestRequiredLite.DefaultInstance, msg.WeakDefaultInstanceForType)); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs index 0430c4a1..5377ea6a 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs @@ -35,34 +35,31 @@ #endregion using System; -using System.Collections; using System.Collections.Generic; -using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class ExtendableBuilderLiteTest { - [TestMethod] + [Fact] public void TestHasExtensionT() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnittestLite.OptionalInt32ExtensionLite, 123); - Assert.IsTrue(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.True(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestHasExtensionTMissing() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.IsFalse(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.False(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestGetExtensionCountT() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -70,41 +67,41 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 2) .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 3); - Assert.AreEqual(3, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(3, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestGetExtensionCountTEmpty() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestGetExtensionTNull() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); string value = builder.GetExtension(UnittestLite.OptionalStringExtensionLite); - Assert.IsNull(value); + Assert.Null(value); } - [TestMethod] + [Fact] public void TestGetExtensionTValue() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnittestLite.OptionalInt32ExtensionLite, 3); - Assert.AreEqual(3, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.Equal(3, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestGetExtensionTEmpty() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.AreEqual(0, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite).Count); + Assert.Equal(0, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite).Count); } - [TestMethod] + [Fact] public void TestGetExtensionTList() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -113,10 +110,10 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 3); IList values = builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite); - Assert.AreEqual(3, values.Count); + Assert.Equal(3, values.Count); } - [TestMethod] + [Fact] public void TestGetExtensionTIndex() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -125,17 +122,17 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 2); for (int i = 0; i < 3; i++) - Assert.AreEqual(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); + Assert.Equal(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); } - [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] + [Fact] public void TestGetExtensionTIndexOutOfRange() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); + Assert.Throws(() => builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); } - [TestMethod] + [Fact] public void TestSetExtensionTIndex() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -144,107 +141,107 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 2); for (int i = 0; i < 3; i++) - Assert.AreEqual(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); + Assert.Equal(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0, 5); builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 1, 6); builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 2, 7); for (int i = 0; i < 3; i++) - Assert.AreEqual(5 + i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); + Assert.Equal(5 + i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); } - [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] + [Fact] public void TestSetExtensionTIndexOutOfRange() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0, -1); + Assert.Throws(() => builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0, -1)); } - [TestMethod] + [Fact] public void TestClearExtensionTList() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); builder.ClearExtension(UnittestLite.RepeatedInt32ExtensionLite); - Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestClearExtensionTValue() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnittestLite.OptionalInt32ExtensionLite, 0); - Assert.IsTrue(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.True(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); builder.ClearExtension(UnittestLite.OptionalInt32ExtensionLite); - Assert.IsFalse(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.False(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestIndexedByDescriptor() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.IsFalse(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.False(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); builder[UnittestLite.OptionalInt32ExtensionLite.Descriptor] = 123; - Assert.IsTrue(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.AreEqual(123, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.True(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.Equal(123, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestIndexedByDescriptorAndOrdinal() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; builder[f, 0] = 123; - Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); - Assert.AreEqual(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); + Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); } - [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] + [Fact] public void TestIndexedByDescriptorAndOrdinalOutOfRange() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; - builder[f, 0] = 123; + Assert.Throws(() => builder[f, 0] = 123); } - [TestMethod] + [Fact] public void TestClearFieldByDescriptor() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; builder.ClearField(f); - Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [TestMethod] + [Fact] public void TestAddRepeatedFieldByDescriptor() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; builder.AddRepeatedField(f, 123); - Assert.AreEqual(2, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); - Assert.AreEqual(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 1)); + Assert.Equal(2, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.Equal(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 1)); } - [TestMethod] + [Fact] public void TestMissingExtensionsLite() { const int optionalInt32 = 12345678; @@ -255,21 +252,21 @@ namespace Google.ProtocolBuffers builder.AddExtension(UnittestLite.RepeatedDoubleExtensionLite, 1.3); TestAllExtensionsLite msg = builder.Build(); - Assert.IsTrue(msg.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.AreEqual(3, msg.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); + Assert.True(msg.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.Equal(3, msg.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); byte[] bits = msg.ToByteArray(); TestAllExtensionsLite copy = TestAllExtensionsLite.ParseFrom(bits); - Assert.IsFalse(copy.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.AreEqual(0, copy.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); - Assert.AreNotEqual(msg, copy); + Assert.False(copy.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.Equal(0, copy.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); + Assert.NotEqual(msg, copy); //The lite runtime removes all unknown fields and extensions byte[] copybits = copy.ToByteArray(); - Assert.AreEqual(0, copybits.Length); + Assert.Equal(0, copybits.Length); } - [TestMethod] + [Fact] public void TestMissingFieldsLite() { TestAllTypesLite msg = TestAllTypesLite.CreateBuilder() @@ -278,12 +275,14 @@ namespace Google.ProtocolBuffers .Build(); byte[] bits = msg.ToByteArray(); - TestAllExtensionsLite copy = TestAllExtensionsLite.ParseFrom(bits); - Assert.AreNotEqual(msg, copy); + IMessageLite copy = TestAllExtensionsLite.ParseFrom(bits); + // Use explicit call to Equals to avoid xUnit checking for type equality. + Assert.False(msg.Equals(copy)); + Assert.False(copy.Equals(msg)); //The lite runtime removes all unknown fields and extensions byte[] copybits = copy.ToByteArray(); - Assert.AreEqual(0, copybits.Length); + Assert.Equal(0, copybits.Length); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs index b31fb754..78127445 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs @@ -39,11 +39,10 @@ using System.Collections.Generic; using System.Text; using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class ExtendableMessageLiteTest { //The lite framework does not make this assertion @@ -55,7 +54,7 @@ namespace Google.ProtocolBuffers // ForeignMessageLite.DefaultInstance; //} - [TestMethod] + [Fact] public void ExtensionWriterTestMessages() { TestAllExtensionsLite.Builder b = TestAllExtensionsLite.CreateBuilder().SetExtension( @@ -67,20 +66,20 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void ExtensionWriterIsInitialized() { - Assert.IsTrue(ForeignMessageLite.DefaultInstance.IsInitialized); - Assert.IsTrue(TestPackedExtensionsLite.CreateBuilder().IsInitialized); - Assert.IsTrue(TestAllExtensionsLite.CreateBuilder().SetExtension( + Assert.True(ForeignMessageLite.DefaultInstance.IsInitialized); + Assert.True(TestPackedExtensionsLite.CreateBuilder().IsInitialized); + Assert.True(TestAllExtensionsLite.CreateBuilder().SetExtension( UnittestLite.OptionalForeignMessageExtensionLite, ForeignMessageLite.DefaultInstance) .IsInitialized); } - [TestMethod] + [Fact] public void ExtensionWriterTestSetExtensionLists() { TestAllExtensionsLite msg, copy; @@ -96,13 +95,13 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_FOO, + Assert.Equal(ForeignEnumLite.FOREIGN_LITE_FOO, copy.GetExtension(UnittestLite.RepeatedForeignEnumExtensionLite, 1)); } - [TestMethod] + [Fact] public void ExtensionWriterTest() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -181,82 +180,82 @@ namespace Google.ProtocolBuffers TestAllExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry); TestAllExtensionsLite copy = copyBuilder.Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual(true, copy.GetExtension(UnittestLite.DefaultBoolExtensionLite)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), + Assert.Equal(true, copy.GetExtension(UnittestLite.DefaultBoolExtensionLite)); + Assert.Equal(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnittestLite.DefaultBytesExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.DefaultCordExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultDoubleExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultFixed32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultFixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultFloatExtensionLite)); - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, + Assert.Equal("123", copy.GetExtension(UnittestLite.DefaultCordExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultDoubleExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultFixed32ExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultFixed64ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultFloatExtensionLite)); + Assert.Equal(ForeignEnumLite.FOREIGN_LITE_BAZ, copy.GetExtension(UnittestLite.DefaultForeignEnumExtensionLite)); - Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, + Assert.Equal(ImportEnumLite.IMPORT_LITE_BAZ, copy.GetExtension(UnittestLite.DefaultImportEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultInt32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultInt64ExtensionLite)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultInt32ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultInt64ExtensionLite)); + Assert.Equal(TestAllTypesLite.Types.NestedEnum.FOO, copy.GetExtension(UnittestLite.DefaultNestedEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSfixed32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSfixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSint32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSint64ExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.DefaultStringExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.DefaultStringPieceExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultUint32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultUint64ExtensionLite)); - - Assert.AreEqual(true, copy.GetExtension(UnittestLite.OptionalBoolExtensionLite)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSfixed32ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSfixed64ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSint32ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSint64ExtensionLite)); + Assert.Equal("123", copy.GetExtension(UnittestLite.DefaultStringExtensionLite)); + Assert.Equal("123", copy.GetExtension(UnittestLite.DefaultStringPieceExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultUint32ExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultUint64ExtensionLite)); + + Assert.Equal(true, copy.GetExtension(UnittestLite.OptionalBoolExtensionLite)); + Assert.Equal(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnittestLite.OptionalBytesExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.OptionalCordExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalDoubleExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalFixed32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalFixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalFloatExtensionLite)); - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, + Assert.Equal("123", copy.GetExtension(UnittestLite.OptionalCordExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalDoubleExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalFixed32ExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalFixed64ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalFloatExtensionLite)); + Assert.Equal(ForeignEnumLite.FOREIGN_LITE_BAZ, copy.GetExtension(UnittestLite.OptionalForeignEnumExtensionLite)); - Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, + Assert.Equal(ImportEnumLite.IMPORT_LITE_BAZ, copy.GetExtension(UnittestLite.OptionalImportEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalInt64ExtensionLite)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalInt64ExtensionLite)); + Assert.Equal(TestAllTypesLite.Types.NestedEnum.FOO, copy.GetExtension(UnittestLite.OptionalNestedEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSfixed32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSfixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSint32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSint64ExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.OptionalStringPieceExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalUint32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalUint64ExtensionLite)); - - Assert.AreEqual(true, copy.GetExtension(UnittestLite.RepeatedBoolExtensionLite, 0)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSfixed32ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSfixed64ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSint32ExtensionLite)); + Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSint64ExtensionLite)); + Assert.Equal("123", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.Equal("123", copy.GetExtension(UnittestLite.OptionalStringPieceExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalUint32ExtensionLite)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalUint64ExtensionLite)); + + Assert.Equal(true, copy.GetExtension(UnittestLite.RepeatedBoolExtensionLite, 0)); + Assert.Equal(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnittestLite.RepeatedBytesExtensionLite, 0)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.RepeatedCordExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedDoubleExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedFixed32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedFixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedFloatExtensionLite, 0)); - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, + Assert.Equal("123", copy.GetExtension(UnittestLite.RepeatedCordExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedDoubleExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedFixed32ExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedFixed64ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedFloatExtensionLite, 0)); + Assert.Equal(ForeignEnumLite.FOREIGN_LITE_BAZ, copy.GetExtension(UnittestLite.RepeatedForeignEnumExtensionLite, 0)); - Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, + Assert.Equal(ImportEnumLite.IMPORT_LITE_BAZ, copy.GetExtension(UnittestLite.RepeatedImportEnumExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedInt64ExtensionLite, 0)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedInt64ExtensionLite, 0)); + Assert.Equal(TestAllTypesLite.Types.NestedEnum.FOO, copy.GetExtension(UnittestLite.RepeatedNestedEnumExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSfixed32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSfixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSint32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSint64ExtensionLite, 0)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.RepeatedStringExtensionLite, 0)); - Assert.AreEqual("123", copy.GetExtension(UnittestLite.RepeatedStringPieceExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedUint32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedUint64ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSfixed32ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSfixed64ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSint32ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSint64ExtensionLite, 0)); + Assert.Equal("123", copy.GetExtension(UnittestLite.RepeatedStringExtensionLite, 0)); + Assert.Equal("123", copy.GetExtension(UnittestLite.RepeatedStringPieceExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedUint32ExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedUint64ExtensionLite, 0)); } private TestPackedExtensionsLite BuildPackedExtensions() @@ -295,36 +294,36 @@ namespace Google.ProtocolBuffers private void AssertPackedExtensions(TestPackedExtensionsLite copy) { - Assert.AreEqual(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 0)); - - Assert.AreEqual(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 1)); + Assert.Equal(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 0)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 0)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 0)); + + Assert.Equal(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 1)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 1)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 1)); + Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 1)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 1)); + Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 1)); } - [TestMethod] + [Fact] public void ExtensionWriterTestPacked() { TestPackedExtensionsLite msg = BuildPackedExtensions(); @@ -336,12 +335,12 @@ namespace Google.ProtocolBuffers TestPackedExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry); TestPackedExtensionsLite copy = copyBuilder.Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); AssertPackedExtensions(copy); } - [TestMethod] + [Fact] public void TestUnpackedAndPackedExtensions() { TestPackedExtensionsLite original = BuildPackedExtensions(); @@ -355,19 +354,19 @@ namespace Google.ProtocolBuffers TestPackedExtensionsLite packed = TestPackedExtensionsLite.ParseFrom(unpacked.ToByteArray(), registry); - Assert.AreEqual(original, packed); - TestUtil.AssertBytesEqual(original.ToByteArray(), packed.ToByteArray()); + Assert.Equal(original, packed); + Assert.Equal(original.ToByteArray(), packed.ToByteArray()); AssertPackedExtensions(packed); } - [TestMethod] + [Fact] public void TestUnpackedFromPackedInput() { byte[] packedData = BuildPackedExtensions().ToByteArray(); TestUnpackedTypesLite unpacked = TestUnpackedTypesLite.ParseFrom(packedData); TestPackedTypesLite packed = TestPackedTypesLite.ParseFrom(unpacked.ToByteArray()); - TestUtil.AssertBytesEqual(packedData, packed.ToByteArray()); + Assert.Equal(packedData, packed.ToByteArray()); unpacked = TestUnpackedTypesLite.ParseFrom(packed.ToByteArray()); diff --git a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs index 0640a445..7feb0448 100644 --- a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs @@ -35,31 +35,28 @@ #endregion using System; -using System.Collections.Generic; -using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class InteropLiteTest { - [TestMethod] + [Fact] public void TestConvertFromFullMinimal() { TestInteropPerson person = TestInteropPerson.CreateBuilder() .SetId(123) .SetName("abc") .Build(); - Assert.IsTrue(person.IsInitialized); + Assert.True(person.IsInitialized); TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray()); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); + Assert.Equal(person.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestConvertFromFullComplete() { TestInteropPerson person = TestInteropPerson.CreateBuilder() @@ -75,7 +72,7 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasFull.EmployeeId, TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.IsTrue(person.IsInitialized); + Assert.True(person.IsInitialized); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasLite.RegisterAllExtensions(registry); @@ -84,24 +81,24 @@ namespace Google.ProtocolBuffers TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(fullBytes, registry); byte[] liteBytes = copy.ToByteArray(); - TestUtil.AssertBytesEqual(fullBytes, liteBytes); + Assert.Equal(fullBytes, liteBytes); } - [TestMethod] + [Fact] public void TestConvertFromLiteMinimal() { TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() .SetId(123) .SetName("abc") .Build(); - Assert.IsTrue(person.IsInitialized); + Assert.True(person.IsInitialized); TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray()); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); + Assert.Equal(person.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestConvertFromLiteComplete() { TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() @@ -117,14 +114,14 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasLite.EmployeeIdLite, TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.IsTrue(person.IsInitialized); + Assert.True(person.IsInitialized); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasFull.RegisterAllExtensions(registry); TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); + Assert.Equal(person.ToByteArray(), copy.ToByteArray()); } public ByteString AllBytes @@ -138,7 +135,7 @@ namespace Google.ProtocolBuffers } } - [TestMethod] + [Fact] public void TestCompareStringValues() { TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() @@ -156,14 +153,14 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasLite.EmployeeIdLite, TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.IsTrue(person.IsInitialized); + Assert.True(person.IsInitialized); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasFull.RegisterAllExtensions(registry); TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); + Assert.Equal(person.ToByteArray(), copy.ToByteArray()); TestInteropPerson.Builder copyBuilder = TestInteropPerson.CreateBuilder(); TextFormat.Merge( @@ -171,7 +168,7 @@ namespace Google.ProtocolBuffers "[protobuf_unittest_extra.employee_id]"), registry, copyBuilder); copy = copyBuilder.Build(); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); + Assert.Equal(person.ToByteArray(), copy.ToByteArray()); string liteText = person.ToString().TrimEnd().Replace("\r", ""); string fullText = copy.ToString().TrimEnd().Replace("\r", ""); @@ -179,10 +176,10 @@ namespace Google.ProtocolBuffers liteText = liteText.Replace("[protobuf_unittest_extra.employee_id_lite]", "[protobuf_unittest_extra.employee_id]"); //lite version does not indent - while (fullText.IndexOf("\n ") >= 0) + while (fullText.IndexOf("\n ", StringComparison.Ordinal) >= 0) fullText = fullText.Replace("\n ", "\n"); - Assert.AreEqual(fullText, liteText); + Assert.Equal(fullText, liteText); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs index 9ef5cc84..8ffd3ee2 100644 --- a/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs @@ -34,12 +34,8 @@ #endregion -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { @@ -47,10 +43,9 @@ namespace Google.ProtocolBuffers /// Miscellaneous tests for message operations that apply to both /// generated and dynamic messages. /// - [TestClass] public class LiteTest { - [TestMethod] + [Fact] public void TestLite() { // Since lite messages are a subset of regular messages, we can mostly @@ -73,13 +68,13 @@ namespace Google.ProtocolBuffers TestAllTypesLite message2 = TestAllTypesLite.ParseFrom(data); - Assert.AreEqual(123, message2.OptionalInt32); - Assert.AreEqual(1, message2.RepeatedStringCount); - Assert.AreEqual("hello", message2.RepeatedStringList[0]); - Assert.AreEqual(7, message2.OptionalNestedMessage.Bb); + Assert.Equal(123, message2.OptionalInt32); + Assert.Equal(1, message2.RepeatedStringCount); + Assert.Equal("hello", message2.RepeatedStringList[0]); + Assert.Equal(7, message2.OptionalNestedMessage.Bb); } - [TestMethod] + [Fact] public void TestLiteExtensions() { // TODO(kenton): Unlike other features of the lite library, extensions are @@ -101,17 +96,17 @@ namespace Google.ProtocolBuffers // writing, parsing hasn't been implemented yet. TestAllExtensionsLite message2 = message.ToBuilder().Build(); - Assert.AreEqual(123, (int) message2.GetExtension( + Assert.Equal(123, (int) message2.GetExtension( UnittestLite.OptionalInt32ExtensionLite)); - Assert.AreEqual(1, message2.GetExtensionCount( + Assert.Equal(1, message2.GetExtensionCount( UnittestLite.RepeatedStringExtensionLite)); - Assert.AreEqual(1, message2.GetExtension( + Assert.Equal(1, message2.GetExtension( UnittestLite.RepeatedStringExtensionLite).Count); - Assert.AreEqual("hello", message2.GetExtension( + Assert.Equal("hello", message2.GetExtension( UnittestLite.RepeatedStringExtensionLite, 0)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension( + Assert.Equal(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension( UnittestLite.OptionalNestedEnumExtensionLite)); - Assert.AreEqual(7, message2.GetExtension( + Assert.Equal(7, message2.GetExtension( UnittestLite.OptionalNestedMessageExtensionLite).Bb); } } diff --git a/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs b/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs index b70635d5..b9680e68 100644 --- a/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs @@ -34,17 +34,14 @@ #endregion -using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; using Google.ProtocolBuffers.TestProtos; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class MissingFieldAndExtensionTest { - [TestMethod] + [Fact] public void TestRecoverMissingExtensions() { const int optionalInt32 = 12345678; @@ -55,42 +52,42 @@ namespace Google.ProtocolBuffers builder.AddExtension(Unittest.RepeatedDoubleExtension, 1.3); TestAllExtensions msg = builder.Build(); - Assert.IsTrue(msg.HasExtension(Unittest.OptionalInt32Extension)); - Assert.AreEqual(3, msg.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.True(msg.HasExtension(Unittest.OptionalInt32Extension)); + Assert.Equal(3, msg.GetExtensionCount(Unittest.RepeatedDoubleExtension)); byte[] bits = msg.ToByteArray(); TestAllExtensions copy = TestAllExtensions.ParseFrom(bits); - Assert.IsFalse(copy.HasExtension(Unittest.OptionalInt32Extension)); - Assert.AreEqual(0, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.AreNotEqual(msg, copy); + Assert.False(copy.HasExtension(Unittest.OptionalInt32Extension)); + Assert.Equal(0, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.NotEqual(msg, copy); //Even though copy does not understand the typees they serialize correctly byte[] copybits = copy.ToByteArray(); - TestUtil.AssertBytesEqual(bits, copybits); + Assert.Equal(bits, copybits); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); Unittest.RegisterAllExtensions(registry); //Now we can take those copy bits and restore the full message with extensions copy = TestAllExtensions.ParseFrom(copybits, registry); - Assert.IsTrue(copy.HasExtension(Unittest.OptionalInt32Extension)); - Assert.AreEqual(3, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.True(copy.HasExtension(Unittest.OptionalInt32Extension)); + Assert.Equal(3, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.AreEqual(msg, copy); - TestUtil.AssertBytesEqual(bits, copy.ToByteArray()); + Assert.Equal(msg, copy); + Assert.Equal(bits, copy.ToByteArray()); //If we modify the object this should all continue to work as before copybits = copy.ToBuilder().Build().ToByteArray(); - TestUtil.AssertBytesEqual(bits, copybits); + Assert.Equal(bits, copybits); //If we replace extension the object this should all continue to work as before copybits = copy.ToBuilder() .SetExtension(Unittest.OptionalInt32Extension, optionalInt32) .Build().ToByteArray(); - TestUtil.AssertBytesEqual(bits, copybits); + Assert.Equal(bits, copybits); } - [TestMethod] + [Fact] public void TestRecoverMissingFields() { TestMissingFieldsA msga = TestMissingFieldsA.CreateBuilder() @@ -101,53 +98,53 @@ namespace Google.ProtocolBuffers //serialize to type B and verify all fields exist TestMissingFieldsB msgb = TestMissingFieldsB.ParseFrom(msga.ToByteArray()); - Assert.AreEqual(1001, msgb.Id); - Assert.AreEqual("Name", msgb.Name); - Assert.IsFalse(msgb.HasWebsite); - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); - Assert.AreEqual("missing@field.value", + Assert.Equal(1001, msgb.Id); + Assert.Equal("Name", msgb.Name); + Assert.False(msgb.HasWebsite); + Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.Equal("missing@field.value", msgb.UnknownFields[TestMissingFieldsA.EmailFieldNumber].LengthDelimitedList[0].ToStringUtf8()); //serializes exactly the same (at least for this simple example) - TestUtil.AssertBytesEqual(msga.ToByteArray(), msgb.ToByteArray()); - Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); + Assert.Equal(msga.ToByteArray(), msgb.ToByteArray()); + Assert.Equal(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); //now re-create an exact copy of A from serialized B TestMissingFieldsA copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual("missing@field.value", copya.Email); + Assert.Equal(msga, copya); + Assert.Equal(1001, copya.Id); + Assert.Equal("Name", copya.Name); + Assert.Equal("missing@field.value", copya.Email); //Now we modify B... and try again msgb = msgb.ToBuilder().SetWebsite("http://new.missing.field").Build(); //Does B still have the missing field? - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); //Convert back to A and see if all fields are there? copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreNotEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual("missing@field.value", copya.Email); - Assert.AreEqual(1, copya.UnknownFields.FieldDictionary.Count); - Assert.AreEqual("http://new.missing.field", + Assert.NotEqual(msga, copya); + Assert.Equal(1001, copya.Id); + Assert.Equal("Name", copya.Name); + Assert.Equal("missing@field.value", copya.Email); + Assert.Equal(1, copya.UnknownFields.FieldDictionary.Count); + Assert.Equal("http://new.missing.field", copya.UnknownFields[TestMissingFieldsB.WebsiteFieldNumber].LengthDelimitedList[0]. ToStringUtf8()); //Lastly we can even still trip back to type B and see all fields: TestMissingFieldsB copyb = TestMissingFieldsB.ParseFrom(copya.ToByteArray()); - Assert.AreEqual(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. - Assert.AreEqual(1001, copyb.Id); - Assert.AreEqual("Name", copyb.Name); - Assert.AreEqual("http://new.missing.field", copyb.Website); - Assert.AreEqual(1, copyb.UnknownFields.FieldDictionary.Count); - Assert.AreEqual("missing@field.value", + Assert.Equal(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. + Assert.Equal(1001, copyb.Id); + Assert.Equal("Name", copyb.Name); + Assert.Equal("http://new.missing.field", copyb.Website); + Assert.Equal(1, copyb.UnknownFields.FieldDictionary.Count); + Assert.Equal("missing@field.value", copyb.UnknownFields[TestMissingFieldsA.EmailFieldNumber].LengthDelimitedList[0].ToStringUtf8 ()); } - [TestMethod] + [Fact] public void TestRecoverMissingMessage() { TestMissingFieldsA.Types.SubA suba = @@ -161,52 +158,52 @@ namespace Google.ProtocolBuffers //serialize to type B and verify all fields exist TestMissingFieldsB msgb = TestMissingFieldsB.ParseFrom(msga.ToByteArray()); - Assert.AreEqual(1001, msgb.Id); - Assert.AreEqual("Name", msgb.Name); - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); - Assert.AreEqual(suba.ToString(), + Assert.Equal(1001, msgb.Id); + Assert.Equal("Name", msgb.Name); + Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.Equal(suba.ToString(), TestMissingFieldsA.Types.SubA.ParseFrom( msgb.UnknownFields[TestMissingFieldsA.TestAFieldNumber].LengthDelimitedList[0]).ToString ()); //serializes exactly the same (at least for this simple example) - TestUtil.AssertBytesEqual(msga.ToByteArray(), msgb.ToByteArray()); - Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); + Assert.Equal(msga.ToByteArray(), msgb.ToByteArray()); + Assert.Equal(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); //now re-create an exact copy of A from serialized B TestMissingFieldsA copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual(suba, copya.TestA); + Assert.Equal(msga, copya); + Assert.Equal(1001, copya.Id); + Assert.Equal("Name", copya.Name); + Assert.Equal(suba, copya.TestA); //Now we modify B... and try again TestMissingFieldsB.Types.SubB subb = TestMissingFieldsB.Types.SubB.CreateBuilder().AddValues("test-b").Build(); msgb = msgb.ToBuilder().SetTestB(subb).Build(); //Does B still have the missing field? - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); //Convert back to A and see if all fields are there? copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreNotEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual(suba, copya.TestA); - Assert.AreEqual(1, copya.UnknownFields.FieldDictionary.Count); - TestUtil.AssertBytesEqual(subb.ToByteArray(), + Assert.NotEqual(msga, copya); + Assert.Equal(1001, copya.Id); + Assert.Equal("Name", copya.Name); + Assert.Equal(suba, copya.TestA); + Assert.Equal(1, copya.UnknownFields.FieldDictionary.Count); + Assert.Equal(subb.ToByteArray(), copya.UnknownFields[TestMissingFieldsB.TestBFieldNumber].LengthDelimitedList[0].ToByteArray()); //Lastly we can even still trip back to type B and see all fields: TestMissingFieldsB copyb = TestMissingFieldsB.ParseFrom(copya.ToByteArray()); - Assert.AreEqual(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. - Assert.AreEqual(1001, copyb.Id); - Assert.AreEqual("Name", copyb.Name); - Assert.AreEqual(subb, copyb.TestB); - Assert.AreEqual(1, copyb.UnknownFields.FieldDictionary.Count); + Assert.Equal(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. + Assert.Equal(1001, copyb.Id); + Assert.Equal("Name", copyb.Name); + Assert.Equal(subb, copyb.TestB); + Assert.Equal(1, copyb.UnknownFields.FieldDictionary.Count); } - [TestMethod] + [Fact] public void TestRestoreFromOtherType() { TestInteropPerson person = TestInteropPerson.CreateBuilder() @@ -222,19 +219,19 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasFull.EmployeeId, TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.IsTrue(person.IsInitialized); + Assert.True(person.IsInitialized); TestEmptyMessage temp = TestEmptyMessage.ParseFrom(person.ToByteArray()); - Assert.AreEqual(7, temp.UnknownFields.FieldDictionary.Count); + Assert.Equal(7, temp.UnknownFields.FieldDictionary.Count); temp = temp.ToBuilder().Build(); - Assert.AreEqual(7, temp.UnknownFields.FieldDictionary.Count); + Assert.Equal(7, temp.UnknownFields.FieldDictionary.Count); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasFull.RegisterAllExtensions(registry); TestInteropPerson copy = TestInteropPerson.ParseFrom(temp.ToByteArray(), registry); - Assert.AreEqual(person, copy); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); + Assert.Equal(person, copy); + Assert.Equal(person.ToByteArray(), copy.ToByteArray()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj index 12315442..8acc1fb1 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj @@ -1,9 +1,8 @@  + + - CLIENTPROFILE - NET35 - TEST Debug AnyCPU 9.0.30729 @@ -13,12 +12,13 @@ Properties Google.ProtocolBuffers Google.ProtocolBuffersLite.Test - v4.0 + v4.5 512 true ..\..\keys\Google.ProtocolBuffers.snk 3.5 - Client + + true @@ -32,6 +32,7 @@ true true Off + false pdbonly @@ -44,32 +45,23 @@ true true Off + false - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll + + ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll + + ..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll + + ..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll - - Microsoft.VisualStudio.TestTools.cs - Properties\AssemblyInfo.cs @@ -83,7 +75,6 @@ - @@ -96,7 +87,9 @@ True - + + + - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj index f7772f39..5f1a7ba3 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj @@ -1,9 +1,8 @@  + + - CLIENTPROFILE - NET35 - TEST Debug AnyCPU 9.0.30729 @@ -13,12 +12,13 @@ Properties Google.ProtocolBuffers Google.ProtocolBuffersMixedLite.Test - v4.0 + v4.5 512 true ..\..\keys\Google.ProtocolBuffers.snk 3.5 - Client + + true @@ -32,6 +32,7 @@ true true Off + false pdbonly @@ -44,32 +45,23 @@ true true Off + false - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll + + ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll + + ..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll + + ..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll - - Microsoft.VisualStudio.TestTools.cs - Properties\AssemblyInfo.cs @@ -90,7 +82,6 @@ - @@ -98,7 +89,9 @@ ProtocolBuffers - + + + - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs b/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs index e44a72a8..e4f9acff 100644 --- a/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs +++ b/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs @@ -35,67 +35,66 @@ #endregion using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class TestLiteByApi { - [TestMethod] + [Fact] public void TestAllTypesEquality() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; TestAllTypesLite copy = msg.ToBuilder().Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); + Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); + Assert.True(msg.Equals(copy)); msg = msg.ToBuilder().SetOptionalString("Hi").Build(); - Assert.AreNotEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsFalse(msg.Equals(copy)); + Assert.NotEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.False(msg.Equals(copy)); copy = copy.ToBuilder().SetOptionalString("Hi").Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); + Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); + Assert.True(msg.Equals(copy)); } - [TestMethod] + [Fact] public void TestEqualityOnExtensions() { TestAllExtensionsLite msg = TestAllExtensionsLite.DefaultInstance; TestAllExtensionsLite copy = msg.ToBuilder().Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); + Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); + Assert.True(msg.Equals(copy)); msg = msg.ToBuilder().SetExtension(UnittestLite.OptionalStringExtensionLite, "Hi").Build(); - Assert.AreNotEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsFalse(msg.Equals(copy)); + Assert.NotEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.False(msg.Equals(copy)); copy = copy.ToBuilder().SetExtension(UnittestLite.OptionalStringExtensionLite, "Hi").Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); + Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); + Assert.True(msg.Equals(copy)); } - [TestMethod] + [Fact] public void TestAllTypesToString() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; TestAllTypesLite copy = msg.ToBuilder().Build(); - Assert.AreEqual(msg.ToString(), copy.ToString()); - Assert.AreEqual(0, msg.ToString().Length); + Assert.Equal(msg.ToString(), copy.ToString()); + Assert.Equal(0, msg.ToString().Length); msg = msg.ToBuilder().SetOptionalInt32(-1).Build(); - Assert.AreEqual("optional_int32: -1", msg.ToString().TrimEnd()); + Assert.Equal("optional_int32: -1", msg.ToString().TrimEnd()); msg = msg.ToBuilder().SetOptionalString("abc123").Build(); - Assert.AreEqual("optional_int32: -1\noptional_string: \"abc123\"", + Assert.Equal("optional_int32: -1\noptional_string: \"abc123\"", msg.ToString().Replace("\r", "").TrimEnd()); } - [TestMethod] + [Fact] public void TestAllTypesDefaultedRoundTrip() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; - Assert.IsTrue(msg.IsInitialized); + Assert.True(msg.IsInitialized); TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } - [TestMethod] + [Fact] public void TestAllTypesModifiedRoundTrip() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; @@ -115,7 +114,7 @@ namespace Google.ProtocolBuffers .AddRepeatedGroup(TestAllTypesLite.Types.RepeatedGroup.CreateBuilder().SetA('A').Build()) ; TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/TestUtil.cs b/csharp/src/ProtocolBuffersLite.Test/TestUtil.cs deleted file mode 100644 index 44c09b9c..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/TestUtil.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - class TestUtil - { - internal static void AssertBytesEqual(byte[] a, byte[] b) - { - if (a == null || b == null) - { - Assert.AreEqual(a, b); - } - else - { - Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length."); - - for (int i = 0; i < a.Length; i++) - { - if (a[i] != b[i]) - { - Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i); - } - } - } - } - - } -} diff --git a/csharp/src/ProtocolBuffersLite.Test/packages.config b/csharp/src/ProtocolBuffersLite.Test/packages.config new file mode 100644 index 00000000..6f1fb7f5 --- /dev/null +++ b/csharp/src/ProtocolBuffersLite.Test/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/csharp/src/packages/repositories.config b/csharp/src/packages/repositories.config new file mode 100644 index 00000000..0117aa7c --- /dev/null +++ b/csharp/src/packages/repositories.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file -- cgit v1.2.3 From 6e1ec5f6eaf79563aba0d220e36547afe15f0dd6 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Thu, 30 Apr 2015 18:19:50 -0700 Subject: fix commends from Jon Skeet --- csharp/src/AddressBook/AddressBook.csproj | 20 + csharp/src/AddressBook/app.config | 15 +- .../src/ProtocolBuffers.Test/FieldPresenceTest.cs | 46 +- .../TestProtos/FieldPresence.cs | 783 +++++++++++++++++++++ .../TestProtos/FieldPresense.cs | 783 --------------------- .../ProtocolBuffers/Descriptors/FileDescriptor.cs | 11 +- .../FieldAccess/FieldAccessorTable.cs | 6 +- .../FieldAccess/SinglePrimitiveAccessor.cs | 12 +- 8 files changed, 845 insertions(+), 831 deletions(-) create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresence.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresense.cs (limited to 'csharp/src') diff --git a/csharp/src/AddressBook/AddressBook.csproj b/csharp/src/AddressBook/AddressBook.csproj index 52b82a8f..5140e1eb 100644 --- a/csharp/src/AddressBook/AddressBook.csproj +++ b/csharp/src/AddressBook/AddressBook.csproj @@ -1,5 +1,6 @@  + Debug AnyCPU @@ -14,6 +15,8 @@ 512 Google.ProtocolBuffers.Examples.AddressBook.Program Client + + true @@ -45,6 +48,14 @@ + + ..\packages\xunit.1.9.2\lib\net20\xunit.dll + True + + + ..\packages\xunit.should.1.1\lib\net35\xunit.should.dll + True + @@ -62,8 +73,17 @@ + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs b/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs index 5fa22fef..bd1d2c65 100644 --- a/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs +++ b/csharp/src/ProtocolBuffers.Test/ReflectionTester.cs @@ -37,7 +37,7 @@ using System; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; #pragma warning disable 618 // Disable warning about obsolete use miss-matched assert arguments @@ -97,7 +97,7 @@ namespace Google.ProtocolBuffers this.extensionRegistry = extensionRegistry; this.file = baseDescriptor.File; - Assert.Equal(1, file.Dependencies.Count); + Assert.AreEqual(1, file.Dependencies.Count); this.importFile = file.Dependencies[0]; MessageDescriptor testAllTypes; @@ -449,199 +449,199 @@ namespace Google.ProtocolBuffers /// public void AssertAllFieldsSetViaReflection(IMessage message) { - Assert.True(message.HasField(f("optional_int32"))); - Assert.True(message.HasField(f("optional_int64"))); - Assert.True(message.HasField(f("optional_uint32"))); - Assert.True(message.HasField(f("optional_uint64"))); - Assert.True(message.HasField(f("optional_sint32"))); - Assert.True(message.HasField(f("optional_sint64"))); - Assert.True(message.HasField(f("optional_fixed32"))); - Assert.True(message.HasField(f("optional_fixed64"))); - Assert.True(message.HasField(f("optional_sfixed32"))); - Assert.True(message.HasField(f("optional_sfixed64"))); - Assert.True(message.HasField(f("optional_float"))); - Assert.True(message.HasField(f("optional_double"))); - Assert.True(message.HasField(f("optional_bool"))); - Assert.True(message.HasField(f("optional_string"))); - Assert.True(message.HasField(f("optional_bytes"))); - - Assert.True(message.HasField(f("optionalgroup"))); - Assert.True(message.HasField(f("optional_nested_message"))); - Assert.True(message.HasField(f("optional_foreign_message"))); - Assert.True(message.HasField(f("optional_import_message"))); - - Assert.True(((IMessage) message[f("optionalgroup")]).HasField(groupA)); - Assert.True(((IMessage) message[f("optional_nested_message")]).HasField(nestedB)); - Assert.True(((IMessage) message[f("optional_foreign_message")]).HasField(foreignC)); - Assert.True(((IMessage) message[f("optional_import_message")]).HasField(importD)); - - Assert.True(message.HasField(f("optional_nested_enum"))); - Assert.True(message.HasField(f("optional_foreign_enum"))); - Assert.True(message.HasField(f("optional_import_enum"))); - - Assert.True(message.HasField(f("optional_string_piece"))); - Assert.True(message.HasField(f("optional_cord"))); - - Assert.Equal(101, message[f("optional_int32")]); - Assert.Equal(102L, message[f("optional_int64")]); - Assert.Equal(103u, message[f("optional_uint32")]); - Assert.Equal(104UL, message[f("optional_uint64")]); - Assert.Equal(105, message[f("optional_sint32")]); - Assert.Equal(106L, message[f("optional_sint64")]); - Assert.Equal(107U, message[f("optional_fixed32")]); - Assert.Equal(108UL, message[f("optional_fixed64")]); - Assert.Equal(109, message[f("optional_sfixed32")]); - Assert.Equal(110L, message[f("optional_sfixed64")]); - Assert.Equal(111F, message[f("optional_float")]); - Assert.Equal(112D, message[f("optional_double")]); - Assert.Equal(true, message[f("optional_bool")]); - Assert.Equal("115", message[f("optional_string")]); - Assert.Equal(TestUtil.ToBytes("116"), message[f("optional_bytes")]); - - Assert.Equal(117, ((IMessage) message[f("optionalgroup")])[groupA]); - Assert.Equal(118, ((IMessage) message[f("optional_nested_message")])[nestedB]); - Assert.Equal(119, ((IMessage) message[f("optional_foreign_message")])[foreignC]); - Assert.Equal(120, ((IMessage) message[f("optional_import_message")])[importD]); - - Assert.Equal(nestedBaz, message[f("optional_nested_enum")]); - Assert.Equal(foreignBaz, message[f("optional_foreign_enum")]); - Assert.Equal(importBaz, message[f("optional_import_enum")]); - - Assert.Equal("124", message[f("optional_string_piece")]); - Assert.Equal("125", message[f("optional_cord")]); + Assert.IsTrue(message.HasField(f("optional_int32"))); + Assert.IsTrue(message.HasField(f("optional_int64"))); + Assert.IsTrue(message.HasField(f("optional_uint32"))); + Assert.IsTrue(message.HasField(f("optional_uint64"))); + Assert.IsTrue(message.HasField(f("optional_sint32"))); + Assert.IsTrue(message.HasField(f("optional_sint64"))); + Assert.IsTrue(message.HasField(f("optional_fixed32"))); + Assert.IsTrue(message.HasField(f("optional_fixed64"))); + Assert.IsTrue(message.HasField(f("optional_sfixed32"))); + Assert.IsTrue(message.HasField(f("optional_sfixed64"))); + Assert.IsTrue(message.HasField(f("optional_float"))); + Assert.IsTrue(message.HasField(f("optional_double"))); + Assert.IsTrue(message.HasField(f("optional_bool"))); + Assert.IsTrue(message.HasField(f("optional_string"))); + Assert.IsTrue(message.HasField(f("optional_bytes"))); + + Assert.IsTrue(message.HasField(f("optionalgroup"))); + Assert.IsTrue(message.HasField(f("optional_nested_message"))); + Assert.IsTrue(message.HasField(f("optional_foreign_message"))); + Assert.IsTrue(message.HasField(f("optional_import_message"))); + + Assert.IsTrue(((IMessage) message[f("optionalgroup")]).HasField(groupA)); + Assert.IsTrue(((IMessage) message[f("optional_nested_message")]).HasField(nestedB)); + Assert.IsTrue(((IMessage) message[f("optional_foreign_message")]).HasField(foreignC)); + Assert.IsTrue(((IMessage) message[f("optional_import_message")]).HasField(importD)); + + Assert.IsTrue(message.HasField(f("optional_nested_enum"))); + Assert.IsTrue(message.HasField(f("optional_foreign_enum"))); + Assert.IsTrue(message.HasField(f("optional_import_enum"))); + + Assert.IsTrue(message.HasField(f("optional_string_piece"))); + Assert.IsTrue(message.HasField(f("optional_cord"))); + + Assert.AreEqual(101, message[f("optional_int32")]); + Assert.AreEqual(102L, message[f("optional_int64")]); + Assert.AreEqual(103u, message[f("optional_uint32")]); + Assert.AreEqual(104UL, message[f("optional_uint64")]); + Assert.AreEqual(105, message[f("optional_sint32")]); + Assert.AreEqual(106L, message[f("optional_sint64")]); + Assert.AreEqual(107U, message[f("optional_fixed32")]); + Assert.AreEqual(108UL, message[f("optional_fixed64")]); + Assert.AreEqual(109, message[f("optional_sfixed32")]); + Assert.AreEqual(110L, message[f("optional_sfixed64")]); + Assert.AreEqual(111F, message[f("optional_float")]); + Assert.AreEqual(112D, message[f("optional_double")]); + Assert.AreEqual(true, message[f("optional_bool")]); + Assert.AreEqual("115", message[f("optional_string")]); + Assert.AreEqual(TestUtil.ToBytes("116"), message[f("optional_bytes")]); + + Assert.AreEqual(117, ((IMessage) message[f("optionalgroup")])[groupA]); + Assert.AreEqual(118, ((IMessage) message[f("optional_nested_message")])[nestedB]); + Assert.AreEqual(119, ((IMessage) message[f("optional_foreign_message")])[foreignC]); + Assert.AreEqual(120, ((IMessage) message[f("optional_import_message")])[importD]); + + Assert.AreEqual(nestedBaz, message[f("optional_nested_enum")]); + Assert.AreEqual(foreignBaz, message[f("optional_foreign_enum")]); + Assert.AreEqual(importBaz, message[f("optional_import_enum")]); + + Assert.AreEqual("124", message[f("optional_string_piece")]); + Assert.AreEqual("125", message[f("optional_cord")]); // ----------------------------------------------------------------- - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_cord"))); - - Assert.Equal(201, message[f("repeated_int32"), 0]); - Assert.Equal(202L, message[f("repeated_int64"), 0]); - Assert.Equal(203U, message[f("repeated_uint32"), 0]); - Assert.Equal(204UL, message[f("repeated_uint64"), 0]); - Assert.Equal(205, message[f("repeated_sint32"), 0]); - Assert.Equal(206L, message[f("repeated_sint64"), 0]); - Assert.Equal(207U, message[f("repeated_fixed32"), 0]); - Assert.Equal(208UL, message[f("repeated_fixed64"), 0]); - Assert.Equal(209, message[f("repeated_sfixed32"), 0]); - Assert.Equal(210L, message[f("repeated_sfixed64"), 0]); - Assert.Equal(211F, message[f("repeated_float"), 0]); - Assert.Equal(212D, message[f("repeated_double"), 0]); - Assert.Equal(true, message[f("repeated_bool"), 0]); - Assert.Equal("215", message[f("repeated_string"), 0]); - Assert.Equal(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); - - Assert.Equal(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); - Assert.Equal(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); - Assert.Equal(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); - Assert.Equal(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); - - Assert.Equal(nestedBar, message[f("repeated_nested_enum"), 0]); - Assert.Equal(foreignBar, message[f("repeated_foreign_enum"), 0]); - Assert.Equal(importBar, message[f("repeated_import_enum"), 0]); - - Assert.Equal("224", message[f("repeated_string_piece"), 0]); - Assert.Equal("225", message[f("repeated_cord"), 0]); - - Assert.Equal(301, message[f("repeated_int32"), 1]); - Assert.Equal(302L, message[f("repeated_int64"), 1]); - Assert.Equal(303U, message[f("repeated_uint32"), 1]); - Assert.Equal(304UL, message[f("repeated_uint64"), 1]); - Assert.Equal(305, message[f("repeated_sint32"), 1]); - Assert.Equal(306L, message[f("repeated_sint64"), 1]); - Assert.Equal(307U, message[f("repeated_fixed32"), 1]); - Assert.Equal(308UL, message[f("repeated_fixed64"), 1]); - Assert.Equal(309, message[f("repeated_sfixed32"), 1]); - Assert.Equal(310L, message[f("repeated_sfixed64"), 1]); - Assert.Equal(311F, message[f("repeated_float"), 1]); - Assert.Equal(312D, message[f("repeated_double"), 1]); - Assert.Equal(false, message[f("repeated_bool"), 1]); - Assert.Equal("315", message[f("repeated_string"), 1]); - Assert.Equal(TestUtil.ToBytes("316"), message[f("repeated_bytes"), 1]); - - Assert.Equal(317, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); - Assert.Equal(318, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); - Assert.Equal(319, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); - Assert.Equal(320, ((IMessage) message[f("repeated_import_message"), 1])[importD]); - - Assert.Equal(nestedBaz, message[f("repeated_nested_enum"), 1]); - Assert.Equal(foreignBaz, message[f("repeated_foreign_enum"), 1]); - Assert.Equal(importBaz, message[f("repeated_import_enum"), 1]); - - Assert.Equal("324", message[f("repeated_string_piece"), 1]); - Assert.Equal("325", message[f("repeated_cord"), 1]); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); + + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); + + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord"))); + + Assert.AreEqual(201, message[f("repeated_int32"), 0]); + Assert.AreEqual(202L, message[f("repeated_int64"), 0]); + Assert.AreEqual(203U, message[f("repeated_uint32"), 0]); + Assert.AreEqual(204UL, message[f("repeated_uint64"), 0]); + Assert.AreEqual(205, message[f("repeated_sint32"), 0]); + Assert.AreEqual(206L, message[f("repeated_sint64"), 0]); + Assert.AreEqual(207U, message[f("repeated_fixed32"), 0]); + Assert.AreEqual(208UL, message[f("repeated_fixed64"), 0]); + Assert.AreEqual(209, message[f("repeated_sfixed32"), 0]); + Assert.AreEqual(210L, message[f("repeated_sfixed64"), 0]); + Assert.AreEqual(211F, message[f("repeated_float"), 0]); + Assert.AreEqual(212D, message[f("repeated_double"), 0]); + Assert.AreEqual(true, message[f("repeated_bool"), 0]); + Assert.AreEqual("215", message[f("repeated_string"), 0]); + Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); + + Assert.AreEqual(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); + Assert.AreEqual(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); + Assert.AreEqual(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); + Assert.AreEqual(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); + + Assert.AreEqual(nestedBar, message[f("repeated_nested_enum"), 0]); + Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"), 0]); + Assert.AreEqual(importBar, message[f("repeated_import_enum"), 0]); + + Assert.AreEqual("224", message[f("repeated_string_piece"), 0]); + Assert.AreEqual("225", message[f("repeated_cord"), 0]); + + Assert.AreEqual(301, message[f("repeated_int32"), 1]); + Assert.AreEqual(302L, message[f("repeated_int64"), 1]); + Assert.AreEqual(303U, message[f("repeated_uint32"), 1]); + Assert.AreEqual(304UL, message[f("repeated_uint64"), 1]); + Assert.AreEqual(305, message[f("repeated_sint32"), 1]); + Assert.AreEqual(306L, message[f("repeated_sint64"), 1]); + Assert.AreEqual(307U, message[f("repeated_fixed32"), 1]); + Assert.AreEqual(308UL, message[f("repeated_fixed64"), 1]); + Assert.AreEqual(309, message[f("repeated_sfixed32"), 1]); + Assert.AreEqual(310L, message[f("repeated_sfixed64"), 1]); + Assert.AreEqual(311F, message[f("repeated_float"), 1]); + Assert.AreEqual(312D, message[f("repeated_double"), 1]); + Assert.AreEqual(false, message[f("repeated_bool"), 1]); + Assert.AreEqual("315", message[f("repeated_string"), 1]); + Assert.AreEqual(TestUtil.ToBytes("316"), message[f("repeated_bytes"), 1]); + + Assert.AreEqual(317, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); + Assert.AreEqual(318, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); + Assert.AreEqual(319, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); + Assert.AreEqual(320, ((IMessage) message[f("repeated_import_message"), 1])[importD]); + + Assert.AreEqual(nestedBaz, message[f("repeated_nested_enum"), 1]); + Assert.AreEqual(foreignBaz, message[f("repeated_foreign_enum"), 1]); + Assert.AreEqual(importBaz, message[f("repeated_import_enum"), 1]); + + Assert.AreEqual("324", message[f("repeated_string_piece"), 1]); + Assert.AreEqual("325", message[f("repeated_cord"), 1]); // ----------------------------------------------------------------- - Assert.True(message.HasField(f("default_int32"))); - Assert.True(message.HasField(f("default_int64"))); - Assert.True(message.HasField(f("default_uint32"))); - Assert.True(message.HasField(f("default_uint64"))); - Assert.True(message.HasField(f("default_sint32"))); - Assert.True(message.HasField(f("default_sint64"))); - Assert.True(message.HasField(f("default_fixed32"))); - Assert.True(message.HasField(f("default_fixed64"))); - Assert.True(message.HasField(f("default_sfixed32"))); - Assert.True(message.HasField(f("default_sfixed64"))); - Assert.True(message.HasField(f("default_float"))); - Assert.True(message.HasField(f("default_double"))); - Assert.True(message.HasField(f("default_bool"))); - Assert.True(message.HasField(f("default_string"))); - Assert.True(message.HasField(f("default_bytes"))); - - Assert.True(message.HasField(f("default_nested_enum"))); - Assert.True(message.HasField(f("default_foreign_enum"))); - Assert.True(message.HasField(f("default_import_enum"))); - - Assert.True(message.HasField(f("default_string_piece"))); - Assert.True(message.HasField(f("default_cord"))); - - Assert.Equal(401, message[f("default_int32")]); - Assert.Equal(402L, message[f("default_int64")]); - Assert.Equal(403U, message[f("default_uint32")]); - Assert.Equal(404UL, message[f("default_uint64")]); - Assert.Equal(405, message[f("default_sint32")]); - Assert.Equal(406L, message[f("default_sint64")]); - Assert.Equal(407U, message[f("default_fixed32")]); - Assert.Equal(408UL, message[f("default_fixed64")]); - Assert.Equal(409, message[f("default_sfixed32")]); - Assert.Equal(410L, message[f("default_sfixed64")]); - Assert.Equal(411F, message[f("default_float")]); - Assert.Equal(412D, message[f("default_double")]); - Assert.Equal(false, message[f("default_bool")]); - Assert.Equal("415", message[f("default_string")]); - Assert.Equal(TestUtil.ToBytes("416"), message[f("default_bytes")]); - - Assert.Equal(nestedFoo, message[f("default_nested_enum")]); - Assert.Equal(foreignFoo, message[f("default_foreign_enum")]); - Assert.Equal(importFoo, message[f("default_import_enum")]); - - Assert.Equal("424", message[f("default_string_piece")]); - Assert.Equal("425", message[f("default_cord")]); + Assert.IsTrue(message.HasField(f("default_int32"))); + Assert.IsTrue(message.HasField(f("default_int64"))); + Assert.IsTrue(message.HasField(f("default_uint32"))); + Assert.IsTrue(message.HasField(f("default_uint64"))); + Assert.IsTrue(message.HasField(f("default_sint32"))); + Assert.IsTrue(message.HasField(f("default_sint64"))); + Assert.IsTrue(message.HasField(f("default_fixed32"))); + Assert.IsTrue(message.HasField(f("default_fixed64"))); + Assert.IsTrue(message.HasField(f("default_sfixed32"))); + Assert.IsTrue(message.HasField(f("default_sfixed64"))); + Assert.IsTrue(message.HasField(f("default_float"))); + Assert.IsTrue(message.HasField(f("default_double"))); + Assert.IsTrue(message.HasField(f("default_bool"))); + Assert.IsTrue(message.HasField(f("default_string"))); + Assert.IsTrue(message.HasField(f("default_bytes"))); + + Assert.IsTrue(message.HasField(f("default_nested_enum"))); + Assert.IsTrue(message.HasField(f("default_foreign_enum"))); + Assert.IsTrue(message.HasField(f("default_import_enum"))); + + Assert.IsTrue(message.HasField(f("default_string_piece"))); + Assert.IsTrue(message.HasField(f("default_cord"))); + + Assert.AreEqual(401, message[f("default_int32")]); + Assert.AreEqual(402L, message[f("default_int64")]); + Assert.AreEqual(403U, message[f("default_uint32")]); + Assert.AreEqual(404UL, message[f("default_uint64")]); + Assert.AreEqual(405, message[f("default_sint32")]); + Assert.AreEqual(406L, message[f("default_sint64")]); + Assert.AreEqual(407U, message[f("default_fixed32")]); + Assert.AreEqual(408UL, message[f("default_fixed64")]); + Assert.AreEqual(409, message[f("default_sfixed32")]); + Assert.AreEqual(410L, message[f("default_sfixed64")]); + Assert.AreEqual(411F, message[f("default_float")]); + Assert.AreEqual(412D, message[f("default_double")]); + Assert.AreEqual(false, message[f("default_bool")]); + Assert.AreEqual("415", message[f("default_string")]); + Assert.AreEqual(TestUtil.ToBytes("416"), message[f("default_bytes")]); + + Assert.AreEqual(nestedFoo, message[f("default_nested_enum")]); + Assert.AreEqual(foreignFoo, message[f("default_foreign_enum")]); + Assert.AreEqual(importFoo, message[f("default_import_enum")]); + + Assert.AreEqual("424", message[f("default_string_piece")]); + Assert.AreEqual("425", message[f("default_cord")]); } /// @@ -651,148 +651,148 @@ namespace Google.ProtocolBuffers public void AssertClearViaReflection(IMessage message) { // has_blah() should initially be false for all optional fields. - Assert.False(message.HasField(f("optional_int32"))); - Assert.False(message.HasField(f("optional_int64"))); - Assert.False(message.HasField(f("optional_uint32"))); - Assert.False(message.HasField(f("optional_uint64"))); - Assert.False(message.HasField(f("optional_sint32"))); - Assert.False(message.HasField(f("optional_sint64"))); - Assert.False(message.HasField(f("optional_fixed32"))); - Assert.False(message.HasField(f("optional_fixed64"))); - Assert.False(message.HasField(f("optional_sfixed32"))); - Assert.False(message.HasField(f("optional_sfixed64"))); - Assert.False(message.HasField(f("optional_float"))); - Assert.False(message.HasField(f("optional_double"))); - Assert.False(message.HasField(f("optional_bool"))); - Assert.False(message.HasField(f("optional_string"))); - Assert.False(message.HasField(f("optional_bytes"))); - - Assert.False(message.HasField(f("optionalgroup"))); - Assert.False(message.HasField(f("optional_nested_message"))); - Assert.False(message.HasField(f("optional_foreign_message"))); - Assert.False(message.HasField(f("optional_import_message"))); - - Assert.False(message.HasField(f("optional_nested_enum"))); - Assert.False(message.HasField(f("optional_foreign_enum"))); - Assert.False(message.HasField(f("optional_import_enum"))); - - Assert.False(message.HasField(f("optional_string_piece"))); - Assert.False(message.HasField(f("optional_cord"))); + Assert.IsFalse(message.HasField(f("optional_int32"))); + Assert.IsFalse(message.HasField(f("optional_int64"))); + Assert.IsFalse(message.HasField(f("optional_uint32"))); + Assert.IsFalse(message.HasField(f("optional_uint64"))); + Assert.IsFalse(message.HasField(f("optional_sint32"))); + Assert.IsFalse(message.HasField(f("optional_sint64"))); + Assert.IsFalse(message.HasField(f("optional_fixed32"))); + Assert.IsFalse(message.HasField(f("optional_fixed64"))); + Assert.IsFalse(message.HasField(f("optional_sfixed32"))); + Assert.IsFalse(message.HasField(f("optional_sfixed64"))); + Assert.IsFalse(message.HasField(f("optional_float"))); + Assert.IsFalse(message.HasField(f("optional_double"))); + Assert.IsFalse(message.HasField(f("optional_bool"))); + Assert.IsFalse(message.HasField(f("optional_string"))); + Assert.IsFalse(message.HasField(f("optional_bytes"))); + + Assert.IsFalse(message.HasField(f("optionalgroup"))); + Assert.IsFalse(message.HasField(f("optional_nested_message"))); + Assert.IsFalse(message.HasField(f("optional_foreign_message"))); + Assert.IsFalse(message.HasField(f("optional_import_message"))); + + Assert.IsFalse(message.HasField(f("optional_nested_enum"))); + Assert.IsFalse(message.HasField(f("optional_foreign_enum"))); + Assert.IsFalse(message.HasField(f("optional_import_enum"))); + + Assert.IsFalse(message.HasField(f("optional_string_piece"))); + Assert.IsFalse(message.HasField(f("optional_cord"))); // Optional fields without defaults are set to zero or something like it. - Assert.Equal(0, message[f("optional_int32")]); - Assert.Equal(0L, message[f("optional_int64")]); - Assert.Equal(0U, message[f("optional_uint32")]); - Assert.Equal(0UL, message[f("optional_uint64")]); - Assert.Equal(0, message[f("optional_sint32")]); - Assert.Equal(0L, message[f("optional_sint64")]); - Assert.Equal(0U, message[f("optional_fixed32")]); - Assert.Equal(0UL, message[f("optional_fixed64")]); - Assert.Equal(0, message[f("optional_sfixed32")]); - Assert.Equal(0L, message[f("optional_sfixed64")]); - Assert.Equal(0F, message[f("optional_float")]); - Assert.Equal(0D, message[f("optional_double")]); - Assert.Equal(false, message[f("optional_bool")]); - Assert.Equal("", message[f("optional_string")]); - Assert.Equal(ByteString.Empty, message[f("optional_bytes")]); + Assert.AreEqual(0, message[f("optional_int32")]); + Assert.AreEqual(0L, message[f("optional_int64")]); + Assert.AreEqual(0U, message[f("optional_uint32")]); + Assert.AreEqual(0UL, message[f("optional_uint64")]); + Assert.AreEqual(0, message[f("optional_sint32")]); + Assert.AreEqual(0L, message[f("optional_sint64")]); + Assert.AreEqual(0U, message[f("optional_fixed32")]); + Assert.AreEqual(0UL, message[f("optional_fixed64")]); + Assert.AreEqual(0, message[f("optional_sfixed32")]); + Assert.AreEqual(0L, message[f("optional_sfixed64")]); + Assert.AreEqual(0F, message[f("optional_float")]); + Assert.AreEqual(0D, message[f("optional_double")]); + Assert.AreEqual(false, message[f("optional_bool")]); + Assert.AreEqual("", message[f("optional_string")]); + Assert.AreEqual(ByteString.Empty, message[f("optional_bytes")]); // Embedded messages should also be clear. - Assert.False(((IMessage) message[f("optionalgroup")]).HasField(groupA)); - Assert.False(((IMessage) message[f("optional_nested_message")]) + Assert.IsFalse(((IMessage) message[f("optionalgroup")]).HasField(groupA)); + Assert.IsFalse(((IMessage) message[f("optional_nested_message")]) .HasField(nestedB)); - Assert.False(((IMessage) message[f("optional_foreign_message")]) + Assert.IsFalse(((IMessage) message[f("optional_foreign_message")]) .HasField(foreignC)); - Assert.False(((IMessage) message[f("optional_import_message")]) + Assert.IsFalse(((IMessage) message[f("optional_import_message")]) .HasField(importD)); - Assert.Equal(0, ((IMessage) message[f("optionalgroup")])[groupA]); - Assert.Equal(0, ((IMessage) message[f("optional_nested_message")])[nestedB]); - Assert.Equal(0, ((IMessage) message[f("optional_foreign_message")])[foreignC]); - Assert.Equal(0, ((IMessage) message[f("optional_import_message")])[importD]); + Assert.AreEqual(0, ((IMessage) message[f("optionalgroup")])[groupA]); + Assert.AreEqual(0, ((IMessage) message[f("optional_nested_message")])[nestedB]); + Assert.AreEqual(0, ((IMessage) message[f("optional_foreign_message")])[foreignC]); + Assert.AreEqual(0, ((IMessage) message[f("optional_import_message")])[importD]); // Enums without defaults are set to the first value in the enum. - Assert.Equal(nestedFoo, message[f("optional_nested_enum")]); - Assert.Equal(foreignFoo, message[f("optional_foreign_enum")]); - Assert.Equal(importFoo, message[f("optional_import_enum")]); + Assert.AreEqual(nestedFoo, message[f("optional_nested_enum")]); + Assert.AreEqual(foreignFoo, message[f("optional_foreign_enum")]); + Assert.AreEqual(importFoo, message[f("optional_import_enum")]); - Assert.Equal("", message[f("optional_string_piece")]); - Assert.Equal("", message[f("optional_cord")]); + Assert.AreEqual("", message[f("optional_string_piece")]); + Assert.AreEqual("", message[f("optional_cord")]); // Repeated fields are empty. - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.Equal(0, message.GetRepeatedFieldCount(f("repeated_cord"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int32"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int64"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint32"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint64"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint32"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint64"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed32"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed64"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_float"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_double"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bool"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bytes"))); + + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeatedgroup"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_message"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_message"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_enum"))); + + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string_piece"))); + Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_cord"))); // has_blah() should also be false for all default fields. - Assert.False(message.HasField(f("default_int32"))); - Assert.False(message.HasField(f("default_int64"))); - Assert.False(message.HasField(f("default_uint32"))); - Assert.False(message.HasField(f("default_uint64"))); - Assert.False(message.HasField(f("default_sint32"))); - Assert.False(message.HasField(f("default_sint64"))); - Assert.False(message.HasField(f("default_fixed32"))); - Assert.False(message.HasField(f("default_fixed64"))); - Assert.False(message.HasField(f("default_sfixed32"))); - Assert.False(message.HasField(f("default_sfixed64"))); - Assert.False(message.HasField(f("default_float"))); - Assert.False(message.HasField(f("default_double"))); - Assert.False(message.HasField(f("default_bool"))); - Assert.False(message.HasField(f("default_string"))); - Assert.False(message.HasField(f("default_bytes"))); - - Assert.False(message.HasField(f("default_nested_enum"))); - Assert.False(message.HasField(f("default_foreign_enum"))); - Assert.False(message.HasField(f("default_import_enum"))); - - Assert.False(message.HasField(f("default_string_piece"))); - Assert.False(message.HasField(f("default_cord"))); + Assert.IsFalse(message.HasField(f("default_int32"))); + Assert.IsFalse(message.HasField(f("default_int64"))); + Assert.IsFalse(message.HasField(f("default_uint32"))); + Assert.IsFalse(message.HasField(f("default_uint64"))); + Assert.IsFalse(message.HasField(f("default_sint32"))); + Assert.IsFalse(message.HasField(f("default_sint64"))); + Assert.IsFalse(message.HasField(f("default_fixed32"))); + Assert.IsFalse(message.HasField(f("default_fixed64"))); + Assert.IsFalse(message.HasField(f("default_sfixed32"))); + Assert.IsFalse(message.HasField(f("default_sfixed64"))); + Assert.IsFalse(message.HasField(f("default_float"))); + Assert.IsFalse(message.HasField(f("default_double"))); + Assert.IsFalse(message.HasField(f("default_bool"))); + Assert.IsFalse(message.HasField(f("default_string"))); + Assert.IsFalse(message.HasField(f("default_bytes"))); + + Assert.IsFalse(message.HasField(f("default_nested_enum"))); + Assert.IsFalse(message.HasField(f("default_foreign_enum"))); + Assert.IsFalse(message.HasField(f("default_import_enum"))); + + Assert.IsFalse(message.HasField(f("default_string_piece"))); + Assert.IsFalse(message.HasField(f("default_cord"))); // Fields with defaults have their default values (duh). - Assert.Equal(41, message[f("default_int32")]); - Assert.Equal(42L, message[f("default_int64")]); - Assert.Equal(43U, message[f("default_uint32")]); - Assert.Equal(44UL, message[f("default_uint64")]); - Assert.Equal(-45, message[f("default_sint32")]); - Assert.Equal(46L, message[f("default_sint64")]); - Assert.Equal(47U, message[f("default_fixed32")]); - Assert.Equal(48UL, message[f("default_fixed64")]); - Assert.Equal(49, message[f("default_sfixed32")]); - Assert.Equal(-50L, message[f("default_sfixed64")]); - Assert.Equal(51.5F, message[f("default_float")]); - Assert.Equal(52e3D, message[f("default_double")]); - Assert.Equal(true, message[f("default_bool")]); - Assert.Equal("hello", message[f("default_string")]); - Assert.Equal(TestUtil.ToBytes("world"), message[f("default_bytes")]); - - Assert.Equal(nestedBar, message[f("default_nested_enum")]); - Assert.Equal(foreignBar, message[f("default_foreign_enum")]); - Assert.Equal(importBar, message[f("default_import_enum")]); - - Assert.Equal("abc", message[f("default_string_piece")]); - Assert.Equal("123", message[f("default_cord")]); + Assert.AreEqual(41, message[f("default_int32")]); + Assert.AreEqual(42L, message[f("default_int64")]); + Assert.AreEqual(43U, message[f("default_uint32")]); + Assert.AreEqual(44UL, message[f("default_uint64")]); + Assert.AreEqual(-45, message[f("default_sint32")]); + Assert.AreEqual(46L, message[f("default_sint64")]); + Assert.AreEqual(47U, message[f("default_fixed32")]); + Assert.AreEqual(48UL, message[f("default_fixed64")]); + Assert.AreEqual(49, message[f("default_sfixed32")]); + Assert.AreEqual(-50L, message[f("default_sfixed64")]); + Assert.AreEqual(51.5F, message[f("default_float")]); + Assert.AreEqual(52e3D, message[f("default_double")]); + Assert.AreEqual(true, message[f("default_bool")]); + Assert.AreEqual("hello", message[f("default_string")]); + Assert.AreEqual(TestUtil.ToBytes("world"), message[f("default_bytes")]); + + Assert.AreEqual(nestedBar, message[f("default_nested_enum")]); + Assert.AreEqual(foreignBar, message[f("default_foreign_enum")]); + Assert.AreEqual(importBar, message[f("default_import_enum")]); + + Assert.AreEqual("abc", message[f("default_string_piece")]); + Assert.AreEqual("123", message[f("default_cord")]); } // --------------------------------------------------------------- @@ -802,88 +802,88 @@ namespace Google.ProtocolBuffers // ModifyRepeatedFields only sets the second repeated element of each // field. In addition to verifying this, we also verify that the first // element and size were *not* modified. - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("repeated_cord"))); - - Assert.Equal(201, message[f("repeated_int32"), 0]); - Assert.Equal(202L, message[f("repeated_int64"), 0]); - Assert.Equal(203U, message[f("repeated_uint32"), 0]); - Assert.Equal(204UL, message[f("repeated_uint64"), 0]); - Assert.Equal(205, message[f("repeated_sint32"), 0]); - Assert.Equal(206L, message[f("repeated_sint64"), 0]); - Assert.Equal(207U, message[f("repeated_fixed32"), 0]); - Assert.Equal(208UL, message[f("repeated_fixed64"), 0]); - Assert.Equal(209, message[f("repeated_sfixed32"), 0]); - Assert.Equal(210L, message[f("repeated_sfixed64"), 0]); - Assert.Equal(211F, message[f("repeated_float"), 0]); - Assert.Equal(212D, message[f("repeated_double"), 0]); - Assert.Equal(true, message[f("repeated_bool"), 0]); - Assert.Equal("215", message[f("repeated_string"), 0]); - Assert.Equal(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); - - Assert.Equal(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); - Assert.Equal(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); - Assert.Equal(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); - Assert.Equal(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); - - Assert.Equal(nestedBar, message[f("repeated_nested_enum"), 0]); - Assert.Equal(foreignBar, message[f("repeated_foreign_enum"), 0]); - Assert.Equal(importBar, message[f("repeated_import_enum"), 0]); - - Assert.Equal("224", message[f("repeated_string_piece"), 0]); - Assert.Equal("225", message[f("repeated_cord"), 0]); - - Assert.Equal(501, message[f("repeated_int32"), 1]); - Assert.Equal(502L, message[f("repeated_int64"), 1]); - Assert.Equal(503U, message[f("repeated_uint32"), 1]); - Assert.Equal(504UL, message[f("repeated_uint64"), 1]); - Assert.Equal(505, message[f("repeated_sint32"), 1]); - Assert.Equal(506L, message[f("repeated_sint64"), 1]); - Assert.Equal(507U, message[f("repeated_fixed32"), 1]); - Assert.Equal(508UL, message[f("repeated_fixed64"), 1]); - Assert.Equal(509, message[f("repeated_sfixed32"), 1]); - Assert.Equal(510L, message[f("repeated_sfixed64"), 1]); - Assert.Equal(511F, message[f("repeated_float"), 1]); - Assert.Equal(512D, message[f("repeated_double"), 1]); - Assert.Equal(true, message[f("repeated_bool"), 1]); - Assert.Equal("515", message[f("repeated_string"), 1]); - Assert.Equal(TestUtil.ToBytes("516"), message[f("repeated_bytes"), 1]); - - Assert.Equal(517, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); - Assert.Equal(518, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); - Assert.Equal(519, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); - Assert.Equal(520, ((IMessage) message[f("repeated_import_message"), 1])[importD]); - - Assert.Equal(nestedFoo, message[f("repeated_nested_enum"), 1]); - Assert.Equal(foreignFoo, message[f("repeated_foreign_enum"), 1]); - Assert.Equal(importFoo, message[f("repeated_import_enum"), 1]); - - Assert.Equal("524", message[f("repeated_string_piece"), 1]); - Assert.Equal("525", message[f("repeated_cord"), 1]); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); + + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); + + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord"))); + + Assert.AreEqual(201, message[f("repeated_int32"), 0]); + Assert.AreEqual(202L, message[f("repeated_int64"), 0]); + Assert.AreEqual(203U, message[f("repeated_uint32"), 0]); + Assert.AreEqual(204UL, message[f("repeated_uint64"), 0]); + Assert.AreEqual(205, message[f("repeated_sint32"), 0]); + Assert.AreEqual(206L, message[f("repeated_sint64"), 0]); + Assert.AreEqual(207U, message[f("repeated_fixed32"), 0]); + Assert.AreEqual(208UL, message[f("repeated_fixed64"), 0]); + Assert.AreEqual(209, message[f("repeated_sfixed32"), 0]); + Assert.AreEqual(210L, message[f("repeated_sfixed64"), 0]); + Assert.AreEqual(211F, message[f("repeated_float"), 0]); + Assert.AreEqual(212D, message[f("repeated_double"), 0]); + Assert.AreEqual(true, message[f("repeated_bool"), 0]); + Assert.AreEqual("215", message[f("repeated_string"), 0]); + Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); + + Assert.AreEqual(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); + Assert.AreEqual(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); + Assert.AreEqual(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); + Assert.AreEqual(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); + + Assert.AreEqual(nestedBar, message[f("repeated_nested_enum"), 0]); + Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"), 0]); + Assert.AreEqual(importBar, message[f("repeated_import_enum"), 0]); + + Assert.AreEqual("224", message[f("repeated_string_piece"), 0]); + Assert.AreEqual("225", message[f("repeated_cord"), 0]); + + Assert.AreEqual(501, message[f("repeated_int32"), 1]); + Assert.AreEqual(502L, message[f("repeated_int64"), 1]); + Assert.AreEqual(503U, message[f("repeated_uint32"), 1]); + Assert.AreEqual(504UL, message[f("repeated_uint64"), 1]); + Assert.AreEqual(505, message[f("repeated_sint32"), 1]); + Assert.AreEqual(506L, message[f("repeated_sint64"), 1]); + Assert.AreEqual(507U, message[f("repeated_fixed32"), 1]); + Assert.AreEqual(508UL, message[f("repeated_fixed64"), 1]); + Assert.AreEqual(509, message[f("repeated_sfixed32"), 1]); + Assert.AreEqual(510L, message[f("repeated_sfixed64"), 1]); + Assert.AreEqual(511F, message[f("repeated_float"), 1]); + Assert.AreEqual(512D, message[f("repeated_double"), 1]); + Assert.AreEqual(true, message[f("repeated_bool"), 1]); + Assert.AreEqual("515", message[f("repeated_string"), 1]); + Assert.AreEqual(TestUtil.ToBytes("516"), message[f("repeated_bytes"), 1]); + + Assert.AreEqual(517, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); + Assert.AreEqual(518, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); + Assert.AreEqual(519, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); + Assert.AreEqual(520, ((IMessage) message[f("repeated_import_message"), 1])[importD]); + + Assert.AreEqual(nestedFoo, message[f("repeated_nested_enum"), 1]); + Assert.AreEqual(foreignFoo, message[f("repeated_foreign_enum"), 1]); + Assert.AreEqual(importFoo, message[f("repeated_import_enum"), 1]); + + Assert.AreEqual("524", message[f("repeated_string_piece"), 1]); + Assert.AreEqual("525", message[f("repeated_cord"), 1]); } /// @@ -955,50 +955,50 @@ namespace Google.ProtocolBuffers public void AssertPackedFieldsSetViaReflection(IMessage message) { - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_int32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_int64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_uint32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_uint64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sint32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sint64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_fixed32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_fixed64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sfixed32"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_sfixed64"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_float"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_double"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_bool"))); - Assert.Equal(2, message.GetRepeatedFieldCount(f("packed_enum"))); - - Assert.Equal(601, message[f("packed_int32"), 0]); - Assert.Equal(602L, message[f("packed_int64"), 0]); - Assert.Equal(603u, message[f("packed_uint32"), 0]); - Assert.Equal(604uL, message[f("packed_uint64"), 0]); - Assert.Equal(605, message[f("packed_sint32"), 0]); - Assert.Equal(606L, message[f("packed_sint64"), 0]); - Assert.Equal(607u, message[f("packed_fixed32"), 0]); - Assert.Equal(608uL, message[f("packed_fixed64"), 0]); - Assert.Equal(609, message[f("packed_sfixed32"), 0]); - Assert.Equal(610L, message[f("packed_sfixed64"), 0]); - Assert.Equal(611F, message[f("packed_float"), 0]); - Assert.Equal(612D, message[f("packed_double"), 0]); - Assert.Equal(true, message[f("packed_bool"), 0]); - Assert.Equal(foreignBar, message[f("packed_enum"), 0]); - - Assert.Equal(701, message[f("packed_int32"), 1]); - Assert.Equal(702L, message[f("packed_int64"), 1]); - Assert.Equal(703u, message[f("packed_uint32"), 1]); - Assert.Equal(704uL, message[f("packed_uint64"), 1]); - Assert.Equal(705, message[f("packed_sint32"), 1]); - Assert.Equal(706L, message[f("packed_sint64"), 1]); - Assert.Equal(707u, message[f("packed_fixed32"), 1]); - Assert.Equal(708uL, message[f("packed_fixed64"), 1]); - Assert.Equal(709, message[f("packed_sfixed32"), 1]); - Assert.Equal(710L, message[f("packed_sfixed64"), 1]); - Assert.Equal(711F, message[f("packed_float"), 1]); - Assert.Equal(712D, message[f("packed_double"), 1]); - Assert.Equal(false, message[f("packed_bool"), 1]); - Assert.Equal(foreignBaz, message[f("packed_enum"), 1]); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_int32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_int64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_uint32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_uint64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sint32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sint64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_fixed32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_fixed64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sfixed32"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sfixed64"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_float"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_double"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_bool"))); + Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_enum"))); + + Assert.AreEqual(601, message[f("packed_int32"), 0]); + Assert.AreEqual(602L, message[f("packed_int64"), 0]); + Assert.AreEqual(603u, message[f("packed_uint32"), 0]); + Assert.AreEqual(604uL, message[f("packed_uint64"), 0]); + Assert.AreEqual(605, message[f("packed_sint32"), 0]); + Assert.AreEqual(606L, message[f("packed_sint64"), 0]); + Assert.AreEqual(607u, message[f("packed_fixed32"), 0]); + Assert.AreEqual(608uL, message[f("packed_fixed64"), 0]); + Assert.AreEqual(609, message[f("packed_sfixed32"), 0]); + Assert.AreEqual(610L, message[f("packed_sfixed64"), 0]); + Assert.AreEqual(611F, message[f("packed_float"), 0]); + Assert.AreEqual(612D, message[f("packed_double"), 0]); + Assert.AreEqual(true, message[f("packed_bool"), 0]); + Assert.AreEqual(foreignBar, message[f("packed_enum"), 0]); + + Assert.AreEqual(701, message[f("packed_int32"), 1]); + Assert.AreEqual(702L, message[f("packed_int64"), 1]); + Assert.AreEqual(703u, message[f("packed_uint32"), 1]); + Assert.AreEqual(704uL, message[f("packed_uint64"), 1]); + Assert.AreEqual(705, message[f("packed_sint32"), 1]); + Assert.AreEqual(706L, message[f("packed_sint64"), 1]); + Assert.AreEqual(707u, message[f("packed_fixed32"), 1]); + Assert.AreEqual(708uL, message[f("packed_fixed64"), 1]); + Assert.AreEqual(709, message[f("packed_sfixed32"), 1]); + Assert.AreEqual(710L, message[f("packed_sfixed64"), 1]); + Assert.AreEqual(711F, message[f("packed_float"), 1]); + Assert.AreEqual(712D, message[f("packed_double"), 1]); + Assert.AreEqual(false, message[f("packed_bool"), 1]); + Assert.AreEqual(foreignBaz, message[f("packed_enum"), 1]); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs b/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs index e6b6a1b3..4f25a5ab 100644 --- a/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs +++ b/csharp/src/ProtocolBuffers.Test/ReusableBuilderTest.cs @@ -2,14 +2,14 @@ using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.TestProtos; using UnitTest.Issues.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class ReusableBuilderTest { //Issue 28: Circular message dependencies result in null defaults for DefaultInstance - [Fact] + [Test] public void EnsureStaticCicularReference() { MyMessageAReferenceB ab = MyMessageAReferenceB.DefaultInstance; @@ -20,24 +20,24 @@ namespace Google.ProtocolBuffers Assert.NotNull(ba.Value); } - [Fact] + [Test] public void TestModifyDefaultInstance() { //verify that the default instance has correctly been marked as read-only - Assert.Equal(typeof(PopsicleList), TestAllTypes.DefaultInstance.RepeatedBoolList.GetType()); + Assert.AreEqual(typeof(PopsicleList), TestAllTypes.DefaultInstance.RepeatedBoolList.GetType()); PopsicleList list = (PopsicleList)TestAllTypes.DefaultInstance.RepeatedBoolList; - Assert.True(list.IsReadOnly); + Assert.IsTrue(list.IsReadOnly); } - [Fact] + [Test] public void TestUnmodifiedDefaultInstance() { //Simply calling ToBuilder().Build() no longer creates a copy of the message TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void BuildMultipleWithoutChange() { //Calling Build() or BuildPartial() does not require a copy of the message @@ -46,31 +46,31 @@ namespace Google.ProtocolBuffers TestAllTypes first = builder.BuildPartial(); //Still the same instance? - Assert.True(ReferenceEquals(first, builder.Build())); + Assert.IsTrue(ReferenceEquals(first, builder.Build())); //Still the same instance? - Assert.True(ReferenceEquals(first, builder.BuildPartial().ToBuilder().Build())); + Assert.IsTrue(ReferenceEquals(first, builder.BuildPartial().ToBuilder().Build())); } - [Fact] + [Test] public void MergeFromDefaultInstance() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.MergeFrom(TestAllTypes.DefaultInstance); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void BuildNewBuilderIsDefaultInstance() { - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, new TestAllTypes.Builder().Build())); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, new TestAllTypes.Builder().Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().Build())); //last test, if you clear a builder it reverts to default instance - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().SetOptionalBool(true).Build().ToBuilder().Clear().Build())); } - [Fact] + [Test] public void BuildModifyAndRebuild() { TestAllTypes.Builder b1 = new TestAllTypes.Builder(); @@ -86,80 +86,80 @@ namespace Google.ProtocolBuffers TestAllTypes m2 = b1.Build(); - Assert.Equal("{\"optional_foreign_message\":{},\"repeated_int32\":[2],\"default_int32\":1}", Extensions.ToJson(m1)); - Assert.Equal("{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}", Extensions.ToJson(m2)); + Assert.AreEqual("{\"optional_foreign_message\":{},\"repeated_int32\":[2],\"default_int32\":1}", Extensions.ToJson(m1)); + Assert.AreEqual("{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}", Extensions.ToJson(m2)); } - [Fact] + [Test] public void CloneOnChangePrimitive() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.SetDefaultBool(true); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void CloneOnAddRepeatedBool() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.AddRepeatedBool(true); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void CloneOnGetRepeatedBoolList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); GC.KeepAlive(builder.RepeatedBoolList); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void CloneOnChangeMessage() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.SetOptionalForeignMessage(new ForeignMessage.Builder()); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void CloneOnClearMessage() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.ClearOptionalForeignMessage(); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void CloneOnGetRepeatedForeignMessageList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); GC.KeepAlive(builder.RepeatedForeignMessageList); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void CloneOnChangeEnumValue() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); builder.SetOptionalForeignEnum(ForeignEnum.FOREIGN_BAR); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Fact] + [Test] public void CloneOnGetRepeatedForeignEnumList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.True(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); GC.KeepAlive(builder.RepeatedForeignEnumList); - Assert.False(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); + Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } } diff --git a/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs b/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs index 5bec24f1..b60e7fae 100644 --- a/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs +++ b/csharp/src/ProtocolBuffers.Test/TestCornerCases.cs @@ -1,11 +1,11 @@ using UnitTest.Issues.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class TestCornerCases { - [Fact] + [Test] public void TestRoundTripNegativeEnums() { NegativeEnumMessage msg = NegativeEnumMessage.CreateBuilder() @@ -19,16 +19,16 @@ namespace Google.ProtocolBuffers .AddPackedValues(NegativeEnum.FiveBelow) //10 .Build(); - Assert.Equal(58, msg.SerializedSize); + Assert.AreEqual(58, msg.SerializedSize); byte[] bytes = new byte[58]; CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); msg.WriteTo(output); - Assert.Equal(0, output.SpaceLeft); + Assert.AreEqual(0, output.SpaceLeft); NegativeEnumMessage copy = NegativeEnumMessage.ParseFrom(bytes); - Assert.Equal(msg, copy); + Assert.AreEqual(msg, copy); } } } diff --git a/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs b/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs index 5caa2e23..da0d9eef 100644 --- a/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs +++ b/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs @@ -5,7 +5,7 @@ using System.Text; using Google.ProtocolBuffers.Serialization; using Google.ProtocolBuffers.Serialization.Http; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -16,91 +16,91 @@ namespace Google.ProtocolBuffers readonly IEnumerable XmlTypes = new string[] { "text/xml", "application/xml" }; readonly IEnumerable ProtobufTypes = new string[] { "application/binary", "application/x-protobuf", "application/vnd.google.protobuf" }; - [Fact] + [Test] public void TestReadJsonMimeTypes() { foreach (string type in JsonTypes) { - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) is JsonFormatReader); } - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) is JsonFormatReader); } - [Fact] + [Test] public void TestWriteJsonMimeTypes() { foreach (string type in JsonTypes) { - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) is JsonFormatWriter); } - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) is JsonFormatWriter); } - [Fact] + [Test] public void TestReadXmlMimeTypes() { foreach (string type in XmlTypes) { - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) is XmlFormatReader); } - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) is XmlFormatReader); } - [Fact] + [Test] public void TestWriteXmlMimeTypes() { foreach (string type in XmlTypes) { - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) is XmlFormatWriter); } - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) is XmlFormatWriter); } - [Fact] + [Test] public void TestReadProtoMimeTypes() { foreach (string type in ProtobufTypes) { - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) is CodedInputStream); } - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) is CodedInputStream); } - [Fact] + [Test] public void TestWriteProtoMimeTypes() { foreach (string type in ProtobufTypes) { - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) is CodedOutputStream); } - Assert.True( + Assert.IsTrue( MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) is CodedOutputStream); } - [Fact] + [Test] public void TestMergeFromJsonType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), @@ -108,11 +108,11 @@ namespace Google.ProtocolBuffers Extensions.ToJson(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) ))) .Build(); - Assert.Equal("a", msg.Text); - Assert.Equal(1, msg.Number); + Assert.AreEqual("a", msg.Text); + Assert.AreEqual(1, msg.Number); } - [Fact] + [Test] public void TestMergeFromXmlType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), @@ -120,10 +120,10 @@ namespace Google.ProtocolBuffers Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) ))) .Build(); - Assert.Equal("a", msg.Text); - Assert.Equal(1, msg.Number); + Assert.AreEqual("a", msg.Text); + Assert.AreEqual(1, msg.Number); } - [Fact] + [Test] public void TestMergeFromProtoType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), @@ -131,30 +131,30 @@ namespace Google.ProtocolBuffers TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray() )) .Build(); - Assert.Equal("a", msg.Text); - Assert.Equal(1, msg.Number); + Assert.AreEqual("a", msg.Text); + Assert.AreEqual(1, msg.Number); } - [Fact] + [Test] public void TestWriteToJsonType() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions(), "application/json", ms); - Assert.Equal(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.AreEqual(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Fact] + [Test] public void TestWriteToXmlType() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions(), "application/xml", ms); - Assert.Equal("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Fact] + [Test] public void TestWriteToProtoType() { MemoryStream ms = new MemoryStream(); @@ -162,10 +162,10 @@ namespace Google.ProtocolBuffers new MessageFormatOptions(), "application/vnd.google.protobuf", ms); byte[] bytes = TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray(); - Assert.Equal(bytes, ms.ToArray()); + Assert.AreEqual(bytes, ms.ToArray()); } - [Fact] + [Test] public void TestXmlReaderOptions() { MemoryStream ms = new MemoryStream(); @@ -184,13 +184,13 @@ namespace Google.ProtocolBuffers options, "application/xml", ms) .Build(); - Assert.Equal("a", msg.Text); - Assert.Equal(1, msg.NumbersList[0]); - Assert.Equal(2, msg.NumbersList[1]); + Assert.AreEqual("a", msg.Text); + Assert.AreEqual(1, msg.NumbersList[0]); + Assert.AreEqual(2, msg.NumbersList[1]); } - [Fact] + [Test] public void TestXmlWriterOptions() { TestXmlMessage message = TestXmlMessage.CreateBuilder().SetText("a").AddNumbers(1).AddNumbers(2).Build(); @@ -209,32 +209,32 @@ namespace Google.ProtocolBuffers .SetOptions(XmlReaderOptions.ReadNestedArrays) .Merge("root-node", builder); - Assert.Equal("a", builder.Text); - Assert.Equal(1, builder.NumbersList[0]); - Assert.Equal(2, builder.NumbersList[1]); + Assert.AreEqual("a", builder.Text); + Assert.AreEqual(1, builder.NumbersList[0]); + Assert.AreEqual(2, builder.NumbersList[1]); } - [Fact] + [Test] public void TestJsonFormatted() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions() { FormattedOutput = true }, "application/json", ms); - Assert.Equal("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Fact] + [Test] public void TestXmlFormatted() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions() { FormattedOutput = true }, "application/xml", ms); - Assert.Equal("\r\n a\r\n 1\r\n", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.AreEqual("\r\n a\r\n 1\r\n", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Fact] + [Test] public void TestReadCustomMimeTypes() { var options = new MessageFormatOptions(); @@ -242,7 +242,7 @@ namespace Google.ProtocolBuffers options.MimeInputTypes.Clear(); //Add our own options.MimeInputTypes.Add("-custom-XML-mime-type-", XmlFormatReader.CreateInstance); - Assert.Equal(1, options.MimeInputTypes.Count); + Assert.AreEqual(1, options.MimeInputTypes.Count); Stream xmlStream = new MemoryStream(Encoding.UTF8.GetBytes( Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) @@ -251,11 +251,11 @@ namespace Google.ProtocolBuffers TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), options, "-custom-XML-mime-type-", xmlStream) .Build(); - Assert.Equal("a", msg.Text); - Assert.Equal(1, msg.Number); + Assert.AreEqual("a", msg.Text); + Assert.AreEqual(1, msg.Number); } - [Fact] + [Test] public void TestWriteToCustomType() { var options = new MessageFormatOptions(); @@ -264,13 +264,13 @@ namespace Google.ProtocolBuffers //Add our own options.MimeOutputTypes.Add("-custom-XML-mime-type-", XmlFormatWriter.CreateInstance); - Assert.Equal(1, options.MimeOutputTypes.Count); + Assert.AreEqual(1, options.MimeOutputTypes.Count); MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), options, "-custom-XML-mime-type-", ms); - Assert.Equal("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs b/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs index b262667a..f1d2bfad 100644 --- a/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs +++ b/csharp/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs @@ -3,13 +3,13 @@ using System.IO; using System.Text; using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.Serialization.Http; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class TestReaderForUrlEncoded { - [Fact] + [Test] public void Example_FromQueryString() { Uri sampleUri = new Uri("http://sample.com/Path/File.ext?text=two+three%20four&valid=true&numbers=1&numbers=2", UriKind.Absolute); @@ -20,14 +20,14 @@ namespace Google.ProtocolBuffers builder.MergeFrom(input); TestXmlMessage message = builder.Build(); - Assert.Equal(true, message.Valid); - Assert.Equal("two three four", message.Text); - Assert.Equal(2, message.NumbersCount); - Assert.Equal(1, message.NumbersList[0]); - Assert.Equal(2, message.NumbersList[1]); + Assert.AreEqual(true, message.Valid); + Assert.AreEqual("two three four", message.Text); + Assert.AreEqual(2, message.NumbersCount); + Assert.AreEqual(1, message.NumbersList[0]); + Assert.AreEqual(2, message.NumbersList[1]); } - [Fact] + [Test] public void Example_FromFormData() { Stream rawPost = new MemoryStream(Encoding.UTF8.GetBytes("text=two+three%20four&valid=true&numbers=1&numbers=2"), false); @@ -38,42 +38,42 @@ namespace Google.ProtocolBuffers builder.MergeFrom(input); TestXmlMessage message = builder.Build(); - Assert.Equal(true, message.Valid); - Assert.Equal("two three four", message.Text); - Assert.Equal(2, message.NumbersCount); - Assert.Equal(1, message.NumbersList[0]); - Assert.Equal(2, message.NumbersList[1]); + Assert.AreEqual(true, message.Valid); + Assert.AreEqual("two three four", message.Text); + Assert.AreEqual(2, message.NumbersCount); + Assert.AreEqual(1, message.NumbersList[0]); + Assert.AreEqual(2, message.NumbersList[1]); } - [Fact] + [Test] public void TestEmptyValues() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text=&numbers=1"); TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); builder.MergeFrom(input); - Assert.True(builder.Valid); - Assert.True(builder.HasText); - Assert.Equal("", builder.Text); - Assert.Equal(1, builder.NumbersCount); - Assert.Equal(1, builder.NumbersList[0]); + Assert.IsTrue(builder.Valid); + Assert.IsTrue(builder.HasText); + Assert.AreEqual("", builder.Text); + Assert.AreEqual(1, builder.NumbersCount); + Assert.AreEqual(1, builder.NumbersList[0]); } - [Fact] + [Test] public void TestNoValue() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text&numbers=1"); TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); builder.MergeFrom(input); - Assert.True(builder.Valid); - Assert.True(builder.HasText); - Assert.Equal("", builder.Text); - Assert.Equal(1, builder.NumbersCount); - Assert.Equal(1, builder.NumbersList[0]); + Assert.IsTrue(builder.Valid); + Assert.IsTrue(builder.HasText); + Assert.AreEqual("", builder.Text); + Assert.AreEqual(1, builder.NumbersCount); + Assert.AreEqual(1, builder.NumbersList[0]); } - [Fact] + [Test] public void FormUrlEncodedReaderDoesNotSupportChildren() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("child=uh0"); diff --git a/csharp/src/ProtocolBuffers.Test/TestUtil.cs b/csharp/src/ProtocolBuffers.Test/TestUtil.cs index 83509c18..583e8090 100644 --- a/csharp/src/ProtocolBuffers.Test/TestUtil.cs +++ b/csharp/src/ProtocolBuffers.Test/TestUtil.cs @@ -41,7 +41,7 @@ using System.IO; using System.Text; using System.Threading; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -324,343 +324,343 @@ namespace Google.ProtocolBuffers /// internal static void AssertAllFieldsSet(TestAllTypes message) { - Assert.True(message.HasOptionalInt32); - Assert.True(message.HasOptionalInt64); - Assert.True(message.HasOptionalUint32); - Assert.True(message.HasOptionalUint64); - Assert.True(message.HasOptionalSint32); - Assert.True(message.HasOptionalSint64); - Assert.True(message.HasOptionalFixed32); - Assert.True(message.HasOptionalFixed64); - Assert.True(message.HasOptionalSfixed32); - Assert.True(message.HasOptionalSfixed64); - Assert.True(message.HasOptionalFloat); - Assert.True(message.HasOptionalDouble); - Assert.True(message.HasOptionalBool); - Assert.True(message.HasOptionalString); - Assert.True(message.HasOptionalBytes); - - Assert.True(message.HasOptionalGroup); - Assert.True(message.HasOptionalNestedMessage); - Assert.True(message.HasOptionalForeignMessage); - Assert.True(message.HasOptionalImportMessage); - - Assert.True(message.OptionalGroup.HasA); - Assert.True(message.OptionalNestedMessage.HasBb); - Assert.True(message.OptionalForeignMessage.HasC); - Assert.True(message.OptionalImportMessage.HasD); - - Assert.True(message.HasOptionalNestedEnum); - Assert.True(message.HasOptionalForeignEnum); - Assert.True(message.HasOptionalImportEnum); - - Assert.True(message.HasOptionalStringPiece); - Assert.True(message.HasOptionalCord); - - Assert.Equal(101, message.OptionalInt32); - Assert.Equal(102, message.OptionalInt64); - Assert.Equal(103u, message.OptionalUint32); - Assert.Equal(104u, message.OptionalUint64); - Assert.Equal(105, message.OptionalSint32); - Assert.Equal(106, message.OptionalSint64); - Assert.Equal(107u, message.OptionalFixed32); - Assert.Equal(108u, message.OptionalFixed64); - Assert.Equal(109, message.OptionalSfixed32); - Assert.Equal(110, message.OptionalSfixed64); - Assert.Equal(111, message.OptionalFloat); - Assert.Equal(112, message.OptionalDouble); - Assert.Equal(true, message.OptionalBool); - Assert.Equal("115", message.OptionalString); - Assert.Equal(ToBytes("116"), message.OptionalBytes); - - Assert.Equal(117, message.OptionalGroup.A); - Assert.Equal(118, message.OptionalNestedMessage.Bb); - Assert.Equal(119, message.OptionalForeignMessage.C); - Assert.Equal(120, message.OptionalImportMessage.D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, message.OptionalNestedEnum); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.OptionalForeignEnum); - Assert.Equal(ImportEnum.IMPORT_BAZ, message.OptionalImportEnum); - - Assert.Equal("124", message.OptionalStringPiece); - Assert.Equal("125", message.OptionalCord); + Assert.IsTrue(message.HasOptionalInt32); + Assert.IsTrue(message.HasOptionalInt64); + Assert.IsTrue(message.HasOptionalUint32); + Assert.IsTrue(message.HasOptionalUint64); + Assert.IsTrue(message.HasOptionalSint32); + Assert.IsTrue(message.HasOptionalSint64); + Assert.IsTrue(message.HasOptionalFixed32); + Assert.IsTrue(message.HasOptionalFixed64); + Assert.IsTrue(message.HasOptionalSfixed32); + Assert.IsTrue(message.HasOptionalSfixed64); + Assert.IsTrue(message.HasOptionalFloat); + Assert.IsTrue(message.HasOptionalDouble); + Assert.IsTrue(message.HasOptionalBool); + Assert.IsTrue(message.HasOptionalString); + Assert.IsTrue(message.HasOptionalBytes); + + Assert.IsTrue(message.HasOptionalGroup); + Assert.IsTrue(message.HasOptionalNestedMessage); + Assert.IsTrue(message.HasOptionalForeignMessage); + Assert.IsTrue(message.HasOptionalImportMessage); + + Assert.IsTrue(message.OptionalGroup.HasA); + Assert.IsTrue(message.OptionalNestedMessage.HasBb); + Assert.IsTrue(message.OptionalForeignMessage.HasC); + Assert.IsTrue(message.OptionalImportMessage.HasD); + + Assert.IsTrue(message.HasOptionalNestedEnum); + Assert.IsTrue(message.HasOptionalForeignEnum); + Assert.IsTrue(message.HasOptionalImportEnum); + + Assert.IsTrue(message.HasOptionalStringPiece); + Assert.IsTrue(message.HasOptionalCord); + + Assert.AreEqual(101, message.OptionalInt32); + Assert.AreEqual(102, message.OptionalInt64); + Assert.AreEqual(103u, message.OptionalUint32); + Assert.AreEqual(104u, message.OptionalUint64); + Assert.AreEqual(105, message.OptionalSint32); + Assert.AreEqual(106, message.OptionalSint64); + Assert.AreEqual(107u, message.OptionalFixed32); + Assert.AreEqual(108u, message.OptionalFixed64); + Assert.AreEqual(109, message.OptionalSfixed32); + Assert.AreEqual(110, message.OptionalSfixed64); + Assert.AreEqual(111, message.OptionalFloat); + Assert.AreEqual(112, message.OptionalDouble); + Assert.AreEqual(true, message.OptionalBool); + Assert.AreEqual("115", message.OptionalString); + Assert.AreEqual(ToBytes("116"), message.OptionalBytes); + + Assert.AreEqual(117, message.OptionalGroup.A); + Assert.AreEqual(118, message.OptionalNestedMessage.Bb); + Assert.AreEqual(119, message.OptionalForeignMessage.C); + Assert.AreEqual(120, message.OptionalImportMessage.D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.OptionalNestedEnum); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.OptionalForeignEnum); + Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.OptionalImportEnum); + + Assert.AreEqual("124", message.OptionalStringPiece); + Assert.AreEqual("125", message.OptionalCord); // ----------------------------------------------------------------- - Assert.Equal(2, message.RepeatedInt32Count); - Assert.Equal(2, message.RepeatedInt64Count); - Assert.Equal(2, message.RepeatedUint32Count); - Assert.Equal(2, message.RepeatedUint64Count); - Assert.Equal(2, message.RepeatedSint32Count); - Assert.Equal(2, message.RepeatedSint64Count); - Assert.Equal(2, message.RepeatedFixed32Count); - Assert.Equal(2, message.RepeatedFixed64Count); - Assert.Equal(2, message.RepeatedSfixed32Count); - Assert.Equal(2, message.RepeatedSfixed64Count); - Assert.Equal(2, message.RepeatedFloatCount); - Assert.Equal(2, message.RepeatedDoubleCount); - Assert.Equal(2, message.RepeatedBoolCount); - Assert.Equal(2, message.RepeatedStringCount); - Assert.Equal(2, message.RepeatedBytesCount); - - Assert.Equal(2, message.RepeatedGroupCount); - Assert.Equal(2, message.RepeatedNestedMessageCount); - Assert.Equal(2, message.RepeatedForeignMessageCount); - Assert.Equal(2, message.RepeatedImportMessageCount); - Assert.Equal(2, message.RepeatedNestedEnumCount); - Assert.Equal(2, message.RepeatedForeignEnumCount); - Assert.Equal(2, message.RepeatedImportEnumCount); - - Assert.Equal(2, message.RepeatedStringPieceCount); - Assert.Equal(2, message.RepeatedCordCount); - - Assert.Equal(201, message.GetRepeatedInt32(0)); - Assert.Equal(202, message.GetRepeatedInt64(0)); - Assert.Equal(203u, message.GetRepeatedUint32(0)); - Assert.Equal(204u, message.GetRepeatedUint64(0)); - Assert.Equal(205, message.GetRepeatedSint32(0)); - Assert.Equal(206, message.GetRepeatedSint64(0)); - Assert.Equal(207u, message.GetRepeatedFixed32(0)); - Assert.Equal(208u, message.GetRepeatedFixed64(0)); - Assert.Equal(209, message.GetRepeatedSfixed32(0)); - Assert.Equal(210, message.GetRepeatedSfixed64(0)); - Assert.Equal(211, message.GetRepeatedFloat(0)); - Assert.Equal(212, message.GetRepeatedDouble(0)); - Assert.Equal(true, message.GetRepeatedBool(0)); - Assert.Equal("215", message.GetRepeatedString(0)); - Assert.Equal(ToBytes("216"), message.GetRepeatedBytes(0)); - - Assert.Equal(217, message.GetRepeatedGroup(0).A); - Assert.Equal(218, message.GetRepeatedNestedMessage(0).Bb); - Assert.Equal(219, message.GetRepeatedForeignMessage(0).C); - Assert.Equal(220, message.GetRepeatedImportMessage(0).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); - Assert.Equal(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); - - Assert.Equal("224", message.GetRepeatedStringPiece(0)); - Assert.Equal("225", message.GetRepeatedCord(0)); - - Assert.Equal(301, message.GetRepeatedInt32(1)); - Assert.Equal(302, message.GetRepeatedInt64(1)); - Assert.Equal(303u, message.GetRepeatedUint32(1)); - Assert.Equal(304u, message.GetRepeatedUint64(1)); - Assert.Equal(305, message.GetRepeatedSint32(1)); - Assert.Equal(306, message.GetRepeatedSint64(1)); - Assert.Equal(307u, message.GetRepeatedFixed32(1)); - Assert.Equal(308u, message.GetRepeatedFixed64(1)); - Assert.Equal(309, message.GetRepeatedSfixed32(1)); - Assert.Equal(310, message.GetRepeatedSfixed64(1)); - Assert.Equal(311f, message.GetRepeatedFloat(1)); - Assert.Equal(312d, message.GetRepeatedDouble(1)); - Assert.Equal(false, message.GetRepeatedBool(1)); - Assert.Equal("315", message.GetRepeatedString(1)); - Assert.Equal(ToBytes("316"), message.GetRepeatedBytes(1)); - - Assert.Equal(317, message.GetRepeatedGroup(1).A); - Assert.Equal(318, message.GetRepeatedNestedMessage(1).Bb); - Assert.Equal(319, message.GetRepeatedForeignMessage(1).C); - Assert.Equal(320, message.GetRepeatedImportMessage(1).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, message.GetRepeatedNestedEnum(1)); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetRepeatedForeignEnum(1)); - Assert.Equal(ImportEnum.IMPORT_BAZ, message.GetRepeatedImportEnum(1)); - - Assert.Equal("324", message.GetRepeatedStringPiece(1)); - Assert.Equal("325", message.GetRepeatedCord(1)); + Assert.AreEqual(2, message.RepeatedInt32Count); + Assert.AreEqual(2, message.RepeatedInt64Count); + Assert.AreEqual(2, message.RepeatedUint32Count); + Assert.AreEqual(2, message.RepeatedUint64Count); + Assert.AreEqual(2, message.RepeatedSint32Count); + Assert.AreEqual(2, message.RepeatedSint64Count); + Assert.AreEqual(2, message.RepeatedFixed32Count); + Assert.AreEqual(2, message.RepeatedFixed64Count); + Assert.AreEqual(2, message.RepeatedSfixed32Count); + Assert.AreEqual(2, message.RepeatedSfixed64Count); + Assert.AreEqual(2, message.RepeatedFloatCount); + Assert.AreEqual(2, message.RepeatedDoubleCount); + Assert.AreEqual(2, message.RepeatedBoolCount); + Assert.AreEqual(2, message.RepeatedStringCount); + Assert.AreEqual(2, message.RepeatedBytesCount); + + Assert.AreEqual(2, message.RepeatedGroupCount); + Assert.AreEqual(2, message.RepeatedNestedMessageCount); + Assert.AreEqual(2, message.RepeatedForeignMessageCount); + Assert.AreEqual(2, message.RepeatedImportMessageCount); + Assert.AreEqual(2, message.RepeatedNestedEnumCount); + Assert.AreEqual(2, message.RepeatedForeignEnumCount); + Assert.AreEqual(2, message.RepeatedImportEnumCount); + + Assert.AreEqual(2, message.RepeatedStringPieceCount); + Assert.AreEqual(2, message.RepeatedCordCount); + + Assert.AreEqual(201, message.GetRepeatedInt32(0)); + Assert.AreEqual(202, message.GetRepeatedInt64(0)); + Assert.AreEqual(203u, message.GetRepeatedUint32(0)); + Assert.AreEqual(204u, message.GetRepeatedUint64(0)); + Assert.AreEqual(205, message.GetRepeatedSint32(0)); + Assert.AreEqual(206, message.GetRepeatedSint64(0)); + Assert.AreEqual(207u, message.GetRepeatedFixed32(0)); + Assert.AreEqual(208u, message.GetRepeatedFixed64(0)); + Assert.AreEqual(209, message.GetRepeatedSfixed32(0)); + Assert.AreEqual(210, message.GetRepeatedSfixed64(0)); + Assert.AreEqual(211, message.GetRepeatedFloat(0)); + Assert.AreEqual(212, message.GetRepeatedDouble(0)); + Assert.AreEqual(true, message.GetRepeatedBool(0)); + Assert.AreEqual("215", message.GetRepeatedString(0)); + Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0)); + + Assert.AreEqual(217, message.GetRepeatedGroup(0).A); + Assert.AreEqual(218, message.GetRepeatedNestedMessage(0).Bb); + Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C); + Assert.AreEqual(220, message.GetRepeatedImportMessage(0).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); + Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); + + Assert.AreEqual("224", message.GetRepeatedStringPiece(0)); + Assert.AreEqual("225", message.GetRepeatedCord(0)); + + Assert.AreEqual(301, message.GetRepeatedInt32(1)); + Assert.AreEqual(302, message.GetRepeatedInt64(1)); + Assert.AreEqual(303u, message.GetRepeatedUint32(1)); + Assert.AreEqual(304u, message.GetRepeatedUint64(1)); + Assert.AreEqual(305, message.GetRepeatedSint32(1)); + Assert.AreEqual(306, message.GetRepeatedSint64(1)); + Assert.AreEqual(307u, message.GetRepeatedFixed32(1)); + Assert.AreEqual(308u, message.GetRepeatedFixed64(1)); + Assert.AreEqual(309, message.GetRepeatedSfixed32(1)); + Assert.AreEqual(310, message.GetRepeatedSfixed64(1)); + Assert.AreEqual(311f, message.GetRepeatedFloat(1)); + Assert.AreEqual(312d, message.GetRepeatedDouble(1)); + Assert.AreEqual(false, message.GetRepeatedBool(1)); + Assert.AreEqual("315", message.GetRepeatedString(1)); + Assert.AreEqual(ToBytes("316"), message.GetRepeatedBytes(1)); + + Assert.AreEqual(317, message.GetRepeatedGroup(1).A); + Assert.AreEqual(318, message.GetRepeatedNestedMessage(1).Bb); + Assert.AreEqual(319, message.GetRepeatedForeignMessage(1).C); + Assert.AreEqual(320, message.GetRepeatedImportMessage(1).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetRepeatedNestedEnum(1)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetRepeatedForeignEnum(1)); + Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetRepeatedImportEnum(1)); + + Assert.AreEqual("324", message.GetRepeatedStringPiece(1)); + Assert.AreEqual("325", message.GetRepeatedCord(1)); // ----------------------------------------------------------------- - Assert.True(message.HasDefaultInt32); - Assert.True(message.HasDefaultInt64); - Assert.True(message.HasDefaultUint32); - Assert.True(message.HasDefaultUint64); - Assert.True(message.HasDefaultSint32); - Assert.True(message.HasDefaultSint64); - Assert.True(message.HasDefaultFixed32); - Assert.True(message.HasDefaultFixed64); - Assert.True(message.HasDefaultSfixed32); - Assert.True(message.HasDefaultSfixed64); - Assert.True(message.HasDefaultFloat); - Assert.True(message.HasDefaultDouble); - Assert.True(message.HasDefaultBool); - Assert.True(message.HasDefaultString); - Assert.True(message.HasDefaultBytes); - - Assert.True(message.HasDefaultNestedEnum); - Assert.True(message.HasDefaultForeignEnum); - Assert.True(message.HasDefaultImportEnum); - - Assert.True(message.HasDefaultStringPiece); - Assert.True(message.HasDefaultCord); - - Assert.Equal(401, message.DefaultInt32); - Assert.Equal(402, message.DefaultInt64); - Assert.Equal(403u, message.DefaultUint32); - Assert.Equal(404u, message.DefaultUint64); - Assert.Equal(405, message.DefaultSint32); - Assert.Equal(406, message.DefaultSint64); - Assert.Equal(407u, message.DefaultFixed32); - Assert.Equal(408u, message.DefaultFixed64); - Assert.Equal(409, message.DefaultSfixed32); - Assert.Equal(410, message.DefaultSfixed64); - Assert.Equal(411, message.DefaultFloat); - Assert.Equal(412, message.DefaultDouble); - Assert.Equal(false, message.DefaultBool); - Assert.Equal("415", message.DefaultString); - Assert.Equal(ToBytes("416"), message.DefaultBytes); - - Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.DefaultNestedEnum); - Assert.Equal(ForeignEnum.FOREIGN_FOO, message.DefaultForeignEnum); - Assert.Equal(ImportEnum.IMPORT_FOO, message.DefaultImportEnum); - - Assert.Equal("424", message.DefaultStringPiece); - Assert.Equal("425", message.DefaultCord); + Assert.IsTrue(message.HasDefaultInt32); + Assert.IsTrue(message.HasDefaultInt64); + Assert.IsTrue(message.HasDefaultUint32); + Assert.IsTrue(message.HasDefaultUint64); + Assert.IsTrue(message.HasDefaultSint32); + Assert.IsTrue(message.HasDefaultSint64); + Assert.IsTrue(message.HasDefaultFixed32); + Assert.IsTrue(message.HasDefaultFixed64); + Assert.IsTrue(message.HasDefaultSfixed32); + Assert.IsTrue(message.HasDefaultSfixed64); + Assert.IsTrue(message.HasDefaultFloat); + Assert.IsTrue(message.HasDefaultDouble); + Assert.IsTrue(message.HasDefaultBool); + Assert.IsTrue(message.HasDefaultString); + Assert.IsTrue(message.HasDefaultBytes); + + Assert.IsTrue(message.HasDefaultNestedEnum); + Assert.IsTrue(message.HasDefaultForeignEnum); + Assert.IsTrue(message.HasDefaultImportEnum); + + Assert.IsTrue(message.HasDefaultStringPiece); + Assert.IsTrue(message.HasDefaultCord); + + Assert.AreEqual(401, message.DefaultInt32); + Assert.AreEqual(402, message.DefaultInt64); + Assert.AreEqual(403u, message.DefaultUint32); + Assert.AreEqual(404u, message.DefaultUint64); + Assert.AreEqual(405, message.DefaultSint32); + Assert.AreEqual(406, message.DefaultSint64); + Assert.AreEqual(407u, message.DefaultFixed32); + Assert.AreEqual(408u, message.DefaultFixed64); + Assert.AreEqual(409, message.DefaultSfixed32); + Assert.AreEqual(410, message.DefaultSfixed64); + Assert.AreEqual(411, message.DefaultFloat); + Assert.AreEqual(412, message.DefaultDouble); + Assert.AreEqual(false, message.DefaultBool); + Assert.AreEqual("415", message.DefaultString); + Assert.AreEqual(ToBytes("416"), message.DefaultBytes); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.DefaultNestedEnum); + Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.DefaultForeignEnum); + Assert.AreEqual(ImportEnum.IMPORT_FOO, message.DefaultImportEnum); + + Assert.AreEqual("424", message.DefaultStringPiece); + Assert.AreEqual("425", message.DefaultCord); } internal static void AssertClear(TestAllTypes message) { // HasBlah() should initially be false for all optional fields. - Assert.False(message.HasOptionalInt32); - Assert.False(message.HasOptionalInt64); - Assert.False(message.HasOptionalUint32); - Assert.False(message.HasOptionalUint64); - Assert.False(message.HasOptionalSint32); - Assert.False(message.HasOptionalSint64); - Assert.False(message.HasOptionalFixed32); - Assert.False(message.HasOptionalFixed64); - Assert.False(message.HasOptionalSfixed32); - Assert.False(message.HasOptionalSfixed64); - Assert.False(message.HasOptionalFloat); - Assert.False(message.HasOptionalDouble); - Assert.False(message.HasOptionalBool); - Assert.False(message.HasOptionalString); - Assert.False(message.HasOptionalBytes); - - Assert.False(message.HasOptionalGroup); - Assert.False(message.HasOptionalNestedMessage); - Assert.False(message.HasOptionalForeignMessage); - Assert.False(message.HasOptionalImportMessage); - - Assert.False(message.HasOptionalNestedEnum); - Assert.False(message.HasOptionalForeignEnum); - Assert.False(message.HasOptionalImportEnum); - - Assert.False(message.HasOptionalStringPiece); - Assert.False(message.HasOptionalCord); + Assert.IsFalse(message.HasOptionalInt32); + Assert.IsFalse(message.HasOptionalInt64); + Assert.IsFalse(message.HasOptionalUint32); + Assert.IsFalse(message.HasOptionalUint64); + Assert.IsFalse(message.HasOptionalSint32); + Assert.IsFalse(message.HasOptionalSint64); + Assert.IsFalse(message.HasOptionalFixed32); + Assert.IsFalse(message.HasOptionalFixed64); + Assert.IsFalse(message.HasOptionalSfixed32); + Assert.IsFalse(message.HasOptionalSfixed64); + Assert.IsFalse(message.HasOptionalFloat); + Assert.IsFalse(message.HasOptionalDouble); + Assert.IsFalse(message.HasOptionalBool); + Assert.IsFalse(message.HasOptionalString); + Assert.IsFalse(message.HasOptionalBytes); + + Assert.IsFalse(message.HasOptionalGroup); + Assert.IsFalse(message.HasOptionalNestedMessage); + Assert.IsFalse(message.HasOptionalForeignMessage); + Assert.IsFalse(message.HasOptionalImportMessage); + + Assert.IsFalse(message.HasOptionalNestedEnum); + Assert.IsFalse(message.HasOptionalForeignEnum); + Assert.IsFalse(message.HasOptionalImportEnum); + + Assert.IsFalse(message.HasOptionalStringPiece); + Assert.IsFalse(message.HasOptionalCord); // Optional fields without defaults are set to zero or something like it. - Assert.Equal(0, message.OptionalInt32); - Assert.Equal(0, message.OptionalInt64); - Assert.Equal(0u, message.OptionalUint32); - Assert.Equal(0u, message.OptionalUint64); - Assert.Equal(0, message.OptionalSint32); - Assert.Equal(0, message.OptionalSint64); - Assert.Equal(0u, message.OptionalFixed32); - Assert.Equal(0u, message.OptionalFixed64); - Assert.Equal(0, message.OptionalSfixed32); - Assert.Equal(0, message.OptionalSfixed64); - Assert.Equal(0, message.OptionalFloat); - Assert.Equal(0, message.OptionalDouble); - Assert.Equal(false, message.OptionalBool); - Assert.Equal("", message.OptionalString); - Assert.Equal(ByteString.Empty, message.OptionalBytes); + Assert.AreEqual(0, message.OptionalInt32); + Assert.AreEqual(0, message.OptionalInt64); + Assert.AreEqual(0u, message.OptionalUint32); + Assert.AreEqual(0u, message.OptionalUint64); + Assert.AreEqual(0, message.OptionalSint32); + Assert.AreEqual(0, message.OptionalSint64); + Assert.AreEqual(0u, message.OptionalFixed32); + Assert.AreEqual(0u, message.OptionalFixed64); + Assert.AreEqual(0, message.OptionalSfixed32); + Assert.AreEqual(0, message.OptionalSfixed64); + Assert.AreEqual(0, message.OptionalFloat); + Assert.AreEqual(0, message.OptionalDouble); + Assert.AreEqual(false, message.OptionalBool); + Assert.AreEqual("", message.OptionalString); + Assert.AreEqual(ByteString.Empty, message.OptionalBytes); // Embedded messages should also be clear. - Assert.False(message.OptionalGroup.HasA); - Assert.False(message.OptionalNestedMessage.HasBb); - Assert.False(message.OptionalForeignMessage.HasC); - Assert.False(message.OptionalImportMessage.HasD); + Assert.IsFalse(message.OptionalGroup.HasA); + Assert.IsFalse(message.OptionalNestedMessage.HasBb); + Assert.IsFalse(message.OptionalForeignMessage.HasC); + Assert.IsFalse(message.OptionalImportMessage.HasD); - Assert.Equal(0, message.OptionalGroup.A); - Assert.Equal(0, message.OptionalNestedMessage.Bb); - Assert.Equal(0, message.OptionalForeignMessage.C); - Assert.Equal(0, message.OptionalImportMessage.D); + Assert.AreEqual(0, message.OptionalGroup.A); + Assert.AreEqual(0, message.OptionalNestedMessage.Bb); + Assert.AreEqual(0, message.OptionalForeignMessage.C); + Assert.AreEqual(0, message.OptionalImportMessage.D); // Enums without defaults are set to the first value in the enum. - Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); - Assert.Equal(ForeignEnum.FOREIGN_FOO, message.OptionalForeignEnum); - Assert.Equal(ImportEnum.IMPORT_FOO, message.OptionalImportEnum); + Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); + Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.OptionalForeignEnum); + Assert.AreEqual(ImportEnum.IMPORT_FOO, message.OptionalImportEnum); - Assert.Equal("", message.OptionalStringPiece); - Assert.Equal("", message.OptionalCord); + Assert.AreEqual("", message.OptionalStringPiece); + Assert.AreEqual("", message.OptionalCord); // Repeated fields are empty. - Assert.Equal(0, message.RepeatedInt32Count); - Assert.Equal(0, message.RepeatedInt64Count); - Assert.Equal(0, message.RepeatedUint32Count); - Assert.Equal(0, message.RepeatedUint64Count); - Assert.Equal(0, message.RepeatedSint32Count); - Assert.Equal(0, message.RepeatedSint64Count); - Assert.Equal(0, message.RepeatedFixed32Count); - Assert.Equal(0, message.RepeatedFixed64Count); - Assert.Equal(0, message.RepeatedSfixed32Count); - Assert.Equal(0, message.RepeatedSfixed64Count); - Assert.Equal(0, message.RepeatedFloatCount); - Assert.Equal(0, message.RepeatedDoubleCount); - Assert.Equal(0, message.RepeatedBoolCount); - Assert.Equal(0, message.RepeatedStringCount); - Assert.Equal(0, message.RepeatedBytesCount); - - Assert.Equal(0, message.RepeatedGroupCount); - Assert.Equal(0, message.RepeatedNestedMessageCount); - Assert.Equal(0, message.RepeatedForeignMessageCount); - Assert.Equal(0, message.RepeatedImportMessageCount); - Assert.Equal(0, message.RepeatedNestedEnumCount); - Assert.Equal(0, message.RepeatedForeignEnumCount); - Assert.Equal(0, message.RepeatedImportEnumCount); - - Assert.Equal(0, message.RepeatedStringPieceCount); - Assert.Equal(0, message.RepeatedCordCount); + Assert.AreEqual(0, message.RepeatedInt32Count); + Assert.AreEqual(0, message.RepeatedInt64Count); + Assert.AreEqual(0, message.RepeatedUint32Count); + Assert.AreEqual(0, message.RepeatedUint64Count); + Assert.AreEqual(0, message.RepeatedSint32Count); + Assert.AreEqual(0, message.RepeatedSint64Count); + Assert.AreEqual(0, message.RepeatedFixed32Count); + Assert.AreEqual(0, message.RepeatedFixed64Count); + Assert.AreEqual(0, message.RepeatedSfixed32Count); + Assert.AreEqual(0, message.RepeatedSfixed64Count); + Assert.AreEqual(0, message.RepeatedFloatCount); + Assert.AreEqual(0, message.RepeatedDoubleCount); + Assert.AreEqual(0, message.RepeatedBoolCount); + Assert.AreEqual(0, message.RepeatedStringCount); + Assert.AreEqual(0, message.RepeatedBytesCount); + + Assert.AreEqual(0, message.RepeatedGroupCount); + Assert.AreEqual(0, message.RepeatedNestedMessageCount); + Assert.AreEqual(0, message.RepeatedForeignMessageCount); + Assert.AreEqual(0, message.RepeatedImportMessageCount); + Assert.AreEqual(0, message.RepeatedNestedEnumCount); + Assert.AreEqual(0, message.RepeatedForeignEnumCount); + Assert.AreEqual(0, message.RepeatedImportEnumCount); + + Assert.AreEqual(0, message.RepeatedStringPieceCount); + Assert.AreEqual(0, message.RepeatedCordCount); // HasBlah() should also be false for all default fields. - Assert.False(message.HasDefaultInt32); - Assert.False(message.HasDefaultInt64); - Assert.False(message.HasDefaultUint32); - Assert.False(message.HasDefaultUint64); - Assert.False(message.HasDefaultSint32); - Assert.False(message.HasDefaultSint64); - Assert.False(message.HasDefaultFixed32); - Assert.False(message.HasDefaultFixed64); - Assert.False(message.HasDefaultSfixed32); - Assert.False(message.HasDefaultSfixed64); - Assert.False(message.HasDefaultFloat); - Assert.False(message.HasDefaultDouble); - Assert.False(message.HasDefaultBool); - Assert.False(message.HasDefaultString); - Assert.False(message.HasDefaultBytes); - - Assert.False(message.HasDefaultNestedEnum); - Assert.False(message.HasDefaultForeignEnum); - Assert.False(message.HasDefaultImportEnum); - - Assert.False(message.HasDefaultStringPiece); - Assert.False(message.HasDefaultCord); + Assert.IsFalse(message.HasDefaultInt32); + Assert.IsFalse(message.HasDefaultInt64); + Assert.IsFalse(message.HasDefaultUint32); + Assert.IsFalse(message.HasDefaultUint64); + Assert.IsFalse(message.HasDefaultSint32); + Assert.IsFalse(message.HasDefaultSint64); + Assert.IsFalse(message.HasDefaultFixed32); + Assert.IsFalse(message.HasDefaultFixed64); + Assert.IsFalse(message.HasDefaultSfixed32); + Assert.IsFalse(message.HasDefaultSfixed64); + Assert.IsFalse(message.HasDefaultFloat); + Assert.IsFalse(message.HasDefaultDouble); + Assert.IsFalse(message.HasDefaultBool); + Assert.IsFalse(message.HasDefaultString); + Assert.IsFalse(message.HasDefaultBytes); + + Assert.IsFalse(message.HasDefaultNestedEnum); + Assert.IsFalse(message.HasDefaultForeignEnum); + Assert.IsFalse(message.HasDefaultImportEnum); + + Assert.IsFalse(message.HasDefaultStringPiece); + Assert.IsFalse(message.HasDefaultCord); // Fields with defaults have their default values (duh). - Assert.Equal(41, message.DefaultInt32); - Assert.Equal(42, message.DefaultInt64); - Assert.Equal(43u, message.DefaultUint32); - Assert.Equal(44u, message.DefaultUint64); - Assert.Equal(-45, message.DefaultSint32); - Assert.Equal(46, message.DefaultSint64); - Assert.Equal(47u, message.DefaultFixed32); - Assert.Equal(48u, message.DefaultFixed64); - Assert.Equal(49, message.DefaultSfixed32); - Assert.Equal(-50, message.DefaultSfixed64); - Assert.Equal(51.5f, message.DefaultFloat); - Assert.Equal(52e3d, message.DefaultDouble); - Assert.Equal(true, message.DefaultBool); - Assert.Equal("hello", message.DefaultString); - Assert.Equal(ToBytes("world"), message.DefaultBytes); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.DefaultNestedEnum); - Assert.Equal(ForeignEnum.FOREIGN_BAR, message.DefaultForeignEnum); - Assert.Equal(ImportEnum.IMPORT_BAR, message.DefaultImportEnum); - - Assert.Equal("abc", message.DefaultStringPiece); - Assert.Equal("123", message.DefaultCord); + Assert.AreEqual(41, message.DefaultInt32); + Assert.AreEqual(42, message.DefaultInt64); + Assert.AreEqual(43u, message.DefaultUint32); + Assert.AreEqual(44u, message.DefaultUint64); + Assert.AreEqual(-45, message.DefaultSint32); + Assert.AreEqual(46, message.DefaultSint64); + Assert.AreEqual(47u, message.DefaultFixed32); + Assert.AreEqual(48u, message.DefaultFixed64); + Assert.AreEqual(49, message.DefaultSfixed32); + Assert.AreEqual(-50, message.DefaultSfixed64); + Assert.AreEqual(51.5f, message.DefaultFloat); + Assert.AreEqual(52e3d, message.DefaultDouble); + Assert.AreEqual(true, message.DefaultBool); + Assert.AreEqual("hello", message.DefaultString); + Assert.AreEqual(ToBytes("world"), message.DefaultBytes); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.DefaultNestedEnum); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.DefaultForeignEnum); + Assert.AreEqual(ImportEnum.IMPORT_BAR, message.DefaultImportEnum); + + Assert.AreEqual("abc", message.DefaultStringPiece); + Assert.AreEqual("123", message.DefaultCord); } /// @@ -855,89 +855,89 @@ namespace Google.ProtocolBuffers // ModifyRepeatedFields only sets the second repeated element of each // field. In addition to verifying this, we also verify that the first // element and size were *not* modified. - Assert.Equal(2, message.RepeatedInt32Count); - Assert.Equal(2, message.RepeatedInt64Count); - Assert.Equal(2, message.RepeatedUint32Count); - Assert.Equal(2, message.RepeatedUint64Count); - Assert.Equal(2, message.RepeatedSint32Count); - Assert.Equal(2, message.RepeatedSint64Count); - Assert.Equal(2, message.RepeatedFixed32Count); - Assert.Equal(2, message.RepeatedFixed64Count); - Assert.Equal(2, message.RepeatedSfixed32Count); - Assert.Equal(2, message.RepeatedSfixed64Count); - Assert.Equal(2, message.RepeatedFloatCount); - Assert.Equal(2, message.RepeatedDoubleCount); - Assert.Equal(2, message.RepeatedBoolCount); - Assert.Equal(2, message.RepeatedStringCount); - Assert.Equal(2, message.RepeatedBytesCount); - - Assert.Equal(2, message.RepeatedGroupCount); - Assert.Equal(2, message.RepeatedNestedMessageCount); - Assert.Equal(2, message.RepeatedForeignMessageCount); - Assert.Equal(2, message.RepeatedImportMessageCount); - Assert.Equal(2, message.RepeatedNestedEnumCount); - Assert.Equal(2, message.RepeatedForeignEnumCount); - Assert.Equal(2, message.RepeatedImportEnumCount); - - Assert.Equal(2, message.RepeatedStringPieceCount); - Assert.Equal(2, message.RepeatedCordCount); - - Assert.Equal(201, message.GetRepeatedInt32(0)); - Assert.Equal(202L, message.GetRepeatedInt64(0)); - Assert.Equal(203U, message.GetRepeatedUint32(0)); - Assert.Equal(204UL, message.GetRepeatedUint64(0)); - Assert.Equal(205, message.GetRepeatedSint32(0)); - Assert.Equal(206L, message.GetRepeatedSint64(0)); - Assert.Equal(207U, message.GetRepeatedFixed32(0)); - Assert.Equal(208UL, message.GetRepeatedFixed64(0)); - Assert.Equal(209, message.GetRepeatedSfixed32(0)); - Assert.Equal(210L, message.GetRepeatedSfixed64(0)); - Assert.Equal(211F, message.GetRepeatedFloat(0)); - Assert.Equal(212D, message.GetRepeatedDouble(0)); - Assert.Equal(true, message.GetRepeatedBool(0)); - Assert.Equal("215", message.GetRepeatedString(0)); - Assert.Equal(ToBytes("216"), message.GetRepeatedBytes(0)); - - Assert.Equal(217, message.GetRepeatedGroup(0).A); - Assert.Equal(218, message.GetRepeatedNestedMessage(0).Bb); - Assert.Equal(219, message.GetRepeatedForeignMessage(0).C); - Assert.Equal(220, message.GetRepeatedImportMessage(0).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); - Assert.Equal(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); - - Assert.Equal("224", message.GetRepeatedStringPiece(0)); - Assert.Equal("225", message.GetRepeatedCord(0)); + Assert.AreEqual(2, message.RepeatedInt32Count); + Assert.AreEqual(2, message.RepeatedInt64Count); + Assert.AreEqual(2, message.RepeatedUint32Count); + Assert.AreEqual(2, message.RepeatedUint64Count); + Assert.AreEqual(2, message.RepeatedSint32Count); + Assert.AreEqual(2, message.RepeatedSint64Count); + Assert.AreEqual(2, message.RepeatedFixed32Count); + Assert.AreEqual(2, message.RepeatedFixed64Count); + Assert.AreEqual(2, message.RepeatedSfixed32Count); + Assert.AreEqual(2, message.RepeatedSfixed64Count); + Assert.AreEqual(2, message.RepeatedFloatCount); + Assert.AreEqual(2, message.RepeatedDoubleCount); + Assert.AreEqual(2, message.RepeatedBoolCount); + Assert.AreEqual(2, message.RepeatedStringCount); + Assert.AreEqual(2, message.RepeatedBytesCount); + + Assert.AreEqual(2, message.RepeatedGroupCount); + Assert.AreEqual(2, message.RepeatedNestedMessageCount); + Assert.AreEqual(2, message.RepeatedForeignMessageCount); + Assert.AreEqual(2, message.RepeatedImportMessageCount); + Assert.AreEqual(2, message.RepeatedNestedEnumCount); + Assert.AreEqual(2, message.RepeatedForeignEnumCount); + Assert.AreEqual(2, message.RepeatedImportEnumCount); + + Assert.AreEqual(2, message.RepeatedStringPieceCount); + Assert.AreEqual(2, message.RepeatedCordCount); + + Assert.AreEqual(201, message.GetRepeatedInt32(0)); + Assert.AreEqual(202L, message.GetRepeatedInt64(0)); + Assert.AreEqual(203U, message.GetRepeatedUint32(0)); + Assert.AreEqual(204UL, message.GetRepeatedUint64(0)); + Assert.AreEqual(205, message.GetRepeatedSint32(0)); + Assert.AreEqual(206L, message.GetRepeatedSint64(0)); + Assert.AreEqual(207U, message.GetRepeatedFixed32(0)); + Assert.AreEqual(208UL, message.GetRepeatedFixed64(0)); + Assert.AreEqual(209, message.GetRepeatedSfixed32(0)); + Assert.AreEqual(210L, message.GetRepeatedSfixed64(0)); + Assert.AreEqual(211F, message.GetRepeatedFloat(0)); + Assert.AreEqual(212D, message.GetRepeatedDouble(0)); + Assert.AreEqual(true, message.GetRepeatedBool(0)); + Assert.AreEqual("215", message.GetRepeatedString(0)); + Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0)); + + Assert.AreEqual(217, message.GetRepeatedGroup(0).A); + Assert.AreEqual(218, message.GetRepeatedNestedMessage(0).Bb); + Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C); + Assert.AreEqual(220, message.GetRepeatedImportMessage(0).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); + Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); + + Assert.AreEqual("224", message.GetRepeatedStringPiece(0)); + Assert.AreEqual("225", message.GetRepeatedCord(0)); // Actually verify the second (modified) elements now. - Assert.Equal(501, message.GetRepeatedInt32(1)); - Assert.Equal(502L, message.GetRepeatedInt64(1)); - Assert.Equal(503U, message.GetRepeatedUint32(1)); - Assert.Equal(504UL, message.GetRepeatedUint64(1)); - Assert.Equal(505, message.GetRepeatedSint32(1)); - Assert.Equal(506L, message.GetRepeatedSint64(1)); - Assert.Equal(507U, message.GetRepeatedFixed32(1)); - Assert.Equal(508UL, message.GetRepeatedFixed64(1)); - Assert.Equal(509, message.GetRepeatedSfixed32(1)); - Assert.Equal(510L, message.GetRepeatedSfixed64(1)); - Assert.Equal(511F, message.GetRepeatedFloat(1)); - Assert.Equal(512D, message.GetRepeatedDouble(1)); - Assert.Equal(true, message.GetRepeatedBool(1)); - Assert.Equal("515", message.GetRepeatedString(1)); - Assert.Equal(ToBytes("516"), message.GetRepeatedBytes(1)); - - Assert.Equal(517, message.GetRepeatedGroup(1).A); - Assert.Equal(518, message.GetRepeatedNestedMessage(1).Bb); - Assert.Equal(519, message.GetRepeatedForeignMessage(1).C); - Assert.Equal(520, message.GetRepeatedImportMessage(1).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, message.GetRepeatedNestedEnum(1)); - Assert.Equal(ForeignEnum.FOREIGN_FOO, message.GetRepeatedForeignEnum(1)); - Assert.Equal(ImportEnum.IMPORT_FOO, message.GetRepeatedImportEnum(1)); - - Assert.Equal("524", message.GetRepeatedStringPiece(1)); - Assert.Equal("525", message.GetRepeatedCord(1)); + Assert.AreEqual(501, message.GetRepeatedInt32(1)); + Assert.AreEqual(502L, message.GetRepeatedInt64(1)); + Assert.AreEqual(503U, message.GetRepeatedUint32(1)); + Assert.AreEqual(504UL, message.GetRepeatedUint64(1)); + Assert.AreEqual(505, message.GetRepeatedSint32(1)); + Assert.AreEqual(506L, message.GetRepeatedSint64(1)); + Assert.AreEqual(507U, message.GetRepeatedFixed32(1)); + Assert.AreEqual(508UL, message.GetRepeatedFixed64(1)); + Assert.AreEqual(509, message.GetRepeatedSfixed32(1)); + Assert.AreEqual(510L, message.GetRepeatedSfixed64(1)); + Assert.AreEqual(511F, message.GetRepeatedFloat(1)); + Assert.AreEqual(512D, message.GetRepeatedDouble(1)); + Assert.AreEqual(true, message.GetRepeatedBool(1)); + Assert.AreEqual("515", message.GetRepeatedString(1)); + Assert.AreEqual(ToBytes("516"), message.GetRepeatedBytes(1)); + + Assert.AreEqual(517, message.GetRepeatedGroup(1).A); + Assert.AreEqual(518, message.GetRepeatedNestedMessage(1).Bb); + Assert.AreEqual(519, message.GetRepeatedForeignMessage(1).C); + Assert.AreEqual(520, message.GetRepeatedImportMessage(1).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetRepeatedNestedEnum(1)); + Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetRepeatedForeignEnum(1)); + Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetRepeatedImportEnum(1)); + + Assert.AreEqual("524", message.GetRepeatedStringPiece(1)); + Assert.AreEqual("525", message.GetRepeatedCord(1)); } /// @@ -949,222 +949,222 @@ namespace Google.ProtocolBuffers { foreach (T secondElement in second) { - Assert.True(firstEnumerator.MoveNext(), "First enumerator ran out of elements too early."); - Assert.Equal(firstEnumerator.Current, secondElement); + Assert.IsTrue(firstEnumerator.MoveNext(), "First enumerator ran out of elements too early."); + Assert.AreEqual(firstEnumerator.Current, secondElement); } - Assert.False(firstEnumerator.MoveNext(), "Second enumerator ran out of elements too early."); + Assert.IsFalse(firstEnumerator.MoveNext(), "Second enumerator ran out of elements too early."); } } internal static void AssertEqualBytes(byte[] expected, byte[] actual) { - Assert.Equal(ByteString.CopyFrom(expected), ByteString.CopyFrom(actual)); + Assert.AreEqual(ByteString.CopyFrom(expected), ByteString.CopyFrom(actual)); } internal static void AssertAllExtensionsSet(TestAllExtensions message) { - Assert.True(message.HasExtension(Unittest.OptionalInt32Extension)); - Assert.True(message.HasExtension(Unittest.OptionalInt64Extension)); - Assert.True(message.HasExtension(Unittest.OptionalUint32Extension)); - Assert.True(message.HasExtension(Unittest.OptionalUint64Extension)); - Assert.True(message.HasExtension(Unittest.OptionalSint32Extension)); - Assert.True(message.HasExtension(Unittest.OptionalSint64Extension)); - Assert.True(message.HasExtension(Unittest.OptionalFixed32Extension)); - Assert.True(message.HasExtension(Unittest.OptionalFixed64Extension)); - Assert.True(message.HasExtension(Unittest.OptionalSfixed32Extension)); - Assert.True(message.HasExtension(Unittest.OptionalSfixed64Extension)); - Assert.True(message.HasExtension(Unittest.OptionalFloatExtension)); - Assert.True(message.HasExtension(Unittest.OptionalDoubleExtension)); - Assert.True(message.HasExtension(Unittest.OptionalBoolExtension)); - Assert.True(message.HasExtension(Unittest.OptionalStringExtension)); - Assert.True(message.HasExtension(Unittest.OptionalBytesExtension)); - - Assert.True(message.HasExtension(Unittest.OptionalGroupExtension)); - Assert.True(message.HasExtension(Unittest.OptionalNestedMessageExtension)); - Assert.True(message.HasExtension(Unittest.OptionalForeignMessageExtension)); - Assert.True(message.HasExtension(Unittest.OptionalImportMessageExtension)); - - Assert.True(message.GetExtension(Unittest.OptionalGroupExtension).HasA); - Assert.True(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); - Assert.True(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); - Assert.True(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); - - Assert.True(message.HasExtension(Unittest.OptionalNestedEnumExtension)); - Assert.True(message.HasExtension(Unittest.OptionalForeignEnumExtension)); - Assert.True(message.HasExtension(Unittest.OptionalImportEnumExtension)); - - Assert.True(message.HasExtension(Unittest.OptionalStringPieceExtension)); - Assert.True(message.HasExtension(Unittest.OptionalCordExtension)); - - Assert.Equal(101, message.GetExtension(Unittest.OptionalInt32Extension)); - Assert.Equal(102L, message.GetExtension(Unittest.OptionalInt64Extension)); - Assert.Equal(103U, message.GetExtension(Unittest.OptionalUint32Extension)); - Assert.Equal(104UL, message.GetExtension(Unittest.OptionalUint64Extension)); - Assert.Equal(105, message.GetExtension(Unittest.OptionalSint32Extension)); - Assert.Equal(106L, message.GetExtension(Unittest.OptionalSint64Extension)); - Assert.Equal(107U, message.GetExtension(Unittest.OptionalFixed32Extension)); - Assert.Equal(108UL, message.GetExtension(Unittest.OptionalFixed64Extension)); - Assert.Equal(109, message.GetExtension(Unittest.OptionalSfixed32Extension)); - Assert.Equal(110L, message.GetExtension(Unittest.OptionalSfixed64Extension)); - Assert.Equal(111F, message.GetExtension(Unittest.OptionalFloatExtension)); - Assert.Equal(112D, message.GetExtension(Unittest.OptionalDoubleExtension)); - Assert.Equal(true, message.GetExtension(Unittest.OptionalBoolExtension)); - Assert.Equal("115", message.GetExtension(Unittest.OptionalStringExtension)); - Assert.Equal(ToBytes("116"), message.GetExtension(Unittest.OptionalBytesExtension)); - - Assert.Equal(117, message.GetExtension(Unittest.OptionalGroupExtension).A); - Assert.Equal(118, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); - Assert.Equal(119, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); - Assert.Equal(120, message.GetExtension(Unittest.OptionalImportMessageExtension).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, + Assert.IsTrue(message.HasExtension(Unittest.OptionalInt32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalInt64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalUint32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalUint64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalSint32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalSint64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalFixed32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalFixed64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalSfixed32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalSfixed64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalFloatExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalDoubleExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalBoolExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalStringExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalBytesExtension)); + + Assert.IsTrue(message.HasExtension(Unittest.OptionalGroupExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalNestedMessageExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalForeignMessageExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalImportMessageExtension)); + + Assert.IsTrue(message.GetExtension(Unittest.OptionalGroupExtension).HasA); + Assert.IsTrue(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); + Assert.IsTrue(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); + Assert.IsTrue(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); + + Assert.IsTrue(message.HasExtension(Unittest.OptionalNestedEnumExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalForeignEnumExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalImportEnumExtension)); + + Assert.IsTrue(message.HasExtension(Unittest.OptionalStringPieceExtension)); + Assert.IsTrue(message.HasExtension(Unittest.OptionalCordExtension)); + + Assert.AreEqual(101, message.GetExtension(Unittest.OptionalInt32Extension)); + Assert.AreEqual(102L, message.GetExtension(Unittest.OptionalInt64Extension)); + Assert.AreEqual(103U, message.GetExtension(Unittest.OptionalUint32Extension)); + Assert.AreEqual(104UL, message.GetExtension(Unittest.OptionalUint64Extension)); + Assert.AreEqual(105, message.GetExtension(Unittest.OptionalSint32Extension)); + Assert.AreEqual(106L, message.GetExtension(Unittest.OptionalSint64Extension)); + Assert.AreEqual(107U, message.GetExtension(Unittest.OptionalFixed32Extension)); + Assert.AreEqual(108UL, message.GetExtension(Unittest.OptionalFixed64Extension)); + Assert.AreEqual(109, message.GetExtension(Unittest.OptionalSfixed32Extension)); + Assert.AreEqual(110L, message.GetExtension(Unittest.OptionalSfixed64Extension)); + Assert.AreEqual(111F, message.GetExtension(Unittest.OptionalFloatExtension)); + Assert.AreEqual(112D, message.GetExtension(Unittest.OptionalDoubleExtension)); + Assert.AreEqual(true, message.GetExtension(Unittest.OptionalBoolExtension)); + Assert.AreEqual("115", message.GetExtension(Unittest.OptionalStringExtension)); + Assert.AreEqual(ToBytes("116"), message.GetExtension(Unittest.OptionalBytesExtension)); + + Assert.AreEqual(117, message.GetExtension(Unittest.OptionalGroupExtension).A); + Assert.AreEqual(118, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); + Assert.AreEqual(119, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); + Assert.AreEqual(120, message.GetExtension(Unittest.OptionalImportMessageExtension).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetExtension(Unittest.OptionalNestedEnumExtension)); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.OptionalForeignEnumExtension)); - Assert.Equal(ImportEnum.IMPORT_BAZ, message.GetExtension(Unittest.OptionalImportEnumExtension)); + Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetExtension(Unittest.OptionalImportEnumExtension)); - Assert.Equal("124", message.GetExtension(Unittest.OptionalStringPieceExtension)); - Assert.Equal("125", message.GetExtension(Unittest.OptionalCordExtension)); + Assert.AreEqual("124", message.GetExtension(Unittest.OptionalStringPieceExtension)); + Assert.AreEqual("125", message.GetExtension(Unittest.OptionalCordExtension)); // ----------------------------------------------------------------- - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); - - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); - - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); - - Assert.Equal(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); - Assert.Equal(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); - Assert.Equal(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); - Assert.Equal(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); - Assert.Equal(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); - Assert.Equal(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); - Assert.Equal(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); - Assert.Equal(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); - Assert.Equal(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); - Assert.Equal(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); - Assert.Equal(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); - Assert.Equal(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); - Assert.Equal(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); - Assert.Equal("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); - Assert.Equal(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); - - Assert.Equal(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); - Assert.Equal(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); - Assert.Equal(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); - Assert.Equal(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); + + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); + + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); + + Assert.AreEqual(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); + Assert.AreEqual(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); + Assert.AreEqual(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); + Assert.AreEqual(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); + Assert.AreEqual(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); + Assert.AreEqual(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); + Assert.AreEqual(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); + Assert.AreEqual(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); + Assert.AreEqual(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); + Assert.AreEqual(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); + Assert.AreEqual(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); + Assert.AreEqual(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); + Assert.AreEqual(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); + Assert.AreEqual("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); + Assert.AreEqual(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); + + Assert.AreEqual(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); + Assert.AreEqual(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); + Assert.AreEqual(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); + Assert.AreEqual(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 0)); - Assert.Equal(ImportEnum.IMPORT_BAR, + Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.RepeatedImportEnumExtension, 0)); - Assert.Equal("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); - Assert.Equal("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); - - Assert.Equal(301, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); - Assert.Equal(302L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); - Assert.Equal(303U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); - Assert.Equal(304UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); - Assert.Equal(305, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); - Assert.Equal(306L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); - Assert.Equal(307U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); - Assert.Equal(308UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); - Assert.Equal(309, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); - Assert.Equal(310L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); - Assert.Equal(311F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); - Assert.Equal(312D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); - Assert.Equal(false, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); - Assert.Equal("315", message.GetExtension(Unittest.RepeatedStringExtension, 1)); - Assert.Equal(ToBytes("316"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); - - Assert.Equal(317, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); - Assert.Equal(318, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); - Assert.Equal(319, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); - Assert.Equal(320, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAZ, + Assert.AreEqual("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); + Assert.AreEqual("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); + + Assert.AreEqual(301, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); + Assert.AreEqual(302L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); + Assert.AreEqual(303U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); + Assert.AreEqual(304UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); + Assert.AreEqual(305, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); + Assert.AreEqual(306L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); + Assert.AreEqual(307U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); + Assert.AreEqual(308UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); + Assert.AreEqual(309, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); + Assert.AreEqual(310L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); + Assert.AreEqual(311F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); + Assert.AreEqual(312D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); + Assert.AreEqual(false, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); + Assert.AreEqual("315", message.GetExtension(Unittest.RepeatedStringExtension, 1)); + Assert.AreEqual(ToBytes("316"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); + + Assert.AreEqual(317, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); + Assert.AreEqual(318, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); + Assert.AreEqual(319, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); + Assert.AreEqual(320, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 1)); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 1)); - Assert.Equal(ImportEnum.IMPORT_BAZ, + Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetExtension(Unittest.RepeatedImportEnumExtension, 1)); - Assert.Equal("324", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); - Assert.Equal("325", message.GetExtension(Unittest.RepeatedCordExtension, 1)); + Assert.AreEqual("324", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); + Assert.AreEqual("325", message.GetExtension(Unittest.RepeatedCordExtension, 1)); // ----------------------------------------------------------------- - Assert.True(message.HasExtension(Unittest.DefaultInt32Extension)); - Assert.True(message.HasExtension(Unittest.DefaultInt64Extension)); - Assert.True(message.HasExtension(Unittest.DefaultUint32Extension)); - Assert.True(message.HasExtension(Unittest.DefaultUint64Extension)); - Assert.True(message.HasExtension(Unittest.DefaultSint32Extension)); - Assert.True(message.HasExtension(Unittest.DefaultSint64Extension)); - Assert.True(message.HasExtension(Unittest.DefaultFixed32Extension)); - Assert.True(message.HasExtension(Unittest.DefaultFixed64Extension)); - Assert.True(message.HasExtension(Unittest.DefaultSfixed32Extension)); - Assert.True(message.HasExtension(Unittest.DefaultSfixed64Extension)); - Assert.True(message.HasExtension(Unittest.DefaultFloatExtension)); - Assert.True(message.HasExtension(Unittest.DefaultDoubleExtension)); - Assert.True(message.HasExtension(Unittest.DefaultBoolExtension)); - Assert.True(message.HasExtension(Unittest.DefaultStringExtension)); - Assert.True(message.HasExtension(Unittest.DefaultBytesExtension)); - - Assert.True(message.HasExtension(Unittest.DefaultNestedEnumExtension)); - Assert.True(message.HasExtension(Unittest.DefaultForeignEnumExtension)); - Assert.True(message.HasExtension(Unittest.DefaultImportEnumExtension)); - - Assert.True(message.HasExtension(Unittest.DefaultStringPieceExtension)); - Assert.True(message.HasExtension(Unittest.DefaultCordExtension)); - - Assert.Equal(401, message.GetExtension(Unittest.DefaultInt32Extension)); - Assert.Equal(402L, message.GetExtension(Unittest.DefaultInt64Extension)); - Assert.Equal(403U, message.GetExtension(Unittest.DefaultUint32Extension)); - Assert.Equal(404UL, message.GetExtension(Unittest.DefaultUint64Extension)); - Assert.Equal(405, message.GetExtension(Unittest.DefaultSint32Extension)); - Assert.Equal(406L, message.GetExtension(Unittest.DefaultSint64Extension)); - Assert.Equal(407U, message.GetExtension(Unittest.DefaultFixed32Extension)); - Assert.Equal(408UL, message.GetExtension(Unittest.DefaultFixed64Extension)); - Assert.Equal(409, message.GetExtension(Unittest.DefaultSfixed32Extension)); - Assert.Equal(410L, message.GetExtension(Unittest.DefaultSfixed64Extension)); - Assert.Equal(411F, message.GetExtension(Unittest.DefaultFloatExtension)); - Assert.Equal(412D, message.GetExtension(Unittest.DefaultDoubleExtension)); - Assert.Equal(false, message.GetExtension(Unittest.DefaultBoolExtension)); - Assert.Equal("415", message.GetExtension(Unittest.DefaultStringExtension)); - Assert.Equal(ToBytes("416"), message.GetExtension(Unittest.DefaultBytesExtension)); - - Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, + Assert.IsTrue(message.HasExtension(Unittest.DefaultInt32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultInt64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultUint32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultUint64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultSint32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultSint64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultFixed32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultFixed64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultSfixed32Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultSfixed64Extension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultFloatExtension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultDoubleExtension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultBoolExtension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultStringExtension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultBytesExtension)); + + Assert.IsTrue(message.HasExtension(Unittest.DefaultNestedEnumExtension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultForeignEnumExtension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultImportEnumExtension)); + + Assert.IsTrue(message.HasExtension(Unittest.DefaultStringPieceExtension)); + Assert.IsTrue(message.HasExtension(Unittest.DefaultCordExtension)); + + Assert.AreEqual(401, message.GetExtension(Unittest.DefaultInt32Extension)); + Assert.AreEqual(402L, message.GetExtension(Unittest.DefaultInt64Extension)); + Assert.AreEqual(403U, message.GetExtension(Unittest.DefaultUint32Extension)); + Assert.AreEqual(404UL, message.GetExtension(Unittest.DefaultUint64Extension)); + Assert.AreEqual(405, message.GetExtension(Unittest.DefaultSint32Extension)); + Assert.AreEqual(406L, message.GetExtension(Unittest.DefaultSint64Extension)); + Assert.AreEqual(407U, message.GetExtension(Unittest.DefaultFixed32Extension)); + Assert.AreEqual(408UL, message.GetExtension(Unittest.DefaultFixed64Extension)); + Assert.AreEqual(409, message.GetExtension(Unittest.DefaultSfixed32Extension)); + Assert.AreEqual(410L, message.GetExtension(Unittest.DefaultSfixed64Extension)); + Assert.AreEqual(411F, message.GetExtension(Unittest.DefaultFloatExtension)); + Assert.AreEqual(412D, message.GetExtension(Unittest.DefaultDoubleExtension)); + Assert.AreEqual(false, message.GetExtension(Unittest.DefaultBoolExtension)); + Assert.AreEqual("415", message.GetExtension(Unittest.DefaultStringExtension)); + Assert.AreEqual(ToBytes("416"), message.GetExtension(Unittest.DefaultBytesExtension)); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(Unittest.DefaultNestedEnumExtension)); - Assert.Equal(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.DefaultForeignEnumExtension)); - Assert.Equal(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.DefaultImportEnumExtension)); + Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.DefaultForeignEnumExtension)); + Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.DefaultImportEnumExtension)); - Assert.Equal("424", message.GetExtension(Unittest.DefaultStringPieceExtension)); - Assert.Equal("425", message.GetExtension(Unittest.DefaultCordExtension)); + Assert.AreEqual("424", message.GetExtension(Unittest.DefaultStringPieceExtension)); + Assert.AreEqual("425", message.GetExtension(Unittest.DefaultCordExtension)); } /// @@ -1215,242 +1215,242 @@ namespace Google.ProtocolBuffers // ModifyRepeatedFields only sets the second repeated element of each // field. In addition to verifying this, we also verify that the first // element and size were *not* modified. - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); - - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); - - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); - - Assert.Equal(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); - Assert.Equal(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); - Assert.Equal(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); - Assert.Equal(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); - Assert.Equal(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); - Assert.Equal(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); - Assert.Equal(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); - Assert.Equal(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); - Assert.Equal(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); - Assert.Equal(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); - Assert.Equal(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); - Assert.Equal(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); - Assert.Equal(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); - Assert.Equal("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); - Assert.Equal(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); - - Assert.Equal(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); - Assert.Equal(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); - Assert.Equal(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); - Assert.Equal(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); + + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); + + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.RepeatedCordExtension)); + + Assert.AreEqual(201, message.GetExtension(Unittest.RepeatedInt32Extension, 0)); + Assert.AreEqual(202L, message.GetExtension(Unittest.RepeatedInt64Extension, 0)); + Assert.AreEqual(203U, message.GetExtension(Unittest.RepeatedUint32Extension, 0)); + Assert.AreEqual(204UL, message.GetExtension(Unittest.RepeatedUint64Extension, 0)); + Assert.AreEqual(205, message.GetExtension(Unittest.RepeatedSint32Extension, 0)); + Assert.AreEqual(206L, message.GetExtension(Unittest.RepeatedSint64Extension, 0)); + Assert.AreEqual(207U, message.GetExtension(Unittest.RepeatedFixed32Extension, 0)); + Assert.AreEqual(208UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 0)); + Assert.AreEqual(209, message.GetExtension(Unittest.RepeatedSfixed32Extension, 0)); + Assert.AreEqual(210L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 0)); + Assert.AreEqual(211F, message.GetExtension(Unittest.RepeatedFloatExtension, 0)); + Assert.AreEqual(212D, message.GetExtension(Unittest.RepeatedDoubleExtension, 0)); + Assert.AreEqual(true, message.GetExtension(Unittest.RepeatedBoolExtension, 0)); + Assert.AreEqual("215", message.GetExtension(Unittest.RepeatedStringExtension, 0)); + Assert.AreEqual(ToBytes("216"), message.GetExtension(Unittest.RepeatedBytesExtension, 0)); + + Assert.AreEqual(217, message.GetExtension(Unittest.RepeatedGroupExtension, 0).A); + Assert.AreEqual(218, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 0).Bb); + Assert.AreEqual(219, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 0).C); + Assert.AreEqual(220, message.GetExtension(Unittest.RepeatedImportMessageExtension, 0).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 0)); - Assert.Equal(ImportEnum.IMPORT_BAR, + Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.RepeatedImportEnumExtension, 0)); - Assert.Equal("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); - Assert.Equal("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); + Assert.AreEqual("224", message.GetExtension(Unittest.RepeatedStringPieceExtension, 0)); + Assert.AreEqual("225", message.GetExtension(Unittest.RepeatedCordExtension, 0)); // Actually verify the second (modified) elements now. - Assert.Equal(501, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); - Assert.Equal(502L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); - Assert.Equal(503U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); - Assert.Equal(504UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); - Assert.Equal(505, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); - Assert.Equal(506L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); - Assert.Equal(507U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); - Assert.Equal(508UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); - Assert.Equal(509, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); - Assert.Equal(510L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); - Assert.Equal(511F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); - Assert.Equal(512D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); - Assert.Equal(true, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); - Assert.Equal("515", message.GetExtension(Unittest.RepeatedStringExtension, 1)); - Assert.Equal(ToBytes("516"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); - - Assert.Equal(517, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); - Assert.Equal(518, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); - Assert.Equal(519, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); - Assert.Equal(520, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); - - Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, + Assert.AreEqual(501, message.GetExtension(Unittest.RepeatedInt32Extension, 1)); + Assert.AreEqual(502L, message.GetExtension(Unittest.RepeatedInt64Extension, 1)); + Assert.AreEqual(503U, message.GetExtension(Unittest.RepeatedUint32Extension, 1)); + Assert.AreEqual(504UL, message.GetExtension(Unittest.RepeatedUint64Extension, 1)); + Assert.AreEqual(505, message.GetExtension(Unittest.RepeatedSint32Extension, 1)); + Assert.AreEqual(506L, message.GetExtension(Unittest.RepeatedSint64Extension, 1)); + Assert.AreEqual(507U, message.GetExtension(Unittest.RepeatedFixed32Extension, 1)); + Assert.AreEqual(508UL, message.GetExtension(Unittest.RepeatedFixed64Extension, 1)); + Assert.AreEqual(509, message.GetExtension(Unittest.RepeatedSfixed32Extension, 1)); + Assert.AreEqual(510L, message.GetExtension(Unittest.RepeatedSfixed64Extension, 1)); + Assert.AreEqual(511F, message.GetExtension(Unittest.RepeatedFloatExtension, 1)); + Assert.AreEqual(512D, message.GetExtension(Unittest.RepeatedDoubleExtension, 1)); + Assert.AreEqual(true, message.GetExtension(Unittest.RepeatedBoolExtension, 1)); + Assert.AreEqual("515", message.GetExtension(Unittest.RepeatedStringExtension, 1)); + Assert.AreEqual(ToBytes("516"), message.GetExtension(Unittest.RepeatedBytesExtension, 1)); + + Assert.AreEqual(517, message.GetExtension(Unittest.RepeatedGroupExtension, 1).A); + Assert.AreEqual(518, message.GetExtension(Unittest.RepeatedNestedMessageExtension, 1).Bb); + Assert.AreEqual(519, message.GetExtension(Unittest.RepeatedForeignMessageExtension, 1).C); + Assert.AreEqual(520, message.GetExtension(Unittest.RepeatedImportMessageExtension, 1).D); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(Unittest.RepeatedNestedEnumExtension, 1)); - Assert.Equal(ForeignEnum.FOREIGN_FOO, + Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.RepeatedForeignEnumExtension, 1)); - Assert.Equal(ImportEnum.IMPORT_FOO, + Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.RepeatedImportEnumExtension, 1)); - Assert.Equal("524", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); - Assert.Equal("525", message.GetExtension(Unittest.RepeatedCordExtension, 1)); + Assert.AreEqual("524", message.GetExtension(Unittest.RepeatedStringPieceExtension, 1)); + Assert.AreEqual("525", message.GetExtension(Unittest.RepeatedCordExtension, 1)); } internal static void AssertExtensionsClear(TestAllExtensions message) { // HasBlah() should initially be false for all optional fields. - Assert.False(message.HasExtension(Unittest.OptionalInt32Extension)); - Assert.False(message.HasExtension(Unittest.OptionalInt64Extension)); - Assert.False(message.HasExtension(Unittest.OptionalUint32Extension)); - Assert.False(message.HasExtension(Unittest.OptionalUint64Extension)); - Assert.False(message.HasExtension(Unittest.OptionalSint32Extension)); - Assert.False(message.HasExtension(Unittest.OptionalSint64Extension)); - Assert.False(message.HasExtension(Unittest.OptionalFixed32Extension)); - Assert.False(message.HasExtension(Unittest.OptionalFixed64Extension)); - Assert.False(message.HasExtension(Unittest.OptionalSfixed32Extension)); - Assert.False(message.HasExtension(Unittest.OptionalSfixed64Extension)); - Assert.False(message.HasExtension(Unittest.OptionalFloatExtension)); - Assert.False(message.HasExtension(Unittest.OptionalDoubleExtension)); - Assert.False(message.HasExtension(Unittest.OptionalBoolExtension)); - Assert.False(message.HasExtension(Unittest.OptionalStringExtension)); - Assert.False(message.HasExtension(Unittest.OptionalBytesExtension)); - - Assert.False(message.HasExtension(Unittest.OptionalGroupExtension)); - Assert.False(message.HasExtension(Unittest.OptionalNestedMessageExtension)); - Assert.False(message.HasExtension(Unittest.OptionalForeignMessageExtension)); - Assert.False(message.HasExtension(Unittest.OptionalImportMessageExtension)); - - Assert.False(message.HasExtension(Unittest.OptionalNestedEnumExtension)); - Assert.False(message.HasExtension(Unittest.OptionalForeignEnumExtension)); - Assert.False(message.HasExtension(Unittest.OptionalImportEnumExtension)); - - Assert.False(message.HasExtension(Unittest.OptionalStringPieceExtension)); - Assert.False(message.HasExtension(Unittest.OptionalCordExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalInt32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalInt64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalUint32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalUint64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalSint32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalSint64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalFixed32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalFixed64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalSfixed32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalSfixed64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalFloatExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalDoubleExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalBoolExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalStringExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalBytesExtension)); + + Assert.IsFalse(message.HasExtension(Unittest.OptionalGroupExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalNestedMessageExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalForeignMessageExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalImportMessageExtension)); + + Assert.IsFalse(message.HasExtension(Unittest.OptionalNestedEnumExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalForeignEnumExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalImportEnumExtension)); + + Assert.IsFalse(message.HasExtension(Unittest.OptionalStringPieceExtension)); + Assert.IsFalse(message.HasExtension(Unittest.OptionalCordExtension)); // Optional fields without defaults are set to zero or something like it. - Assert.Equal(0, message.GetExtension(Unittest.OptionalInt32Extension)); - Assert.Equal(0L, message.GetExtension(Unittest.OptionalInt64Extension)); - Assert.Equal(0U, message.GetExtension(Unittest.OptionalUint32Extension)); - Assert.Equal(0UL, message.GetExtension(Unittest.OptionalUint64Extension)); - Assert.Equal(0, message.GetExtension(Unittest.OptionalSint32Extension)); - Assert.Equal(0L, message.GetExtension(Unittest.OptionalSint64Extension)); - Assert.Equal(0U, message.GetExtension(Unittest.OptionalFixed32Extension)); - Assert.Equal(0UL, message.GetExtension(Unittest.OptionalFixed64Extension)); - Assert.Equal(0, message.GetExtension(Unittest.OptionalSfixed32Extension)); - Assert.Equal(0L, message.GetExtension(Unittest.OptionalSfixed64Extension)); - Assert.Equal(0F, message.GetExtension(Unittest.OptionalFloatExtension)); - Assert.Equal(0D, message.GetExtension(Unittest.OptionalDoubleExtension)); - Assert.Equal(false, message.GetExtension(Unittest.OptionalBoolExtension)); - Assert.Equal("", message.GetExtension(Unittest.OptionalStringExtension)); - Assert.Equal(ByteString.Empty, message.GetExtension(Unittest.OptionalBytesExtension)); + Assert.AreEqual(0, message.GetExtension(Unittest.OptionalInt32Extension)); + Assert.AreEqual(0L, message.GetExtension(Unittest.OptionalInt64Extension)); + Assert.AreEqual(0U, message.GetExtension(Unittest.OptionalUint32Extension)); + Assert.AreEqual(0UL, message.GetExtension(Unittest.OptionalUint64Extension)); + Assert.AreEqual(0, message.GetExtension(Unittest.OptionalSint32Extension)); + Assert.AreEqual(0L, message.GetExtension(Unittest.OptionalSint64Extension)); + Assert.AreEqual(0U, message.GetExtension(Unittest.OptionalFixed32Extension)); + Assert.AreEqual(0UL, message.GetExtension(Unittest.OptionalFixed64Extension)); + Assert.AreEqual(0, message.GetExtension(Unittest.OptionalSfixed32Extension)); + Assert.AreEqual(0L, message.GetExtension(Unittest.OptionalSfixed64Extension)); + Assert.AreEqual(0F, message.GetExtension(Unittest.OptionalFloatExtension)); + Assert.AreEqual(0D, message.GetExtension(Unittest.OptionalDoubleExtension)); + Assert.AreEqual(false, message.GetExtension(Unittest.OptionalBoolExtension)); + Assert.AreEqual("", message.GetExtension(Unittest.OptionalStringExtension)); + Assert.AreEqual(ByteString.Empty, message.GetExtension(Unittest.OptionalBytesExtension)); // Embedded messages should also be clear. - Assert.False(message.GetExtension(Unittest.OptionalGroupExtension).HasA); - Assert.False(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); - Assert.False(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); - Assert.False(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); + Assert.IsFalse(message.GetExtension(Unittest.OptionalGroupExtension).HasA); + Assert.IsFalse(message.GetExtension(Unittest.OptionalNestedMessageExtension).HasBb); + Assert.IsFalse(message.GetExtension(Unittest.OptionalForeignMessageExtension).HasC); + Assert.IsFalse(message.GetExtension(Unittest.OptionalImportMessageExtension).HasD); - Assert.Equal(0, message.GetExtension(Unittest.OptionalGroupExtension).A); - Assert.Equal(0, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); - Assert.Equal(0, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); - Assert.Equal(0, message.GetExtension(Unittest.OptionalImportMessageExtension).D); + Assert.AreEqual(0, message.GetExtension(Unittest.OptionalGroupExtension).A); + Assert.AreEqual(0, message.GetExtension(Unittest.OptionalNestedMessageExtension).Bb); + Assert.AreEqual(0, message.GetExtension(Unittest.OptionalForeignMessageExtension).C); + Assert.AreEqual(0, message.GetExtension(Unittest.OptionalImportMessageExtension).D); // Enums without defaults are set to the first value in the enum. - Assert.Equal(TestAllTypes.Types.NestedEnum.FOO, + Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetExtension(Unittest.OptionalNestedEnumExtension)); - Assert.Equal(ForeignEnum.FOREIGN_FOO, + Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(Unittest.OptionalForeignEnumExtension)); - Assert.Equal(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.OptionalImportEnumExtension)); + Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(Unittest.OptionalImportEnumExtension)); - Assert.Equal("", message.GetExtension(Unittest.OptionalStringPieceExtension)); - Assert.Equal("", message.GetExtension(Unittest.OptionalCordExtension)); + Assert.AreEqual("", message.GetExtension(Unittest.OptionalStringPieceExtension)); + Assert.AreEqual("", message.GetExtension(Unittest.OptionalCordExtension)); // Repeated fields are empty. - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedStringExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); - - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); - - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); - Assert.Equal(0, message.GetExtensionCount(Unittest.RepeatedCordExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedInt32Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedInt64Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedUint32Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedUint64Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSint32Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSint64Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedFixed32Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedFixed64Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSfixed32Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedSfixed64Extension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedFloatExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedBoolExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedStringExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedBytesExtension)); + + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedGroupExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedNestedMessageExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedForeignMessageExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedImportMessageExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedNestedEnumExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedForeignEnumExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedImportEnumExtension)); + + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedStringPieceExtension)); + Assert.AreEqual(0, message.GetExtensionCount(Unittest.RepeatedCordExtension)); // HasBlah() should also be false for all default fields. - Assert.False(message.HasExtension(Unittest.DefaultInt32Extension)); - Assert.False(message.HasExtension(Unittest.DefaultInt64Extension)); - Assert.False(message.HasExtension(Unittest.DefaultUint32Extension)); - Assert.False(message.HasExtension(Unittest.DefaultUint64Extension)); - Assert.False(message.HasExtension(Unittest.DefaultSint32Extension)); - Assert.False(message.HasExtension(Unittest.DefaultSint64Extension)); - Assert.False(message.HasExtension(Unittest.DefaultFixed32Extension)); - Assert.False(message.HasExtension(Unittest.DefaultFixed64Extension)); - Assert.False(message.HasExtension(Unittest.DefaultSfixed32Extension)); - Assert.False(message.HasExtension(Unittest.DefaultSfixed64Extension)); - Assert.False(message.HasExtension(Unittest.DefaultFloatExtension)); - Assert.False(message.HasExtension(Unittest.DefaultDoubleExtension)); - Assert.False(message.HasExtension(Unittest.DefaultBoolExtension)); - Assert.False(message.HasExtension(Unittest.DefaultStringExtension)); - Assert.False(message.HasExtension(Unittest.DefaultBytesExtension)); - - Assert.False(message.HasExtension(Unittest.DefaultNestedEnumExtension)); - Assert.False(message.HasExtension(Unittest.DefaultForeignEnumExtension)); - Assert.False(message.HasExtension(Unittest.DefaultImportEnumExtension)); - - Assert.False(message.HasExtension(Unittest.DefaultStringPieceExtension)); - Assert.False(message.HasExtension(Unittest.DefaultCordExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultInt32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultInt64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultUint32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultUint64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultSint32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultSint64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultFixed32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultFixed64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultSfixed32Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultSfixed64Extension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultFloatExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultDoubleExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultBoolExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultStringExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultBytesExtension)); + + Assert.IsFalse(message.HasExtension(Unittest.DefaultNestedEnumExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultForeignEnumExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultImportEnumExtension)); + + Assert.IsFalse(message.HasExtension(Unittest.DefaultStringPieceExtension)); + Assert.IsFalse(message.HasExtension(Unittest.DefaultCordExtension)); // Fields with defaults have their default values (duh). - Assert.Equal(41, message.GetExtension(Unittest.DefaultInt32Extension)); - Assert.Equal(42L, message.GetExtension(Unittest.DefaultInt64Extension)); - Assert.Equal(43U, message.GetExtension(Unittest.DefaultUint32Extension)); - Assert.Equal(44UL, message.GetExtension(Unittest.DefaultUint64Extension)); - Assert.Equal(-45, message.GetExtension(Unittest.DefaultSint32Extension)); - Assert.Equal(46L, message.GetExtension(Unittest.DefaultSint64Extension)); - Assert.Equal(47U, message.GetExtension(Unittest.DefaultFixed32Extension)); - Assert.Equal(48UL, message.GetExtension(Unittest.DefaultFixed64Extension)); - Assert.Equal(49, message.GetExtension(Unittest.DefaultSfixed32Extension)); - Assert.Equal(-50L, message.GetExtension(Unittest.DefaultSfixed64Extension)); - Assert.Equal(51.5F, message.GetExtension(Unittest.DefaultFloatExtension)); - Assert.Equal(52e3D, message.GetExtension(Unittest.DefaultDoubleExtension)); - Assert.Equal(true, message.GetExtension(Unittest.DefaultBoolExtension)); - Assert.Equal("hello", message.GetExtension(Unittest.DefaultStringExtension)); - Assert.Equal(ToBytes("world"), message.GetExtension(Unittest.DefaultBytesExtension)); - - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, + Assert.AreEqual(41, message.GetExtension(Unittest.DefaultInt32Extension)); + Assert.AreEqual(42L, message.GetExtension(Unittest.DefaultInt64Extension)); + Assert.AreEqual(43U, message.GetExtension(Unittest.DefaultUint32Extension)); + Assert.AreEqual(44UL, message.GetExtension(Unittest.DefaultUint64Extension)); + Assert.AreEqual(-45, message.GetExtension(Unittest.DefaultSint32Extension)); + Assert.AreEqual(46L, message.GetExtension(Unittest.DefaultSint64Extension)); + Assert.AreEqual(47U, message.GetExtension(Unittest.DefaultFixed32Extension)); + Assert.AreEqual(48UL, message.GetExtension(Unittest.DefaultFixed64Extension)); + Assert.AreEqual(49, message.GetExtension(Unittest.DefaultSfixed32Extension)); + Assert.AreEqual(-50L, message.GetExtension(Unittest.DefaultSfixed64Extension)); + Assert.AreEqual(51.5F, message.GetExtension(Unittest.DefaultFloatExtension)); + Assert.AreEqual(52e3D, message.GetExtension(Unittest.DefaultDoubleExtension)); + Assert.AreEqual(true, message.GetExtension(Unittest.DefaultBoolExtension)); + Assert.AreEqual("hello", message.GetExtension(Unittest.DefaultStringExtension)); + Assert.AreEqual(ToBytes("world"), message.GetExtension(Unittest.DefaultBytesExtension)); + + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.DefaultNestedEnumExtension)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.DefaultForeignEnumExtension)); - Assert.Equal(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.DefaultImportEnumExtension)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.DefaultForeignEnumExtension)); + Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(Unittest.DefaultImportEnumExtension)); - Assert.Equal("abc", message.GetExtension(Unittest.DefaultStringPieceExtension)); - Assert.Equal("123", message.GetExtension(Unittest.DefaultCordExtension)); + Assert.AreEqual("abc", message.GetExtension(Unittest.DefaultStringPieceExtension)); + Assert.AreEqual("123", message.GetExtension(Unittest.DefaultCordExtension)); } /// @@ -1495,48 +1495,48 @@ namespace Google.ProtocolBuffers /// public static void AssertPackedFieldsSet(TestPackedTypes message) { - Assert.Equal(2, message.PackedInt32Count); - Assert.Equal(2, message.PackedInt64Count); - Assert.Equal(2, message.PackedUint32Count); - Assert.Equal(2, message.PackedUint64Count); - Assert.Equal(2, message.PackedSint32Count); - Assert.Equal(2, message.PackedSint64Count); - Assert.Equal(2, message.PackedFixed32Count); - Assert.Equal(2, message.PackedFixed64Count); - Assert.Equal(2, message.PackedSfixed32Count); - Assert.Equal(2, message.PackedSfixed64Count); - Assert.Equal(2, message.PackedFloatCount); - Assert.Equal(2, message.PackedDoubleCount); - Assert.Equal(2, message.PackedBoolCount); - Assert.Equal(2, message.PackedEnumCount); - Assert.Equal(601, message.GetPackedInt32(0)); - Assert.Equal(602, message.GetPackedInt64(0)); - Assert.Equal(603u, message.GetPackedUint32(0)); - Assert.Equal(604u, message.GetPackedUint64(0)); - Assert.Equal(605, message.GetPackedSint32(0)); - Assert.Equal(606, message.GetPackedSint64(0)); - Assert.Equal(607u, message.GetPackedFixed32(0)); - Assert.Equal(608u, message.GetPackedFixed64(0)); - Assert.Equal(609, message.GetPackedSfixed32(0)); - Assert.Equal(610, message.GetPackedSfixed64(0)); - Assert.Equal(611f, message.GetPackedFloat(0)); - Assert.Equal(612d, message.GetPackedDouble(0)); - Assert.Equal(true, message.GetPackedBool(0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetPackedEnum(0)); - Assert.Equal(701, message.GetPackedInt32(1)); - Assert.Equal(702, message.GetPackedInt64(1)); - Assert.Equal(703u, message.GetPackedUint32(1)); - Assert.Equal(704u, message.GetPackedUint64(1)); - Assert.Equal(705, message.GetPackedSint32(1)); - Assert.Equal(706, message.GetPackedSint64(1)); - Assert.Equal(707u, message.GetPackedFixed32(1)); - Assert.Equal(708u, message.GetPackedFixed64(1)); - Assert.Equal(709, message.GetPackedSfixed32(1)); - Assert.Equal(710, message.GetPackedSfixed64(1)); - Assert.Equal(711f, message.GetPackedFloat(1)); - Assert.Equal(712d, message.GetPackedDouble(1)); - Assert.Equal(false, message.GetPackedBool(1)); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetPackedEnum(1)); + Assert.AreEqual(2, message.PackedInt32Count); + Assert.AreEqual(2, message.PackedInt64Count); + Assert.AreEqual(2, message.PackedUint32Count); + Assert.AreEqual(2, message.PackedUint64Count); + Assert.AreEqual(2, message.PackedSint32Count); + Assert.AreEqual(2, message.PackedSint64Count); + Assert.AreEqual(2, message.PackedFixed32Count); + Assert.AreEqual(2, message.PackedFixed64Count); + Assert.AreEqual(2, message.PackedSfixed32Count); + Assert.AreEqual(2, message.PackedSfixed64Count); + Assert.AreEqual(2, message.PackedFloatCount); + Assert.AreEqual(2, message.PackedDoubleCount); + Assert.AreEqual(2, message.PackedBoolCount); + Assert.AreEqual(2, message.PackedEnumCount); + Assert.AreEqual(601, message.GetPackedInt32(0)); + Assert.AreEqual(602, message.GetPackedInt64(0)); + Assert.AreEqual(603u, message.GetPackedUint32(0)); + Assert.AreEqual(604u, message.GetPackedUint64(0)); + Assert.AreEqual(605, message.GetPackedSint32(0)); + Assert.AreEqual(606, message.GetPackedSint64(0)); + Assert.AreEqual(607u, message.GetPackedFixed32(0)); + Assert.AreEqual(608u, message.GetPackedFixed64(0)); + Assert.AreEqual(609, message.GetPackedSfixed32(0)); + Assert.AreEqual(610, message.GetPackedSfixed64(0)); + Assert.AreEqual(611f, message.GetPackedFloat(0)); + Assert.AreEqual(612d, message.GetPackedDouble(0)); + Assert.AreEqual(true, message.GetPackedBool(0)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetPackedEnum(0)); + Assert.AreEqual(701, message.GetPackedInt32(1)); + Assert.AreEqual(702, message.GetPackedInt64(1)); + Assert.AreEqual(703u, message.GetPackedUint32(1)); + Assert.AreEqual(704u, message.GetPackedUint64(1)); + Assert.AreEqual(705, message.GetPackedSint32(1)); + Assert.AreEqual(706, message.GetPackedSint64(1)); + Assert.AreEqual(707u, message.GetPackedFixed32(1)); + Assert.AreEqual(708u, message.GetPackedFixed64(1)); + Assert.AreEqual(709, message.GetPackedSfixed32(1)); + Assert.AreEqual(710, message.GetPackedSfixed64(1)); + Assert.AreEqual(711f, message.GetPackedFloat(1)); + Assert.AreEqual(712d, message.GetPackedDouble(1)); + Assert.AreEqual(false, message.GetPackedBool(1)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetPackedEnum(1)); } /// /// Asserts that all the fields of the specified message are set to the values assigned @@ -1544,48 +1544,48 @@ namespace Google.ProtocolBuffers /// public static void AssertUnpackedFieldsSet(TestUnpackedTypes message) { - Assert.Equal(2, message.UnpackedInt32Count); - Assert.Equal(2, message.UnpackedInt64Count); - Assert.Equal(2, message.UnpackedUint32Count); - Assert.Equal(2, message.UnpackedUint64Count); - Assert.Equal(2, message.UnpackedSint32Count); - Assert.Equal(2, message.UnpackedSint64Count); - Assert.Equal(2, message.UnpackedFixed32Count); - Assert.Equal(2, message.UnpackedFixed64Count); - Assert.Equal(2, message.UnpackedSfixed32Count); - Assert.Equal(2, message.UnpackedSfixed64Count); - Assert.Equal(2, message.UnpackedFloatCount); - Assert.Equal(2, message.UnpackedDoubleCount); - Assert.Equal(2, message.UnpackedBoolCount); - Assert.Equal(2, message.UnpackedEnumCount); - Assert.Equal(601, message.GetUnpackedInt32(0)); - Assert.Equal(602, message.GetUnpackedInt64(0)); - Assert.Equal(603u, message.GetUnpackedUint32(0)); - Assert.Equal(604u, message.GetUnpackedUint64(0)); - Assert.Equal(605, message.GetUnpackedSint32(0)); - Assert.Equal(606, message.GetUnpackedSint64(0)); - Assert.Equal(607u, message.GetUnpackedFixed32(0)); - Assert.Equal(608u, message.GetUnpackedFixed64(0)); - Assert.Equal(609, message.GetUnpackedSfixed32(0)); - Assert.Equal(610, message.GetUnpackedSfixed64(0)); - Assert.Equal(611f, message.GetUnpackedFloat(0)); - Assert.Equal(612d, message.GetUnpackedDouble(0)); - Assert.Equal(true, message.GetUnpackedBool(0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetUnpackedEnum(0)); - Assert.Equal(701, message.GetUnpackedInt32(1)); - Assert.Equal(702, message.GetUnpackedInt64(1)); - Assert.Equal(703u, message.GetUnpackedUint32(1)); - Assert.Equal(704u, message.GetUnpackedUint64(1)); - Assert.Equal(705, message.GetUnpackedSint32(1)); - Assert.Equal(706, message.GetUnpackedSint64(1)); - Assert.Equal(707u, message.GetUnpackedFixed32(1)); - Assert.Equal(708u, message.GetUnpackedFixed64(1)); - Assert.Equal(709, message.GetUnpackedSfixed32(1)); - Assert.Equal(710, message.GetUnpackedSfixed64(1)); - Assert.Equal(711f, message.GetUnpackedFloat(1)); - Assert.Equal(712d, message.GetUnpackedDouble(1)); - Assert.Equal(false, message.GetUnpackedBool(1)); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetUnpackedEnum(1)); + Assert.AreEqual(2, message.UnpackedInt32Count); + Assert.AreEqual(2, message.UnpackedInt64Count); + Assert.AreEqual(2, message.UnpackedUint32Count); + Assert.AreEqual(2, message.UnpackedUint64Count); + Assert.AreEqual(2, message.UnpackedSint32Count); + Assert.AreEqual(2, message.UnpackedSint64Count); + Assert.AreEqual(2, message.UnpackedFixed32Count); + Assert.AreEqual(2, message.UnpackedFixed64Count); + Assert.AreEqual(2, message.UnpackedSfixed32Count); + Assert.AreEqual(2, message.UnpackedSfixed64Count); + Assert.AreEqual(2, message.UnpackedFloatCount); + Assert.AreEqual(2, message.UnpackedDoubleCount); + Assert.AreEqual(2, message.UnpackedBoolCount); + Assert.AreEqual(2, message.UnpackedEnumCount); + Assert.AreEqual(601, message.GetUnpackedInt32(0)); + Assert.AreEqual(602, message.GetUnpackedInt64(0)); + Assert.AreEqual(603u, message.GetUnpackedUint32(0)); + Assert.AreEqual(604u, message.GetUnpackedUint64(0)); + Assert.AreEqual(605, message.GetUnpackedSint32(0)); + Assert.AreEqual(606, message.GetUnpackedSint64(0)); + Assert.AreEqual(607u, message.GetUnpackedFixed32(0)); + Assert.AreEqual(608u, message.GetUnpackedFixed64(0)); + Assert.AreEqual(609, message.GetUnpackedSfixed32(0)); + Assert.AreEqual(610, message.GetUnpackedSfixed64(0)); + Assert.AreEqual(611f, message.GetUnpackedFloat(0)); + Assert.AreEqual(612d, message.GetUnpackedDouble(0)); + Assert.AreEqual(true, message.GetUnpackedBool(0)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetUnpackedEnum(0)); + Assert.AreEqual(701, message.GetUnpackedInt32(1)); + Assert.AreEqual(702, message.GetUnpackedInt64(1)); + Assert.AreEqual(703u, message.GetUnpackedUint32(1)); + Assert.AreEqual(704u, message.GetUnpackedUint64(1)); + Assert.AreEqual(705, message.GetUnpackedSint32(1)); + Assert.AreEqual(706, message.GetUnpackedSint64(1)); + Assert.AreEqual(707u, message.GetUnpackedFixed32(1)); + Assert.AreEqual(708u, message.GetUnpackedFixed64(1)); + Assert.AreEqual(709, message.GetUnpackedSfixed32(1)); + Assert.AreEqual(710, message.GetUnpackedSfixed64(1)); + Assert.AreEqual(711f, message.GetUnpackedFloat(1)); + Assert.AreEqual(712d, message.GetUnpackedDouble(1)); + Assert.AreEqual(false, message.GetUnpackedBool(1)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetUnpackedEnum(1)); } public static void SetPackedExtensions(TestPackedExtensions.Builder message) @@ -1623,95 +1623,95 @@ namespace Google.ProtocolBuffers public static void AssertPackedExtensionsSet(TestPackedExtensions message) { - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedInt32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedInt64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedUint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedUint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedFixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedFixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSfixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedSfixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedFloatExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedDoubleExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedBoolExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.PackedEnumExtension)); - Assert.Equal(601, message.GetExtension(Unittest.PackedInt32Extension, 0)); - Assert.Equal(602L, message.GetExtension(Unittest.PackedInt64Extension, 0)); - Assert.Equal(603u, message.GetExtension(Unittest.PackedUint32Extension, 0)); - Assert.Equal(604uL, message.GetExtension(Unittest.PackedUint64Extension, 0)); - Assert.Equal(605, message.GetExtension(Unittest.PackedSint32Extension, 0)); - Assert.Equal(606L, message.GetExtension(Unittest.PackedSint64Extension, 0)); - Assert.Equal(607u, message.GetExtension(Unittest.PackedFixed32Extension, 0)); - Assert.Equal(608uL, message.GetExtension(Unittest.PackedFixed64Extension, 0)); - Assert.Equal(609, message.GetExtension(Unittest.PackedSfixed32Extension, 0)); - Assert.Equal(610L, message.GetExtension(Unittest.PackedSfixed64Extension, 0)); - Assert.Equal(611F, message.GetExtension(Unittest.PackedFloatExtension, 0)); - Assert.Equal(612D, message.GetExtension(Unittest.PackedDoubleExtension, 0)); - Assert.Equal(true, message.GetExtension(Unittest.PackedBoolExtension, 0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedInt32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedInt64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedUint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedUint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedFixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedFixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSfixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedSfixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedFloatExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedDoubleExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedBoolExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.PackedEnumExtension)); + Assert.AreEqual(601, message.GetExtension(Unittest.PackedInt32Extension, 0)); + Assert.AreEqual(602L, message.GetExtension(Unittest.PackedInt64Extension, 0)); + Assert.AreEqual(603u, message.GetExtension(Unittest.PackedUint32Extension, 0)); + Assert.AreEqual(604uL, message.GetExtension(Unittest.PackedUint64Extension, 0)); + Assert.AreEqual(605, message.GetExtension(Unittest.PackedSint32Extension, 0)); + Assert.AreEqual(606L, message.GetExtension(Unittest.PackedSint64Extension, 0)); + Assert.AreEqual(607u, message.GetExtension(Unittest.PackedFixed32Extension, 0)); + Assert.AreEqual(608uL, message.GetExtension(Unittest.PackedFixed64Extension, 0)); + Assert.AreEqual(609, message.GetExtension(Unittest.PackedSfixed32Extension, 0)); + Assert.AreEqual(610L, message.GetExtension(Unittest.PackedSfixed64Extension, 0)); + Assert.AreEqual(611F, message.GetExtension(Unittest.PackedFloatExtension, 0)); + Assert.AreEqual(612D, message.GetExtension(Unittest.PackedDoubleExtension, 0)); + Assert.AreEqual(true, message.GetExtension(Unittest.PackedBoolExtension, 0)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.PackedEnumExtension, 0)); - Assert.Equal(701, message.GetExtension(Unittest.PackedInt32Extension, 1)); - Assert.Equal(702L, message.GetExtension(Unittest.PackedInt64Extension, 1)); - Assert.Equal(703u, message.GetExtension(Unittest.PackedUint32Extension, 1)); - Assert.Equal(704uL, message.GetExtension(Unittest.PackedUint64Extension, 1)); - Assert.Equal(705, message.GetExtension(Unittest.PackedSint32Extension, 1)); - Assert.Equal(706L, message.GetExtension(Unittest.PackedSint64Extension, 1)); - Assert.Equal(707u, message.GetExtension(Unittest.PackedFixed32Extension, 1)); - Assert.Equal(708uL, message.GetExtension(Unittest.PackedFixed64Extension, 1)); - Assert.Equal(709, message.GetExtension(Unittest.PackedSfixed32Extension, 1)); - Assert.Equal(710L, message.GetExtension(Unittest.PackedSfixed64Extension, 1)); - Assert.Equal(711F, message.GetExtension(Unittest.PackedFloatExtension, 1)); - Assert.Equal(712D, message.GetExtension(Unittest.PackedDoubleExtension, 1)); - Assert.Equal(false, message.GetExtension(Unittest.PackedBoolExtension, 1)); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.PackedEnumExtension, 1)); + Assert.AreEqual(701, message.GetExtension(Unittest.PackedInt32Extension, 1)); + Assert.AreEqual(702L, message.GetExtension(Unittest.PackedInt64Extension, 1)); + Assert.AreEqual(703u, message.GetExtension(Unittest.PackedUint32Extension, 1)); + Assert.AreEqual(704uL, message.GetExtension(Unittest.PackedUint64Extension, 1)); + Assert.AreEqual(705, message.GetExtension(Unittest.PackedSint32Extension, 1)); + Assert.AreEqual(706L, message.GetExtension(Unittest.PackedSint64Extension, 1)); + Assert.AreEqual(707u, message.GetExtension(Unittest.PackedFixed32Extension, 1)); + Assert.AreEqual(708uL, message.GetExtension(Unittest.PackedFixed64Extension, 1)); + Assert.AreEqual(709, message.GetExtension(Unittest.PackedSfixed32Extension, 1)); + Assert.AreEqual(710L, message.GetExtension(Unittest.PackedSfixed64Extension, 1)); + Assert.AreEqual(711F, message.GetExtension(Unittest.PackedFloatExtension, 1)); + Assert.AreEqual(712D, message.GetExtension(Unittest.PackedDoubleExtension, 1)); + Assert.AreEqual(false, message.GetExtension(Unittest.PackedBoolExtension, 1)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.PackedEnumExtension, 1)); } public static void AssertUnpackedExtensionsSet(TestUnpackedExtensions message) { - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedInt32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedInt64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedUint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedUint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSint32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSint64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedFixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedFixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSfixed32Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedSfixed64Extension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedFloatExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedDoubleExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedBoolExtension)); - Assert.Equal(2, message.GetExtensionCount(Unittest.UnpackedEnumExtension)); - Assert.Equal(601, message.GetExtension(Unittest.UnpackedInt32Extension, 0)); - Assert.Equal(602L, message.GetExtension(Unittest.UnpackedInt64Extension, 0)); - Assert.Equal(603u, message.GetExtension(Unittest.UnpackedUint32Extension, 0)); - Assert.Equal(604uL, message.GetExtension(Unittest.UnpackedUint64Extension, 0)); - Assert.Equal(605, message.GetExtension(Unittest.UnpackedSint32Extension, 0)); - Assert.Equal(606L, message.GetExtension(Unittest.UnpackedSint64Extension, 0)); - Assert.Equal(607u, message.GetExtension(Unittest.UnpackedFixed32Extension, 0)); - Assert.Equal(608uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 0)); - Assert.Equal(609, message.GetExtension(Unittest.UnpackedSfixed32Extension, 0)); - Assert.Equal(610L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 0)); - Assert.Equal(611F, message.GetExtension(Unittest.UnpackedFloatExtension, 0)); - Assert.Equal(612D, message.GetExtension(Unittest.UnpackedDoubleExtension, 0)); - Assert.Equal(true, message.GetExtension(Unittest.UnpackedBoolExtension, 0)); - Assert.Equal(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.UnpackedEnumExtension, 0)); - Assert.Equal(701, message.GetExtension(Unittest.UnpackedInt32Extension, 1)); - Assert.Equal(702L, message.GetExtension(Unittest.UnpackedInt64Extension, 1)); - Assert.Equal(703u, message.GetExtension(Unittest.UnpackedUint32Extension, 1)); - Assert.Equal(704uL, message.GetExtension(Unittest.UnpackedUint64Extension, 1)); - Assert.Equal(705, message.GetExtension(Unittest.UnpackedSint32Extension, 1)); - Assert.Equal(706L, message.GetExtension(Unittest.UnpackedSint64Extension, 1)); - Assert.Equal(707u, message.GetExtension(Unittest.UnpackedFixed32Extension, 1)); - Assert.Equal(708uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 1)); - Assert.Equal(709, message.GetExtension(Unittest.UnpackedSfixed32Extension, 1)); - Assert.Equal(710L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 1)); - Assert.Equal(711F, message.GetExtension(Unittest.UnpackedFloatExtension, 1)); - Assert.Equal(712D, message.GetExtension(Unittest.UnpackedDoubleExtension, 1)); - Assert.Equal(false, message.GetExtension(Unittest.UnpackedBoolExtension, 1)); - Assert.Equal(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.UnpackedEnumExtension, 1)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedInt32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedInt64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedUint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedUint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSint32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSint64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedFixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedFixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSfixed32Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedSfixed64Extension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedFloatExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedDoubleExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedBoolExtension)); + Assert.AreEqual(2, message.GetExtensionCount(Unittest.UnpackedEnumExtension)); + Assert.AreEqual(601, message.GetExtension(Unittest.UnpackedInt32Extension, 0)); + Assert.AreEqual(602L, message.GetExtension(Unittest.UnpackedInt64Extension, 0)); + Assert.AreEqual(603u, message.GetExtension(Unittest.UnpackedUint32Extension, 0)); + Assert.AreEqual(604uL, message.GetExtension(Unittest.UnpackedUint64Extension, 0)); + Assert.AreEqual(605, message.GetExtension(Unittest.UnpackedSint32Extension, 0)); + Assert.AreEqual(606L, message.GetExtension(Unittest.UnpackedSint64Extension, 0)); + Assert.AreEqual(607u, message.GetExtension(Unittest.UnpackedFixed32Extension, 0)); + Assert.AreEqual(608uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 0)); + Assert.AreEqual(609, message.GetExtension(Unittest.UnpackedSfixed32Extension, 0)); + Assert.AreEqual(610L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 0)); + Assert.AreEqual(611F, message.GetExtension(Unittest.UnpackedFloatExtension, 0)); + Assert.AreEqual(612D, message.GetExtension(Unittest.UnpackedDoubleExtension, 0)); + Assert.AreEqual(true, message.GetExtension(Unittest.UnpackedBoolExtension, 0)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(Unittest.UnpackedEnumExtension, 0)); + Assert.AreEqual(701, message.GetExtension(Unittest.UnpackedInt32Extension, 1)); + Assert.AreEqual(702L, message.GetExtension(Unittest.UnpackedInt64Extension, 1)); + Assert.AreEqual(703u, message.GetExtension(Unittest.UnpackedUint32Extension, 1)); + Assert.AreEqual(704uL, message.GetExtension(Unittest.UnpackedUint64Extension, 1)); + Assert.AreEqual(705, message.GetExtension(Unittest.UnpackedSint32Extension, 1)); + Assert.AreEqual(706L, message.GetExtension(Unittest.UnpackedSint64Extension, 1)); + Assert.AreEqual(707u, message.GetExtension(Unittest.UnpackedFixed32Extension, 1)); + Assert.AreEqual(708uL, message.GetExtension(Unittest.UnpackedFixed64Extension, 1)); + Assert.AreEqual(709, message.GetExtension(Unittest.UnpackedSfixed32Extension, 1)); + Assert.AreEqual(710L, message.GetExtension(Unittest.UnpackedSfixed64Extension, 1)); + Assert.AreEqual(711F, message.GetExtension(Unittest.UnpackedFloatExtension, 1)); + Assert.AreEqual(712D, message.GetExtension(Unittest.UnpackedDoubleExtension, 1)); + Assert.AreEqual(false, message.GetExtension(Unittest.UnpackedBoolExtension, 1)); + Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(Unittest.UnpackedEnumExtension, 1)); } private static readonly string[] TestCultures = {"en-US", "en-GB", "fr-FR", "de-DE"}; diff --git a/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs b/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs index ad5c052e..c218deed 100644 --- a/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs +++ b/csharp/src/ProtocolBuffers.Test/TestWriterFormatJson.cs @@ -6,13 +6,13 @@ using EnumOptions = Google.ProtocolBuffers.TestProtos.EnumOptions; using Google.ProtocolBuffers.DescriptorProtos; using Google.ProtocolBuffers.Serialization; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class TestWriterFormatJson { - [Fact] + [Test] public void Example_FromJson() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -21,10 +21,10 @@ namespace Google.ProtocolBuffers Extensions.MergeFromJson(builder, @"{""valid"":true}"); TestXmlMessage message = builder.Build(); - Assert.Equal(true, message.Valid); + Assert.AreEqual(true, message.Valid); } - [Fact] + [Test] public void Example_ToJson() { TestXmlMessage message = @@ -35,10 +35,10 @@ namespace Google.ProtocolBuffers //3.5: string json = message.ToJson(); string json = Extensions.ToJson(message); - Assert.Equal(@"{""valid"":true}", json); + Assert.AreEqual(@"{""valid"":true}", json); } - [Fact] + [Test] public void Example_WriteJsonUsingICodedOutputStream() { TestXmlMessage message = @@ -52,20 +52,20 @@ namespace Google.ProtocolBuffers writer.WriteMessageStart(); //manually begin the message, output is '{' writer.Flush(); - Assert.Equal("{", output.ToString()); + Assert.AreEqual("{", output.ToString()); ICodedOutputStream stream = writer; message.WriteTo(stream); //write the message normally writer.Flush(); - Assert.Equal(@"{""valid"":true", output.ToString()); + Assert.AreEqual(@"{""valid"":true", output.ToString()); writer.WriteMessageEnd(); //manually write the end message '}' - Assert.Equal(@"{""valid"":true}", output.ToString()); + Assert.AreEqual(@"{""valid"":true}", output.ToString()); } } - [Fact] + [Test] public void Example_ReadJsonUsingICodedInputStream() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -94,37 +94,37 @@ namespace Google.ProtocolBuffers JsonFormatReader.CreateInstance(Content) .Merge(message.WeakCreateBuilderForType(), registry).WeakBuild(); - Assert.Equal(typeof(TMessage), copy.GetType()); - Assert.Equal(message, copy); + Assert.AreEqual(typeof(TMessage), copy.GetType()); + Assert.AreEqual(message, copy); foreach (string expect in expecting) { - Assert.True(Content.IndexOf(expect) >= 0); + Assert.IsTrue(Content.IndexOf(expect) >= 0); } } - [Fact] + [Test] public void TestToJsonParseFromJson() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string json = Extensions.ToJson(msg); - Assert.Equal("{\"default_bool\":true}", json); + Assert.AreEqual("{\"default_bool\":true}", json); TestAllTypes copy = Extensions.MergeFromJson(new TestAllTypes.Builder(), json).Build(); - Assert.True(copy.HasDefaultBool && copy.DefaultBool); - Assert.Equal(msg, copy); + Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); + Assert.AreEqual(msg, copy); } - [Fact] + [Test] public void TestToJsonParseFromJsonReader() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string json = Extensions.ToJson(msg); - Assert.Equal("{\"default_bool\":true}", json); + Assert.AreEqual("{\"default_bool\":true}", json); TestAllTypes copy = Extensions.MergeFromJson(new TestAllTypes.Builder(), new StringReader(json)).Build(); - Assert.True(copy.HasDefaultBool && copy.DefaultBool); - Assert.Equal(msg, copy); + Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); + Assert.AreEqual(msg, copy); } - [Fact] + [Test] public void TestJsonFormatted() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -144,10 +144,10 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = JsonFormatReader.CreateInstance(json) .Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestEmptyMessage() { FormatterAssert( @@ -157,7 +157,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestRepeatedField() { FormatterAssert( @@ -169,7 +169,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestNestedEmptyMessage() { FormatterAssert( @@ -180,7 +180,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestNestedMessage() { FormatterAssert( @@ -191,7 +191,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestBooleanTypes() { FormatterAssert( @@ -202,7 +202,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestFullMessage() { FormatterAssert( @@ -232,7 +232,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestMessageWithXmlText() { FormatterAssert( @@ -243,7 +243,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestWithEscapeChars() { FormatterAssert( @@ -254,7 +254,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestWithExtensionText() { FormatterAssert( @@ -266,7 +266,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestWithExtensionNumber() { FormatterAssert( @@ -278,7 +278,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestWithExtensionArray() { FormatterAssert( @@ -291,7 +291,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestWithExtensionEnum() { FormatterAssert( @@ -302,7 +302,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestMessageWithExtensions() { FormatterAssert( @@ -325,7 +325,7 @@ namespace Google.ProtocolBuffers ); } - [Fact] + [Test] public void TestMessageMissingExtensions() { TestXmlMessage original = TestXmlMessage.CreateBuilder() @@ -353,23 +353,23 @@ namespace Google.ProtocolBuffers IMessageLite copy = JsonFormatReader.CreateInstance(Content) .Merge(message.CreateBuilderForType()).Build(); - Assert.NotEqual(original, message); - Assert.NotEqual(original, copy); - Assert.Equal(message, copy); + Assert.AreNotEqual(original, message); + Assert.AreNotEqual(original, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestMergeFields() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); builder.MergeFrom(JsonFormatReader.CreateInstance("\"valid\": true")); builder.MergeFrom(JsonFormatReader.CreateInstance("\"text\": \"text\", \"number\": \"411\"")); - Assert.Equal(true, builder.Valid); - Assert.Equal("text", builder.Text); - Assert.Equal(411, builder.Number); + Assert.AreEqual(true, builder.Valid); + Assert.AreEqual("text", builder.Text); + Assert.AreEqual(411, builder.Number); } - [Fact] + [Test] public void TestMessageArray() { JsonFormatWriter writer = JsonFormatWriter.CreateInstance().Formatted(); @@ -388,13 +388,13 @@ namespace Google.ProtocolBuffers foreach (JsonFormatReader r in reader.EnumerateArray()) { r.Merge(builder); - Assert.Equal(++ordinal, builder.Number); + Assert.AreEqual(++ordinal, builder.Number); } - Assert.Equal(3, ordinal); - Assert.Equal(3, builder.TextlinesCount); + Assert.AreEqual(3, ordinal); + Assert.AreEqual(3, builder.TextlinesCount); } - [Fact] + [Test] public void TestNestedMessageArray() { JsonFormatWriter writer = JsonFormatWriter.CreateInstance(); @@ -418,13 +418,13 @@ namespace Google.ProtocolBuffers foreach (JsonFormatReader r2 in r.EnumerateArray()) { r2.Merge(builder); - Assert.Equal(++ordinal, builder.Number); + Assert.AreEqual(++ordinal, builder.Number); } - Assert.Equal(3, ordinal); - Assert.Equal(3, builder.TextlinesCount); + Assert.AreEqual(3, ordinal); + Assert.AreEqual(3, builder.TextlinesCount); } - [Fact] + [Test] public void TestReadWriteJsonWithoutRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -439,15 +439,15 @@ namespace Google.ProtocolBuffers output.Flush(); Json = sw.ToString(); } - Assert.Equal(@"""text"":""abc"",""number"":123", Json); + Assert.AreEqual(@"""text"":""abc"",""number"":123", Json); ICodedInputStream input = JsonFormatReader.CreateInstance(Json); TestXmlMessage copy = TestXmlMessage.CreateBuilder().MergeFrom(input).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestRecursiveLimit() { StringBuilder sb = new StringBuilder(8192); @@ -458,32 +458,32 @@ namespace Google.ProtocolBuffers Assert.Throws(() => Extensions.MergeFromJson(new TestXmlRescursive.Builder(), sb.ToString()).Build()); } - [Fact] + [Test] public void FailWithEmptyText() { Assert.Throws(() => JsonFormatReader.CreateInstance("").Merge(TestXmlMessage.CreateBuilder())); } - [Fact] + [Test] public void FailWithUnexpectedValue() { Assert.Throws(() => JsonFormatReader.CreateInstance("{{}}").Merge(TestXmlMessage.CreateBuilder())); } - [Fact] + [Test] public void FailWithUnQuotedName() { Assert.Throws(() => JsonFormatReader.CreateInstance("{name:{}}").Merge(TestXmlMessage.CreateBuilder())); } - [Fact] + [Test] public void FailWithUnexpectedType() { Assert.Throws(() => JsonFormatReader.CreateInstance("{\"valid\":{}}").Merge(TestXmlMessage.CreateBuilder())); } // See issue 64 for background. - [Fact] + [Test] public void ToJsonRequiringBufferExpansion() { string s = new string('.', 4086); diff --git a/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs b/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs index 78e6bb27..38d7ad18 100644 --- a/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs +++ b/csharp/src/ProtocolBuffers.Test/TestWriterFormatXml.cs @@ -4,13 +4,13 @@ using System.Text; using System.Xml; using Google.ProtocolBuffers.Serialization; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class TestWriterFormatXml { - [Fact] + [Test] public void Example_FromXml() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -20,10 +20,10 @@ namespace Google.ProtocolBuffers Extensions.MergeFromXml(builder, rdr); TestXmlMessage message = builder.Build(); - Assert.Equal(true, message.Valid); + Assert.AreEqual(true, message.Valid); } - [Fact] + [Test] public void Example_ToXml() { TestXmlMessage message = @@ -34,10 +34,10 @@ namespace Google.ProtocolBuffers //3.5: string Xml = message.ToXml(); string Xml = Extensions.ToXml(message); - Assert.Equal(@"true", Xml); + Assert.AreEqual(@"true", Xml); } - [Fact] + [Test] public void Example_WriteXmlUsingICodedOutputStream() { TestXmlMessage message = @@ -54,11 +54,11 @@ namespace Google.ProtocolBuffers message.WriteTo(stream); //write the message normally writer.WriteMessageEnd(); //manually write the end message '}' - Assert.Equal(@"true", output.ToString()); + Assert.AreEqual(@"true", output.ToString()); } } - [Fact] + [Test] public void Example_ReadXmlUsingICodedInputStream() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -71,29 +71,29 @@ namespace Google.ProtocolBuffers reader.ReadMessageEnd(); //manually read the end message '}' } - [Fact] + [Test] public void TestToXmlParseFromXml() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string xml = Extensions.ToXml(msg); - Assert.Equal("true", xml); + Assert.AreEqual("true", xml); TestAllTypes copy = Extensions.MergeFromXml(new TestAllTypes.Builder(), XmlReader.Create(new StringReader(xml))).Build(); - Assert.True(copy.HasDefaultBool && copy.DefaultBool); - Assert.Equal(msg, copy); + Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); + Assert.AreEqual(msg, copy); } - [Fact] + [Test] public void TestToXmlParseFromXmlWithRootName() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); string xml = Extensions.ToXml(msg, "message"); - Assert.Equal("true", xml); + Assert.AreEqual("true", xml); TestAllTypes copy = Extensions.MergeFromXml(new TestAllTypes.Builder(), "message", XmlReader.Create(new StringReader(xml))).Build(); - Assert.True(copy.HasDefaultBool && copy.DefaultBool); - Assert.Equal(msg, copy); + Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); + Assert.AreEqual(msg, copy); } - [Fact] + [Test] public void TestEmptyMessage() { TestXmlChild message = TestXmlChild.CreateBuilder() @@ -111,9 +111,9 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestRepeatedField() { TestXmlChild message = TestXmlChild.CreateBuilder() @@ -128,10 +128,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestNestedEmptyMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -144,10 +144,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestNestedMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -160,10 +160,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestBooleanTypes() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -176,10 +176,10 @@ namespace Google.ProtocolBuffers string xml = sw.ToString(); XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestFullMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -206,10 +206,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestFullMessageWithRichTypes() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -239,10 +239,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); rdr.Options = XmlReaderOptions.ReadNestedArrays; TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestFullMessageWithUnknownFields() { TestXmlMessage origial = TestXmlMessage.CreateBuilder() @@ -261,7 +261,7 @@ namespace Google.ProtocolBuffers .Build(); TestXmlNoFields message = TestXmlNoFields.CreateBuilder().MergeFrom(origial.ToByteArray()).Build(); - Assert.Equal(0, message.AllFields.Count); + Assert.AreEqual(0, message.AllFields.Count); StringWriter sw = new StringWriter(); XmlFormatWriter.CreateInstance(sw) @@ -273,9 +273,9 @@ namespace Google.ProtocolBuffers using (XmlReader x = XmlReader.Create(new StringReader(xml))) { x.MoveToContent(); - Assert.Equal(XmlNodeType.Element, x.NodeType); + Assert.AreEqual(XmlNodeType.Element, x.NodeType); //should always be empty - Assert.True(x.IsEmptyElement || + Assert.IsTrue(x.IsEmptyElement || (x.Read() && x.NodeType == XmlNodeType.EndElement) ); } @@ -283,10 +283,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); rdr.Options = XmlReaderOptions.ReadNestedArrays; TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(TestXmlMessage.DefaultInstance, copy); + Assert.AreEqual(TestXmlMessage.DefaultInstance, copy); } - [Fact] + [Test] public void TestMessageWithXmlText() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -299,10 +299,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestXmlWithWhitespace() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -315,10 +315,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestXmlWithExtensionText() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -335,10 +335,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestXmlWithExtensionMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -355,10 +355,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestXmlWithExtensionArray() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -377,10 +377,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestXmlWithExtensionEnum() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -397,10 +397,10 @@ namespace Google.ProtocolBuffers XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestXmlReadEmptyRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -413,7 +413,7 @@ namespace Google.ProtocolBuffers reader.ReadMessageEnd(); //manually read the end message '}' } - [Fact] + [Test] public void TestXmlReadEmptyChild() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -422,11 +422,11 @@ namespace Google.ProtocolBuffers reader.ReadMessageStart(); //manually read the begin the message '{' builder.MergeFrom(reader); //write the message normally - Assert.True(builder.HasText); - Assert.Equal(String.Empty, builder.Text); + Assert.IsTrue(builder.HasText); + Assert.AreEqual(String.Empty, builder.Text); } - [Fact] + [Test] public void TestXmlReadWriteWithoutRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -442,7 +442,7 @@ namespace Google.ProtocolBuffers output.Flush(); xml = sw.ToString(); } - Assert.Equal("abc123", xml); + Assert.AreEqual("abc123", xml); TestXmlMessage copy; using (XmlReader xr = XmlReader.Create(new StringReader(xml), new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Fragment })) @@ -451,10 +451,10 @@ namespace Google.ProtocolBuffers copy = TestXmlMessage.CreateBuilder().MergeFrom(input).Build(); } - Assert.Equal(message, copy); + Assert.AreEqual(message, copy); } - [Fact] + [Test] public void TestRecursiveLimit() { StringBuilder sb = new StringBuilder(8192); diff --git a/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs b/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs index 1e083c6b..5af71787 100644 --- a/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs +++ b/csharp/src/ProtocolBuffers.Test/TextFormatTest.cs @@ -37,7 +37,7 @@ using System; using System.IO; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -84,13 +84,13 @@ namespace Google.ProtocolBuffers /// /// Print TestAllTypes and compare with golden file. /// - [Fact] + [Test] public void PrintMessage() { TestUtil.TestInMultipleCultures(() => { string text = TextFormat.PrintToString(TestUtil.GetAllSet()); - Assert.Equal(AllFieldsSetText.Replace("\r\n", "\n").Trim(), + Assert.AreEqual(AllFieldsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim()); }); } @@ -98,32 +98,32 @@ namespace Google.ProtocolBuffers /// /// Tests that a builder prints the same way as a message. /// - [Fact] + [Test] public void PrintBuilder() { TestUtil.TestInMultipleCultures(() => { string messageText = TextFormat.PrintToString(TestUtil.GetAllSet()); string builderText = TextFormat.PrintToString(TestUtil.GetAllSet().ToBuilder()); - Assert.Equal(messageText, builderText); + Assert.AreEqual(messageText, builderText); }); } /// /// Print TestAllExtensions and compare with golden file. /// - [Fact] + [Test] public void PrintExtensions() { string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet()); - Assert.Equal(AllExtensionsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim()); + Assert.AreEqual(AllExtensionsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim()); } /// /// Test printing of unknown fields in a message. /// - [Fact] + [Test] public void PrintUnknownFields() { TestEmptyMessage message = @@ -159,7 +159,7 @@ namespace Google.ProtocolBuffers .Build()) .Build(); - Assert.Equal( + Assert.AreEqual( "5: 1\n" + "5: 0x00000002\n" + "5: 0x0000000000000003\n" + @@ -189,7 +189,7 @@ namespace Google.ProtocolBuffers return ByteString.CopyFrom(bytes); } - [Fact] + [Test] public void PrintExotic() { IMessage message = TestAllTypes.CreateBuilder() @@ -220,10 +220,10 @@ namespace Google.ProtocolBuffers .AddRepeatedBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\"\u00fe")) .Build(); - Assert.Equal(ExoticText, message.ToString()); + Assert.AreEqual(ExoticText, message.ToString()); } - [Fact] + [Test] public void PrintMessageSet() { TestMessageSet messageSet = @@ -236,12 +236,12 @@ namespace Google.ProtocolBuffers TestMessageSetExtension2.CreateBuilder().SetStr("foo").Build()) .Build(); - Assert.Equal(MessageSetText, messageSet.ToString()); + Assert.AreEqual(MessageSetText, messageSet.ToString()); } // ================================================================= - [Fact] + [Test] public void Parse() { TestUtil.TestInMultipleCultures(() => @@ -252,7 +252,7 @@ namespace Google.ProtocolBuffers }); } - [Fact] + [Test] public void ParseReader() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -260,7 +260,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(builder.Build()); } - [Fact] + [Test] public void ParseExtensions() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -270,7 +270,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(builder.Build()); } - [Fact] + [Test] public void ParseCompatibility() { string original = "repeated_float: inf\n" + @@ -299,10 +299,10 @@ namespace Google.ProtocolBuffers "repeated_double: NaN\n"; TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge(original, builder); - Assert.Equal(canonical, builder.Build().ToString()); + Assert.AreEqual(canonical, builder.Build().ToString()); } - [Fact] + [Test] public void ParseExotic() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -310,10 +310,10 @@ namespace Google.ProtocolBuffers // Too lazy to check things individually. Don't try to debug this // if testPrintExotic() is Assert.Failing. - Assert.Equal(ExoticText, builder.Build().ToString()); + Assert.AreEqual(ExoticText, builder.Build().ToString()); } - [Fact] + [Test] public void ParseMessageSet() { ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); @@ -324,30 +324,30 @@ namespace Google.ProtocolBuffers TextFormat.Merge(MessageSetText, extensionRegistry, builder); TestMessageSet messageSet = builder.Build(); - Assert.True(messageSet.HasExtension(TestMessageSetExtension1.MessageSetExtension)); - Assert.Equal(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); - Assert.True(messageSet.HasExtension(TestMessageSetExtension2.MessageSetExtension)); - Assert.Equal("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); + Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension1.MessageSetExtension)); + Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); + Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension2.MessageSetExtension)); + Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); } - [Fact] + [Test] public void ParseNumericEnum() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge("optional_nested_enum: 2", builder); - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum); + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum); } - [Fact] + [Test] public void ParseAngleBrackets() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge("OptionalGroup: < a: 1 >", builder); - Assert.True(builder.HasOptionalGroup); - Assert.Equal(1, builder.OptionalGroup.A); + Assert.IsTrue(builder.HasOptionalGroup); + Assert.AreEqual(1, builder.OptionalGroup.A); } - [Fact] + [Test] public void ParseComment() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -356,8 +356,8 @@ namespace Google.ProtocolBuffers "optional_int32: 1 # another comment\n" + "optional_int64: 2\n" + "# EOF comment", builder); - Assert.Equal(1, builder.OptionalInt32); - Assert.Equal(2, builder.OptionalInt64); + Assert.AreEqual(1, builder.OptionalInt32); + Assert.AreEqual(2, builder.OptionalInt64); } @@ -365,10 +365,10 @@ namespace Google.ProtocolBuffers { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); Exception exception = Assert.Throws(() => TextFormat.Merge(text, TestUtil.CreateExtensionRegistry(), builder)); - Assert.Equal(error, exception.Message); + Assert.AreEqual(error, exception.Message); } - [Fact] + [Test] public void ParseErrors() { AssertParseError( @@ -443,26 +443,26 @@ namespace Google.ProtocolBuffers return ByteString.CopyFrom(bytes); } - [Fact] + [Test] public void Escape() { // Escape sequences. - Assert.Equal("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", + Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", TextFormat.EscapeBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""))); - Assert.Equal("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", + Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", TextFormat.EscapeText("\0\u0001\u0007\b\f\n\r\t\v\\\'\"")); - Assert.Equal(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""), + Assert.AreEqual(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""), TextFormat.UnescapeBytes("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); - Assert.Equal("\0\u0001\u0007\b\f\n\r\t\v\\\'\"", + Assert.AreEqual("\0\u0001\u0007\b\f\n\r\t\v\\\'\"", TextFormat.UnescapeText("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); // Unicode handling. - Assert.Equal("\\341\\210\\264", TextFormat.EscapeText("\u1234")); - Assert.Equal("\\341\\210\\264", TextFormat.EscapeBytes(Bytes(0xe1, 0x88, 0xb4))); - Assert.Equal("\u1234", TextFormat.UnescapeText("\\341\\210\\264")); - Assert.Equal(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\341\\210\\264")); - Assert.Equal("\u1234", TextFormat.UnescapeText("\\xe1\\x88\\xb4")); - Assert.Equal(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\xe1\\x88\\xb4")); + Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeText("\u1234")); + Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeBytes(Bytes(0xe1, 0x88, 0xb4))); + Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\341\\210\\264")); + Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\341\\210\\264")); + Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\xe1\\x88\\xb4")); + Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\xe1\\x88\\xb4")); // Errors. Assert.Throws(() => TextFormat.UnescapeText("\\x")); @@ -470,55 +470,55 @@ namespace Google.ProtocolBuffers Assert.Throws(() => TextFormat.UnescapeText("\\")); } - [Fact] + [Test] public void ParseInteger() { - Assert.Equal(0, TextFormat.ParseInt32("0")); - Assert.Equal(1, TextFormat.ParseInt32("1")); - Assert.Equal(-1, TextFormat.ParseInt32("-1")); - Assert.Equal(12345, TextFormat.ParseInt32("12345")); - Assert.Equal(-12345, TextFormat.ParseInt32("-12345")); - Assert.Equal(2147483647, TextFormat.ParseInt32("2147483647")); - Assert.Equal(-2147483648, TextFormat.ParseInt32("-2147483648")); - - Assert.Equal(0u, TextFormat.ParseUInt32("0")); - Assert.Equal(1u, TextFormat.ParseUInt32("1")); - Assert.Equal(12345u, TextFormat.ParseUInt32("12345")); - Assert.Equal(2147483647u, TextFormat.ParseUInt32("2147483647")); - Assert.Equal(2147483648U, TextFormat.ParseUInt32("2147483648")); - Assert.Equal(4294967295U, TextFormat.ParseUInt32("4294967295")); - - Assert.Equal(0L, TextFormat.ParseInt64("0")); - Assert.Equal(1L, TextFormat.ParseInt64("1")); - Assert.Equal(-1L, TextFormat.ParseInt64("-1")); - Assert.Equal(12345L, TextFormat.ParseInt64("12345")); - Assert.Equal(-12345L, TextFormat.ParseInt64("-12345")); - Assert.Equal(2147483647L, TextFormat.ParseInt64("2147483647")); - Assert.Equal(-2147483648L, TextFormat.ParseInt64("-2147483648")); - Assert.Equal(4294967295L, TextFormat.ParseInt64("4294967295")); - Assert.Equal(4294967296L, TextFormat.ParseInt64("4294967296")); - Assert.Equal(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807")); - Assert.Equal(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808")); - - Assert.Equal(0uL, TextFormat.ParseUInt64("0")); - Assert.Equal(1uL, TextFormat.ParseUInt64("1")); - Assert.Equal(12345uL, TextFormat.ParseUInt64("12345")); - Assert.Equal(2147483647uL, TextFormat.ParseUInt64("2147483647")); - Assert.Equal(4294967295uL, TextFormat.ParseUInt64("4294967295")); - Assert.Equal(4294967296uL, TextFormat.ParseUInt64("4294967296")); - Assert.Equal(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807")); - Assert.Equal(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808")); - Assert.Equal(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615")); + Assert.AreEqual(0, TextFormat.ParseInt32("0")); + Assert.AreEqual(1, TextFormat.ParseInt32("1")); + Assert.AreEqual(-1, TextFormat.ParseInt32("-1")); + Assert.AreEqual(12345, TextFormat.ParseInt32("12345")); + Assert.AreEqual(-12345, TextFormat.ParseInt32("-12345")); + Assert.AreEqual(2147483647, TextFormat.ParseInt32("2147483647")); + Assert.AreEqual(-2147483648, TextFormat.ParseInt32("-2147483648")); + + Assert.AreEqual(0u, TextFormat.ParseUInt32("0")); + Assert.AreEqual(1u, TextFormat.ParseUInt32("1")); + Assert.AreEqual(12345u, TextFormat.ParseUInt32("12345")); + Assert.AreEqual(2147483647u, TextFormat.ParseUInt32("2147483647")); + Assert.AreEqual(2147483648U, TextFormat.ParseUInt32("2147483648")); + Assert.AreEqual(4294967295U, TextFormat.ParseUInt32("4294967295")); + + Assert.AreEqual(0L, TextFormat.ParseInt64("0")); + Assert.AreEqual(1L, TextFormat.ParseInt64("1")); + Assert.AreEqual(-1L, TextFormat.ParseInt64("-1")); + Assert.AreEqual(12345L, TextFormat.ParseInt64("12345")); + Assert.AreEqual(-12345L, TextFormat.ParseInt64("-12345")); + Assert.AreEqual(2147483647L, TextFormat.ParseInt64("2147483647")); + Assert.AreEqual(-2147483648L, TextFormat.ParseInt64("-2147483648")); + Assert.AreEqual(4294967295L, TextFormat.ParseInt64("4294967295")); + Assert.AreEqual(4294967296L, TextFormat.ParseInt64("4294967296")); + Assert.AreEqual(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807")); + Assert.AreEqual(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808")); + + Assert.AreEqual(0uL, TextFormat.ParseUInt64("0")); + Assert.AreEqual(1uL, TextFormat.ParseUInt64("1")); + Assert.AreEqual(12345uL, TextFormat.ParseUInt64("12345")); + Assert.AreEqual(2147483647uL, TextFormat.ParseUInt64("2147483647")); + Assert.AreEqual(4294967295uL, TextFormat.ParseUInt64("4294967295")); + Assert.AreEqual(4294967296uL, TextFormat.ParseUInt64("4294967296")); + Assert.AreEqual(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807")); + Assert.AreEqual(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808")); + Assert.AreEqual(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615")); // Hex - Assert.Equal(0x1234abcd, TextFormat.ParseInt32("0x1234abcd")); - Assert.Equal(-0x1234abcd, TextFormat.ParseInt32("-0x1234abcd")); - Assert.Equal(0xffffffffffffffffUL, TextFormat.ParseUInt64("0xffffffffffffffff")); - Assert.Equal(0x7fffffffffffffffL, + Assert.AreEqual(0x1234abcd, TextFormat.ParseInt32("0x1234abcd")); + Assert.AreEqual(-0x1234abcd, TextFormat.ParseInt32("-0x1234abcd")); + Assert.AreEqual(0xffffffffffffffffUL, TextFormat.ParseUInt64("0xffffffffffffffff")); + Assert.AreEqual(0x7fffffffffffffffL, TextFormat.ParseInt64("0x7fffffffffffffff")); // Octal - Assert.Equal(342391, TextFormat.ParseInt32("01234567")); + Assert.AreEqual(342391, TextFormat.ParseInt32("01234567")); // Out-of-range Assert.Throws(() => TextFormat.ParseInt32("2147483648")); @@ -532,7 +532,7 @@ namespace Google.ProtocolBuffers Assert.Throws(() => TextFormat.ParseInt32("abcd")); } - [Fact] + [Test] public void ParseLongString() { string longText = @@ -554,7 +554,7 @@ namespace Google.ProtocolBuffers "123456789012345678901234567890123456789012345678901234567890"; TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge("optional_string: \"" + longText + "\"", builder); - Assert.Equal(longText, builder.OptionalString); + Assert.AreEqual(longText, builder.OptionalString); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs b/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs index f20ba7cb..97f48ead 100644 --- a/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs +++ b/csharp/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs @@ -38,7 +38,7 @@ using System; using System.Collections.Generic; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -103,39 +103,39 @@ namespace Google.ProtocolBuffers // ================================================================= - [Fact] + [Test] public void Varint() { UnknownField field = GetField("optional_int32"); - Assert.Equal(1, field.VarintList.Count); - Assert.Equal(allFields.OptionalInt32, (long) field.VarintList[0]); + Assert.AreEqual(1, field.VarintList.Count); + Assert.AreEqual(allFields.OptionalInt32, (long) field.VarintList[0]); } - [Fact] + [Test] public void Fixed32() { UnknownField field = GetField("optional_fixed32"); - Assert.Equal(1, field.Fixed32List.Count); - Assert.Equal(allFields.OptionalFixed32, (int) field.Fixed32List[0]); + Assert.AreEqual(1, field.Fixed32List.Count); + Assert.AreEqual(allFields.OptionalFixed32, (int) field.Fixed32List[0]); } - [Fact] + [Test] public void Fixed64() { UnknownField field = GetField("optional_fixed64"); - Assert.Equal(1, field.Fixed64List.Count); - Assert.Equal((long)allFields.OptionalFixed64, (long)field.Fixed64List[0]); + Assert.AreEqual(1, field.Fixed64List.Count); + Assert.AreEqual((long)allFields.OptionalFixed64, (long)field.Fixed64List[0]); } - [Fact] + [Test] public void LengthDelimited() { UnknownField field = GetField("optional_bytes"); - Assert.Equal(1, field.LengthDelimitedList.Count); - Assert.Equal(allFields.OptionalBytes, field.LengthDelimitedList[0]); + Assert.AreEqual(1, field.LengthDelimitedList.Count); + Assert.AreEqual(allFields.OptionalBytes, field.LengthDelimitedList[0]); } - [Fact] + [Test] public void Group() { FieldDescriptor nestedFieldDescriptor = @@ -143,35 +143,35 @@ namespace Google.ProtocolBuffers Assert.NotNull(nestedFieldDescriptor); UnknownField field = GetField("optionalgroup"); - Assert.Equal(1, field.GroupList.Count); + Assert.AreEqual(1, field.GroupList.Count); UnknownFieldSet group = field.GroupList[0]; - Assert.Equal(1, group.FieldDictionary.Count); - Assert.True(group.HasField(nestedFieldDescriptor.FieldNumber)); + Assert.AreEqual(1, group.FieldDictionary.Count); + Assert.IsTrue(group.HasField(nestedFieldDescriptor.FieldNumber)); UnknownField nestedField = group[nestedFieldDescriptor.FieldNumber]; - Assert.Equal(1, nestedField.VarintList.Count); - Assert.Equal(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]); + Assert.AreEqual(1, nestedField.VarintList.Count); + Assert.AreEqual(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]); } - [Fact] + [Test] public void Serialize() { // Check that serializing the UnknownFieldSet produces the original data again. ByteString data = emptyMessage.ToByteString(); - Assert.Equal(allFieldsData, data); + Assert.AreEqual(allFieldsData, data); } - [Fact] + [Test] public void CopyFrom() { TestEmptyMessage message = TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Build(); - Assert.Equal(emptyMessage.ToString(), message.ToString()); + Assert.AreEqual(emptyMessage.ToString(), message.ToString()); } - [Fact] + [Test] public void MergeFrom() { TestEmptyMessage source = @@ -200,7 +200,7 @@ namespace Google.ProtocolBuffers .MergeFrom(source) .Build(); - Assert.Equal( + Assert.AreEqual( "1: 1\n" + "2: 2\n" + "3: 3\n" + @@ -208,23 +208,23 @@ namespace Google.ProtocolBuffers destination.ToString()); } - [Fact] + [Test] public void Clear() { UnknownFieldSet fields = UnknownFieldSet.CreateBuilder().MergeFrom(unknownFields).Clear().Build(); - Assert.Equal(0, fields.FieldDictionary.Count); + Assert.AreEqual(0, fields.FieldDictionary.Count); } - [Fact] + [Test] public void ClearMessage() { TestEmptyMessage message = TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Clear().Build(); - Assert.Equal(0, message.SerializedSize); + Assert.AreEqual(0, message.SerializedSize); } - [Fact] + [Test] public void ParseKnownAndUnknown() { // Test mixing known and unknown fields when parsing. @@ -239,14 +239,14 @@ namespace Google.ProtocolBuffers TestAllTypes destination = TestAllTypes.ParseFrom(data); TestUtil.AssertAllFieldsSet(destination); - Assert.Equal(1, destination.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(1, destination.UnknownFields.FieldDictionary.Count); UnknownField field = destination.UnknownFields[123456]; - Assert.Equal(1, field.VarintList.Count); - Assert.Equal(654321, (long) field.VarintList[0]); + Assert.AreEqual(1, field.VarintList.Count); + Assert.AreEqual(654321, (long) field.VarintList[0]); } - [Fact] + [Test] public void WrongTypeTreatedAsUnknown() { // Test that fields of the wrong wire type are treated like unknown fields @@ -258,10 +258,10 @@ namespace Google.ProtocolBuffers // All fields should have been interpreted as unknown, so the debug strings // should be the same. - Assert.Equal(emptyMessage.ToString(), allTypesMessage.ToString()); + Assert.AreEqual(emptyMessage.ToString(), allTypesMessage.ToString()); } - [Fact] + [Test] public void UnknownExtensions() { // Make sure fields are properly parsed to the UnknownFieldSet even when @@ -270,12 +270,12 @@ namespace Google.ProtocolBuffers TestEmptyMessageWithExtensions message = TestEmptyMessageWithExtensions.ParseFrom(allFieldsData); - Assert.Equal(unknownFields.FieldDictionary.Count, + Assert.AreEqual(unknownFields.FieldDictionary.Count, message.UnknownFields.FieldDictionary.Count); - Assert.Equal(allFieldsData, message.ToByteString()); + Assert.AreEqual(allFieldsData, message.ToByteString()); } - [Fact] + [Test] public void WrongExtensionTypeTreatedAsUnknown() { // Test that fields of the wrong wire type are treated like unknown fields @@ -287,11 +287,11 @@ namespace Google.ProtocolBuffers // All fields should have been interpreted as unknown, so the debug strings // should be the same. - Assert.Equal(emptyMessage.ToString(), + Assert.AreEqual(emptyMessage.ToString(), allExtensionsMessage.ToString()); } - [Fact] + [Test] public void ParseUnknownEnumValue() { FieldDescriptor singularField = @@ -320,7 +320,7 @@ namespace Google.ProtocolBuffers { TestAllTypes message = TestAllTypes.ParseFrom(data); - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.OptionalNestedEnum); TestUtil.AssertEqual(new[] {TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ}, message.RepeatedNestedEnumList); @@ -331,7 +331,7 @@ namespace Google.ProtocolBuffers { TestAllExtensions message = TestAllExtensions.ParseFrom(data, TestUtil.CreateExtensionRegistry()); - Assert.Equal(TestAllTypes.Types.NestedEnum.BAR, + Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetExtension(Unittest.OptionalNestedEnumExtension)); TestUtil.AssertEqual(new[] {TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ}, message.GetExtension(Unittest.RepeatedNestedEnumExtension)); @@ -340,7 +340,7 @@ namespace Google.ProtocolBuffers } } - [Fact] + [Test] public void LargeVarint() { ByteString data = @@ -353,11 +353,11 @@ namespace Google.ProtocolBuffers .ToByteString(); UnknownFieldSet parsed = UnknownFieldSet.ParseFrom(data); UnknownField field = parsed[1]; - Assert.Equal(1, field.VarintList.Count); - Assert.Equal(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]); + Assert.AreEqual(1, field.VarintList.Count); + Assert.AreEqual(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]); } - [Fact] + [Test] public void EqualsAndHashCode() { UnknownField fixed32Field = UnknownField.CreateBuilder().AddFixed32(1).Build(); @@ -405,10 +405,10 @@ namespace Google.ProtocolBuffers private static void CheckNotEqual(UnknownFieldSet s1, UnknownFieldSet s2) { String equalsError = string.Format("{0} should not be equal to {1}", s1, s2); - Assert.False(s1.Equals(s2), equalsError); - Assert.False(s2.Equals(s1), equalsError); + Assert.IsFalse(s1.Equals(s2), equalsError); + Assert.IsFalse(s2.Equals(s1), equalsError); - Assert.False(s1.GetHashCode() == s2.GetHashCode(), + Assert.IsFalse(s1.GetHashCode() == s2.GetHashCode(), string.Format("{0} should have a different hash code from {1}", s1, s2)); } @@ -419,13 +419,13 @@ namespace Google.ProtocolBuffers private static void CheckEqualsIsConsistent(UnknownFieldSet set) { // Object should be equal to itself. - Assert.Equal(set, set); + Assert.AreEqual(set, set); // Object should be equal to a copy of itself. UnknownFieldSet copy = UnknownFieldSet.CreateBuilder(set).Build(); - Assert.Equal(set, copy); - Assert.Equal(copy, set); - Assert.Equal(set.GetHashCode(), copy.GetHashCode()); + Assert.AreEqual(set, copy); + Assert.AreEqual(copy, set); + Assert.AreEqual(set.GetHashCode(), copy.GetHashCode()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs b/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs index 12a9d236..0c9b8c27 100644 --- a/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs +++ b/csharp/src/ProtocolBuffers.Test/WireFormatTest.cs @@ -38,7 +38,7 @@ using System.IO; using System.Reflection; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -47,7 +47,7 @@ namespace Google.ProtocolBuffers /// /// Keeps the attributes on FieldType and the switch statement in WireFormat in sync. /// - [Fact] + [Test] public void FieldTypeToWireTypeMapping() { foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) @@ -55,34 +55,34 @@ namespace Google.ProtocolBuffers FieldType fieldType = (FieldType) field.GetValue(null); FieldMappingAttribute mapping = (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0]; - Assert.Equal(mapping.WireType, WireFormat.GetWireType(fieldType)); + Assert.AreEqual(mapping.WireType, WireFormat.GetWireType(fieldType)); } } - [Fact] + [Test] public void Serialization() { TestAllTypes message = TestUtil.GetAllSet(); ByteString rawBytes = message.ToByteString(); - Assert.Equal(rawBytes.Length, message.SerializedSize); + Assert.AreEqual(rawBytes.Length, message.SerializedSize); TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); TestUtil.AssertAllFieldsSet(message2); } - [Fact] + [Test] public void SerializationPacked() { TestPackedTypes message = TestUtil.GetPackedSet(); ByteString rawBytes = message.ToByteString(); - Assert.Equal(rawBytes.Length, message.SerializedSize); + Assert.AreEqual(rawBytes.Length, message.SerializedSize); TestPackedTypes message2 = TestPackedTypes.ParseFrom(rawBytes); TestUtil.AssertPackedFieldsSet(message2); } - [Fact] + [Test] public void SerializeExtensions() { // TestAllTypes and TestAllExtensions should have compatible wire formats, @@ -90,14 +90,14 @@ namespace Google.ProtocolBuffers // it should work. TestAllExtensions message = TestUtil.GetAllExtensionsSet(); ByteString rawBytes = message.ToByteString(); - Assert.Equal(rawBytes.Length, message.SerializedSize); + Assert.AreEqual(rawBytes.Length, message.SerializedSize); TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); TestUtil.AssertAllFieldsSet(message2); } - [Fact] + [Test] public void SerializePackedExtensions() { // TestPackedTypes and TestPackedExtensions should have compatible wire @@ -108,10 +108,10 @@ namespace Google.ProtocolBuffers TestPackedTypes message2 = TestUtil.GetPackedSet(); ByteString rawBytes2 = message2.ToByteString(); - Assert.Equal(rawBytes, rawBytes2); + Assert.AreEqual(rawBytes, rawBytes2); } - [Fact] + [Test] public void SerializeDelimited() { MemoryStream stream = new MemoryStream(); @@ -123,13 +123,13 @@ namespace Google.ProtocolBuffers stream.Position = 0; TestUtil.AssertAllFieldsSet(TestAllTypes.ParseDelimitedFrom(stream)); - Assert.Equal(12, stream.ReadByte()); + Assert.AreEqual(12, stream.ReadByte()); TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseDelimitedFrom(stream)); - Assert.Equal(34, stream.ReadByte()); - Assert.Equal(-1, stream.ReadByte()); + Assert.AreEqual(34, stream.ReadByte()); + Assert.AreEqual(-1, stream.ReadByte()); } - [Fact] + [Test] public void ParseExtensions() { // TestAllTypes and TestAllExtensions should have compatible wire formats, @@ -148,7 +148,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(message2); } - [Fact] + [Test] public void ParsePackedExtensions() { // Ensure that packed extensions can be properly parsed. @@ -161,10 +161,10 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedExtensionsSet(message2); } - [Fact] + [Test] public void ExtensionsSerializedSize() { - Assert.Equal(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize); + Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize); } private static void AssertFieldsInOrder(ByteString data) @@ -176,13 +176,13 @@ namespace Google.ProtocolBuffers string name; while (input.ReadTag(out tag, out name)) { - Assert.True(tag > previousTag); + Assert.IsTrue(tag > previousTag); previousTag = tag; input.SkipField(); } } - [Fact] + [Test] public void InterleavedFieldsAndExtensions() { // Tests that fields are written in order even when extension ranges @@ -213,7 +213,7 @@ namespace Google.ProtocolBuffers private static readonly int TypeId1 = TestMessageSetExtension1.Descriptor.Extensions[0].FieldNumber; private static readonly int TypeId2 = TestMessageSetExtension2.Descriptor.Extensions[0].FieldNumber; - [Fact] + [Test] public void SerializeMessageSet() { // Set up a TestMessageSet with two known messages and an unknown one. @@ -239,23 +239,23 @@ namespace Google.ProtocolBuffers // Parse back using RawMessageSet and check the contents. RawMessageSet raw = RawMessageSet.ParseFrom(data); - Assert.Equal(0, raw.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(0, raw.UnknownFields.FieldDictionary.Count); - Assert.Equal(3, raw.ItemCount); - Assert.Equal(TypeId1, raw.ItemList[0].TypeId); - Assert.Equal(TypeId2, raw.ItemList[1].TypeId); - Assert.Equal(UnknownTypeId, raw.ItemList[2].TypeId); + Assert.AreEqual(3, raw.ItemCount); + Assert.AreEqual(TypeId1, raw.ItemList[0].TypeId); + Assert.AreEqual(TypeId2, raw.ItemList[1].TypeId); + Assert.AreEqual(UnknownTypeId, raw.ItemList[2].TypeId); TestMessageSetExtension1 message1 = TestMessageSetExtension1.ParseFrom(raw.GetItem(0).Message.ToByteArray()); - Assert.Equal(123, message1.I); + Assert.AreEqual(123, message1.I); TestMessageSetExtension2 message2 = TestMessageSetExtension2.ParseFrom(raw.GetItem(1).Message.ToByteArray()); - Assert.Equal("foo", message2.Str); + Assert.AreEqual("foo", message2.Str); - Assert.Equal("bar", raw.GetItem(2).Message.ToStringUtf8()); + Assert.AreEqual("bar", raw.GetItem(2).Message.ToStringUtf8()); } - [Fact] + [Test] public void ParseMessageSet() { ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); @@ -294,18 +294,18 @@ namespace Google.ProtocolBuffers TestMessageSet messageSet = TestMessageSet.ParseFrom(data, extensionRegistry); - Assert.Equal(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); - Assert.Equal("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); + Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); + Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); // Check for unknown field with type LENGTH_DELIMITED, // number UNKNOWN_TYPE_ID, and contents "bar". UnknownFieldSet unknownFields = messageSet.UnknownFields; - Assert.Equal(1, unknownFields.FieldDictionary.Count); - Assert.True(unknownFields.HasField(UnknownTypeId)); + Assert.AreEqual(1, unknownFields.FieldDictionary.Count); + Assert.IsTrue(unknownFields.HasField(UnknownTypeId)); UnknownField field = unknownFields[UnknownTypeId]; - Assert.Equal(1, field.LengthDelimitedList.Count); - Assert.Equal("bar", field.LengthDelimitedList[0].ToStringUtf8()); + Assert.AreEqual(1, field.LengthDelimitedList.Count); + Assert.AreEqual("bar", field.LengthDelimitedList[0].ToStringUtf8()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers.Test/packages.config b/csharp/src/ProtocolBuffers.Test/packages.config index 6f1fb7f5..c7653992 100644 --- a/csharp/src/ProtocolBuffers.Test/packages.config +++ b/csharp/src/ProtocolBuffers.Test/packages.config @@ -1,9 +1,5 @@  - - - - - - + + \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs index e0199202..f5932ab3 100644 --- a/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs @@ -36,13 +36,13 @@ using System.IO; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class AbstractBuilderLiteTest { - [Fact] + [Test] public void TestMergeFromCodedInputStream() { TestAllTypesLite copy, @@ -50,7 +50,7 @@ namespace Google.ProtocolBuffers .SetOptionalUint32(uint.MaxValue).Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); using (MemoryStream ms = new MemoryStream(msg.ToByteArray())) { @@ -58,22 +58,22 @@ namespace Google.ProtocolBuffers copy = copy.ToBuilder().MergeFrom(ci).Build(); } - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestIBuilderLiteWeakClear() { TestAllTypesLite copy, msg = TestAllTypesLite.DefaultInstance; copy = msg.ToBuilder().SetOptionalString("Should be removed.").Build(); - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakClear().WeakBuild(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestBuilderLiteMergeFromCodedInputStream() { TestAllTypesLite copy, @@ -81,14 +81,14 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = copy.ToBuilder().MergeFrom(CodedInputStream.CreateInstance(new MemoryStream(msg.ToByteArray()))).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestBuilderLiteMergeDelimitedFrom() { TestAllTypesLite copy, @@ -96,15 +96,15 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteDelimitedTo(s); s.Position = 0; copy = copy.ToBuilder().MergeDelimitedFrom(s).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestBuilderLiteMergeDelimitedFromExtensions() { TestAllExtensionsLite copy, @@ -113,7 +113,7 @@ namespace Google.ProtocolBuffers "Should be merged.").Build(); copy = TestAllExtensionsLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteDelimitedTo(s); @@ -123,11 +123,11 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = copy.ToBuilder().MergeDelimitedFrom(s, registry).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); - Assert.Equal("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); } - [Fact] + [Test] public void TestBuilderLiteMergeFromStream() { TestAllTypesLite copy, @@ -135,15 +135,15 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteTo(s); s.Position = 0; copy = copy.ToBuilder().MergeFrom(s).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestBuilderLiteMergeFromStreamExtensions() { TestAllExtensionsLite copy, @@ -152,7 +152,7 @@ namespace Google.ProtocolBuffers "Should be merged.").Build(); copy = TestAllExtensionsLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); Stream s = new MemoryStream(); msg.WriteTo(s); @@ -162,11 +162,11 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = copy.ToBuilder().MergeFrom(s, registry).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); - Assert.Equal("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); } - [Fact] + [Test] public void TestIBuilderLiteWeakMergeFromIMessageLite() { TestAllTypesLite copy, @@ -174,13 +174,13 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom((IMessageLite) msg).WeakBuild(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestIBuilderLiteWeakMergeFromByteString() { TestAllTypesLite copy, @@ -188,13 +188,13 @@ namespace Google.ProtocolBuffers .SetOptionalString("Should be merged.").Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString()).WeakBuild(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestIBuilderLiteWeakMergeFromByteStringExtensions() { TestAllExtensionsLite copy, @@ -203,12 +203,12 @@ namespace Google.ProtocolBuffers "Should be merged.").Build(); copy = TestAllExtensionsLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); copy = (TestAllExtensionsLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), ExtensionRegistry.Empty).WeakBuild(); - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestLite.RegisterAllExtensions(registry); @@ -216,11 +216,11 @@ namespace Google.ProtocolBuffers copy = (TestAllExtensionsLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), registry).WeakBuild(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); - Assert.Equal("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual("Should be merged.", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); } - [Fact] + [Test] public void TestIBuilderLiteWeakMergeFromCodedInputStream() { TestAllTypesLite copy, @@ -228,7 +228,7 @@ namespace Google.ProtocolBuffers .SetOptionalUint32(uint.MaxValue).Build(); copy = TestAllTypesLite.DefaultInstance; - Assert.NotEqual(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); using (MemoryStream ms = new MemoryStream(msg.ToByteArray())) { @@ -236,58 +236,58 @@ namespace Google.ProtocolBuffers copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(ci).WeakBuild(); } - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestIBuilderLiteWeakBuildPartial() { IBuilderLite builder = TestRequiredLite.CreateBuilder(); - Assert.False(builder.IsInitialized); + Assert.IsFalse(builder.IsInitialized); IMessageLite msg = builder.WeakBuildPartial(); - Assert.False(msg.IsInitialized); + Assert.IsFalse(msg.IsInitialized); - Assert.Equal(msg.ToByteArray(), TestRequiredLite.DefaultInstance.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), TestRequiredLite.DefaultInstance.ToByteArray()); } - [Fact] + [Test] public void TestIBuilderLiteWeakBuildUninitialized() { IBuilderLite builder = TestRequiredLite.CreateBuilder(); - Assert.False(builder.IsInitialized); + Assert.IsFalse(builder.IsInitialized); Assert.Throws(() => builder.WeakBuild()); } - [Fact] + [Test] public void TestIBuilderLiteWeakBuild() { IBuilderLite builder = TestRequiredLite.CreateBuilder() .SetD(0) .SetEn(ExtraEnum.EXLITE_BAZ); - Assert.True(builder.IsInitialized); + Assert.IsTrue(builder.IsInitialized); builder.WeakBuild(); } - [Fact] + [Test] public void TestIBuilderLiteWeakClone() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() .SetD(1).SetEn(ExtraEnum.EXLITE_BAR).Build(); - Assert.True(msg.IsInitialized); + Assert.IsTrue(msg.IsInitialized); IMessageLite copy = ((IBuilderLite) msg.ToBuilder()).WeakClone().WeakBuild(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestIBuilderLiteWeakDefaultInstance() { - Assert.True(ReferenceEquals(TestRequiredLite.DefaultInstance, + Assert.IsTrue(ReferenceEquals(TestRequiredLite.DefaultInstance, ((IBuilderLite) TestRequiredLite.CreateBuilder()).WeakDefaultInstanceForType)); } - [Fact] + [Test] public void TestGeneratedBuilderLiteAddRange() { TestAllTypesLite copy, @@ -299,11 +299,11 @@ namespace Google.ProtocolBuffers .Build(); copy = msg.DefaultInstanceForType.ToBuilder().MergeFrom(msg).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } // ROK 5/7/2013 Issue #54: should retire all bytes in buffer (bufferSize) - [Fact] + [Test] public void TestBufferRefillIssue() { var ms = new MemoryStream(); @@ -322,15 +322,15 @@ namespace Google.ProtocolBuffers var input = CodedInputStream.CreateInstance(ms); var builder = BucketOfBytes.CreateBuilder(); input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.Equal(3005L, input.Position); - Assert.Equal(3000, builder.Value.Length); + Assert.AreEqual(3005L, input.Position); + Assert.AreEqual(3000, builder.Value.Length); input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.Equal(5114, input.Position); - Assert.Equal(1000, builder.Value.Length); + Assert.AreEqual(5114, input.Position); + Assert.AreEqual(1000, builder.Value.Length); input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.Equal(5217L, input.Position); - Assert.Equal(input.Position, ms.Length); - Assert.Equal(100, builder.Value.Length); + Assert.AreEqual(5217L, input.Position); + Assert.AreEqual(input.Position, ms.Length); + Assert.AreEqual(100, builder.Value.Length); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs index f6a4e94b..93ed5ea5 100644 --- a/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs @@ -37,13 +37,13 @@ using System; using System.IO; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class AbstractMessageLiteTest { - [Fact] + [Test] public void TestMessageLiteToByteString() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -52,14 +52,14 @@ namespace Google.ProtocolBuffers .Build(); ByteString b = msg.ToByteString(); - Assert.Equal(4, b.Length); - Assert.Equal(TestRequiredLite.DFieldNumber << 3, b[0]); - Assert.Equal(42, b[1]); - Assert.Equal(TestRequiredLite.EnFieldNumber << 3, b[2]); - Assert.Equal((int) ExtraEnum.EXLITE_BAZ, b[3]); + Assert.AreEqual(4, b.Length); + Assert.AreEqual(TestRequiredLite.DFieldNumber << 3, b[0]); + Assert.AreEqual(42, b[1]); + Assert.AreEqual(TestRequiredLite.EnFieldNumber << 3, b[2]); + Assert.AreEqual((int) ExtraEnum.EXLITE_BAZ, b[3]); } - [Fact] + [Test] public void TestMessageLiteToByteArray() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -69,10 +69,10 @@ namespace Google.ProtocolBuffers ByteString b = msg.ToByteString(); ByteString copy = ByteString.CopyFrom(msg.ToByteArray()); - Assert.Equal(b, copy); + Assert.AreEqual(b, copy); } - [Fact] + [Test] public void TestMessageLiteWriteTo() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -82,10 +82,10 @@ namespace Google.ProtocolBuffers MemoryStream ms = new MemoryStream(); msg.WriteTo(ms); - Assert.Equal(msg.ToByteArray(), ms.ToArray()); + Assert.AreEqual(msg.ToByteArray(), ms.ToArray()); } - [Fact] + [Test] public void TestMessageLiteWriteDelimitedTo() { TestRequiredLite msg = TestRequiredLite.CreateBuilder() @@ -97,21 +97,21 @@ namespace Google.ProtocolBuffers msg.WriteDelimitedTo(ms); byte[] buffer = ms.ToArray(); - Assert.Equal(5, buffer.Length); - Assert.Equal(4, buffer[0]); + Assert.AreEqual(5, buffer.Length); + Assert.AreEqual(4, buffer[0]); byte[] msgBytes = new byte[4]; Array.Copy(buffer, 1, msgBytes, 0, 4); - Assert.Equal(msg.ToByteArray(), msgBytes); + Assert.AreEqual(msg.ToByteArray(), msgBytes); } - [Fact] + [Test] public void TestIMessageLiteWeakCreateBuilderForType() { IMessageLite msg = TestRequiredLite.DefaultInstance; - Assert.Equal(typeof(TestRequiredLite.Builder), msg.WeakCreateBuilderForType().GetType()); + Assert.AreEqual(typeof(TestRequiredLite.Builder), msg.WeakCreateBuilderForType().GetType()); } - [Fact] + [Test] public void TestMessageLiteWeakToBuilder() { IMessageLite msg = TestRequiredLite.CreateBuilder() @@ -120,14 +120,14 @@ namespace Google.ProtocolBuffers .Build(); IMessageLite copy = msg.WeakToBuilder().WeakBuild(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestMessageLiteWeakDefaultInstanceForType() { IMessageLite msg = TestRequiredLite.DefaultInstance; - Assert.True(Object.ReferenceEquals(TestRequiredLite.DefaultInstance, msg.WeakDefaultInstanceForType)); + Assert.IsTrue(Object.ReferenceEquals(TestRequiredLite.DefaultInstance, msg.WeakDefaultInstanceForType)); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs index 5377ea6a..1ea712d4 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs @@ -37,29 +37,29 @@ using System; using System.Collections.Generic; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class ExtendableBuilderLiteTest { - [Fact] + [Test] public void TestHasExtensionT() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnittestLite.OptionalInt32ExtensionLite, 123); - Assert.True(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.IsTrue(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [Fact] + [Test] public void TestHasExtensionTMissing() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.False(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.IsFalse(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [Fact] + [Test] public void TestGetExtensionCountT() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -67,17 +67,17 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 2) .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 3); - Assert.Equal(3, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(3, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [Fact] + [Test] public void TestGetExtensionCountTEmpty() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [Fact] + [Test] public void TestGetExtensionTNull() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); @@ -85,23 +85,23 @@ namespace Google.ProtocolBuffers Assert.Null(value); } - [Fact] + [Test] public void TestGetExtensionTValue() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnittestLite.OptionalInt32ExtensionLite, 3); - Assert.Equal(3, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.AreEqual(3, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [Fact] + [Test] public void TestGetExtensionTEmpty() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.Equal(0, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite).Count); + Assert.AreEqual(0, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite).Count); } - [Fact] + [Test] public void TestGetExtensionTList() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -110,10 +110,10 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 3); IList values = builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite); - Assert.Equal(3, values.Count); + Assert.AreEqual(3, values.Count); } - [Fact] + [Test] public void TestGetExtensionTIndex() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -122,17 +122,17 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 2); for (int i = 0; i < 3; i++) - Assert.Equal(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); + Assert.AreEqual(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); } - [Fact] + [Test] public void TestGetExtensionTIndexOutOfRange() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); Assert.Throws(() => builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); } - [Fact] + [Test] public void TestSetExtensionTIndex() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -141,107 +141,107 @@ namespace Google.ProtocolBuffers .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 2); for (int i = 0; i < 3; i++) - Assert.Equal(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); + Assert.AreEqual(i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0, 5); builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 1, 6); builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 2, 7); for (int i = 0; i < 3; i++) - Assert.Equal(5 + i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); + Assert.AreEqual(5 + i, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, i)); } - [Fact] + [Test] public void TestSetExtensionTIndexOutOfRange() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); Assert.Throws(() => builder.SetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0, -1)); } - [Fact] + [Test] public void TestClearExtensionTList() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); builder.ClearExtension(UnittestLite.RepeatedInt32ExtensionLite); - Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [Fact] + [Test] public void TestClearExtensionTValue() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnittestLite.OptionalInt32ExtensionLite, 0); - Assert.True(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.IsTrue(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); builder.ClearExtension(UnittestLite.OptionalInt32ExtensionLite); - Assert.False(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.IsFalse(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [Fact] + [Test] public void TestIndexedByDescriptor() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.False(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.IsFalse(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); builder[UnittestLite.OptionalInt32ExtensionLite.Descriptor] = 123; - Assert.True(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.Equal(123, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.IsTrue(builder.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.AreEqual(123, builder.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); } - [Fact] + [Test] public void TestIndexedByDescriptorAndOrdinal() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; builder[f, 0] = 123; - Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); - Assert.Equal(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); + Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); } - [Fact] + [Test] public void TestIndexedByDescriptorAndOrdinalOutOfRange() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; Assert.Throws(() => builder[f, 0] = 123); } - [Fact] + [Test] public void TestClearFieldByDescriptor() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; builder.ClearField(f); - Assert.Equal(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(0, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); } - [Fact] + [Test] public void TestAddRepeatedFieldByDescriptor() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnittestLite.RepeatedInt32ExtensionLite, 0); - Assert.Equal(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(1, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); IFieldDescriptorLite f = UnittestLite.RepeatedInt32ExtensionLite.Descriptor; builder.AddRepeatedField(f, 123); - Assert.Equal(2, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); - Assert.Equal(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 1)); + Assert.AreEqual(2, builder.GetExtensionCount(UnittestLite.RepeatedInt32ExtensionLite)); + Assert.AreEqual(123, builder.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 1)); } - [Fact] + [Test] public void TestMissingExtensionsLite() { const int optionalInt32 = 12345678; @@ -252,21 +252,21 @@ namespace Google.ProtocolBuffers builder.AddExtension(UnittestLite.RepeatedDoubleExtensionLite, 1.3); TestAllExtensionsLite msg = builder.Build(); - Assert.True(msg.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.Equal(3, msg.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); + Assert.IsTrue(msg.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.AreEqual(3, msg.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); byte[] bits = msg.ToByteArray(); TestAllExtensionsLite copy = TestAllExtensionsLite.ParseFrom(bits); - Assert.False(copy.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.Equal(0, copy.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); - Assert.NotEqual(msg, copy); + Assert.IsFalse(copy.HasExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.AreEqual(0, copy.GetExtensionCount(UnittestLite.RepeatedDoubleExtensionLite)); + Assert.AreNotEqual(msg, copy); //The lite runtime removes all unknown fields and extensions byte[] copybits = copy.ToByteArray(); - Assert.Equal(0, copybits.Length); + Assert.AreEqual(0, copybits.Length); } - [Fact] + [Test] public void TestMissingFieldsLite() { TestAllTypesLite msg = TestAllTypesLite.CreateBuilder() @@ -276,13 +276,11 @@ namespace Google.ProtocolBuffers byte[] bits = msg.ToByteArray(); IMessageLite copy = TestAllExtensionsLite.ParseFrom(bits); - // Use explicit call to Equals to avoid xUnit checking for type equality. - Assert.False(msg.Equals(copy)); - Assert.False(copy.Equals(msg)); + Assert.AreNotEqual(msg, copy); //The lite runtime removes all unknown fields and extensions byte[] copybits = copy.ToByteArray(); - Assert.Equal(0, copybits.Length); + Assert.AreEqual(0, copybits.Length); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs index 78127445..9a8e35b6 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs @@ -39,7 +39,7 @@ using System.Collections.Generic; using System.Text; using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -54,7 +54,7 @@ namespace Google.ProtocolBuffers // ForeignMessageLite.DefaultInstance; //} - [Fact] + [Test] public void ExtensionWriterTestMessages() { TestAllExtensionsLite.Builder b = TestAllExtensionsLite.CreateBuilder().SetExtension( @@ -66,20 +66,20 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void ExtensionWriterIsInitialized() { - Assert.True(ForeignMessageLite.DefaultInstance.IsInitialized); - Assert.True(TestPackedExtensionsLite.CreateBuilder().IsInitialized); - Assert.True(TestAllExtensionsLite.CreateBuilder().SetExtension( + Assert.IsTrue(ForeignMessageLite.DefaultInstance.IsInitialized); + Assert.IsTrue(TestPackedExtensionsLite.CreateBuilder().IsInitialized); + Assert.IsTrue(TestAllExtensionsLite.CreateBuilder().SetExtension( UnittestLite.OptionalForeignMessageExtensionLite, ForeignMessageLite.DefaultInstance) .IsInitialized); } - [Fact] + [Test] public void ExtensionWriterTestSetExtensionLists() { TestAllExtensionsLite msg, copy; @@ -95,13 +95,13 @@ namespace Google.ProtocolBuffers UnittestLite.RegisterAllExtensions(registry); copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.Equal(ForeignEnumLite.FOREIGN_LITE_FOO, + Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_FOO, copy.GetExtension(UnittestLite.RepeatedForeignEnumExtensionLite, 1)); } - [Fact] + [Test] public void ExtensionWriterTest() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() @@ -180,82 +180,82 @@ namespace Google.ProtocolBuffers TestAllExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry); TestAllExtensionsLite copy = copyBuilder.Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.Equal(true, copy.GetExtension(UnittestLite.DefaultBoolExtensionLite)); - Assert.Equal(ByteString.CopyFromUtf8("123"), + Assert.AreEqual(true, copy.GetExtension(UnittestLite.DefaultBoolExtensionLite)); + Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnittestLite.DefaultBytesExtensionLite)); - Assert.Equal("123", copy.GetExtension(UnittestLite.DefaultCordExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultDoubleExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultFixed32ExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultFixed64ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultFloatExtensionLite)); - Assert.Equal(ForeignEnumLite.FOREIGN_LITE_BAZ, + Assert.AreEqual("123", copy.GetExtension(UnittestLite.DefaultCordExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultDoubleExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultFixed32ExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultFixed64ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultFloatExtensionLite)); + Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, copy.GetExtension(UnittestLite.DefaultForeignEnumExtensionLite)); - Assert.Equal(ImportEnumLite.IMPORT_LITE_BAZ, + Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, copy.GetExtension(UnittestLite.DefaultImportEnumExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultInt32ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultInt64ExtensionLite)); - Assert.Equal(TestAllTypesLite.Types.NestedEnum.FOO, + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultInt32ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultInt64ExtensionLite)); + Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, copy.GetExtension(UnittestLite.DefaultNestedEnumExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSfixed32ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSfixed64ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSint32ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.DefaultSint64ExtensionLite)); - Assert.Equal("123", copy.GetExtension(UnittestLite.DefaultStringExtensionLite)); - Assert.Equal("123", copy.GetExtension(UnittestLite.DefaultStringPieceExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultUint32ExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.DefaultUint64ExtensionLite)); - - Assert.Equal(true, copy.GetExtension(UnittestLite.OptionalBoolExtensionLite)); - Assert.Equal(ByteString.CopyFromUtf8("123"), + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSfixed32ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSfixed64ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSint32ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.DefaultSint64ExtensionLite)); + Assert.AreEqual("123", copy.GetExtension(UnittestLite.DefaultStringExtensionLite)); + Assert.AreEqual("123", copy.GetExtension(UnittestLite.DefaultStringPieceExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultUint32ExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.DefaultUint64ExtensionLite)); + + Assert.AreEqual(true, copy.GetExtension(UnittestLite.OptionalBoolExtensionLite)); + Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnittestLite.OptionalBytesExtensionLite)); - Assert.Equal("123", copy.GetExtension(UnittestLite.OptionalCordExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalDoubleExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalFixed32ExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalFixed64ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalFloatExtensionLite)); - Assert.Equal(ForeignEnumLite.FOREIGN_LITE_BAZ, + Assert.AreEqual("123", copy.GetExtension(UnittestLite.OptionalCordExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalDoubleExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalFixed32ExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalFixed64ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalFloatExtensionLite)); + Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, copy.GetExtension(UnittestLite.OptionalForeignEnumExtensionLite)); - Assert.Equal(ImportEnumLite.IMPORT_LITE_BAZ, + Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, copy.GetExtension(UnittestLite.OptionalImportEnumExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalInt64ExtensionLite)); - Assert.Equal(TestAllTypesLite.Types.NestedEnum.FOO, + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalInt32ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalInt64ExtensionLite)); + Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, copy.GetExtension(UnittestLite.OptionalNestedEnumExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSfixed32ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSfixed64ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSint32ExtensionLite)); - Assert.Equal(123, copy.GetExtension(UnittestLite.OptionalSint64ExtensionLite)); - Assert.Equal("123", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); - Assert.Equal("123", copy.GetExtension(UnittestLite.OptionalStringPieceExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalUint32ExtensionLite)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.OptionalUint64ExtensionLite)); - - Assert.Equal(true, copy.GetExtension(UnittestLite.RepeatedBoolExtensionLite, 0)); - Assert.Equal(ByteString.CopyFromUtf8("123"), + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSfixed32ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSfixed64ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSint32ExtensionLite)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.OptionalSint64ExtensionLite)); + Assert.AreEqual("123", copy.GetExtension(UnittestLite.OptionalStringExtensionLite)); + Assert.AreEqual("123", copy.GetExtension(UnittestLite.OptionalStringPieceExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalUint32ExtensionLite)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.OptionalUint64ExtensionLite)); + + Assert.AreEqual(true, copy.GetExtension(UnittestLite.RepeatedBoolExtensionLite, 0)); + Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnittestLite.RepeatedBytesExtensionLite, 0)); - Assert.Equal("123", copy.GetExtension(UnittestLite.RepeatedCordExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedDoubleExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedFixed32ExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedFixed64ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedFloatExtensionLite, 0)); - Assert.Equal(ForeignEnumLite.FOREIGN_LITE_BAZ, + Assert.AreEqual("123", copy.GetExtension(UnittestLite.RepeatedCordExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedDoubleExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedFixed32ExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedFixed64ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedFloatExtensionLite, 0)); + Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, copy.GetExtension(UnittestLite.RepeatedForeignEnumExtensionLite, 0)); - Assert.Equal(ImportEnumLite.IMPORT_LITE_BAZ, + Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, copy.GetExtension(UnittestLite.RepeatedImportEnumExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedInt64ExtensionLite, 0)); - Assert.Equal(TestAllTypesLite.Types.NestedEnum.FOO, + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedInt32ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedInt64ExtensionLite, 0)); + Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, copy.GetExtension(UnittestLite.RepeatedNestedEnumExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSfixed32ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSfixed64ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSint32ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.RepeatedSint64ExtensionLite, 0)); - Assert.Equal("123", copy.GetExtension(UnittestLite.RepeatedStringExtensionLite, 0)); - Assert.Equal("123", copy.GetExtension(UnittestLite.RepeatedStringPieceExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedUint32ExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.RepeatedUint64ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSfixed32ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSfixed64ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSint32ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.RepeatedSint64ExtensionLite, 0)); + Assert.AreEqual("123", copy.GetExtension(UnittestLite.RepeatedStringExtensionLite, 0)); + Assert.AreEqual("123", copy.GetExtension(UnittestLite.RepeatedStringPieceExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedUint32ExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.RepeatedUint64ExtensionLite, 0)); } private TestPackedExtensionsLite BuildPackedExtensions() @@ -294,36 +294,36 @@ namespace Google.ProtocolBuffers private void AssertPackedExtensions(TestPackedExtensionsLite copy) { - Assert.Equal(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 0)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 0)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 0)); - - Assert.Equal(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 1)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 1)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 1)); - Assert.Equal(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 1)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 1)); - Assert.Equal(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 1)); + Assert.AreEqual(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 0)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 0)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 0)); + + Assert.AreEqual(true, copy.GetExtension(UnittestLite.PackedBoolExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedDoubleExtensionLite, 1)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed32ExtensionLite, 1)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedFixed64ExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedFloatExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt32ExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedInt64ExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed32ExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSfixed64ExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint32ExtensionLite, 1)); + Assert.AreEqual(123, copy.GetExtension(UnittestLite.PackedSint64ExtensionLite, 1)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint32ExtensionLite, 1)); + Assert.AreEqual(123u, copy.GetExtension(UnittestLite.PackedUint64ExtensionLite, 1)); } - [Fact] + [Test] public void ExtensionWriterTestPacked() { TestPackedExtensionsLite msg = BuildPackedExtensions(); @@ -335,12 +335,12 @@ namespace Google.ProtocolBuffers TestPackedExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry); TestPackedExtensionsLite copy = copyBuilder.Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); AssertPackedExtensions(copy); } - [Fact] + [Test] public void TestUnpackedAndPackedExtensions() { TestPackedExtensionsLite original = BuildPackedExtensions(); @@ -354,19 +354,19 @@ namespace Google.ProtocolBuffers TestPackedExtensionsLite packed = TestPackedExtensionsLite.ParseFrom(unpacked.ToByteArray(), registry); - Assert.Equal(original, packed); - Assert.Equal(original.ToByteArray(), packed.ToByteArray()); + Assert.AreEqual(original, packed); + Assert.AreEqual(original.ToByteArray(), packed.ToByteArray()); AssertPackedExtensions(packed); } - [Fact] + [Test] public void TestUnpackedFromPackedInput() { byte[] packedData = BuildPackedExtensions().ToByteArray(); TestUnpackedTypesLite unpacked = TestUnpackedTypesLite.ParseFrom(packedData); TestPackedTypesLite packed = TestPackedTypesLite.ParseFrom(unpacked.ToByteArray()); - Assert.Equal(packedData, packed.ToByteArray()); + Assert.AreEqual(packedData, packed.ToByteArray()); unpacked = TestUnpackedTypesLite.ParseFrom(packed.ToByteArray()); diff --git a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs index 7feb0448..227b53d2 100644 --- a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs @@ -36,27 +36,27 @@ using System; using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class InteropLiteTest { - [Fact] + [Test] public void TestConvertFromFullMinimal() { TestInteropPerson person = TestInteropPerson.CreateBuilder() .SetId(123) .SetName("abc") .Build(); - Assert.True(person.IsInitialized); + Assert.IsTrue(person.IsInitialized); TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray()); - Assert.Equal(person.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(person.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestConvertFromFullComplete() { TestInteropPerson person = TestInteropPerson.CreateBuilder() @@ -72,7 +72,7 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasFull.EmployeeId, TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.True(person.IsInitialized); + Assert.IsTrue(person.IsInitialized); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasLite.RegisterAllExtensions(registry); @@ -81,24 +81,24 @@ namespace Google.ProtocolBuffers TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(fullBytes, registry); byte[] liteBytes = copy.ToByteArray(); - Assert.Equal(fullBytes, liteBytes); + Assert.AreEqual(fullBytes, liteBytes); } - [Fact] + [Test] public void TestConvertFromLiteMinimal() { TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() .SetId(123) .SetName("abc") .Build(); - Assert.True(person.IsInitialized); + Assert.IsTrue(person.IsInitialized); TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray()); - Assert.Equal(person.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(person.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestConvertFromLiteComplete() { TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() @@ -114,14 +114,14 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasLite.EmployeeIdLite, TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.True(person.IsInitialized); + Assert.IsTrue(person.IsInitialized); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasFull.RegisterAllExtensions(registry); TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry); - Assert.Equal(person.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(person.ToByteArray(), copy.ToByteArray()); } public ByteString AllBytes @@ -135,7 +135,7 @@ namespace Google.ProtocolBuffers } } - [Fact] + [Test] public void TestCompareStringValues() { TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() @@ -153,14 +153,14 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasLite.EmployeeIdLite, TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.True(person.IsInitialized); + Assert.IsTrue(person.IsInitialized); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasFull.RegisterAllExtensions(registry); TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry); - Assert.Equal(person.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(person.ToByteArray(), copy.ToByteArray()); TestInteropPerson.Builder copyBuilder = TestInteropPerson.CreateBuilder(); TextFormat.Merge( @@ -168,7 +168,7 @@ namespace Google.ProtocolBuffers "[protobuf_unittest_extra.employee_id]"), registry, copyBuilder); copy = copyBuilder.Build(); - Assert.Equal(person.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(person.ToByteArray(), copy.ToByteArray()); string liteText = person.ToString().TrimEnd().Replace("\r", ""); string fullText = copy.ToString().TrimEnd().Replace("\r", ""); @@ -179,7 +179,7 @@ namespace Google.ProtocolBuffers while (fullText.IndexOf("\n ", StringComparison.Ordinal) >= 0) fullText = fullText.Replace("\n ", "\n"); - Assert.Equal(fullText, liteText); + Assert.AreEqual(fullText, liteText); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs index 8ffd3ee2..5defc26e 100644 --- a/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs @@ -35,7 +35,7 @@ #endregion using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { @@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers /// public class LiteTest { - [Fact] + [Test] public void TestLite() { // Since lite messages are a subset of regular messages, we can mostly @@ -68,13 +68,13 @@ namespace Google.ProtocolBuffers TestAllTypesLite message2 = TestAllTypesLite.ParseFrom(data); - Assert.Equal(123, message2.OptionalInt32); - Assert.Equal(1, message2.RepeatedStringCount); - Assert.Equal("hello", message2.RepeatedStringList[0]); - Assert.Equal(7, message2.OptionalNestedMessage.Bb); + Assert.AreEqual(123, message2.OptionalInt32); + Assert.AreEqual(1, message2.RepeatedStringCount); + Assert.AreEqual("hello", message2.RepeatedStringList[0]); + Assert.AreEqual(7, message2.OptionalNestedMessage.Bb); } - [Fact] + [Test] public void TestLiteExtensions() { // TODO(kenton): Unlike other features of the lite library, extensions are @@ -96,17 +96,17 @@ namespace Google.ProtocolBuffers // writing, parsing hasn't been implemented yet. TestAllExtensionsLite message2 = message.ToBuilder().Build(); - Assert.Equal(123, (int) message2.GetExtension( + Assert.AreEqual(123, (int) message2.GetExtension( UnittestLite.OptionalInt32ExtensionLite)); - Assert.Equal(1, message2.GetExtensionCount( + Assert.AreEqual(1, message2.GetExtensionCount( UnittestLite.RepeatedStringExtensionLite)); - Assert.Equal(1, message2.GetExtension( + Assert.AreEqual(1, message2.GetExtension( UnittestLite.RepeatedStringExtensionLite).Count); - Assert.Equal("hello", message2.GetExtension( + Assert.AreEqual("hello", message2.GetExtension( UnittestLite.RepeatedStringExtensionLite, 0)); - Assert.Equal(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension( + Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension( UnittestLite.OptionalNestedEnumExtensionLite)); - Assert.Equal(7, message2.GetExtension( + Assert.AreEqual(7, message2.GetExtension( UnittestLite.OptionalNestedMessageExtensionLite).Bb); } } diff --git a/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs b/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs index b9680e68..2385bde5 100644 --- a/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs @@ -35,13 +35,13 @@ #endregion using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class MissingFieldAndExtensionTest { - [Fact] + [Test] public void TestRecoverMissingExtensions() { const int optionalInt32 = 12345678; @@ -52,42 +52,42 @@ namespace Google.ProtocolBuffers builder.AddExtension(Unittest.RepeatedDoubleExtension, 1.3); TestAllExtensions msg = builder.Build(); - Assert.True(msg.HasExtension(Unittest.OptionalInt32Extension)); - Assert.Equal(3, msg.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.IsTrue(msg.HasExtension(Unittest.OptionalInt32Extension)); + Assert.AreEqual(3, msg.GetExtensionCount(Unittest.RepeatedDoubleExtension)); byte[] bits = msg.ToByteArray(); TestAllExtensions copy = TestAllExtensions.ParseFrom(bits); - Assert.False(copy.HasExtension(Unittest.OptionalInt32Extension)); - Assert.Equal(0, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.NotEqual(msg, copy); + Assert.IsFalse(copy.HasExtension(Unittest.OptionalInt32Extension)); + Assert.AreEqual(0, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.AreNotEqual(msg, copy); //Even though copy does not understand the typees they serialize correctly byte[] copybits = copy.ToByteArray(); - Assert.Equal(bits, copybits); + Assert.AreEqual(bits, copybits); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); Unittest.RegisterAllExtensions(registry); //Now we can take those copy bits and restore the full message with extensions copy = TestAllExtensions.ParseFrom(copybits, registry); - Assert.True(copy.HasExtension(Unittest.OptionalInt32Extension)); - Assert.Equal(3, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); + Assert.IsTrue(copy.HasExtension(Unittest.OptionalInt32Extension)); + Assert.AreEqual(3, copy.GetExtensionCount(Unittest.RepeatedDoubleExtension)); - Assert.Equal(msg, copy); - Assert.Equal(bits, copy.ToByteArray()); + Assert.AreEqual(msg, copy); + Assert.AreEqual(bits, copy.ToByteArray()); //If we modify the object this should all continue to work as before copybits = copy.ToBuilder().Build().ToByteArray(); - Assert.Equal(bits, copybits); + Assert.AreEqual(bits, copybits); //If we replace extension the object this should all continue to work as before copybits = copy.ToBuilder() .SetExtension(Unittest.OptionalInt32Extension, optionalInt32) .Build().ToByteArray(); - Assert.Equal(bits, copybits); + Assert.AreEqual(bits, copybits); } - [Fact] + [Test] public void TestRecoverMissingFields() { TestMissingFieldsA msga = TestMissingFieldsA.CreateBuilder() @@ -98,53 +98,53 @@ namespace Google.ProtocolBuffers //serialize to type B and verify all fields exist TestMissingFieldsB msgb = TestMissingFieldsB.ParseFrom(msga.ToByteArray()); - Assert.Equal(1001, msgb.Id); - Assert.Equal("Name", msgb.Name); - Assert.False(msgb.HasWebsite); - Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); - Assert.Equal("missing@field.value", + Assert.AreEqual(1001, msgb.Id); + Assert.AreEqual("Name", msgb.Name); + Assert.IsFalse(msgb.HasWebsite); + Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.AreEqual("missing@field.value", msgb.UnknownFields[TestMissingFieldsA.EmailFieldNumber].LengthDelimitedList[0].ToStringUtf8()); //serializes exactly the same (at least for this simple example) - Assert.Equal(msga.ToByteArray(), msgb.ToByteArray()); - Assert.Equal(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); + Assert.AreEqual(msga.ToByteArray(), msgb.ToByteArray()); + Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); //now re-create an exact copy of A from serialized B TestMissingFieldsA copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.Equal(msga, copya); - Assert.Equal(1001, copya.Id); - Assert.Equal("Name", copya.Name); - Assert.Equal("missing@field.value", copya.Email); + Assert.AreEqual(msga, copya); + Assert.AreEqual(1001, copya.Id); + Assert.AreEqual("Name", copya.Name); + Assert.AreEqual("missing@field.value", copya.Email); //Now we modify B... and try again msgb = msgb.ToBuilder().SetWebsite("http://new.missing.field").Build(); //Does B still have the missing field? - Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); //Convert back to A and see if all fields are there? copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.NotEqual(msga, copya); - Assert.Equal(1001, copya.Id); - Assert.Equal("Name", copya.Name); - Assert.Equal("missing@field.value", copya.Email); - Assert.Equal(1, copya.UnknownFields.FieldDictionary.Count); - Assert.Equal("http://new.missing.field", + Assert.AreNotEqual(msga, copya); + Assert.AreEqual(1001, copya.Id); + Assert.AreEqual("Name", copya.Name); + Assert.AreEqual("missing@field.value", copya.Email); + Assert.AreEqual(1, copya.UnknownFields.FieldDictionary.Count); + Assert.AreEqual("http://new.missing.field", copya.UnknownFields[TestMissingFieldsB.WebsiteFieldNumber].LengthDelimitedList[0]. ToStringUtf8()); //Lastly we can even still trip back to type B and see all fields: TestMissingFieldsB copyb = TestMissingFieldsB.ParseFrom(copya.ToByteArray()); - Assert.Equal(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. - Assert.Equal(1001, copyb.Id); - Assert.Equal("Name", copyb.Name); - Assert.Equal("http://new.missing.field", copyb.Website); - Assert.Equal(1, copyb.UnknownFields.FieldDictionary.Count); - Assert.Equal("missing@field.value", + Assert.AreEqual(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. + Assert.AreEqual(1001, copyb.Id); + Assert.AreEqual("Name", copyb.Name); + Assert.AreEqual("http://new.missing.field", copyb.Website); + Assert.AreEqual(1, copyb.UnknownFields.FieldDictionary.Count); + Assert.AreEqual("missing@field.value", copyb.UnknownFields[TestMissingFieldsA.EmailFieldNumber].LengthDelimitedList[0].ToStringUtf8 ()); } - [Fact] + [Test] public void TestRecoverMissingMessage() { TestMissingFieldsA.Types.SubA suba = @@ -158,52 +158,52 @@ namespace Google.ProtocolBuffers //serialize to type B and verify all fields exist TestMissingFieldsB msgb = TestMissingFieldsB.ParseFrom(msga.ToByteArray()); - Assert.Equal(1001, msgb.Id); - Assert.Equal("Name", msgb.Name); - Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); - Assert.Equal(suba.ToString(), + Assert.AreEqual(1001, msgb.Id); + Assert.AreEqual("Name", msgb.Name); + Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(suba.ToString(), TestMissingFieldsA.Types.SubA.ParseFrom( msgb.UnknownFields[TestMissingFieldsA.TestAFieldNumber].LengthDelimitedList[0]).ToString ()); //serializes exactly the same (at least for this simple example) - Assert.Equal(msga.ToByteArray(), msgb.ToByteArray()); - Assert.Equal(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); + Assert.AreEqual(msga.ToByteArray(), msgb.ToByteArray()); + Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); //now re-create an exact copy of A from serialized B TestMissingFieldsA copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.Equal(msga, copya); - Assert.Equal(1001, copya.Id); - Assert.Equal("Name", copya.Name); - Assert.Equal(suba, copya.TestA); + Assert.AreEqual(msga, copya); + Assert.AreEqual(1001, copya.Id); + Assert.AreEqual("Name", copya.Name); + Assert.AreEqual(suba, copya.TestA); //Now we modify B... and try again TestMissingFieldsB.Types.SubB subb = TestMissingFieldsB.Types.SubB.CreateBuilder().AddValues("test-b").Build(); msgb = msgb.ToBuilder().SetTestB(subb).Build(); //Does B still have the missing field? - Assert.Equal(1, msgb.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); //Convert back to A and see if all fields are there? copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.NotEqual(msga, copya); - Assert.Equal(1001, copya.Id); - Assert.Equal("Name", copya.Name); - Assert.Equal(suba, copya.TestA); - Assert.Equal(1, copya.UnknownFields.FieldDictionary.Count); - Assert.Equal(subb.ToByteArray(), + Assert.AreNotEqual(msga, copya); + Assert.AreEqual(1001, copya.Id); + Assert.AreEqual("Name", copya.Name); + Assert.AreEqual(suba, copya.TestA); + Assert.AreEqual(1, copya.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(subb.ToByteArray(), copya.UnknownFields[TestMissingFieldsB.TestBFieldNumber].LengthDelimitedList[0].ToByteArray()); //Lastly we can even still trip back to type B and see all fields: TestMissingFieldsB copyb = TestMissingFieldsB.ParseFrom(copya.ToByteArray()); - Assert.Equal(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. - Assert.Equal(1001, copyb.Id); - Assert.Equal("Name", copyb.Name); - Assert.Equal(subb, copyb.TestB); - Assert.Equal(1, copyb.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. + Assert.AreEqual(1001, copyb.Id); + Assert.AreEqual("Name", copyb.Name); + Assert.AreEqual(subb, copyb.TestB); + Assert.AreEqual(1, copyb.UnknownFields.FieldDictionary.Count); } - [Fact] + [Test] public void TestRestoreFromOtherType() { TestInteropPerson person = TestInteropPerson.CreateBuilder() @@ -219,19 +219,19 @@ namespace Google.ProtocolBuffers .SetExtension(UnittestExtrasFull.EmployeeId, TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build()) .Build(); - Assert.True(person.IsInitialized); + Assert.IsTrue(person.IsInitialized); TestEmptyMessage temp = TestEmptyMessage.ParseFrom(person.ToByteArray()); - Assert.Equal(7, temp.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(7, temp.UnknownFields.FieldDictionary.Count); temp = temp.ToBuilder().Build(); - Assert.Equal(7, temp.UnknownFields.FieldDictionary.Count); + Assert.AreEqual(7, temp.UnknownFields.FieldDictionary.Count); ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); UnittestExtrasFull.RegisterAllExtensions(registry); TestInteropPerson copy = TestInteropPerson.ParseFrom(temp.ToByteArray(), registry); - Assert.Equal(person, copy); - Assert.Equal(person.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(person, copy); + Assert.AreEqual(person.ToByteArray(), copy.ToByteArray()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj index 8acc1fb1..75a14499 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj @@ -1,7 +1,5 @@  - - Debug AnyCPU @@ -19,6 +17,8 @@ 3.5 + + true @@ -49,17 +49,28 @@ - - - - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll + True + + + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True - - ..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll + True - - ..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll + + ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll + True + + @@ -90,6 +101,9 @@ + + + - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj index 5f1a7ba3..11109223 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj @@ -1,7 +1,5 @@  - - Debug AnyCPU @@ -49,17 +47,28 @@ - - - - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll + True + + + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True - - ..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll + True - - ..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll + + ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll + True + + @@ -100,11 +109,4 @@ --> - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs b/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs index e4f9acff..9c864618 100644 --- a/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs +++ b/csharp/src/ProtocolBuffersLite.Test/TestLiteByApi.cs @@ -35,66 +35,66 @@ #endregion using Google.ProtocolBuffers.TestProtos; -using Xunit; +using NUnit.Framework; namespace Google.ProtocolBuffers { public class TestLiteByApi { - [Fact] + [Test] public void TestAllTypesEquality() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; TestAllTypesLite copy = msg.ToBuilder().Build(); - Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); - Assert.True(msg.Equals(copy)); + Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.IsTrue(msg.Equals(copy)); msg = msg.ToBuilder().SetOptionalString("Hi").Build(); - Assert.NotEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.False(msg.Equals(copy)); + Assert.AreNotEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.IsFalse(msg.Equals(copy)); copy = copy.ToBuilder().SetOptionalString("Hi").Build(); - Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); - Assert.True(msg.Equals(copy)); + Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.IsTrue(msg.Equals(copy)); } - [Fact] + [Test] public void TestEqualityOnExtensions() { TestAllExtensionsLite msg = TestAllExtensionsLite.DefaultInstance; TestAllExtensionsLite copy = msg.ToBuilder().Build(); - Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); - Assert.True(msg.Equals(copy)); + Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.IsTrue(msg.Equals(copy)); msg = msg.ToBuilder().SetExtension(UnittestLite.OptionalStringExtensionLite, "Hi").Build(); - Assert.NotEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.False(msg.Equals(copy)); + Assert.AreNotEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.IsFalse(msg.Equals(copy)); copy = copy.ToBuilder().SetExtension(UnittestLite.OptionalStringExtensionLite, "Hi").Build(); - Assert.Equal(msg.GetHashCode(), copy.GetHashCode()); - Assert.True(msg.Equals(copy)); + Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); + Assert.IsTrue(msg.Equals(copy)); } - [Fact] + [Test] public void TestAllTypesToString() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; TestAllTypesLite copy = msg.ToBuilder().Build(); - Assert.Equal(msg.ToString(), copy.ToString()); - Assert.Equal(0, msg.ToString().Length); + Assert.AreEqual(msg.ToString(), copy.ToString()); + Assert.AreEqual(0, msg.ToString().Length); msg = msg.ToBuilder().SetOptionalInt32(-1).Build(); - Assert.Equal("optional_int32: -1", msg.ToString().TrimEnd()); + Assert.AreEqual("optional_int32: -1", msg.ToString().TrimEnd()); msg = msg.ToBuilder().SetOptionalString("abc123").Build(); - Assert.Equal("optional_int32: -1\noptional_string: \"abc123\"", + Assert.AreEqual("optional_int32: -1\noptional_string: \"abc123\"", msg.ToString().Replace("\r", "").TrimEnd()); } - [Fact] + [Test] public void TestAllTypesDefaultedRoundTrip() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; - Assert.True(msg.IsInitialized); + Assert.IsTrue(msg.IsInitialized); TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Fact] + [Test] public void TestAllTypesModifiedRoundTrip() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; @@ -114,7 +114,7 @@ namespace Google.ProtocolBuffers .AddRepeatedGroup(TestAllTypesLite.Types.RepeatedGroup.CreateBuilder().SetA('A').Build()) ; TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - Assert.Equal(msg.ToByteArray(), copy.ToByteArray()); + Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffersLite.Test/packages.config b/csharp/src/ProtocolBuffersLite.Test/packages.config index 6f1fb7f5..c7653992 100644 --- a/csharp/src/ProtocolBuffersLite.Test/packages.config +++ b/csharp/src/ProtocolBuffersLite.Test/packages.config @@ -1,9 +1,5 @@  - - - - - - + + \ No newline at end of file -- cgit v1.2.3 From 7149cee2825c013fe5376672572d3745dd5ad57e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 11:23:35 -0700 Subject: remove TreatWarningsAsError setting to allow building in Monodevelop --- csharp/src/AddressBook/AddressBook.csproj | 2 -- csharp/src/ProtoBench/ProtoBench.csproj | 2 -- csharp/src/ProtoDump/ProtoDump.csproj | 2 -- csharp/src/ProtoMunge/ProtoMunge.csproj | 2 -- csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj | 2 -- csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj | 2 -- .../src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj | 2 -- 7 files changed, 14 deletions(-) (limited to 'csharp/src') diff --git a/csharp/src/AddressBook/AddressBook.csproj b/csharp/src/AddressBook/AddressBook.csproj index 52b82a8f..f7e0d6be 100644 --- a/csharp/src/AddressBook/AddressBook.csproj +++ b/csharp/src/AddressBook/AddressBook.csproj @@ -24,7 +24,6 @@ DEBUG;TRACE prompt 4 - true true Off @@ -36,7 +35,6 @@ TRACE prompt 4 - true true Off diff --git a/csharp/src/ProtoBench/ProtoBench.csproj b/csharp/src/ProtoBench/ProtoBench.csproj index 280a54a9..beee3a71 100644 --- a/csharp/src/ProtoBench/ProtoBench.csproj +++ b/csharp/src/ProtoBench/ProtoBench.csproj @@ -23,7 +23,6 @@ DEBUG;TRACE prompt 4 - true true Off @@ -35,7 +34,6 @@ TRACE prompt 4 - true true Off diff --git a/csharp/src/ProtoDump/ProtoDump.csproj b/csharp/src/ProtoDump/ProtoDump.csproj index 506d316b..b7e6c1a3 100644 --- a/csharp/src/ProtoDump/ProtoDump.csproj +++ b/csharp/src/ProtoDump/ProtoDump.csproj @@ -25,7 +25,6 @@ DEBUG;TRACE prompt 4 - true true Off @@ -37,7 +36,6 @@ TRACE prompt 4 - true true Off diff --git a/csharp/src/ProtoMunge/ProtoMunge.csproj b/csharp/src/ProtoMunge/ProtoMunge.csproj index 7be2b3f7..60c907b1 100644 --- a/csharp/src/ProtoMunge/ProtoMunge.csproj +++ b/csharp/src/ProtoMunge/ProtoMunge.csproj @@ -25,7 +25,6 @@ DEBUG;TRACE prompt 4 - true true Off @@ -37,7 +36,6 @@ TRACE prompt 4 - true true Off diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index 545725e3..76bfcab3 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -29,7 +29,6 @@ DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 - true true Off false @@ -42,7 +41,6 @@ TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 - true true Off false diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj index 75a14499..4d813f83 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj @@ -29,7 +29,6 @@ DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 - true true Off false @@ -42,7 +41,6 @@ TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 - true true Off false diff --git a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj index 11109223..c42ab93c 100644 --- a/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj +++ b/csharp/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj @@ -27,7 +27,6 @@ DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 - true true Off false @@ -40,7 +39,6 @@ TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) prompt 4 - true true Off false -- cgit v1.2.3 From 3ccbf4b8936f415eed75c81d6228984516dfcbff Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 11:54:23 -0700 Subject: Fix newline assertion in TestJsonFormatted on mono --- csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs b/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs index da0d9eef..3d4d0320 100644 --- a/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs +++ b/csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs @@ -221,7 +221,8 @@ namespace Google.ProtocolBuffers Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions() { FormattedOutput = true }, "application/json", ms); - Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); + string expected = string.Format("{{{0} \"text\": \"a\",{0} \"number\": 1{0}}}", System.Environment.NewLine); + Assert.AreEqual(expected, Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } [Test] -- cgit v1.2.3 From a39dc6d5be2aac6e78ee5f96f9bf1a304a1c7644 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 20:57:41 -0700 Subject: rename FieldPresence to correct name --- .../ProtocolBuffers.Test.csproj | 2 +- .../TestProtos/FieldPresence.cs | 782 --------------------- .../TestProtos/FieldPresenceTest.cs | 782 +++++++++++++++++++++ 3 files changed, 783 insertions(+), 783 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresence.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index 76bfcab3..dd28f34a 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -84,7 +84,7 @@ - + diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresence.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresence.cs deleted file mode 100644 index b4cb279d..00000000 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresence.cs +++ /dev/null @@ -1,782 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protos/google/protobuf/field_presence_test.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos.FieldPresence { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class FieldPresenceTest { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static FieldPresenceTest() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu", - "cHJvdG8SL0dvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcy5GaWVs", - "ZFByZXNlbmNlIvYCCgxUZXN0QWxsVHlwZXMSFgoOb3B0aW9uYWxfaW50MzIY", - "ASABKAUSFwoPb3B0aW9uYWxfc3RyaW5nGAIgASgJEhYKDm9wdGlvbmFsX2J5", - "dGVzGAMgASgMEmYKFG9wdGlvbmFsX25lc3RlZF9lbnVtGAQgASgOMkguR29v", - "Z2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zLkZpZWxkUHJlc2VuY2Uu", - "VGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SbAoXb3B0aW9uYWxfbmVzdGVkX21l", - "c3NhZ2UYBSABKAsySy5Hb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90", - "b3MuRmllbGRQcmVzZW5jZS5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRoe", - "Cg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3RlZEVudW0S", - "BwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJiBnByb3RvMw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalString", "OptionalBytes", "OptionalNestedEnum", "OptionalNestedMessage", }); - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor = internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Value", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "optional_bytes", "optional_int32", "optional_nested_enum", "optional_nested_message", "optional_string" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 26, 8, 32, 42, 18 }; - public static TestAllTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 0, - BAR = 1, - BAZ = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "value" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private int value_; - public int Value { - get { return value_; } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (Value != 0) { - output.WriteInt32(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (Value != 0) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.Value != 0) { - Value = other.Value; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - input.ReadInt32(ref result.value_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(int value) { - PrepareBuilder(); - result.value_ = value; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.value_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private int optionalInt32_; - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalStringFieldNumber = 2; - private string optionalString_ = ""; - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 3; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalNestedEnumFieldNumber = 4; - private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalNestedMessageFieldNumber = 5; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (OptionalInt32 != 0) { - output.WriteInt32(1, field_names[1], OptionalInt32); - } - if (OptionalString != "") { - output.WriteString(2, field_names[4], OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) { - output.WriteBytes(3, field_names[0], OptionalBytes); - } - if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - output.WriteEnum(4, field_names[2], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(5, field_names[3], OptionalNestedMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (OptionalInt32 != 0) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (OptionalString != "") { - size += pb::CodedOutputStream.ComputeStringSize(2, OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) { - size += pb::CodedOutputStream.ComputeBytesSize(3, OptionalBytes); - } - if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int) OptionalNestedEnum); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(5, OptionalNestedMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllTypes) { - return MergeFrom((TestAllTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.OptionalInt32 != 0) { - OptionalInt32 = other.OptionalInt32; - } - if (other.OptionalString != "") { - OptionalString = other.OptionalString; - } - if (other.OptionalBytes != pb::ByteString.Empty) { - OptionalBytes = other.OptionalBytes; - } - if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - input.ReadInt32(ref result.optionalInt32_); - break; - } - case 18: { - input.ReadString(ref result.optionalString_); - break; - } - case 26: { - input.ReadBytes(ref result.optionalBytes_); - break; - } - case 32: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong)(int)unknown); - } - break; - } - case 42: { - global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.optionalInt32_ = 0; - return this; - } - - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.optionalString_ = ""; - return this; - } - - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - } - static TestAllTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs new file mode 100644 index 00000000..b4cb279d --- /dev/null +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs @@ -0,0 +1,782 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/google/protobuf/field_presence_test.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace Google.ProtocolBuffers.TestProtos.FieldPresence { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class FieldPresenceTest { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static FieldPresenceTest() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu", + "cHJvdG8SL0dvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcy5GaWVs", + "ZFByZXNlbmNlIvYCCgxUZXN0QWxsVHlwZXMSFgoOb3B0aW9uYWxfaW50MzIY", + "ASABKAUSFwoPb3B0aW9uYWxfc3RyaW5nGAIgASgJEhYKDm9wdGlvbmFsX2J5", + "dGVzGAMgASgMEmYKFG9wdGlvbmFsX25lc3RlZF9lbnVtGAQgASgOMkguR29v", + "Z2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zLkZpZWxkUHJlc2VuY2Uu", + "VGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SbAoXb3B0aW9uYWxfbmVzdGVkX21l", + "c3NhZ2UYBSABKAsySy5Hb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90", + "b3MuRmllbGRQcmVzZW5jZS5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRoe", + "Cg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3RlZEVudW0S", + "BwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJiBnByb3RvMw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor, + new string[] { "OptionalInt32", "OptionalString", "OptionalBytes", "OptionalNestedEnum", "OptionalNestedMessage", }); + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor = internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor.NestedTypes[0]; + internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor, + new string[] { "Value", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestAllTypes : pb::GeneratedMessage { + private TestAllTypes() { } + private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); + private static readonly string[] _testAllTypesFieldNames = new string[] { "optional_bytes", "optional_int32", "optional_nested_enum", "optional_nested_message", "optional_string" }; + private static readonly uint[] _testAllTypesFieldTags = new uint[] { 26, 8, 32, 42, 18 }; + public static TestAllTypes DefaultInstance { + get { return defaultInstance; } + } + + public override TestAllTypes DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TestAllTypes ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum NestedEnum { + FOO = 0, + BAR = 1, + BAZ = 2, + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NestedMessage : pb::GeneratedMessage { + private NestedMessage() { } + private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); + private static readonly string[] _nestedMessageFieldNames = new string[] { "value" }; + private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; + public static NestedMessage DefaultInstance { + get { return defaultInstance; } + } + + public override NestedMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NestedMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; } + } + + public const int ValueFieldNumber = 1; + private int value_; + public int Value { + get { return value_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _nestedMessageFieldNames; + if (Value != 0) { + output.WriteInt32(1, field_names[0], Value); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (Value != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Value); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NestedMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NestedMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NestedMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NestedMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NestedMessage result; + + private NestedMessage PrepareBuilder() { + if (resultIsReadOnly) { + NestedMessage original = result; + result = new NestedMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NestedMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Descriptor; } + } + + public override NestedMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override NestedMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NestedMessage) { + return MergeFrom((NestedMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NestedMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.Value != 0) { + Value = other.Value; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nestedMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.value_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int Value { + get { return result.Value; } + set { SetValue(value); } + } + public Builder SetValue(int value) { + PrepareBuilder(); + result.value_ = value; + return this; + } + public Builder ClearValue() { + PrepareBuilder(); + result.value_ = 0; + return this; + } + } + static NestedMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); + } + } + + } + #endregion + + public const int OptionalInt32FieldNumber = 1; + private int optionalInt32_; + public int OptionalInt32 { + get { return optionalInt32_; } + } + + public const int OptionalStringFieldNumber = 2; + private string optionalString_ = ""; + public string OptionalString { + get { return optionalString_; } + } + + public const int OptionalBytesFieldNumber = 3; + private pb::ByteString optionalBytes_ = pb::ByteString.Empty; + public pb::ByteString OptionalBytes { + get { return optionalBytes_; } + } + + public const int OptionalNestedEnumFieldNumber = 4; + private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return optionalNestedEnum_; } + } + + public const int OptionalNestedMessageFieldNumber = 5; + private bool hasOptionalNestedMessage; + private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage optionalNestedMessage_; + public bool HasOptionalNestedMessage { + get { return hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _testAllTypesFieldNames; + if (OptionalInt32 != 0) { + output.WriteInt32(1, field_names[1], OptionalInt32); + } + if (OptionalString != "") { + output.WriteString(2, field_names[4], OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + output.WriteBytes(3, field_names[0], OptionalBytes); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { + output.WriteEnum(4, field_names[2], (int) OptionalNestedEnum, OptionalNestedEnum); + } + if (hasOptionalNestedMessage) { + output.WriteMessage(5, field_names[3], OptionalNestedMessage); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (OptionalInt32 != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); + } + if (OptionalString != "") { + size += pb::CodedOutputStream.ComputeStringSize(2, OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + size += pb::CodedOutputStream.ComputeBytesSize(3, OptionalBytes); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int) OptionalNestedEnum); + } + if (hasOptionalNestedMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(5, OptionalNestedMessage); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TestAllTypes ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TestAllTypes MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TestAllTypes prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TestAllTypes cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TestAllTypes result; + + private TestAllTypes PrepareBuilder() { + if (resultIsReadOnly) { + TestAllTypes original = result; + result = new TestAllTypes(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TestAllTypes MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Descriptor; } + } + + public override TestAllTypes DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance; } + } + + public override TestAllTypes BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TestAllTypes) { + return MergeFrom((TestAllTypes) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TestAllTypes other) { + if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance) return this; + PrepareBuilder(); + if (other.OptionalInt32 != 0) { + OptionalInt32 = other.OptionalInt32; + } + if (other.OptionalString != "") { + OptionalString = other.OptionalString; + } + if (other.OptionalBytes != pb::ByteString.Empty) { + OptionalBytes = other.OptionalBytes; + } + if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { + OptionalNestedEnum = other.OptionalNestedEnum; + } + if (other.HasOptionalNestedMessage) { + MergeOptionalNestedMessage(other.OptionalNestedMessage); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _testAllTypesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.optionalInt32_); + break; + } + case 18: { + input.ReadString(ref result.optionalString_); + break; + } + case 26: { + input.ReadBytes(ref result.optionalBytes_); + break; + } + case 32: { + object unknown; + if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + case 42: { + global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOptionalNestedMessage) { + subBuilder.MergeFrom(OptionalNestedMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalNestedMessage = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int OptionalInt32 { + get { return result.OptionalInt32; } + set { SetOptionalInt32(value); } + } + public Builder SetOptionalInt32(int value) { + PrepareBuilder(); + result.optionalInt32_ = value; + return this; + } + public Builder ClearOptionalInt32() { + PrepareBuilder(); + result.optionalInt32_ = 0; + return this; + } + + public string OptionalString { + get { return result.OptionalString; } + set { SetOptionalString(value); } + } + public Builder SetOptionalString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalString_ = value; + return this; + } + public Builder ClearOptionalString() { + PrepareBuilder(); + result.optionalString_ = ""; + return this; + } + + public pb::ByteString OptionalBytes { + get { return result.OptionalBytes; } + set { SetOptionalBytes(value); } + } + public Builder SetOptionalBytes(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalBytes_ = value; + return this; + } + public Builder ClearOptionalBytes() { + PrepareBuilder(); + result.optionalBytes_ = pb::ByteString.Empty; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return result.OptionalNestedEnum; } + set { SetOptionalNestedEnum(value); } + } + public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.optionalNestedEnum_ = value; + return this; + } + public Builder ClearOptionalNestedEnum() { + PrepareBuilder(); + result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; + return this; + } + + public bool HasOptionalNestedMessage { + get { return result.hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return result.OptionalNestedMessage; } + set { SetOptionalNestedMessage(value); } + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = value; + return this; + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalNestedMessage && + result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalNestedMessage_ = value; + } + result.hasOptionalNestedMessage = true; + return this; + } + public Builder ClearOptionalNestedMessage() { + PrepareBuilder(); + result.hasOptionalNestedMessage = false; + result.optionalNestedMessage_ = null; + return this; + } + } + static TestAllTypes() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code -- cgit v1.2.3 From 385afba572b6541286976f463e6240f2ca45ea11 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 21:09:49 -0700 Subject: Regenerate some proto files after ClsCompliance has been dropped --- .../ProtocolBuffers.Test/TestProtos/GoogleSize.cs | 22 ---------------------- .../ProtocolBuffers.Test/TestProtos/GoogleSpeed.cs | 22 ---------------------- .../TestProtos/UnittestExtrasFull.cs | 3 --- 3 files changed, 47 deletions(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSize.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSize.cs index 06f2c0ca..92309e92 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSize.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSize.cs @@ -265,14 +265,12 @@ namespace Google.ProtocolBuffers.TestProtos { public const int Field5FieldNumber = 5; private pbc::PopsicleList field5_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] public scg::IList Field5List { get { return pbc::Lists.AsReadOnly(field5_); } } public int Field5Count { get { return field5_.Count; } } - [global::System.CLSCompliant(false)] public ulong GetField5(int index) { return field5_[index]; } @@ -899,30 +897,25 @@ namespace Google.ProtocolBuffers.TestProtos { return this; } - [global::System.CLSCompliant(false)] public pbc::IPopsicleList Field5List { get { return PrepareBuilder().field5_; } } public int Field5Count { get { return result.Field5Count; } } - [global::System.CLSCompliant(false)] public ulong GetField5(int index) { return result.GetField5(index); } - [global::System.CLSCompliant(false)] public Builder SetField5(int index, ulong value) { PrepareBuilder(); result.field5_[index] = value; return this; } - [global::System.CLSCompliant(false)] public Builder AddField5(ulong value) { PrepareBuilder(); result.field5_.Add(value); return this; } - [global::System.CLSCompliant(false)] public Builder AddRangeField5(scg::IEnumerable values) { PrepareBuilder(); result.field5_.Add(values); @@ -1683,7 +1676,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField21 { get { return hasField21; } } - [global::System.CLSCompliant(false)] public ulong Field21 { get { return field21_; } } @@ -1724,7 +1716,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField203 { get { return hasField203; } } - [global::System.CLSCompliant(false)] public uint Field203 { get { return field203_; } } @@ -1755,7 +1746,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField207 { get { return hasField207; } } - [global::System.CLSCompliant(false)] public ulong Field207 { get { return field207_; } } @@ -1766,7 +1756,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField300 { get { return hasField300; } } - [global::System.CLSCompliant(false)] public ulong Field300 { get { return field300_; } } @@ -2102,12 +2091,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField21 { get { return result.hasField21; } } - [global::System.CLSCompliant(false)] public ulong Field21 { get { return result.Field21; } set { SetField21(value); } } - [global::System.CLSCompliant(false)] public Builder SetField21(ulong value) { PrepareBuilder(); result.hasField21 = true; @@ -2184,12 +2171,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField203 { get { return result.hasField203; } } - [global::System.CLSCompliant(false)] public uint Field203 { get { return result.Field203; } set { SetField203(value); } } - [global::System.CLSCompliant(false)] public Builder SetField203(uint value) { PrepareBuilder(); result.hasField203 = true; @@ -2247,12 +2232,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField207 { get { return result.hasField207; } } - [global::System.CLSCompliant(false)] public ulong Field207 { get { return result.Field207; } set { SetField207(value); } } - [global::System.CLSCompliant(false)] public Builder SetField207(ulong value) { PrepareBuilder(); result.hasField207 = true; @@ -2269,12 +2252,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField300 { get { return result.hasField300; } } - [global::System.CLSCompliant(false)] public ulong Field300 { get { return result.Field300; } set { SetField300(value); } } - [global::System.CLSCompliant(false)] public Builder SetField300(ulong value) { PrepareBuilder(); result.hasField300 = true; @@ -2402,7 +2383,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField15 { get { return hasField15; } } - [global::System.CLSCompliant(false)] public ulong Field15 { get { return field15_; } } @@ -2738,12 +2718,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField15 { get { return result.hasField15; } } - [global::System.CLSCompliant(false)] public ulong Field15 { get { return result.Field15; } set { SetField15(value); } } - [global::System.CLSCompliant(false)] public Builder SetField15(ulong value) { PrepareBuilder(); result.hasField15 = true; diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSpeed.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSpeed.cs index 13e684a5..aa9b90f0 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSpeed.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/GoogleSpeed.cs @@ -267,14 +267,12 @@ namespace Google.ProtocolBuffers.TestProtos { public const int Field5FieldNumber = 5; private pbc::PopsicleList field5_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] public scg::IList Field5List { get { return pbc::Lists.AsReadOnly(field5_); } } public int Field5Count { get { return field5_.Count; } } - [global::System.CLSCompliant(false)] public ulong GetField5(int index) { return field5_[index]; } @@ -1540,30 +1538,25 @@ namespace Google.ProtocolBuffers.TestProtos { return this; } - [global::System.CLSCompliant(false)] public pbc::IPopsicleList Field5List { get { return PrepareBuilder().field5_; } } public int Field5Count { get { return result.Field5Count; } } - [global::System.CLSCompliant(false)] public ulong GetField5(int index) { return result.GetField5(index); } - [global::System.CLSCompliant(false)] public Builder SetField5(int index, ulong value) { PrepareBuilder(); result.field5_[index] = value; return this; } - [global::System.CLSCompliant(false)] public Builder AddField5(ulong value) { PrepareBuilder(); result.field5_.Add(value); return this; } - [global::System.CLSCompliant(false)] public Builder AddRangeField5(scg::IEnumerable values) { PrepareBuilder(); result.field5_.Add(values); @@ -2326,7 +2319,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField21 { get { return hasField21; } } - [global::System.CLSCompliant(false)] public ulong Field21 { get { return field21_; } } @@ -2367,7 +2359,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField203 { get { return hasField203; } } - [global::System.CLSCompliant(false)] public uint Field203 { get { return field203_; } } @@ -2398,7 +2389,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField207 { get { return hasField207; } } - [global::System.CLSCompliant(false)] public ulong Field207 { get { return field207_; } } @@ -2409,7 +2399,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField300 { get { return hasField300; } } - [global::System.CLSCompliant(false)] public ulong Field300 { get { return field300_; } } @@ -3099,12 +3088,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField21 { get { return result.hasField21; } } - [global::System.CLSCompliant(false)] public ulong Field21 { get { return result.Field21; } set { SetField21(value); } } - [global::System.CLSCompliant(false)] public Builder SetField21(ulong value) { PrepareBuilder(); result.hasField21 = true; @@ -3181,12 +3168,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField203 { get { return result.hasField203; } } - [global::System.CLSCompliant(false)] public uint Field203 { get { return result.Field203; } set { SetField203(value); } } - [global::System.CLSCompliant(false)] public Builder SetField203(uint value) { PrepareBuilder(); result.hasField203 = true; @@ -3244,12 +3229,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField207 { get { return result.hasField207; } } - [global::System.CLSCompliant(false)] public ulong Field207 { get { return result.Field207; } set { SetField207(value); } } - [global::System.CLSCompliant(false)] public Builder SetField207(ulong value) { PrepareBuilder(); result.hasField207 = true; @@ -3266,12 +3249,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField300 { get { return result.hasField300; } } - [global::System.CLSCompliant(false)] public ulong Field300 { get { return result.Field300; } set { SetField300(value); } } - [global::System.CLSCompliant(false)] public Builder SetField300(ulong value) { PrepareBuilder(); result.hasField300 = true; @@ -3403,7 +3384,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField15 { get { return hasField15; } } - [global::System.CLSCompliant(false)] public ulong Field15 { get { return field15_; } } @@ -4064,12 +4044,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasField15 { get { return result.hasField15; } } - [global::System.CLSCompliant(false)] public ulong Field15 { get { return result.Field15; } set { SetField15(value); } } - [global::System.CLSCompliant(false)] public Builder SetField15(ulong value) { PrepareBuilder(); result.hasField15 = true; diff --git a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasFull.cs b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasFull.cs index 3eed99f1..827bedef 100644 --- a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasFull.cs +++ b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasFull.cs @@ -420,7 +420,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasZip { get { return hasZip; } } - [global::System.CLSCompliant(false)] public uint Zip { get { return zip_; } } @@ -619,12 +618,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasZip { get { return result.hasZip; } } - [global::System.CLSCompliant(false)] public uint Zip { get { return result.Zip; } set { SetZip(value); } } - [global::System.CLSCompliant(false)] public Builder SetZip(uint value) { PrepareBuilder(); result.hasZip = true; -- cgit v1.2.3 From 766036f231afb3789292adedd3d1a3e41079b1ea Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 21:33:40 -0700 Subject: remove C# files not referenced in any project --- .../TestProtos/UnittestNoFieldPresence.cs | 4065 -------------------- .../TestProtos/UnittestPreserveUnknownEnum.cs | 1320 ------- .../TestProtos/UnittestPreserveUnknownEnum2.cs | 684 ---- .../TestProtos/UnittestExtrasXmltest.cs | 2277 ----------- .../TestProtos/UnittestIssues.cs | 3437 ----------------- 5 files changed, 11783 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum.cs delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum2.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasXmltest.cs delete mode 100644 csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestIssues.cs (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs deleted file mode 100644 index 654c2e50..00000000 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs +++ /dev/null @@ -1,4065 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/unittest_no_field_presence.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnittestNoFieldPresence { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnittestNoFieldPresence() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjBnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfbm9fZmllbGRfcHJlc2VuY2Uu", - "cHJvdG8SH3Byb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QaHmdvb2ds", - "ZS9wcm90b2J1Zi91bml0dGVzdC5wcm90byKaEQoMVGVzdEFsbFR5cGVzEhYK", - "Dm9wdGlvbmFsX2ludDMyGAEgASgFEhYKDm9wdGlvbmFsX2ludDY0GAIgASgD", - "EhcKD29wdGlvbmFsX3VpbnQzMhgDIAEoDRIXCg9vcHRpb25hbF91aW50NjQY", - "BCABKAQSFwoPb3B0aW9uYWxfc2ludDMyGAUgASgREhcKD29wdGlvbmFsX3Np", - "bnQ2NBgGIAEoEhIYChBvcHRpb25hbF9maXhlZDMyGAcgASgHEhgKEG9wdGlv", - "bmFsX2ZpeGVkNjQYCCABKAYSGQoRb3B0aW9uYWxfc2ZpeGVkMzIYCSABKA8S", - "GQoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBASFgoOb3B0aW9uYWxfZmxvYXQY", - "CyABKAISFwoPb3B0aW9uYWxfZG91YmxlGAwgASgBEhUKDW9wdGlvbmFsX2Jv", - "b2wYDSABKAgSFwoPb3B0aW9uYWxfc3RyaW5nGA4gASgJEhYKDm9wdGlvbmFs", - "X2J5dGVzGA8gASgMElwKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGBIgASgL", - "MjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0dGVzdC5UZXN0QWxsVHlw", - "ZXMuTmVzdGVkTWVzc2FnZRJRChhvcHRpb25hbF9mb3JlaWduX21lc3NhZ2UY", - "EyABKAsyLy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LkZvcmVp", - "Z25NZXNzYWdlEkAKF29wdGlvbmFsX3Byb3RvMl9tZXNzYWdlGBQgASgLMh8u", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzElYKFG9wdGlvbmFsX25l", - "c3RlZF9lbnVtGBUgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", - "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bRJLChVvcHRpb25hbF9mb3Jl", - "aWduX2VudW0YFiABKA4yLC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", - "ZXN0LkZvcmVpZ25FbnVtEiEKFW9wdGlvbmFsX3N0cmluZ19waWVjZRgYIAEo", - "CUICCAISGQoNb3B0aW9uYWxfY29yZBgZIAEoCUICCAESXgoVb3B0aW9uYWxf", - "bGF6eV9tZXNzYWdlGB4gASgLMjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91", - "bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZUICKAESFgoOcmVw", - "ZWF0ZWRfaW50MzIYHyADKAUSFgoOcmVwZWF0ZWRfaW50NjQYICADKAMSFwoP", - "cmVwZWF0ZWRfdWludDMyGCEgAygNEhcKD3JlcGVhdGVkX3VpbnQ2NBgiIAMo", - "BBIXCg9yZXBlYXRlZF9zaW50MzIYIyADKBESFwoPcmVwZWF0ZWRfc2ludDY0", - "GCQgAygSEhgKEHJlcGVhdGVkX2ZpeGVkMzIYJSADKAcSGAoQcmVwZWF0ZWRf", - "Zml4ZWQ2NBgmIAMoBhIZChFyZXBlYXRlZF9zZml4ZWQzMhgnIAMoDxIZChFy", - "ZXBlYXRlZF9zZml4ZWQ2NBgoIAMoEBIWCg5yZXBlYXRlZF9mbG9hdBgpIAMo", - "AhIXCg9yZXBlYXRlZF9kb3VibGUYKiADKAESFQoNcmVwZWF0ZWRfYm9vbBgr", - "IAMoCBIXCg9yZXBlYXRlZF9zdHJpbmcYLCADKAkSFgoOcmVwZWF0ZWRfYnl0", - "ZXMYLSADKAwSXAoXcmVwZWF0ZWRfbmVzdGVkX21lc3NhZ2UYMCADKAsyOy5w", - "cm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LlRlc3RBbGxUeXBlcy5O", - "ZXN0ZWRNZXNzYWdlElEKGHJlcGVhdGVkX2ZvcmVpZ25fbWVzc2FnZRgxIAMo", - "CzIvLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuRm9yZWlnbk1l", - "c3NhZ2USQAoXcmVwZWF0ZWRfcHJvdG8yX21lc3NhZ2UYMiADKAsyHy5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMSVgoUcmVwZWF0ZWRfbmVzdGVk", - "X2VudW0YMyADKA4yOC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0", - "LlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtEksKFXJlcGVhdGVkX2ZvcmVpZ25f", - "ZW51bRg0IAMoDjIsLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3Qu", - "Rm9yZWlnbkVudW0SIQoVcmVwZWF0ZWRfc3RyaW5nX3BpZWNlGDYgAygJQgII", - "AhIZCg1yZXBlYXRlZF9jb3JkGDcgAygJQgIIARJeChVyZXBlYXRlZF9sYXp5", - "X21lc3NhZ2UYOSADKAsyOy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", - "ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlQgIoARIWCgxvbmVvZl91", - "aW50MzIYbyABKA1IABJbChRvbmVvZl9uZXN0ZWRfbWVzc2FnZRhwIAEoCzI7", - "LnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuVGVzdEFsbFR5cGVz", - "Lk5lc3RlZE1lc3NhZ2VIABIWCgxvbmVvZl9zdHJpbmcYcSABKAlIABJOCgpv", - "bmVvZl9lbnVtGHIgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", - "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bUgAGhsKDU5lc3RlZE1lc3Nh", - "Z2USCgoCYmIYASABKAUiJwoKTmVzdGVkRW51bRIHCgNGT08QABIHCgNCQVIQ", - "ARIHCgNCQVoQAkINCgtvbmVvZl9maWVsZCJFChJUZXN0UHJvdG8yUmVxdWly", - "ZWQSLwoGcHJvdG8yGAEgASgLMh8ucHJvdG9idWZfdW5pdHRlc3QuVGVzdFJl", - "cXVpcmVkIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUqQAoLRm9yZWln", - "bkVudW0SDwoLRk9SRUlHTl9GT08QABIPCgtGT1JFSUdOX0JBUhABEg8KC0ZP", - "UkVJR05fQkFaEAJCJKoCIUdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFBy", - "b3Rvc2IGcHJvdG8z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalProto2Message", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "OptionalLazyMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedProto2Message", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "RepeatedLazyMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofEnum", }); - internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Bb", }); - internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor = Descriptor.MessageTypes[1]; - internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor, - new string[] { "Proto2", }); - internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[2]; - internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor, - new string[] { "C", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.Unittest.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.TestProtos.Unittest.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum ForeignEnum { - FOREIGN_FOO = 0, - FOREIGN_BAR = 1, - FOREIGN_BAZ = 2, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "oneof_enum", "oneof_nested_message", "oneof_string", "oneof_uint32", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_int32", "optional_int64", "optional_lazy_message", "optional_nested_enum", "optional_nested_message", "optional_proto2_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_int32", "repeated_int64", "repeated_lazy_message", "repeated_nested_enum", "repeated_nested_message", "repeated_proto2_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 912, 898, 906, 888, 104, 122, 202, 97, 61, 65, 93, 176, 154, 8, 16, 242, 168, 146, 162, 77, 81, 40, 48, 114, 194, 24, 32, 344, 362, 442, 337, 301, 305, 333, 416, 394, 248, 256, 458, 408, 386, 402, 317, 321, 280, 288, 354, 434, 264, 272 }; - public static TestAllTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 0, - BAR = 1, - BAZ = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (hasBb) { - output.WriteInt32(1, field_names[0], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - Bb = other.Bb; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalInt64FieldNumber = 2; - private bool hasOptionalInt64; - private long optionalInt64_; - public bool HasOptionalInt64 { - get { return hasOptionalInt64; } - } - public long OptionalInt64 { - get { return optionalInt64_; } - } - - public const int OptionalUint32FieldNumber = 3; - private bool hasOptionalUint32; - private uint optionalUint32_; - public bool HasOptionalUint32 { - get { return hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return optionalUint32_; } - } - - public const int OptionalUint64FieldNumber = 4; - private bool hasOptionalUint64; - private ulong optionalUint64_; - public bool HasOptionalUint64 { - get { return hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return optionalUint64_; } - } - - public const int OptionalSint32FieldNumber = 5; - private bool hasOptionalSint32; - private int optionalSint32_; - public bool HasOptionalSint32 { - get { return hasOptionalSint32; } - } - public int OptionalSint32 { - get { return optionalSint32_; } - } - - public const int OptionalSint64FieldNumber = 6; - private bool hasOptionalSint64; - private long optionalSint64_; - public bool HasOptionalSint64 { - get { return hasOptionalSint64; } - } - public long OptionalSint64 { - get { return optionalSint64_; } - } - - public const int OptionalFixed32FieldNumber = 7; - private bool hasOptionalFixed32; - private uint optionalFixed32_; - public bool HasOptionalFixed32 { - get { return hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return optionalFixed32_; } - } - - public const int OptionalFixed64FieldNumber = 8; - private bool hasOptionalFixed64; - private ulong optionalFixed64_; - public bool HasOptionalFixed64 { - get { return hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return optionalFixed64_; } - } - - public const int OptionalSfixed32FieldNumber = 9; - private bool hasOptionalSfixed32; - private int optionalSfixed32_; - public bool HasOptionalSfixed32 { - get { return hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return optionalSfixed32_; } - } - - public const int OptionalSfixed64FieldNumber = 10; - private bool hasOptionalSfixed64; - private long optionalSfixed64_; - public bool HasOptionalSfixed64 { - get { return hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return optionalSfixed64_; } - } - - public const int OptionalFloatFieldNumber = 11; - private bool hasOptionalFloat; - private float optionalFloat_; - public bool HasOptionalFloat { - get { return hasOptionalFloat; } - } - public float OptionalFloat { - get { return optionalFloat_; } - } - - public const int OptionalDoubleFieldNumber = 12; - private bool hasOptionalDouble; - private double optionalDouble_; - public bool HasOptionalDouble { - get { return hasOptionalDouble; } - } - public double OptionalDouble { - get { return optionalDouble_; } - } - - public const int OptionalBoolFieldNumber = 13; - private bool hasOptionalBool; - private bool optionalBool_; - public bool HasOptionalBool { - get { return hasOptionalBool; } - } - public bool OptionalBool { - get { return optionalBool_; } - } - - public const int OptionalStringFieldNumber = 14; - private bool hasOptionalString; - private string optionalString_ = ""; - public bool HasOptionalString { - get { return hasOptionalString; } - } - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 15; - private bool hasOptionalBytes; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public bool HasOptionalBytes { - get { return hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalNestedMessageFieldNumber = 18; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public const int OptionalForeignMessageFieldNumber = 19; - private bool hasOptionalForeignMessage; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage optionalForeignMessage_; - public bool HasOptionalForeignMessage { - get { return hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int OptionalProto2MessageFieldNumber = 20; - private bool hasOptionalProto2Message; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes optionalProto2Message_; - public bool HasOptionalProto2Message { - get { return hasOptionalProto2Message; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message { - get { return optionalProto2Message_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } - } - - public const int OptionalNestedEnumFieldNumber = 21; - private bool hasOptionalNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - public bool HasOptionalNestedEnum { - get { return hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalForeignEnumFieldNumber = 22; - private bool hasOptionalForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasOptionalForeignEnum { - get { return hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return optionalForeignEnum_; } - } - - public const int OptionalStringPieceFieldNumber = 24; - private bool hasOptionalStringPiece; - private string optionalStringPiece_ = ""; - public bool HasOptionalStringPiece { - get { return hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return optionalStringPiece_; } - } - - public const int OptionalCordFieldNumber = 25; - private bool hasOptionalCord; - private string optionalCord_ = ""; - public bool HasOptionalCord { - get { return hasOptionalCord; } - } - public string OptionalCord { - get { return optionalCord_; } - } - - public const int OptionalLazyMessageFieldNumber = 30; - private bool hasOptionalLazyMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage optionalLazyMessage_; - public bool HasOptionalLazyMessage { - get { return hasOptionalLazyMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalLazyMessage { - get { return optionalLazyMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public const int RepeatedInt32FieldNumber = 31; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedInt64FieldNumber = 32; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedUint32FieldNumber = 33; - private pbc::PopsicleList repeatedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint32List { - get { return pbc::Lists.AsReadOnly(repeatedUint32_); } - } - public int RepeatedUint32Count { - get { return repeatedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return repeatedUint32_[index]; - } - - public const int RepeatedUint64FieldNumber = 34; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public const int RepeatedSint32FieldNumber = 35; - private pbc::PopsicleList repeatedSint32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint32List { - get { return pbc::Lists.AsReadOnly(repeatedSint32_); } - } - public int RepeatedSint32Count { - get { return repeatedSint32_.Count; } - } - public int GetRepeatedSint32(int index) { - return repeatedSint32_[index]; - } - - public const int RepeatedSint64FieldNumber = 36; - private pbc::PopsicleList repeatedSint64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint64List { - get { return pbc::Lists.AsReadOnly(repeatedSint64_); } - } - public int RepeatedSint64Count { - get { return repeatedSint64_.Count; } - } - public long GetRepeatedSint64(int index) { - return repeatedSint64_[index]; - } - - public const int RepeatedFixed32FieldNumber = 37; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 38; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedSfixed32FieldNumber = 39; - private pbc::PopsicleList repeatedSfixed32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed32List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); } - } - public int RepeatedSfixed32Count { - get { return repeatedSfixed32_.Count; } - } - public int GetRepeatedSfixed32(int index) { - return repeatedSfixed32_[index]; - } - - public const int RepeatedSfixed64FieldNumber = 40; - private pbc::PopsicleList repeatedSfixed64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed64List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); } - } - public int RepeatedSfixed64Count { - get { return repeatedSfixed64_.Count; } - } - public long GetRepeatedSfixed64(int index) { - return repeatedSfixed64_[index]; - } - - public const int RepeatedFloatFieldNumber = 41; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedDoubleFieldNumber = 42; - private pbc::PopsicleList repeatedDouble_ = new pbc::PopsicleList(); - public scg::IList RepeatedDoubleList { - get { return pbc::Lists.AsReadOnly(repeatedDouble_); } - } - public int RepeatedDoubleCount { - get { return repeatedDouble_.Count; } - } - public double GetRepeatedDouble(int index) { - return repeatedDouble_[index]; - } - - public const int RepeatedBoolFieldNumber = 43; - private pbc::PopsicleList repeatedBool_ = new pbc::PopsicleList(); - public scg::IList RepeatedBoolList { - get { return pbc::Lists.AsReadOnly(repeatedBool_); } - } - public int RepeatedBoolCount { - get { return repeatedBool_.Count; } - } - public bool GetRepeatedBool(int index) { - return repeatedBool_[index]; - } - - public const int RepeatedStringFieldNumber = 44; - private pbc::PopsicleList repeatedString_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringList { - get { return pbc::Lists.AsReadOnly(repeatedString_); } - } - public int RepeatedStringCount { - get { return repeatedString_.Count; } - } - public string GetRepeatedString(int index) { - return repeatedString_[index]; - } - - public const int RepeatedBytesFieldNumber = 45; - private pbc::PopsicleList repeatedBytes_ = new pbc::PopsicleList(); - public scg::IList RepeatedBytesList { - get { return pbc::Lists.AsReadOnly(repeatedBytes_); } - } - public int RepeatedBytesCount { - get { return repeatedBytes_.Count; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return repeatedBytes_[index]; - } - - public const int RepeatedNestedMessageFieldNumber = 48; - private pbc::PopsicleList repeatedNestedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedMessageList { - get { return repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return repeatedNestedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return repeatedNestedMessage_[index]; - } - - public const int RepeatedForeignMessageFieldNumber = 49; - private pbc::PopsicleList repeatedForeignMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignMessageList { - get { return repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return repeatedForeignMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return repeatedForeignMessage_[index]; - } - - public const int RepeatedProto2MessageFieldNumber = 50; - private pbc::PopsicleList repeatedProto2Message_ = new pbc::PopsicleList(); - public scg::IList RepeatedProto2MessageList { - get { return repeatedProto2Message_; } - } - public int RepeatedProto2MessageCount { - get { return repeatedProto2Message_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) { - return repeatedProto2Message_[index]; - } - - public const int RepeatedNestedEnumFieldNumber = 51; - private pbc::PopsicleList repeatedNestedEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedEnumList { - get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); } - } - public int RepeatedNestedEnumCount { - get { return repeatedNestedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return repeatedNestedEnum_[index]; - } - - public const int RepeatedForeignEnumFieldNumber = 52; - private pbc::PopsicleList repeatedForeignEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignEnumList { - get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); } - } - public int RepeatedForeignEnumCount { - get { return repeatedForeignEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return repeatedForeignEnum_[index]; - } - - public const int RepeatedStringPieceFieldNumber = 54; - private pbc::PopsicleList repeatedStringPiece_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceList { - get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); } - } - public int RepeatedStringPieceCount { - get { return repeatedStringPiece_.Count; } - } - public string GetRepeatedStringPiece(int index) { - return repeatedStringPiece_[index]; - } - - public const int RepeatedCordFieldNumber = 55; - private pbc::PopsicleList repeatedCord_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordList { - get { return pbc::Lists.AsReadOnly(repeatedCord_); } - } - public int RepeatedCordCount { - get { return repeatedCord_.Count; } - } - public string GetRepeatedCord(int index) { - return repeatedCord_[index]; - } - - public const int RepeatedLazyMessageFieldNumber = 57; - private pbc::PopsicleList repeatedLazyMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedLazyMessageList { - get { return repeatedLazyMessage_; } - } - public int RepeatedLazyMessageCount { - get { return repeatedLazyMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) { - return repeatedLazyMessage_[index]; - } - - public const int OneofUint32FieldNumber = 111; - private bool hasOneofUint32; - private uint oneofUint32_; - public bool HasOneofUint32 { - get { return hasOneofUint32; } - } - [global::System.CLSCompliant(false)] - public uint OneofUint32 { - get { return oneofUint32_; } - } - - public const int OneofNestedMessageFieldNumber = 112; - private bool hasOneofNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage oneofNestedMessage_; - public bool HasOneofNestedMessage { - get { return hasOneofNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { - get { return oneofNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public const int OneofStringFieldNumber = 113; - private bool hasOneofString; - private string oneofString_ = ""; - public bool HasOneofString { - get { return hasOneofString; } - } - public string OneofString { - get { return oneofString_; } - } - - public const int OneofEnumFieldNumber = 114; - private bool hasOneofEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum oneofEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - public bool HasOneofEnum { - get { return hasOneofEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OneofEnum { - get { return oneofEnum_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (hasOptionalInt32) { - output.WriteInt32(1, field_names[13], OptionalInt32); - } - if (hasOptionalInt64) { - output.WriteInt64(2, field_names[14], OptionalInt64); - } - if (hasOptionalUint32) { - output.WriteUInt32(3, field_names[25], OptionalUint32); - } - if (hasOptionalUint64) { - output.WriteUInt64(4, field_names[26], OptionalUint64); - } - if (hasOptionalSint32) { - output.WriteSInt32(5, field_names[21], OptionalSint32); - } - if (hasOptionalSint64) { - output.WriteSInt64(6, field_names[22], OptionalSint64); - } - if (hasOptionalFixed32) { - output.WriteFixed32(7, field_names[8], OptionalFixed32); - } - if (hasOptionalFixed64) { - output.WriteFixed64(8, field_names[9], OptionalFixed64); - } - if (hasOptionalSfixed32) { - output.WriteSFixed32(9, field_names[19], OptionalSfixed32); - } - if (hasOptionalSfixed64) { - output.WriteSFixed64(10, field_names[20], OptionalSfixed64); - } - if (hasOptionalFloat) { - output.WriteFloat(11, field_names[10], OptionalFloat); - } - if (hasOptionalDouble) { - output.WriteDouble(12, field_names[7], OptionalDouble); - } - if (hasOptionalBool) { - output.WriteBool(13, field_names[4], OptionalBool); - } - if (hasOptionalString) { - output.WriteString(14, field_names[23], OptionalString); - } - if (hasOptionalBytes) { - output.WriteBytes(15, field_names[5], OptionalBytes); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(18, field_names[17], OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - output.WriteMessage(19, field_names[12], OptionalForeignMessage); - } - if (hasOptionalProto2Message) { - output.WriteMessage(20, field_names[18], OptionalProto2Message); - } - if (hasOptionalNestedEnum) { - output.WriteEnum(21, field_names[16], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - output.WriteEnum(22, field_names[11], (int) OptionalForeignEnum, OptionalForeignEnum); - } - if (hasOptionalStringPiece) { - output.WriteString(24, field_names[24], OptionalStringPiece); - } - if (hasOptionalCord) { - output.WriteString(25, field_names[6], OptionalCord); - } - if (hasOptionalLazyMessage) { - output.WriteMessage(30, field_names[15], OptionalLazyMessage); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(31, field_names[36], repeatedInt32_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(32, field_names[37], repeatedInt64_); - } - if (repeatedUint32_.Count > 0) { - output.WriteUInt32Array(33, field_names[48], repeatedUint32_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(34, field_names[49], repeatedUint64_); - } - if (repeatedSint32_.Count > 0) { - output.WriteSInt32Array(35, field_names[44], repeatedSint32_); - } - if (repeatedSint64_.Count > 0) { - output.WriteSInt64Array(36, field_names[45], repeatedSint64_); - } - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(37, field_names[31], repeatedFixed32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(38, field_names[32], repeatedFixed64_); - } - if (repeatedSfixed32_.Count > 0) { - output.WriteSFixed32Array(39, field_names[42], repeatedSfixed32_); - } - if (repeatedSfixed64_.Count > 0) { - output.WriteSFixed64Array(40, field_names[43], repeatedSfixed64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(41, field_names[33], repeatedFloat_); - } - if (repeatedDouble_.Count > 0) { - output.WriteDoubleArray(42, field_names[30], repeatedDouble_); - } - if (repeatedBool_.Count > 0) { - output.WriteBoolArray(43, field_names[27], repeatedBool_); - } - if (repeatedString_.Count > 0) { - output.WriteStringArray(44, field_names[46], repeatedString_); - } - if (repeatedBytes_.Count > 0) { - output.WriteBytesArray(45, field_names[28], repeatedBytes_); - } - if (repeatedNestedMessage_.Count > 0) { - output.WriteMessageArray(48, field_names[40], repeatedNestedMessage_); - } - if (repeatedForeignMessage_.Count > 0) { - output.WriteMessageArray(49, field_names[35], repeatedForeignMessage_); - } - if (repeatedProto2Message_.Count > 0) { - output.WriteMessageArray(50, field_names[41], repeatedProto2Message_); - } - if (repeatedNestedEnum_.Count > 0) { - output.WriteEnumArray(51, field_names[39], repeatedNestedEnum_); - } - if (repeatedForeignEnum_.Count > 0) { - output.WriteEnumArray(52, field_names[34], repeatedForeignEnum_); - } - if (repeatedStringPiece_.Count > 0) { - output.WriteStringArray(54, field_names[47], repeatedStringPiece_); - } - if (repeatedCord_.Count > 0) { - output.WriteStringArray(55, field_names[29], repeatedCord_); - } - if (repeatedLazyMessage_.Count > 0) { - output.WriteMessageArray(57, field_names[38], repeatedLazyMessage_); - } - if (hasOneofUint32) { - output.WriteUInt32(111, field_names[3], OneofUint32); - } - if (hasOneofNestedMessage) { - output.WriteMessage(112, field_names[1], OneofNestedMessage); - } - if (hasOneofString) { - output.WriteString(113, field_names[2], OneofString); - } - if (hasOneofEnum) { - output.WriteEnum(114, field_names[0], (int) OneofEnum, OneofEnum); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (hasOptionalInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64); - } - if (hasOptionalUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32); - } - if (hasOptionalUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64); - } - if (hasOptionalSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32); - } - if (hasOptionalSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64); - } - if (hasOptionalFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32); - } - if (hasOptionalFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64); - } - if (hasOptionalSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32); - } - if (hasOptionalSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64); - } - if (hasOptionalFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat); - } - if (hasOptionalDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble); - } - if (hasOptionalBool) { - size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool); - } - if (hasOptionalString) { - size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString); - } - if (hasOptionalBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage); - } - if (hasOptionalProto2Message) { - size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalProto2Message); - } - if (hasOptionalNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum); - } - if (hasOptionalStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece); - } - if (hasOptionalCord) { - size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord); - } - if (hasOptionalLazyMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(30, OptionalLazyMessage); - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in RepeatedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 2 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedSfixed32_.Count; - size += dataSize; - size += 2 * repeatedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedSfixed64_.Count; - size += dataSize; - size += 2 * repeatedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 2 * repeatedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedDouble_.Count; - size += dataSize; - size += 2 * repeatedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * repeatedBool_.Count; - size += dataSize; - size += 2 * repeatedBool_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedString_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in RepeatedBytesList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedBytes_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(48, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedForeignMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(49, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes element in RepeatedProto2MessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(50, element); - } - { - int dataSize = 0; - if (repeatedNestedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedNestedEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedForeignEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in repeatedForeignEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedForeignEnum_.Count; - } - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedStringPiece_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedCord_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage element in RepeatedLazyMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(57, element); - } - if (hasOneofUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(111, OneofUint32); - } - if (hasOneofNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(112, OneofNestedMessage); - } - if (hasOneofString) { - size += pb::CodedOutputStream.ComputeStringSize(113, OneofString); - } - if (hasOneofEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(114, (int) OneofEnum); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() { - repeatedInt32_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedUint32_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - repeatedSint32_.MakeReadOnly(); - repeatedSint64_.MakeReadOnly(); - repeatedFixed32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedSfixed32_.MakeReadOnly(); - repeatedSfixed64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedDouble_.MakeReadOnly(); - repeatedBool_.MakeReadOnly(); - repeatedString_.MakeReadOnly(); - repeatedBytes_.MakeReadOnly(); - repeatedNestedMessage_.MakeReadOnly(); - repeatedForeignMessage_.MakeReadOnly(); - repeatedProto2Message_.MakeReadOnly(); - repeatedNestedEnum_.MakeReadOnly(); - repeatedForeignEnum_.MakeReadOnly(); - repeatedStringPiece_.MakeReadOnly(); - repeatedCord_.MakeReadOnly(); - repeatedLazyMessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllTypes) { - return MergeFrom((TestAllTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - if (other.HasOptionalInt64) { - OptionalInt64 = other.OptionalInt64; - } - if (other.HasOptionalUint32) { - OptionalUint32 = other.OptionalUint32; - } - if (other.HasOptionalUint64) { - OptionalUint64 = other.OptionalUint64; - } - if (other.HasOptionalSint32) { - OptionalSint32 = other.OptionalSint32; - } - if (other.HasOptionalSint64) { - OptionalSint64 = other.OptionalSint64; - } - if (other.HasOptionalFixed32) { - OptionalFixed32 = other.OptionalFixed32; - } - if (other.HasOptionalFixed64) { - OptionalFixed64 = other.OptionalFixed64; - } - if (other.HasOptionalSfixed32) { - OptionalSfixed32 = other.OptionalSfixed32; - } - if (other.HasOptionalSfixed64) { - OptionalSfixed64 = other.OptionalSfixed64; - } - if (other.HasOptionalFloat) { - OptionalFloat = other.OptionalFloat; - } - if (other.HasOptionalDouble) { - OptionalDouble = other.OptionalDouble; - } - if (other.HasOptionalBool) { - OptionalBool = other.OptionalBool; - } - if (other.HasOptionalString) { - OptionalString = other.OptionalString; - } - if (other.HasOptionalBytes) { - OptionalBytes = other.OptionalBytes; - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - if (other.HasOptionalForeignMessage) { - MergeOptionalForeignMessage(other.OptionalForeignMessage); - } - if (other.HasOptionalProto2Message) { - MergeOptionalProto2Message(other.OptionalProto2Message); - } - if (other.HasOptionalNestedEnum) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalForeignEnum) { - OptionalForeignEnum = other.OptionalForeignEnum; - } - if (other.HasOptionalStringPiece) { - OptionalStringPiece = other.OptionalStringPiece; - } - if (other.HasOptionalCord) { - OptionalCord = other.OptionalCord; - } - if (other.HasOptionalLazyMessage) { - MergeOptionalLazyMessage(other.OptionalLazyMessage); - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedUint32_.Count != 0) { - result.repeatedUint32_.Add(other.repeatedUint32_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - if (other.repeatedSint32_.Count != 0) { - result.repeatedSint32_.Add(other.repeatedSint32_); - } - if (other.repeatedSint64_.Count != 0) { - result.repeatedSint64_.Add(other.repeatedSint64_); - } - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedSfixed32_.Count != 0) { - result.repeatedSfixed32_.Add(other.repeatedSfixed32_); - } - if (other.repeatedSfixed64_.Count != 0) { - result.repeatedSfixed64_.Add(other.repeatedSfixed64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedDouble_.Count != 0) { - result.repeatedDouble_.Add(other.repeatedDouble_); - } - if (other.repeatedBool_.Count != 0) { - result.repeatedBool_.Add(other.repeatedBool_); - } - if (other.repeatedString_.Count != 0) { - result.repeatedString_.Add(other.repeatedString_); - } - if (other.repeatedBytes_.Count != 0) { - result.repeatedBytes_.Add(other.repeatedBytes_); - } - if (other.repeatedNestedMessage_.Count != 0) { - result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_); - } - if (other.repeatedForeignMessage_.Count != 0) { - result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_); - } - if (other.repeatedProto2Message_.Count != 0) { - result.repeatedProto2Message_.Add(other.repeatedProto2Message_); - } - if (other.repeatedNestedEnum_.Count != 0) { - result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_); - } - if (other.repeatedForeignEnum_.Count != 0) { - result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_); - } - if (other.repeatedStringPiece_.Count != 0) { - result.repeatedStringPiece_.Add(other.repeatedStringPiece_); - } - if (other.repeatedCord_.Count != 0) { - result.repeatedCord_.Add(other.repeatedCord_); - } - if (other.repeatedLazyMessage_.Count != 0) { - result.repeatedLazyMessage_.Add(other.repeatedLazyMessage_); - } - if (other.HasOneofUint32) { - OneofUint32 = other.OneofUint32; - } - if (other.HasOneofNestedMessage) { - MergeOneofNestedMessage(other.OneofNestedMessage); - } - if (other.HasOneofString) { - OneofString = other.OneofString; - } - if (other.HasOneofEnum) { - OneofEnum = other.OneofEnum; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - case 16: { - result.hasOptionalInt64 = input.ReadInt64(ref result.optionalInt64_); - break; - } - case 24: { - result.hasOptionalUint32 = input.ReadUInt32(ref result.optionalUint32_); - break; - } - case 32: { - result.hasOptionalUint64 = input.ReadUInt64(ref result.optionalUint64_); - break; - } - case 40: { - result.hasOptionalSint32 = input.ReadSInt32(ref result.optionalSint32_); - break; - } - case 48: { - result.hasOptionalSint64 = input.ReadSInt64(ref result.optionalSint64_); - break; - } - case 61: { - result.hasOptionalFixed32 = input.ReadFixed32(ref result.optionalFixed32_); - break; - } - case 65: { - result.hasOptionalFixed64 = input.ReadFixed64(ref result.optionalFixed64_); - break; - } - case 77: { - result.hasOptionalSfixed32 = input.ReadSFixed32(ref result.optionalSfixed32_); - break; - } - case 81: { - result.hasOptionalSfixed64 = input.ReadSFixed64(ref result.optionalSfixed64_); - break; - } - case 93: { - result.hasOptionalFloat = input.ReadFloat(ref result.optionalFloat_); - break; - } - case 97: { - result.hasOptionalDouble = input.ReadDouble(ref result.optionalDouble_); - break; - } - case 104: { - result.hasOptionalBool = input.ReadBool(ref result.optionalBool_); - break; - } - case 114: { - result.hasOptionalString = input.ReadString(ref result.optionalString_); - break; - } - case 122: { - result.hasOptionalBytes = input.ReadBytes(ref result.optionalBytes_); - break; - } - case 146: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - case 154: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasOptionalForeignMessage) { - subBuilder.MergeFrom(OptionalForeignMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalForeignMessage = subBuilder.BuildPartial(); - break; - } - case 162: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(); - if (result.hasOptionalProto2Message) { - subBuilder.MergeFrom(OptionalProto2Message); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalProto2Message = subBuilder.BuildPartial(); - break; - } - case 168: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - result.hasOptionalNestedEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(21, (ulong)(int)unknown); - } - break; - } - case 176: { - object unknown; - if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) { - result.hasOptionalForeignEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(22, (ulong)(int)unknown); - } - break; - } - case 194: { - result.hasOptionalStringPiece = input.ReadString(ref result.optionalStringPiece_); - break; - } - case 202: { - result.hasOptionalCord = input.ReadString(ref result.optionalCord_); - break; - } - case 242: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalLazyMessage) { - subBuilder.MergeFrom(OptionalLazyMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalLazyMessage = subBuilder.BuildPartial(); - break; - } - case 250: - case 248: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 258: - case 256: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 266: - case 264: { - input.ReadUInt32Array(tag, field_name, result.repeatedUint32_); - break; - } - case 274: - case 272: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - case 282: - case 280: { - input.ReadSInt32Array(tag, field_name, result.repeatedSint32_); - break; - } - case 290: - case 288: { - input.ReadSInt64Array(tag, field_name, result.repeatedSint64_); - break; - } - case 298: - case 301: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 306: - case 305: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 314: - case 317: { - input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_); - break; - } - case 322: - case 321: { - input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_); - break; - } - case 330: - case 333: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 338: - case 337: { - input.ReadDoubleArray(tag, field_name, result.repeatedDouble_); - break; - } - case 346: - case 344: { - input.ReadBoolArray(tag, field_name, result.repeatedBool_); - break; - } - case 354: { - input.ReadStringArray(tag, field_name, result.repeatedString_); - break; - } - case 362: { - input.ReadBytesArray(tag, field_name, result.repeatedBytes_); - break; - } - case 386: { - input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); - break; - } - case 394: { - input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - case 402: { - input.ReadMessageArray(tag, field_name, result.repeatedProto2Message_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance, extensionRegistry); - break; - } - case 410: - case 408: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedNestedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(51, (ulong)(int)rawValue); - } - break; - } - case 418: - case 416: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedForeignEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(52, (ulong)(int)rawValue); - } - break; - } - case 434: { - input.ReadStringArray(tag, field_name, result.repeatedStringPiece_); - break; - } - case 442: { - input.ReadStringArray(tag, field_name, result.repeatedCord_); - break; - } - case 458: { - input.ReadMessageArray(tag, field_name, result.repeatedLazyMessage_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); - break; - } - case 888: { - result.hasOneofUint32 = input.ReadUInt32(ref result.oneofUint32_); - break; - } - case 898: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOneofNestedMessage) { - subBuilder.MergeFrom(OneofNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OneofNestedMessage = subBuilder.BuildPartial(); - break; - } - case 906: { - result.hasOneofString = input.ReadString(ref result.oneofString_); - break; - } - case 912: { - object unknown; - if(input.ReadEnum(ref result.oneofEnum_, out unknown)) { - result.hasOneofEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(114, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - - public bool HasOptionalInt64 { - get { return result.hasOptionalInt64; } - } - public long OptionalInt64 { - get { return result.OptionalInt64; } - set { SetOptionalInt64(value); } - } - public Builder SetOptionalInt64(long value) { - PrepareBuilder(); - result.hasOptionalInt64 = true; - result.optionalInt64_ = value; - return this; - } - public Builder ClearOptionalInt64() { - PrepareBuilder(); - result.hasOptionalInt64 = false; - result.optionalInt64_ = 0L; - return this; - } - - public bool HasOptionalUint32 { - get { return result.hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return result.OptionalUint32; } - set { SetOptionalUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint32(uint value) { - PrepareBuilder(); - result.hasOptionalUint32 = true; - result.optionalUint32_ = value; - return this; - } - public Builder ClearOptionalUint32() { - PrepareBuilder(); - result.hasOptionalUint32 = false; - result.optionalUint32_ = 0; - return this; - } - - public bool HasOptionalUint64 { - get { return result.hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return result.OptionalUint64; } - set { SetOptionalUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint64(ulong value) { - PrepareBuilder(); - result.hasOptionalUint64 = true; - result.optionalUint64_ = value; - return this; - } - public Builder ClearOptionalUint64() { - PrepareBuilder(); - result.hasOptionalUint64 = false; - result.optionalUint64_ = 0UL; - return this; - } - - public bool HasOptionalSint32 { - get { return result.hasOptionalSint32; } - } - public int OptionalSint32 { - get { return result.OptionalSint32; } - set { SetOptionalSint32(value); } - } - public Builder SetOptionalSint32(int value) { - PrepareBuilder(); - result.hasOptionalSint32 = true; - result.optionalSint32_ = value; - return this; - } - public Builder ClearOptionalSint32() { - PrepareBuilder(); - result.hasOptionalSint32 = false; - result.optionalSint32_ = 0; - return this; - } - - public bool HasOptionalSint64 { - get { return result.hasOptionalSint64; } - } - public long OptionalSint64 { - get { return result.OptionalSint64; } - set { SetOptionalSint64(value); } - } - public Builder SetOptionalSint64(long value) { - PrepareBuilder(); - result.hasOptionalSint64 = true; - result.optionalSint64_ = value; - return this; - } - public Builder ClearOptionalSint64() { - PrepareBuilder(); - result.hasOptionalSint64 = false; - result.optionalSint64_ = 0L; - return this; - } - - public bool HasOptionalFixed32 { - get { return result.hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return result.OptionalFixed32; } - set { SetOptionalFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed32(uint value) { - PrepareBuilder(); - result.hasOptionalFixed32 = true; - result.optionalFixed32_ = value; - return this; - } - public Builder ClearOptionalFixed32() { - PrepareBuilder(); - result.hasOptionalFixed32 = false; - result.optionalFixed32_ = 0; - return this; - } - - public bool HasOptionalFixed64 { - get { return result.hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return result.OptionalFixed64; } - set { SetOptionalFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed64(ulong value) { - PrepareBuilder(); - result.hasOptionalFixed64 = true; - result.optionalFixed64_ = value; - return this; - } - public Builder ClearOptionalFixed64() { - PrepareBuilder(); - result.hasOptionalFixed64 = false; - result.optionalFixed64_ = 0UL; - return this; - } - - public bool HasOptionalSfixed32 { - get { return result.hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return result.OptionalSfixed32; } - set { SetOptionalSfixed32(value); } - } - public Builder SetOptionalSfixed32(int value) { - PrepareBuilder(); - result.hasOptionalSfixed32 = true; - result.optionalSfixed32_ = value; - return this; - } - public Builder ClearOptionalSfixed32() { - PrepareBuilder(); - result.hasOptionalSfixed32 = false; - result.optionalSfixed32_ = 0; - return this; - } - - public bool HasOptionalSfixed64 { - get { return result.hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return result.OptionalSfixed64; } - set { SetOptionalSfixed64(value); } - } - public Builder SetOptionalSfixed64(long value) { - PrepareBuilder(); - result.hasOptionalSfixed64 = true; - result.optionalSfixed64_ = value; - return this; - } - public Builder ClearOptionalSfixed64() { - PrepareBuilder(); - result.hasOptionalSfixed64 = false; - result.optionalSfixed64_ = 0L; - return this; - } - - public bool HasOptionalFloat { - get { return result.hasOptionalFloat; } - } - public float OptionalFloat { - get { return result.OptionalFloat; } - set { SetOptionalFloat(value); } - } - public Builder SetOptionalFloat(float value) { - PrepareBuilder(); - result.hasOptionalFloat = true; - result.optionalFloat_ = value; - return this; - } - public Builder ClearOptionalFloat() { - PrepareBuilder(); - result.hasOptionalFloat = false; - result.optionalFloat_ = 0F; - return this; - } - - public bool HasOptionalDouble { - get { return result.hasOptionalDouble; } - } - public double OptionalDouble { - get { return result.OptionalDouble; } - set { SetOptionalDouble(value); } - } - public Builder SetOptionalDouble(double value) { - PrepareBuilder(); - result.hasOptionalDouble = true; - result.optionalDouble_ = value; - return this; - } - public Builder ClearOptionalDouble() { - PrepareBuilder(); - result.hasOptionalDouble = false; - result.optionalDouble_ = 0D; - return this; - } - - public bool HasOptionalBool { - get { return result.hasOptionalBool; } - } - public bool OptionalBool { - get { return result.OptionalBool; } - set { SetOptionalBool(value); } - } - public Builder SetOptionalBool(bool value) { - PrepareBuilder(); - result.hasOptionalBool = true; - result.optionalBool_ = value; - return this; - } - public Builder ClearOptionalBool() { - PrepareBuilder(); - result.hasOptionalBool = false; - result.optionalBool_ = false; - return this; - } - - public bool HasOptionalString { - get { return result.hasOptionalString; } - } - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalString = true; - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.hasOptionalString = false; - result.optionalString_ = ""; - return this; - } - - public bool HasOptionalBytes { - get { return result.hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalBytes = true; - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.hasOptionalBytes = false; - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - - public bool HasOptionalForeignMessage { - get { return result.hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return result.OptionalForeignMessage; } - set { SetOptionalForeignMessage(value); } - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = value; - return this; - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalForeignMessage && - result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalForeignMessage_ = value; - } - result.hasOptionalForeignMessage = true; - return this; - } - public Builder ClearOptionalForeignMessage() { - PrepareBuilder(); - result.hasOptionalForeignMessage = false; - result.optionalForeignMessage_ = null; - return this; - } - - public bool HasOptionalProto2Message { - get { return result.hasOptionalProto2Message; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message { - get { return result.OptionalProto2Message; } - set { SetOptionalProto2Message(value); } - } - public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalProto2Message = true; - result.optionalProto2Message_ = value; - return this; - } - public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalProto2Message = true; - result.optionalProto2Message_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalProto2Message && - result.optionalProto2Message_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) { - result.optionalProto2Message_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(result.optionalProto2Message_).MergeFrom(value).BuildPartial(); - } else { - result.optionalProto2Message_ = value; - } - result.hasOptionalProto2Message = true; - return this; - } - public Builder ClearOptionalProto2Message() { - PrepareBuilder(); - result.hasOptionalProto2Message = false; - result.optionalProto2Message_ = null; - return this; - } - - public bool HasOptionalNestedEnum { - get { return result.hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasOptionalNestedEnum = true; - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.hasOptionalNestedEnum = false; - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalForeignEnum { - get { return result.hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return result.OptionalForeignEnum; } - set { SetOptionalForeignEnum(value); } - } - public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasOptionalForeignEnum = true; - result.optionalForeignEnum_ = value; - return this; - } - public Builder ClearOptionalForeignEnum() { - PrepareBuilder(); - result.hasOptionalForeignEnum = false; - result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasOptionalStringPiece { - get { return result.hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return result.OptionalStringPiece; } - set { SetOptionalStringPiece(value); } - } - public Builder SetOptionalStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalStringPiece = true; - result.optionalStringPiece_ = value; - return this; - } - public Builder ClearOptionalStringPiece() { - PrepareBuilder(); - result.hasOptionalStringPiece = false; - result.optionalStringPiece_ = ""; - return this; - } - - public bool HasOptionalCord { - get { return result.hasOptionalCord; } - } - public string OptionalCord { - get { return result.OptionalCord; } - set { SetOptionalCord(value); } - } - public Builder SetOptionalCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalCord = true; - result.optionalCord_ = value; - return this; - } - public Builder ClearOptionalCord() { - PrepareBuilder(); - result.hasOptionalCord = false; - result.optionalCord_ = ""; - return this; - } - - public bool HasOptionalLazyMessage { - get { return result.hasOptionalLazyMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalLazyMessage { - get { return result.OptionalLazyMessage; } - set { SetOptionalLazyMessage(value); } - } - public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalLazyMessage = true; - result.optionalLazyMessage_ = value; - return this; - } - public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalLazyMessage = true; - result.optionalLazyMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalLazyMessage && - result.optionalLazyMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalLazyMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalLazyMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalLazyMessage_ = value; - } - result.hasOptionalLazyMessage = true; - return this; - } - public Builder ClearOptionalLazyMessage() { - PrepareBuilder(); - result.hasOptionalLazyMessage = false; - result.optionalLazyMessage_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint32List { - get { return PrepareBuilder().repeatedUint32_; } - } - public int RepeatedUint32Count { - get { return result.RepeatedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return result.GetRepeatedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint32(int index, uint value) { - PrepareBuilder(); - result.repeatedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint32(uint value) { - PrepareBuilder(); - result.repeatedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint32_.Add(values); - return this; - } - public Builder ClearRepeatedUint32() { - PrepareBuilder(); - result.repeatedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint32List { - get { return PrepareBuilder().repeatedSint32_; } - } - public int RepeatedSint32Count { - get { return result.RepeatedSint32Count; } - } - public int GetRepeatedSint32(int index) { - return result.GetRepeatedSint32(index); - } - public Builder SetRepeatedSint32(int index, int value) { - PrepareBuilder(); - result.repeatedSint32_[index] = value; - return this; - } - public Builder AddRepeatedSint32(int value) { - PrepareBuilder(); - result.repeatedSint32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint32_.Add(values); - return this; - } - public Builder ClearRepeatedSint32() { - PrepareBuilder(); - result.repeatedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint64List { - get { return PrepareBuilder().repeatedSint64_; } - } - public int RepeatedSint64Count { - get { return result.RepeatedSint64Count; } - } - public long GetRepeatedSint64(int index) { - return result.GetRepeatedSint64(index); - } - public Builder SetRepeatedSint64(int index, long value) { - PrepareBuilder(); - result.repeatedSint64_[index] = value; - return this; - } - public Builder AddRepeatedSint64(long value) { - PrepareBuilder(); - result.repeatedSint64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint64_.Add(values); - return this; - } - public Builder ClearRepeatedSint64() { - PrepareBuilder(); - result.repeatedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed32List { - get { return PrepareBuilder().repeatedSfixed32_; } - } - public int RepeatedSfixed32Count { - get { return result.RepeatedSfixed32Count; } - } - public int GetRepeatedSfixed32(int index) { - return result.GetRepeatedSfixed32(index); - } - public Builder SetRepeatedSfixed32(int index, int value) { - PrepareBuilder(); - result.repeatedSfixed32_[index] = value; - return this; - } - public Builder AddRepeatedSfixed32(int value) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed32() { - PrepareBuilder(); - result.repeatedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed64List { - get { return PrepareBuilder().repeatedSfixed64_; } - } - public int RepeatedSfixed64Count { - get { return result.RepeatedSfixed64Count; } - } - public long GetRepeatedSfixed64(int index) { - return result.GetRepeatedSfixed64(index); - } - public Builder SetRepeatedSfixed64(int index, long value) { - PrepareBuilder(); - result.repeatedSfixed64_[index] = value; - return this; - } - public Builder AddRepeatedSfixed64(long value) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed64() { - PrepareBuilder(); - result.repeatedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedDoubleList { - get { return PrepareBuilder().repeatedDouble_; } - } - public int RepeatedDoubleCount { - get { return result.RepeatedDoubleCount; } - } - public double GetRepeatedDouble(int index) { - return result.GetRepeatedDouble(index); - } - public Builder SetRepeatedDouble(int index, double value) { - PrepareBuilder(); - result.repeatedDouble_[index] = value; - return this; - } - public Builder AddRepeatedDouble(double value) { - PrepareBuilder(); - result.repeatedDouble_.Add(value); - return this; - } - public Builder AddRangeRepeatedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedDouble_.Add(values); - return this; - } - public Builder ClearRepeatedDouble() { - PrepareBuilder(); - result.repeatedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBoolList { - get { return PrepareBuilder().repeatedBool_; } - } - public int RepeatedBoolCount { - get { return result.RepeatedBoolCount; } - } - public bool GetRepeatedBool(int index) { - return result.GetRepeatedBool(index); - } - public Builder SetRepeatedBool(int index, bool value) { - PrepareBuilder(); - result.repeatedBool_[index] = value; - return this; - } - public Builder AddRepeatedBool(bool value) { - PrepareBuilder(); - result.repeatedBool_.Add(value); - return this; - } - public Builder AddRangeRepeatedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBool_.Add(values); - return this; - } - public Builder ClearRepeatedBool() { - PrepareBuilder(); - result.repeatedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringList { - get { return PrepareBuilder().repeatedString_; } - } - public int RepeatedStringCount { - get { return result.RepeatedStringCount; } - } - public string GetRepeatedString(int index) { - return result.GetRepeatedString(index); - } - public Builder SetRepeatedString(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_[index] = value; - return this; - } - public Builder AddRepeatedString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_.Add(value); - return this; - } - public Builder AddRangeRepeatedString(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedString_.Add(values); - return this; - } - public Builder ClearRepeatedString() { - PrepareBuilder(); - result.repeatedString_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBytesList { - get { return PrepareBuilder().repeatedBytes_; } - } - public int RepeatedBytesCount { - get { return result.RepeatedBytesCount; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return result.GetRepeatedBytes(index); - } - public Builder SetRepeatedBytes(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_[index] = value; - return this; - } - public Builder AddRepeatedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_.Add(value); - return this; - } - public Builder AddRangeRepeatedBytes(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBytes_.Add(values); - return this; - } - public Builder ClearRepeatedBytes() { - PrepareBuilder(); - result.repeatedBytes_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedMessageList { - get { return PrepareBuilder().repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return result.RepeatedNestedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return result.GetRepeatedNestedMessage(index); - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = value; - return this; - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(value); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedNestedMessage() { - PrepareBuilder(); - result.repeatedNestedMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignMessageList { - get { return PrepareBuilder().repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return result.RepeatedForeignMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return result.GetRepeatedForeignMessage(index); - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = value; - return this; - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(value); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignMessage_.Add(values); - return this; - } - public Builder ClearRepeatedForeignMessage() { - PrepareBuilder(); - result.repeatedForeignMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedProto2MessageList { - get { return PrepareBuilder().repeatedProto2Message_; } - } - public int RepeatedProto2MessageCount { - get { return result.RepeatedProto2MessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) { - return result.GetRepeatedProto2Message(index); - } - public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedProto2Message_[index] = value; - return this; - } - public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedProto2Message_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedProto2Message_.Add(value); - return this; - } - public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedProto2Message_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedProto2Message(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedProto2Message_.Add(values); - return this; - } - public Builder ClearRepeatedProto2Message() { - PrepareBuilder(); - result.repeatedProto2Message_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedEnumList { - get { return PrepareBuilder().repeatedNestedEnum_; } - } - public int RepeatedNestedEnumCount { - get { return result.RepeatedNestedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return result.GetRepeatedNestedEnum(index); - } - public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_[index] = value; - return this; - } - public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(values); - return this; - } - public Builder ClearRepeatedNestedEnum() { - PrepareBuilder(); - result.repeatedNestedEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignEnumList { - get { return PrepareBuilder().repeatedForeignEnum_; } - } - public int RepeatedForeignEnumCount { - get { return result.RepeatedForeignEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return result.GetRepeatedForeignEnum(index); - } - public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_[index] = value; - return this; - } - public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(values); - return this; - } - public Builder ClearRepeatedForeignEnum() { - PrepareBuilder(); - result.repeatedForeignEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceList { - get { return PrepareBuilder().repeatedStringPiece_; } - } - public int RepeatedStringPieceCount { - get { return result.RepeatedStringPieceCount; } - } - public string GetRepeatedStringPiece(int index) { - return result.GetRepeatedStringPiece(index); - } - public Builder SetRepeatedStringPiece(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_[index] = value; - return this; - } - public Builder AddRepeatedStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPiece(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPiece_.Add(values); - return this; - } - public Builder ClearRepeatedStringPiece() { - PrepareBuilder(); - result.repeatedStringPiece_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordList { - get { return PrepareBuilder().repeatedCord_; } - } - public int RepeatedCordCount { - get { return result.RepeatedCordCount; } - } - public string GetRepeatedCord(int index) { - return result.GetRepeatedCord(index); - } - public Builder SetRepeatedCord(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_[index] = value; - return this; - } - public Builder AddRepeatedCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_.Add(value); - return this; - } - public Builder AddRangeRepeatedCord(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCord_.Add(values); - return this; - } - public Builder ClearRepeatedCord() { - PrepareBuilder(); - result.repeatedCord_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedLazyMessageList { - get { return PrepareBuilder().repeatedLazyMessage_; } - } - public int RepeatedLazyMessageCount { - get { return result.RepeatedLazyMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) { - return result.GetRepeatedLazyMessage(index); - } - public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedLazyMessage_[index] = value; - return this; - } - public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedLazyMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedLazyMessage_.Add(value); - return this; - } - public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedLazyMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedLazyMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedLazyMessage_.Add(values); - return this; - } - public Builder ClearRepeatedLazyMessage() { - PrepareBuilder(); - result.repeatedLazyMessage_.Clear(); - return this; - } - - public bool HasOneofUint32 { - get { return result.hasOneofUint32; } - } - [global::System.CLSCompliant(false)] - public uint OneofUint32 { - get { return result.OneofUint32; } - set { SetOneofUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOneofUint32(uint value) { - PrepareBuilder(); - result.hasOneofUint32 = true; - result.oneofUint32_ = value; - return this; - } - public Builder ClearOneofUint32() { - PrepareBuilder(); - result.hasOneofUint32 = false; - result.oneofUint32_ = 0; - return this; - } - - public bool HasOneofNestedMessage { - get { return result.hasOneofNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { - get { return result.OneofNestedMessage; } - set { SetOneofNestedMessage(value); } - } - public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOneofNestedMessage = true; - result.oneofNestedMessage_ = value; - return this; - } - public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOneofNestedMessage = true; - result.oneofNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOneofNestedMessage && - result.oneofNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.oneofNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.oneofNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.oneofNestedMessage_ = value; - } - result.hasOneofNestedMessage = true; - return this; - } - public Builder ClearOneofNestedMessage() { - PrepareBuilder(); - result.hasOneofNestedMessage = false; - result.oneofNestedMessage_ = null; - return this; - } - - public bool HasOneofString { - get { return result.hasOneofString; } - } - public string OneofString { - get { return result.OneofString; } - set { SetOneofString(value); } - } - public Builder SetOneofString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOneofString = true; - result.oneofString_ = value; - return this; - } - public Builder ClearOneofString() { - PrepareBuilder(); - result.hasOneofString = false; - result.oneofString_ = ""; - return this; - } - - public bool HasOneofEnum { - get { return result.hasOneofEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OneofEnum { - get { return result.OneofEnum; } - set { SetOneofEnum(value); } - } - public Builder SetOneofEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasOneofEnum = true; - result.oneofEnum_ = value; - return this; - } - public Builder ClearOneofEnum() { - PrepareBuilder(); - result.hasOneofEnum = false; - result.oneofEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - } - static TestAllTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestProto2Required : pb::GeneratedMessage { - private TestProto2Required() { } - private static readonly TestProto2Required defaultInstance = new TestProto2Required().MakeReadOnly(); - private static readonly string[] _testProto2RequiredFieldNames = new string[] { "proto2" }; - private static readonly uint[] _testProto2RequiredFieldTags = new uint[] { 10 }; - public static TestProto2Required DefaultInstance { - get { return defaultInstance; } - } - - public override TestProto2Required DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestProto2Required ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable; } - } - - public const int Proto2FieldNumber = 1; - private bool hasProto2; - private global::Google.ProtocolBuffers.TestProtos.TestRequired proto2_; - public bool HasProto2 { - get { return hasProto2; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 { - get { return proto2_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasProto2) { - if (!Proto2.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testProto2RequiredFieldNames; - if (hasProto2) { - output.WriteMessage(1, field_names[0], Proto2); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasProto2) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Proto2); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestProto2Required ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestProto2Required ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestProto2Required ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestProto2Required ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestProto2Required ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestProto2Required ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestProto2Required ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestProto2Required ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestProto2Required MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestProto2Required prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestProto2Required cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestProto2Required result; - - private TestProto2Required PrepareBuilder() { - if (resultIsReadOnly) { - TestProto2Required original = result; - result = new TestProto2Required(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestProto2Required MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestProto2Required.Descriptor; } - } - - public override TestProto2Required DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestProto2Required.DefaultInstance; } - } - - public override TestProto2Required BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestProto2Required) { - return MergeFrom((TestProto2Required) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestProto2Required other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestProto2Required.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasProto2) { - MergeProto2(other.Proto2); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testProto2RequiredFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testProto2RequiredFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(); - if (result.hasProto2) { - subBuilder.MergeFrom(Proto2); - } - input.ReadMessage(subBuilder, extensionRegistry); - Proto2 = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasProto2 { - get { return result.hasProto2; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 { - get { return result.Proto2; } - set { SetProto2(value); } - } - public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasProto2 = true; - result.proto2_ = value; - return this; - } - public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasProto2 = true; - result.proto2_ = builderForValue.Build(); - return this; - } - public Builder MergeProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasProto2 && - result.proto2_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) { - result.proto2_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.proto2_).MergeFrom(value).BuildPartial(); - } else { - result.proto2_ = value; - } - result.hasProto2 = true; - return this; - } - public Builder ClearProto2() { - PrepareBuilder(); - result.hasProto2 = false; - result.proto2_ = null; - return this; - } - } - static TestProto2Required() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ForeignMessage : pb::GeneratedMessage { - private ForeignMessage() { } - private static readonly ForeignMessage defaultInstance = new ForeignMessage().MakeReadOnly(); - private static readonly string[] _foreignMessageFieldNames = new string[] { "c" }; - private static readonly uint[] _foreignMessageFieldTags = new uint[] { 8 }; - public static ForeignMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ForeignMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable; } - } - - public const int CFieldNumber = 1; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _foreignMessageFieldNames; - if (hasC) { - output.WriteInt32(1, field_names[0], C); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(1, C); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ForeignMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ForeignMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ForeignMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ForeignMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ForeignMessage result; - - private ForeignMessage PrepareBuilder() { - if (resultIsReadOnly) { - ForeignMessage original = result; - result = new ForeignMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ForeignMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Descriptor; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public override ForeignMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ForeignMessage) { - return MergeFrom((ForeignMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ForeignMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasC) { - C = other.C; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_foreignMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _foreignMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static ForeignMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestNoFieldPresence.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum.cs deleted file mode 100644 index c0f4995e..00000000 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum.cs +++ /dev/null @@ -1,1320 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/unittest_preserve_unknown_enum.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnittestPreserveUnknownEnum { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnittestPreserveUnknownEnum() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjRnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJlc2VydmVfdW5rbm93bl9l", - "bnVtLnByb3RvEiVwcm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0", - "ZXN0IsEDCglNeU1lc3NhZ2USOAoBZRgBIAEoDjItLnByb3RvM19wcmVzZXJ2", - "ZV91bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtEkEKCnJlcGVhdGVkX2UY", - "AiADKA4yLS5wcm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0", - "Lk15RW51bRJMChFyZXBlYXRlZF9wYWNrZWRfZRgDIAMoDjItLnByb3RvM19w", - "cmVzZXJ2ZV91bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtQgIQARJcChxy", - "ZXBlYXRlZF9wYWNrZWRfdW5leHBlY3RlZF9lGAQgAygOMjYucHJvdG8zX3By", - "ZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVzdC5NeUVudW1QbHVzRXh0cmES", - "QgoJb25lb2ZfZV8xGAUgASgOMi0ucHJvdG8zX3ByZXNlcnZlX3Vua25vd25f", - "ZW51bV91bml0dGVzdC5NeUVudW1IABJCCglvbmVvZl9lXzIYBiABKA4yLS5w", - "cm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bUgA", - "QgMKAW8i+wMKEk15TWVzc2FnZVBsdXNFeHRyYRJBCgFlGAEgASgOMjYucHJv", - "dG8zX3ByZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVzdC5NeUVudW1QbHVz", - "RXh0cmESSgoKcmVwZWF0ZWRfZRgCIAMoDjI2LnByb3RvM19wcmVzZXJ2ZV91", - "bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtUGx1c0V4dHJhElUKEXJlcGVh", - "dGVkX3BhY2tlZF9lGAMgAygOMjYucHJvdG8zX3ByZXNlcnZlX3Vua25vd25f", - "ZW51bV91bml0dGVzdC5NeUVudW1QbHVzRXh0cmFCAhABEmAKHHJlcGVhdGVk", - "X3BhY2tlZF91bmV4cGVjdGVkX2UYBCADKA4yNi5wcm90bzNfcHJlc2VydmVf", - "dW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bVBsdXNFeHRyYUICEAESSwoJ", - "b25lb2ZfZV8xGAUgASgOMjYucHJvdG8zX3ByZXNlcnZlX3Vua25vd25fZW51", - "bV91bml0dGVzdC5NeUVudW1QbHVzRXh0cmFIABJLCglvbmVvZl9lXzIYBiAB", - "KA4yNi5wcm90bzNfcHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15", - "RW51bVBsdXNFeHRyYUgAQgMKAW8qIwoGTXlFbnVtEgcKA0ZPTxAAEgcKA0JB", - "UhABEgcKA0JBWhACKj8KD015RW51bVBsdXNFeHRyYRIJCgVFX0ZPTxAAEgkK", - "BUVfQkFSEAESCQoFRV9CQVoQAhILCgdFX0VYVFJBEANCJKoCIUdvb2dsZS5Q", - "cm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvc2IGcHJvdG8z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor, - new string[] { "E", "RepeatedE", "RepeatedPackedE", "RepeatedPackedUnexpectedE", "OneofE1", "OneofE2", }); - internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor = Descriptor.MessageTypes[1]; - internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor, - new string[] { "E", "RepeatedE", "RepeatedPackedE", "RepeatedPackedUnexpectedE", "OneofE1", "OneofE2", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Enums - public enum MyEnum { - FOO = 0, - BAR = 1, - BAZ = 2, - } - - public enum MyEnumPlusExtra { - E_FOO = 0, - E_BAR = 1, - E_BAZ = 2, - E_EXTRA = 3, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MyMessage : pb::GeneratedMessage { - private MyMessage() { } - private static readonly MyMessage defaultInstance = new MyMessage().MakeReadOnly(); - private static readonly string[] _myMessageFieldNames = new string[] { "e", "oneof_e_1", "oneof_e_2", "repeated_e", "repeated_packed_e", "repeated_packed_unexpected_e" }; - private static readonly uint[] _myMessageFieldTags = new uint[] { 8, 40, 48, 16, 26, 32 }; - public static MyMessage DefaultInstance { - get { return defaultInstance; } - } - - public override MyMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MyMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; } - } - - public const int EFieldNumber = 1; - private bool hasE; - private global::Google.ProtocolBuffers.TestProtos.MyEnum e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - public bool HasE { - get { return hasE; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum E { - get { return e_; } - } - - public const int RepeatedEFieldNumber = 2; - private pbc::PopsicleList repeatedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedEList { - get { return pbc::Lists.AsReadOnly(repeatedE_); } - } - public int RepeatedECount { - get { return repeatedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { - return repeatedE_[index]; - } - - public const int RepeatedPackedEFieldNumber = 3; - private int repeatedPackedEMemoizedSerializedSize; - private pbc::PopsicleList repeatedPackedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedPackedEList { - get { return pbc::Lists.AsReadOnly(repeatedPackedE_); } - } - public int RepeatedPackedECount { - get { return repeatedPackedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { - return repeatedPackedE_[index]; - } - - public const int RepeatedPackedUnexpectedEFieldNumber = 4; - private pbc::PopsicleList repeatedPackedUnexpectedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedPackedUnexpectedEList { - get { return pbc::Lists.AsReadOnly(repeatedPackedUnexpectedE_); } - } - public int RepeatedPackedUnexpectedECount { - get { return repeatedPackedUnexpectedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { - return repeatedPackedUnexpectedE_[index]; - } - - public const int OneofE1FieldNumber = 5; - private bool hasOneofE1; - private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - public bool HasOneofE1 { - get { return hasOneofE1; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { - get { return oneofE1_; } - } - - public const int OneofE2FieldNumber = 6; - private bool hasOneofE2; - private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - public bool HasOneofE2 { - get { return hasOneofE2; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { - get { return oneofE2_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _myMessageFieldNames; - if (hasE) { - output.WriteEnum(1, field_names[0], (int) E, E); - } - if (repeatedE_.Count > 0) { - output.WriteEnumArray(2, field_names[3], repeatedE_); - } - if (repeatedPackedE_.Count > 0) { - output.WritePackedEnumArray(3, field_names[4], repeatedPackedEMemoizedSerializedSize, repeatedPackedE_); - } - if (repeatedPackedUnexpectedE_.Count > 0) { - output.WriteEnumArray(4, field_names[5], repeatedPackedUnexpectedE_); - } - if (hasOneofE1) { - output.WriteEnum(5, field_names[1], (int) OneofE1, OneofE1); - } - if (hasOneofE2) { - output.WriteEnum(6, field_names[2], (int) OneofE2, OneofE2); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasE) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) E); - } - { - int dataSize = 0; - if (repeatedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedE_.Count; - } - } - { - int dataSize = 0; - if (repeatedPackedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedPackedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - repeatedPackedEMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - if (repeatedPackedUnexpectedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedPackedUnexpectedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedPackedUnexpectedE_.Count; - } - } - if (hasOneofE1) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) OneofE1); - } - if (hasOneofE2) { - size += pb::CodedOutputStream.ComputeEnumSize(6, (int) OneofE2); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MyMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MyMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MyMessage MakeReadOnly() { - repeatedE_.MakeReadOnly(); - repeatedPackedE_.MakeReadOnly(); - repeatedPackedUnexpectedE_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MyMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MyMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MyMessage result; - - private MyMessage PrepareBuilder() { - if (resultIsReadOnly) { - MyMessage original = result; - result = new MyMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MyMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.Descriptor; } - } - - public override MyMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance; } - } - - public override MyMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MyMessage) { - return MergeFrom((MyMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MyMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasE) { - E = other.E; - } - if (other.repeatedE_.Count != 0) { - result.repeatedE_.Add(other.repeatedE_); - } - if (other.repeatedPackedE_.Count != 0) { - result.repeatedPackedE_.Add(other.repeatedPackedE_); - } - if (other.repeatedPackedUnexpectedE_.Count != 0) { - result.repeatedPackedUnexpectedE_.Add(other.repeatedPackedUnexpectedE_); - } - if (other.HasOneofE1) { - OneofE1 = other.OneofE1; - } - if (other.HasOneofE2) { - OneofE2 = other.OneofE2; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_myMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _myMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.e_, out unknown)) { - result.hasE = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 18: - case 16: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(2, (ulong)(int)rawValue); - } - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedPackedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - case 34: - case 32: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedPackedUnexpectedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(4, (ulong)(int)rawValue); - } - break; - } - case 40: { - object unknown; - if(input.ReadEnum(ref result.oneofE1_, out unknown)) { - result.hasOneofE1 = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong)(int)unknown); - } - break; - } - case 48: { - object unknown; - if(input.ReadEnum(ref result.oneofE2_, out unknown)) { - result.hasOneofE2 = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(6, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasE { - get { return result.hasE; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum E { - get { return result.E; } - set { SetE(value); } - } - public Builder SetE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.hasE = true; - result.e_ = value; - return this; - } - public Builder ClearE() { - PrepareBuilder(); - result.hasE = false; - result.e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - return this; - } - - public pbc::IPopsicleList RepeatedEList { - get { return PrepareBuilder().repeatedE_; } - } - public int RepeatedECount { - get { return result.RepeatedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { - return result.GetRepeatedE(index); - } - public Builder SetRepeatedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedE_[index] = value; - return this; - } - public Builder AddRepeatedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedE_.Add(values); - return this; - } - public Builder ClearRepeatedE() { - PrepareBuilder(); - result.repeatedE_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedPackedEList { - get { return PrepareBuilder().repeatedPackedE_; } - } - public int RepeatedPackedECount { - get { return result.RepeatedPackedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { - return result.GetRepeatedPackedE(index); - } - public Builder SetRepeatedPackedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedPackedE_[index] = value; - return this; - } - public Builder AddRepeatedPackedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedPackedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedPackedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPackedE_.Add(values); - return this; - } - public Builder ClearRepeatedPackedE() { - PrepareBuilder(); - result.repeatedPackedE_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedPackedUnexpectedEList { - get { return PrepareBuilder().repeatedPackedUnexpectedE_; } - } - public int RepeatedPackedUnexpectedECount { - get { return result.RepeatedPackedUnexpectedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { - return result.GetRepeatedPackedUnexpectedE(index); - } - public Builder SetRepeatedPackedUnexpectedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_[index] = value; - return this; - } - public Builder AddRepeatedPackedUnexpectedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedPackedUnexpectedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Add(values); - return this; - } - public Builder ClearRepeatedPackedUnexpectedE() { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Clear(); - return this; - } - - public bool HasOneofE1 { - get { return result.hasOneofE1; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { - get { return result.OneofE1; } - set { SetOneofE1(value); } - } - public Builder SetOneofE1(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.hasOneofE1 = true; - result.oneofE1_ = value; - return this; - } - public Builder ClearOneofE1() { - PrepareBuilder(); - result.hasOneofE1 = false; - result.oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - return this; - } - - public bool HasOneofE2 { - get { return result.hasOneofE2; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { - get { return result.OneofE2; } - set { SetOneofE2(value); } - } - public Builder SetOneofE2(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.hasOneofE2 = true; - result.oneofE2_ = value; - return this; - } - public Builder ClearOneofE2() { - PrepareBuilder(); - result.hasOneofE2 = false; - result.oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - return this; - } - } - static MyMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MyMessagePlusExtra : pb::GeneratedMessage { - private MyMessagePlusExtra() { } - private static readonly MyMessagePlusExtra defaultInstance = new MyMessagePlusExtra().MakeReadOnly(); - private static readonly string[] _myMessagePlusExtraFieldNames = new string[] { "e", "oneof_e_1", "oneof_e_2", "repeated_e", "repeated_packed_e", "repeated_packed_unexpected_e" }; - private static readonly uint[] _myMessagePlusExtraFieldTags = new uint[] { 8, 40, 48, 16, 26, 34 }; - public static MyMessagePlusExtra DefaultInstance { - get { return defaultInstance; } - } - - public override MyMessagePlusExtra DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MyMessagePlusExtra ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.internal__static_proto3_preserve_unknown_enum_unittest_MyMessagePlusExtra__FieldAccessorTable; } - } - - public const int EFieldNumber = 1; - private bool hasE; - private global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra e_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; - public bool HasE { - get { return hasE; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra E { - get { return e_; } - } - - public const int RepeatedEFieldNumber = 2; - private pbc::PopsicleList repeatedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedEList { - get { return pbc::Lists.AsReadOnly(repeatedE_); } - } - public int RepeatedECount { - get { return repeatedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedE(int index) { - return repeatedE_[index]; - } - - public const int RepeatedPackedEFieldNumber = 3; - private int repeatedPackedEMemoizedSerializedSize; - private pbc::PopsicleList repeatedPackedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedPackedEList { - get { return pbc::Lists.AsReadOnly(repeatedPackedE_); } - } - public int RepeatedPackedECount { - get { return repeatedPackedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedE(int index) { - return repeatedPackedE_[index]; - } - - public const int RepeatedPackedUnexpectedEFieldNumber = 4; - private int repeatedPackedUnexpectedEMemoizedSerializedSize; - private pbc::PopsicleList repeatedPackedUnexpectedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedPackedUnexpectedEList { - get { return pbc::Lists.AsReadOnly(repeatedPackedUnexpectedE_); } - } - public int RepeatedPackedUnexpectedECount { - get { return repeatedPackedUnexpectedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { - return repeatedPackedUnexpectedE_[index]; - } - - public const int OneofE1FieldNumber = 5; - private bool hasOneofE1; - private global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; - public bool HasOneofE1 { - get { return hasOneofE1; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE1 { - get { return oneofE1_; } - } - - public const int OneofE2FieldNumber = 6; - private bool hasOneofE2; - private global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; - public bool HasOneofE2 { - get { return hasOneofE2; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE2 { - get { return oneofE2_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _myMessagePlusExtraFieldNames; - if (hasE) { - output.WriteEnum(1, field_names[0], (int) E, E); - } - if (repeatedE_.Count > 0) { - output.WriteEnumArray(2, field_names[3], repeatedE_); - } - if (repeatedPackedE_.Count > 0) { - output.WritePackedEnumArray(3, field_names[4], repeatedPackedEMemoizedSerializedSize, repeatedPackedE_); - } - if (repeatedPackedUnexpectedE_.Count > 0) { - output.WritePackedEnumArray(4, field_names[5], repeatedPackedUnexpectedEMemoizedSerializedSize, repeatedPackedUnexpectedE_); - } - if (hasOneofE1) { - output.WriteEnum(5, field_names[1], (int) OneofE1, OneofE1); - } - if (hasOneofE2) { - output.WriteEnum(6, field_names[2], (int) OneofE2, OneofE2); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasE) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) E); - } - { - int dataSize = 0; - if (repeatedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedE_.Count; - } - } - { - int dataSize = 0; - if (repeatedPackedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedPackedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - repeatedPackedEMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - if (repeatedPackedUnexpectedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra element in repeatedPackedUnexpectedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - repeatedPackedUnexpectedEMemoizedSerializedSize = dataSize; - } - if (hasOneofE1) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) OneofE1); - } - if (hasOneofE2) { - size += pb::CodedOutputStream.ComputeEnumSize(6, (int) OneofE2); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MyMessagePlusExtra ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessagePlusExtra ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessagePlusExtra ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessagePlusExtra ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessagePlusExtra ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessagePlusExtra ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MyMessagePlusExtra ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MyMessagePlusExtra ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MyMessagePlusExtra ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessagePlusExtra ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MyMessagePlusExtra MakeReadOnly() { - repeatedE_.MakeReadOnly(); - repeatedPackedE_.MakeReadOnly(); - repeatedPackedUnexpectedE_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MyMessagePlusExtra prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MyMessagePlusExtra cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MyMessagePlusExtra result; - - private MyMessagePlusExtra PrepareBuilder() { - if (resultIsReadOnly) { - MyMessagePlusExtra original = result; - result = new MyMessagePlusExtra(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MyMessagePlusExtra MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.Descriptor; } - } - - public override MyMessagePlusExtra DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.DefaultInstance; } - } - - public override MyMessagePlusExtra BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MyMessagePlusExtra) { - return MergeFrom((MyMessagePlusExtra) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MyMessagePlusExtra other) { - if (other == global::Google.ProtocolBuffers.TestProtos.MyMessagePlusExtra.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasE) { - E = other.E; - } - if (other.repeatedE_.Count != 0) { - result.repeatedE_.Add(other.repeatedE_); - } - if (other.repeatedPackedE_.Count != 0) { - result.repeatedPackedE_.Add(other.repeatedPackedE_); - } - if (other.repeatedPackedUnexpectedE_.Count != 0) { - result.repeatedPackedUnexpectedE_.Add(other.repeatedPackedUnexpectedE_); - } - if (other.HasOneofE1) { - OneofE1 = other.OneofE1; - } - if (other.HasOneofE2) { - OneofE2 = other.OneofE2; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_myMessagePlusExtraFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _myMessagePlusExtraFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.e_, out unknown)) { - result.hasE = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 18: - case 16: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(2, (ulong)(int)rawValue); - } - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedPackedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - case 34: - case 32: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedPackedUnexpectedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(4, (ulong)(int)rawValue); - } - break; - } - case 40: { - object unknown; - if(input.ReadEnum(ref result.oneofE1_, out unknown)) { - result.hasOneofE1 = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong)(int)unknown); - } - break; - } - case 48: { - object unknown; - if(input.ReadEnum(ref result.oneofE2_, out unknown)) { - result.hasOneofE2 = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(6, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasE { - get { return result.hasE; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra E { - get { return result.E; } - set { SetE(value); } - } - public Builder SetE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.hasE = true; - result.e_ = value; - return this; - } - public Builder ClearE() { - PrepareBuilder(); - result.hasE = false; - result.e_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; - return this; - } - - public pbc::IPopsicleList RepeatedEList { - get { return PrepareBuilder().repeatedE_; } - } - public int RepeatedECount { - get { return result.RepeatedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedE(int index) { - return result.GetRepeatedE(index); - } - public Builder SetRepeatedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedE_[index] = value; - return this; - } - public Builder AddRepeatedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedE_.Add(values); - return this; - } - public Builder ClearRepeatedE() { - PrepareBuilder(); - result.repeatedE_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedPackedEList { - get { return PrepareBuilder().repeatedPackedE_; } - } - public int RepeatedPackedECount { - get { return result.RepeatedPackedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedE(int index) { - return result.GetRepeatedPackedE(index); - } - public Builder SetRepeatedPackedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedPackedE_[index] = value; - return this; - } - public Builder AddRepeatedPackedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedPackedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedPackedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPackedE_.Add(values); - return this; - } - public Builder ClearRepeatedPackedE() { - PrepareBuilder(); - result.repeatedPackedE_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedPackedUnexpectedEList { - get { return PrepareBuilder().repeatedPackedUnexpectedE_; } - } - public int RepeatedPackedUnexpectedECount { - get { return result.RepeatedPackedUnexpectedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra GetRepeatedPackedUnexpectedE(int index) { - return result.GetRepeatedPackedUnexpectedE(index); - } - public Builder SetRepeatedPackedUnexpectedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_[index] = value; - return this; - } - public Builder AddRepeatedPackedUnexpectedE(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedPackedUnexpectedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Add(values); - return this; - } - public Builder ClearRepeatedPackedUnexpectedE() { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Clear(); - return this; - } - - public bool HasOneofE1 { - get { return result.hasOneofE1; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE1 { - get { return result.OneofE1; } - set { SetOneofE1(value); } - } - public Builder SetOneofE1(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.hasOneofE1 = true; - result.oneofE1_ = value; - return this; - } - public Builder ClearOneofE1() { - PrepareBuilder(); - result.hasOneofE1 = false; - result.oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; - return this; - } - - public bool HasOneofE2 { - get { return result.hasOneofE2; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra OneofE2 { - get { return result.OneofE2; } - set { SetOneofE2(value); } - } - public Builder SetOneofE2(global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra value) { - PrepareBuilder(); - result.hasOneofE2 = true; - result.oneofE2_ = value; - return this; - } - public Builder ClearOneofE2() { - PrepareBuilder(); - result.hasOneofE2 = false; - result.oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnumPlusExtra.E_FOO; - return this; - } - } - static MyMessagePlusExtra() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum2.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum2.cs deleted file mode 100644 index b7ab97d9..00000000 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestPreserveUnknownEnum2.cs +++ /dev/null @@ -1,684 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/unittest_preserve_unknown_enum2.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnittestPreserveUnknownEnum2 { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnittestPreserveUnknownEnum2() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJlc2VydmVfdW5rbm93bl9l", - "bnVtMi5wcm90bxIlcHJvdG8yX3ByZXNlcnZlX3Vua25vd25fZW51bV91bml0", - "dGVzdCK4AwoJTXlNZXNzYWdlEjgKAWUYASABKA4yLS5wcm90bzJfcHJlc2Vy", - "dmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bRJBCgpyZXBlYXRlZF9l", - "GAIgAygOMi0ucHJvdG8yX3ByZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVz", - "dC5NeUVudW0STAoRcmVwZWF0ZWRfcGFja2VkX2UYAyADKA4yLS5wcm90bzJf", - "cHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bUICEAESUwoc", - "cmVwZWF0ZWRfcGFja2VkX3VuZXhwZWN0ZWRfZRgEIAMoDjItLnByb3RvMl9w", - "cmVzZXJ2ZV91bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtEkIKCW9uZW9m", - "X2VfMRgFIAEoDjItLnByb3RvMl9wcmVzZXJ2ZV91bmtub3duX2VudW1fdW5p", - "dHRlc3QuTXlFbnVtSAASQgoJb25lb2ZfZV8yGAYgASgOMi0ucHJvdG8yX3By", - "ZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVzdC5NeUVudW1IAEIDCgFvKiMK", - "Bk15RW51bRIHCgNGT08QABIHCgNCQVIQARIHCgNCQVoQAkIkqgIhR29vZ2xl", - "LlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor, - new string[] { "E", "RepeatedE", "RepeatedPackedE", "RepeatedPackedUnexpectedE", "OneofE1", "OneofE2", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Enums - public enum MyEnum { - FOO = 0, - BAR = 1, - BAZ = 2, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MyMessage : pb::GeneratedMessage { - private MyMessage() { } - private static readonly MyMessage defaultInstance = new MyMessage().MakeReadOnly(); - private static readonly string[] _myMessageFieldNames = new string[] { "e", "oneof_e_1", "oneof_e_2", "repeated_e", "repeated_packed_e", "repeated_packed_unexpected_e" }; - private static readonly uint[] _myMessageFieldTags = new uint[] { 8, 40, 48, 16, 26, 32 }; - public static MyMessage DefaultInstance { - get { return defaultInstance; } - } - - public override MyMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MyMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum2.internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum2.internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; } - } - - public const int EFieldNumber = 1; - private bool hasE; - private global::Google.ProtocolBuffers.TestProtos.MyEnum e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - public bool HasE { - get { return hasE; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum E { - get { return e_; } - } - - public const int RepeatedEFieldNumber = 2; - private pbc::PopsicleList repeatedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedEList { - get { return pbc::Lists.AsReadOnly(repeatedE_); } - } - public int RepeatedECount { - get { return repeatedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { - return repeatedE_[index]; - } - - public const int RepeatedPackedEFieldNumber = 3; - private int repeatedPackedEMemoizedSerializedSize; - private pbc::PopsicleList repeatedPackedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedPackedEList { - get { return pbc::Lists.AsReadOnly(repeatedPackedE_); } - } - public int RepeatedPackedECount { - get { return repeatedPackedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { - return repeatedPackedE_[index]; - } - - public const int RepeatedPackedUnexpectedEFieldNumber = 4; - private pbc::PopsicleList repeatedPackedUnexpectedE_ = new pbc::PopsicleList(); - public scg::IList RepeatedPackedUnexpectedEList { - get { return pbc::Lists.AsReadOnly(repeatedPackedUnexpectedE_); } - } - public int RepeatedPackedUnexpectedECount { - get { return repeatedPackedUnexpectedE_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedUnexpectedE(int index) { - return repeatedPackedUnexpectedE_[index]; - } - - public const int OneofE1FieldNumber = 5; - private bool hasOneofE1; - private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - public bool HasOneofE1 { - get { return hasOneofE1; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { - get { return oneofE1_; } - } - - public const int OneofE2FieldNumber = 6; - private bool hasOneofE2; - private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - public bool HasOneofE2 { - get { return hasOneofE2; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { - get { return oneofE2_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _myMessageFieldNames; - if (hasE) { - output.WriteEnum(1, field_names[0], (int) E, E); - } - if (repeatedE_.Count > 0) { - output.WriteEnumArray(2, field_names[3], repeatedE_); - } - if (repeatedPackedE_.Count > 0) { - output.WritePackedEnumArray(3, field_names[4], repeatedPackedEMemoizedSerializedSize, repeatedPackedE_); - } - if (repeatedPackedUnexpectedE_.Count > 0) { - output.WriteEnumArray(4, field_names[5], repeatedPackedUnexpectedE_); - } - if (hasOneofE1) { - output.WriteEnum(5, field_names[1], (int) OneofE1, OneofE1); - } - if (hasOneofE2) { - output.WriteEnum(6, field_names[2], (int) OneofE2, OneofE2); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasE) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) E); - } - { - int dataSize = 0; - if (repeatedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedE_.Count; - } - } - { - int dataSize = 0; - if (repeatedPackedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedPackedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - repeatedPackedEMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - if (repeatedPackedUnexpectedE_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedPackedUnexpectedE_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedPackedUnexpectedE_.Count; - } - } - if (hasOneofE1) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) OneofE1); - } - if (hasOneofE2) { - size += pb::CodedOutputStream.ComputeEnumSize(6, (int) OneofE2); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MyMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MyMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MyMessage MakeReadOnly() { - repeatedE_.MakeReadOnly(); - repeatedPackedE_.MakeReadOnly(); - repeatedPackedUnexpectedE_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MyMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MyMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MyMessage result; - - private MyMessage PrepareBuilder() { - if (resultIsReadOnly) { - MyMessage original = result; - result = new MyMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MyMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.Descriptor; } - } - - public override MyMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance; } - } - - public override MyMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MyMessage) { - return MergeFrom((MyMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MyMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasE) { - E = other.E; - } - if (other.repeatedE_.Count != 0) { - result.repeatedE_.Add(other.repeatedE_); - } - if (other.repeatedPackedE_.Count != 0) { - result.repeatedPackedE_.Add(other.repeatedPackedE_); - } - if (other.repeatedPackedUnexpectedE_.Count != 0) { - result.repeatedPackedUnexpectedE_.Add(other.repeatedPackedUnexpectedE_); - } - if (other.HasOneofE1) { - OneofE1 = other.OneofE1; - } - if (other.HasOneofE2) { - OneofE2 = other.OneofE2; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_myMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _myMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.e_, out unknown)) { - result.hasE = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 18: - case 16: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(2, (ulong)(int)rawValue); - } - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedPackedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - case 34: - case 32: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedPackedUnexpectedE_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(4, (ulong)(int)rawValue); - } - break; - } - case 40: { - object unknown; - if(input.ReadEnum(ref result.oneofE1_, out unknown)) { - result.hasOneofE1 = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong)(int)unknown); - } - break; - } - case 48: { - object unknown; - if(input.ReadEnum(ref result.oneofE2_, out unknown)) { - result.hasOneofE2 = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(6, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasE { - get { return result.hasE; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum E { - get { return result.E; } - set { SetE(value); } - } - public Builder SetE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.hasE = true; - result.e_ = value; - return this; - } - public Builder ClearE() { - PrepareBuilder(); - result.hasE = false; - result.e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - return this; - } - - public pbc::IPopsicleList RepeatedEList { - get { return PrepareBuilder().repeatedE_; } - } - public int RepeatedECount { - get { return result.RepeatedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { - return result.GetRepeatedE(index); - } - public Builder SetRepeatedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedE_[index] = value; - return this; - } - public Builder AddRepeatedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedE_.Add(values); - return this; - } - public Builder ClearRepeatedE() { - PrepareBuilder(); - result.repeatedE_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedPackedEList { - get { return PrepareBuilder().repeatedPackedE_; } - } - public int RepeatedPackedECount { - get { return result.RepeatedPackedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { - return result.GetRepeatedPackedE(index); - } - public Builder SetRepeatedPackedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedPackedE_[index] = value; - return this; - } - public Builder AddRepeatedPackedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedPackedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedPackedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPackedE_.Add(values); - return this; - } - public Builder ClearRepeatedPackedE() { - PrepareBuilder(); - result.repeatedPackedE_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedPackedUnexpectedEList { - get { return PrepareBuilder().repeatedPackedUnexpectedE_; } - } - public int RepeatedPackedUnexpectedECount { - get { return result.RepeatedPackedUnexpectedECount; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedUnexpectedE(int index) { - return result.GetRepeatedPackedUnexpectedE(index); - } - public Builder SetRepeatedPackedUnexpectedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_[index] = value; - return this; - } - public Builder AddRepeatedPackedUnexpectedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Add(value); - return this; - } - public Builder AddRangeRepeatedPackedUnexpectedE(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Add(values); - return this; - } - public Builder ClearRepeatedPackedUnexpectedE() { - PrepareBuilder(); - result.repeatedPackedUnexpectedE_.Clear(); - return this; - } - - public bool HasOneofE1 { - get { return result.hasOneofE1; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { - get { return result.OneofE1; } - set { SetOneofE1(value); } - } - public Builder SetOneofE1(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.hasOneofE1 = true; - result.oneofE1_ = value; - return this; - } - public Builder ClearOneofE1() { - PrepareBuilder(); - result.hasOneofE1 = false; - result.oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - return this; - } - - public bool HasOneofE2 { - get { return result.hasOneofE2; } - } - public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { - get { return result.OneofE2; } - set { SetOneofE2(value); } - } - public Builder SetOneofE2(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { - PrepareBuilder(); - result.hasOneofE2 = true; - result.oneofE2_ = value; - return this; - } - public Builder ClearOneofE2() { - PrepareBuilder(); - result.hasOneofE2 = false; - result.oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; - return this; - } - } - static MyMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum2.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasXmltest.cs b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasXmltest.cs deleted file mode 100644 index 70bdbfa9..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasXmltest.cs +++ /dev/null @@ -1,2277 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: unittest_extras_xmltest.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnittestExtrasXmltest { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionEnum); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionText); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionNumber); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionMessage); - } - #endregion - #region Extensions - public const int ExtensionEnumFieldNumber = 101; - public static pb::GeneratedExtensionBase ExtensionEnum; - public const int ExtensionTextFieldNumber = 102; - public static pb::GeneratedExtensionBase ExtensionText; - public const int ExtensionNumberFieldNumber = 103; - public static pb::GeneratedExtensionBase> ExtensionNumber; - public const int ExtensionMessageFieldNumber = 199; - public static pb::GeneratedExtensionBase ExtensionMessage; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlRescursive__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnittestExtrasXmltest() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch11bml0dGVzdF9leHRyYXNfeG1sdGVzdC5wcm90bxIXcHJvdG9idWZfdW5p", - "dHRlc3RfZXh0cmEiVQoMVGVzdFhtbENoaWxkEjUKB29wdGlvbnMYAyADKA4y", - "JC5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5FbnVtT3B0aW9ucxIOCgZiaW5h", - "cnkYBCABKAwiEQoPVGVzdFhtbE5vRmllbGRzIk4KEVRlc3RYbWxSZXNjdXJz", - "aXZlEjkKBWNoaWxkGAEgASgLMioucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEu", - "VGVzdFhtbFJlc2N1cnNpdmUitwIKDlRlc3RYbWxNZXNzYWdlEg4KBm51bWJl", - "chgGIAEoAxIPCgdudW1iZXJzGAIgAygFEgwKBHRleHQYAyABKAkSEgoJdGV4", - "dGxpbmVzGLwFIAMoCRINCgV2YWxpZBgFIAEoCBI0CgVjaGlsZBgBIAEoCzIl", - "LnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRlc3RYbWxDaGlsZBJDCghjaGls", - "ZHJlbhiRAyADKAoyMC5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1s", - "TWVzc2FnZS5DaGlsZHJlbhpRCghDaGlsZHJlbhI1CgdvcHRpb25zGAMgAygO", - "MiQucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuRW51bU9wdGlvbnMSDgoGYmlu", - "YXJ5GAQgASgMKgUIZBDIASIiChBUZXN0WG1sRXh0ZW5zaW9uEg4KBm51bWJl", - "chgBIAIoBSoqCgtFbnVtT3B0aW9ucxIHCgNPTkUQABIHCgNUV08QARIJCgVU", - "SFJFRRACOmUKDmV4dGVuc2lvbl9lbnVtEicucHJvdG9idWZfdW5pdHRlc3Rf", - "ZXh0cmEuVGVzdFhtbE1lc3NhZ2UYZSABKA4yJC5wcm90b2J1Zl91bml0dGVz", - "dF9leHRyYS5FbnVtT3B0aW9uczo/Cg5leHRlbnNpb25fdGV4dBInLnByb3Rv", - "YnVmX3VuaXR0ZXN0X2V4dHJhLlRlc3RYbWxNZXNzYWdlGGYgASgJOkUKEGV4", - "dGVuc2lvbl9udW1iZXISJy5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0", - "WG1sTWVzc2FnZRhnIAMoBUICEAE6bgoRZXh0ZW5zaW9uX21lc3NhZ2USJy5w", - "cm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1sTWVzc2FnZRjHASABKAsy", - "KS5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1sRXh0ZW5zaW9uQiZI", - "AaoCIUdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor, - new string[] { "Options", "Binary", }); - internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_extra_TestXmlRescursive__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor, - new string[] { "Child", }); - internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor, - new string[] { "Number", "Numbers", "Text", "Textlines", "Valid", "Child", "Children", }); - internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor = internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor, - new string[] { "Options", "Binary", }); - internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor, - new string[] { "Number", }); - global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionEnum = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionText = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionNumber = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.ExtensionMessage = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor.Extensions[3]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Enums - public enum EnumOptions { - ONE = 0, - TWO = 1, - THREE = 2, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlChild : pb::GeneratedMessage { - private TestXmlChild() { } - private static readonly TestXmlChild defaultInstance = new TestXmlChild().MakeReadOnly(); - private static readonly string[] _testXmlChildFieldNames = new string[] { "binary", "options" }; - private static readonly uint[] _testXmlChildFieldTags = new uint[] { 34, 24 }; - public static TestXmlChild DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlChild DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlChild ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable; } - } - - public const int OptionsFieldNumber = 3; - private pbc::PopsicleList options_ = new pbc::PopsicleList(); - public scg::IList OptionsList { - get { return pbc::Lists.AsReadOnly(options_); } - } - public int OptionsCount { - get { return options_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return options_[index]; - } - - public const int BinaryFieldNumber = 4; - private bool hasBinary; - private pb::ByteString binary_ = pb::ByteString.Empty; - public bool HasBinary { - get { return hasBinary; } - } - public pb::ByteString Binary { - get { return binary_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlChildFieldNames; - if (options_.Count > 0) { - output.WriteEnumArray(3, field_names[1], options_); - } - if (hasBinary) { - output.WriteBytes(4, field_names[0], Binary); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - if (options_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.EnumOptions element in options_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * options_.Count; - } - } - if (hasBinary) { - size += pb::CodedOutputStream.ComputeBytesSize(4, Binary); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlChild ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlChild ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlChild ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlChild ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlChild ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlChild ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlChild ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlChild ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlChild ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlChild ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlChild MakeReadOnly() { - options_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlChild prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlChild cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlChild result; - - private TestXmlChild PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlChild original = result; - result = new TestXmlChild(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlChild MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Descriptor; } - } - - public override TestXmlChild DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance; } - } - - public override TestXmlChild BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlChild) { - return MergeFrom((TestXmlChild) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlChild other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance) return this; - PrepareBuilder(); - if (other.options_.Count != 0) { - result.options_.Add(other.options_); - } - if (other.HasBinary) { - Binary = other.Binary; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlChildFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlChildFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.options_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - case 34: { - result.hasBinary = input.ReadBytes(ref result.binary_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList OptionsList { - get { return PrepareBuilder().options_; } - } - public int OptionsCount { - get { return result.OptionsCount; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return result.GetOptions(index); - } - public Builder SetOptions(int index, global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_[index] = value; - return this; - } - public Builder AddOptions(global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_.Add(value); - return this; - } - public Builder AddRangeOptions(scg::IEnumerable values) { - PrepareBuilder(); - result.options_.Add(values); - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.options_.Clear(); - return this; - } - - public bool HasBinary { - get { return result.hasBinary; } - } - public pb::ByteString Binary { - get { return result.Binary; } - set { SetBinary(value); } - } - public Builder SetBinary(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBinary = true; - result.binary_ = value; - return this; - } - public Builder ClearBinary() { - PrepareBuilder(); - result.hasBinary = false; - result.binary_ = pb::ByteString.Empty; - return this; - } - } - static TestXmlChild() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlNoFields : pb::GeneratedMessage { - private TestXmlNoFields() { } - private static readonly TestXmlNoFields defaultInstance = new TestXmlNoFields().MakeReadOnly(); - private static readonly string[] _testXmlNoFieldsFieldNames = new string[] { }; - private static readonly uint[] _testXmlNoFieldsFieldTags = new uint[] { }; - public static TestXmlNoFields DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlNoFields DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlNoFields ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlNoFieldsFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlNoFields ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlNoFields ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlNoFields ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlNoFields MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlNoFields prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlNoFields cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlNoFields result; - - private TestXmlNoFields PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlNoFields original = result; - result = new TestXmlNoFields(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlNoFields MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.Descriptor; } - } - - public override TestXmlNoFields DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.DefaultInstance; } - } - - public override TestXmlNoFields BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlNoFields) { - return MergeFrom((TestXmlNoFields) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlNoFields other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlNoFieldsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlNoFieldsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestXmlNoFields() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlRescursive : pb::GeneratedMessage { - private TestXmlRescursive() { } - private static readonly TestXmlRescursive defaultInstance = new TestXmlRescursive().MakeReadOnly(); - private static readonly string[] _testXmlRescursiveFieldNames = new string[] { "child" }; - private static readonly uint[] _testXmlRescursiveFieldTags = new uint[] { 10 }; - public static TestXmlRescursive DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlRescursive DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlRescursive ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlRescursive__FieldAccessorTable; } - } - - public const int ChildFieldNumber = 1; - private bool hasChild; - private global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive child_; - public bool HasChild { - get { return hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive Child { - get { return child_ ?? global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlRescursiveFieldNames; - if (hasChild) { - output.WriteMessage(1, field_names[0], Child); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasChild) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Child); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlRescursive ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlRescursive ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlRescursive ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlRescursive MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlRescursive prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlRescursive cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlRescursive result; - - private TestXmlRescursive PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlRescursive original = result; - result = new TestXmlRescursive(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlRescursive MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.Descriptor; } - } - - public override TestXmlRescursive DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance; } - } - - public override TestXmlRescursive BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlRescursive) { - return MergeFrom((TestXmlRescursive) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlRescursive other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasChild) { - MergeChild(other.Child); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlRescursiveFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlRescursiveFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.CreateBuilder(); - if (result.hasChild) { - subBuilder.MergeFrom(Child); - } - input.ReadMessage(subBuilder, extensionRegistry); - Child = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasChild { - get { return result.hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive Child { - get { return result.Child; } - set { SetChild(value); } - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = value; - return this; - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = builderForValue.Build(); - return this; - } - public Builder MergeChild(global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasChild && - result.child_ != global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance) { - result.child_ = global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.CreateBuilder(result.child_).MergeFrom(value).BuildPartial(); - } else { - result.child_ = value; - } - result.hasChild = true; - return this; - } - public Builder ClearChild() { - PrepareBuilder(); - result.hasChild = false; - result.child_ = null; - return this; - } - } - static TestXmlRescursive() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlMessage : pb::ExtendableMessage { - private TestXmlMessage() { } - private static readonly TestXmlMessage defaultInstance = new TestXmlMessage().MakeReadOnly(); - private static readonly string[] _testXmlMessageFieldNames = new string[] { "child", "children", "number", "numbers", "text", "textlines", "valid" }; - private static readonly uint[] _testXmlMessageFieldTags = new uint[] { 10, 3211, 48, 16, 26, 5602, 40 }; - public static TestXmlMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Children : pb::GeneratedMessage { - private Children() { } - private static readonly Children defaultInstance = new Children().MakeReadOnly(); - private static readonly string[] _childrenFieldNames = new string[] { "binary", "options" }; - private static readonly uint[] _childrenFieldTags = new uint[] { 34, 24 }; - public static Children DefaultInstance { - get { return defaultInstance; } - } - - public override Children DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Children ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable; } - } - - public const int OptionsFieldNumber = 3; - private pbc::PopsicleList options_ = new pbc::PopsicleList(); - public scg::IList OptionsList { - get { return pbc::Lists.AsReadOnly(options_); } - } - public int OptionsCount { - get { return options_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return options_[index]; - } - - public const int BinaryFieldNumber = 4; - private bool hasBinary; - private pb::ByteString binary_ = pb::ByteString.Empty; - public bool HasBinary { - get { return hasBinary; } - } - public pb::ByteString Binary { - get { return binary_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _childrenFieldNames; - if (options_.Count > 0) { - output.WriteEnumArray(3, field_names[1], options_); - } - if (hasBinary) { - output.WriteBytes(4, field_names[0], Binary); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - if (options_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.EnumOptions element in options_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * options_.Count; - } - } - if (hasBinary) { - size += pb::CodedOutputStream.ComputeBytesSize(4, Binary); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Children ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Children ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Children ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Children ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Children ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Children ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Children ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Children ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Children ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Children ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Children MakeReadOnly() { - options_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Children prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Children cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Children result; - - private Children PrepareBuilder() { - if (resultIsReadOnly) { - Children original = result; - result = new Children(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Children MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Descriptor; } - } - - public override Children DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance; } - } - - public override Children BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Children) { - return MergeFrom((Children) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Children other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance) return this; - PrepareBuilder(); - if (other.options_.Count != 0) { - result.options_.Add(other.options_); - } - if (other.HasBinary) { - Binary = other.Binary; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_childrenFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _childrenFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.options_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - case 34: { - result.hasBinary = input.ReadBytes(ref result.binary_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList OptionsList { - get { return PrepareBuilder().options_; } - } - public int OptionsCount { - get { return result.OptionsCount; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return result.GetOptions(index); - } - public Builder SetOptions(int index, global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_[index] = value; - return this; - } - public Builder AddOptions(global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_.Add(value); - return this; - } - public Builder AddRangeOptions(scg::IEnumerable values) { - PrepareBuilder(); - result.options_.Add(values); - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.options_.Clear(); - return this; - } - - public bool HasBinary { - get { return result.hasBinary; } - } - public pb::ByteString Binary { - get { return result.Binary; } - set { SetBinary(value); } - } - public Builder SetBinary(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBinary = true; - result.binary_ = value; - return this; - } - public Builder ClearBinary() { - PrepareBuilder(); - result.hasBinary = false; - result.binary_ = pb::ByteString.Empty; - return this; - } - } - static Children() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor, null); - } - } - - } - #endregion - - public const int NumberFieldNumber = 6; - private bool hasNumber; - private long number_; - public bool HasNumber { - get { return hasNumber; } - } - public long Number { - get { return number_; } - } - - public const int NumbersFieldNumber = 2; - private pbc::PopsicleList numbers_ = new pbc::PopsicleList(); - public scg::IList NumbersList { - get { return pbc::Lists.AsReadOnly(numbers_); } - } - public int NumbersCount { - get { return numbers_.Count; } - } - public int GetNumbers(int index) { - return numbers_[index]; - } - - public const int TextFieldNumber = 3; - private bool hasText; - private string text_ = ""; - public bool HasText { - get { return hasText; } - } - public string Text { - get { return text_; } - } - - public const int TextlinesFieldNumber = 700; - private pbc::PopsicleList textlines_ = new pbc::PopsicleList(); - public scg::IList TextlinesList { - get { return pbc::Lists.AsReadOnly(textlines_); } - } - public int TextlinesCount { - get { return textlines_.Count; } - } - public string GetTextlines(int index) { - return textlines_[index]; - } - - public const int ValidFieldNumber = 5; - private bool hasValid; - private bool valid_; - public bool HasValid { - get { return hasValid; } - } - public bool Valid { - get { return valid_; } - } - - public const int ChildFieldNumber = 1; - private bool hasChild; - private global::Google.ProtocolBuffers.TestProtos.TestXmlChild child_; - public bool HasChild { - get { return hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlChild Child { - get { return child_ ?? global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance; } - } - - public const int ChildrenFieldNumber = 401; - private pbc::PopsicleList children_ = new pbc::PopsicleList(); - public scg::IList ChildrenList { - get { return children_; } - } - public int ChildrenCount { - get { return children_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children GetChildren(int index) { - return children_[index]; - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlMessageFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasChild) { - output.WriteMessage(1, field_names[0], Child); - } - if (numbers_.Count > 0) { - output.WriteInt32Array(2, field_names[3], numbers_); - } - if (hasText) { - output.WriteString(3, field_names[4], Text); - } - if (hasValid) { - output.WriteBool(5, field_names[6], Valid); - } - if (hasNumber) { - output.WriteInt64(6, field_names[2], Number); - } - extensionWriter.WriteUntil(200, output); - if (children_.Count > 0) { - output.WriteGroupArray(401, field_names[1], children_); - } - if (textlines_.Count > 0) { - output.WriteStringArray(700, field_names[5], textlines_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt64Size(6, Number); - } - { - int dataSize = 0; - foreach (int element in NumbersList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * numbers_.Count; - } - if (hasText) { - size += pb::CodedOutputStream.ComputeStringSize(3, Text); - } - { - int dataSize = 0; - foreach (string element in TextlinesList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * textlines_.Count; - } - if (hasValid) { - size += pb::CodedOutputStream.ComputeBoolSize(5, Valid); - } - if (hasChild) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Child); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children element in ChildrenList) { - size += pb::CodedOutputStream.ComputeGroupSize(401, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlMessage MakeReadOnly() { - numbers_.MakeReadOnly(); - textlines_.MakeReadOnly(); - children_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlMessage result; - - private TestXmlMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlMessage original = result; - result = new TestXmlMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Descriptor; } - } - - public override TestXmlMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.DefaultInstance; } - } - - public override TestXmlMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlMessage) { - return MergeFrom((TestXmlMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - if (other.numbers_.Count != 0) { - result.numbers_.Add(other.numbers_); - } - if (other.HasText) { - Text = other.Text; - } - if (other.textlines_.Count != 0) { - result.textlines_.Add(other.textlines_); - } - if (other.HasValid) { - Valid = other.Valid; - } - if (other.HasChild) { - MergeChild(other.Child); - } - if (other.children_.Count != 0) { - result.children_.Add(other.children_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.CreateBuilder(); - if (result.hasChild) { - subBuilder.MergeFrom(Child); - } - input.ReadMessage(subBuilder, extensionRegistry); - Child = subBuilder.BuildPartial(); - break; - } - case 18: - case 16: { - input.ReadInt32Array(tag, field_name, result.numbers_); - break; - } - case 26: { - result.hasText = input.ReadString(ref result.text_); - break; - } - case 40: { - result.hasValid = input.ReadBool(ref result.valid_); - break; - } - case 48: { - result.hasNumber = input.ReadInt64(ref result.number_); - break; - } - case 3211: { - input.ReadGroupArray(tag, field_name, result.children_, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance, extensionRegistry); - break; - } - case 5602: { - input.ReadStringArray(tag, field_name, result.textlines_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public long Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(long value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0L; - return this; - } - - public pbc::IPopsicleList NumbersList { - get { return PrepareBuilder().numbers_; } - } - public int NumbersCount { - get { return result.NumbersCount; } - } - public int GetNumbers(int index) { - return result.GetNumbers(index); - } - public Builder SetNumbers(int index, int value) { - PrepareBuilder(); - result.numbers_[index] = value; - return this; - } - public Builder AddNumbers(int value) { - PrepareBuilder(); - result.numbers_.Add(value); - return this; - } - public Builder AddRangeNumbers(scg::IEnumerable values) { - PrepareBuilder(); - result.numbers_.Add(values); - return this; - } - public Builder ClearNumbers() { - PrepareBuilder(); - result.numbers_.Clear(); - return this; - } - - public bool HasText { - get { return result.hasText; } - } - public string Text { - get { return result.Text; } - set { SetText(value); } - } - public Builder SetText(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasText = true; - result.text_ = value; - return this; - } - public Builder ClearText() { - PrepareBuilder(); - result.hasText = false; - result.text_ = ""; - return this; - } - - public pbc::IPopsicleList TextlinesList { - get { return PrepareBuilder().textlines_; } - } - public int TextlinesCount { - get { return result.TextlinesCount; } - } - public string GetTextlines(int index) { - return result.GetTextlines(index); - } - public Builder SetTextlines(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.textlines_[index] = value; - return this; - } - public Builder AddTextlines(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.textlines_.Add(value); - return this; - } - public Builder AddRangeTextlines(scg::IEnumerable values) { - PrepareBuilder(); - result.textlines_.Add(values); - return this; - } - public Builder ClearTextlines() { - PrepareBuilder(); - result.textlines_.Clear(); - return this; - } - - public bool HasValid { - get { return result.hasValid; } - } - public bool Valid { - get { return result.Valid; } - set { SetValid(value); } - } - public Builder SetValid(bool value) { - PrepareBuilder(); - result.hasValid = true; - result.valid_ = value; - return this; - } - public Builder ClearValid() { - PrepareBuilder(); - result.hasValid = false; - result.valid_ = false; - return this; - } - - public bool HasChild { - get { return result.hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlChild Child { - get { return result.Child; } - set { SetChild(value); } - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = value; - return this; - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = builderForValue.Build(); - return this; - } - public Builder MergeChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasChild && - result.child_ != global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance) { - result.child_ = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.CreateBuilder(result.child_).MergeFrom(value).BuildPartial(); - } else { - result.child_ = value; - } - result.hasChild = true; - return this; - } - public Builder ClearChild() { - PrepareBuilder(); - result.hasChild = false; - result.child_ = null; - return this; - } - - public pbc::IPopsicleList ChildrenList { - get { return PrepareBuilder().children_; } - } - public int ChildrenCount { - get { return result.ChildrenCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children GetChildren(int index) { - return result.GetChildren(index); - } - public Builder SetChildren(int index, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.children_[index] = value; - return this; - } - public Builder SetChildren(int index, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.children_[index] = builderForValue.Build(); - return this; - } - public Builder AddChildren(global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.children_.Add(value); - return this; - } - public Builder AddChildren(global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.children_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeChildren(scg::IEnumerable values) { - PrepareBuilder(); - result.children_.Add(values); - return this; - } - public Builder ClearChildren() { - PrepareBuilder(); - result.children_.Clear(); - return this; - } - } - static TestXmlMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlExtension : pb::GeneratedMessage { - private TestXmlExtension() { } - private static readonly TestXmlExtension defaultInstance = new TestXmlExtension().MakeReadOnly(); - private static readonly string[] _testXmlExtensionFieldNames = new string[] { "number" }; - private static readonly uint[] _testXmlExtensionFieldTags = new uint[] { 8 }; - public static TestXmlExtension DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlExtension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlExtension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private int number_; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public override bool IsInitialized { - get { - if (!hasNumber) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlExtensionFieldNames; - if (hasNumber) { - output.WriteInt32(1, field_names[0], Number); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Number); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlExtension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlExtension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlExtension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlExtension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlExtension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlExtension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlExtension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlExtension result; - - private TestXmlExtension PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlExtension original = result; - result = new TestXmlExtension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlExtension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.Descriptor; } - } - - public override TestXmlExtension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.DefaultInstance; } - } - - public override TestXmlExtension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlExtension) { - return MergeFrom((TestXmlExtension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlExtension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasNumber = input.ReadInt32(ref result.number_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0; - return this; - } - } - static TestXmlExtension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestExtrasXmltest.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestIssues.cs b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestIssues.cs deleted file mode 100644 index e0bc151b..00000000 --- a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestIssues.cs +++ /dev/null @@ -1,3437 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: unittest_issues.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace UnitTest.Issues.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnittestIssues { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_unittest_issues_A__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_A__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_B__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_B__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_AB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_AB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_NumberField__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_NumberField__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_MyMessageAReferenceB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_MyMessageAReferenceB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_MyMessageBReferenceA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_MyMessageBReferenceA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_NegativeEnumMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedChild__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_ItemField__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_ItemField__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnittestIssues() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyIPCgFB", - "EgoKAl9BGAEgASgFIg8KAUISCgoCQl8YASABKAUiEQoCQUISCwoDYV9iGAEg", - "ASgFIhoKC051bWJlckZpZWxkEgsKA18wMRgBIAEoBSJMChRNeU1lc3NhZ2VB", - "UmVmZXJlbmNlQhI0CgV2YWx1ZRgBIAIoCzIlLnVuaXR0ZXN0X2lzc3Vlcy5N", - "eU1lc3NhZ2VCUmVmZXJlbmNlQSJMChRNeU1lc3NhZ2VCUmVmZXJlbmNlQRI0", - "CgV2YWx1ZRgBIAIoCzIlLnVuaXR0ZXN0X2lzc3Vlcy5NeU1lc3NhZ2VBUmVm", - "ZXJlbmNlQiKsAQoTTmVnYXRpdmVFbnVtTWVzc2FnZRIsCgV2YWx1ZRgBIAEo", - "DjIdLnVuaXR0ZXN0X2lzc3Vlcy5OZWdhdGl2ZUVudW0SLQoGdmFsdWVzGAIg", - "AygOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bRI4Cg1wYWNrZWRf", - "dmFsdWVzGAMgAygOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUIC", - "EAEiEQoPRGVwcmVjYXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVz", - "c2FnZRIaCg5QcmltaXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZl", - "QXJyYXkYAiADKAVCAhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0", - "ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJh", - "eRgEIAMoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgB", - "EjYKCUVudW1WYWx1ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNh", - "dGVkRW51bUICGAESNgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNz", - "dWVzLkRlcHJlY2F0ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgB", - "IAEoBSpHCgxOZWdhdGl2ZUVudW0SFgoJRml2ZUJlbG93EPv//////////wES", - "FQoITWludXNPbmUQ////////////ARIICgRaZXJvEAAqGQoORGVwcmVjYXRl", - "ZEVudW0SBwoDb25lEAFCH0gBqgIaVW5pdFRlc3QuSXNzdWVzLlRlc3RQcm90", - "b3M=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_unittest_issues_A__Descriptor = Descriptor.MessageTypes[0]; - internal__static_unittest_issues_A__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_A__Descriptor, - new string[] { "A_", }); - internal__static_unittest_issues_B__Descriptor = Descriptor.MessageTypes[1]; - internal__static_unittest_issues_B__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_B__Descriptor, - new string[] { "B_", }); - internal__static_unittest_issues_AB__Descriptor = Descriptor.MessageTypes[2]; - internal__static_unittest_issues_AB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_AB__Descriptor, - new string[] { "AB_", }); - internal__static_unittest_issues_NumberField__Descriptor = Descriptor.MessageTypes[3]; - internal__static_unittest_issues_NumberField__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_NumberField__Descriptor, - new string[] { "01", }); - internal__static_unittest_issues_MyMessageAReferenceB__Descriptor = Descriptor.MessageTypes[4]; - internal__static_unittest_issues_MyMessageAReferenceB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_MyMessageAReferenceB__Descriptor, - new string[] { "Value", }); - internal__static_unittest_issues_MyMessageBReferenceA__Descriptor = Descriptor.MessageTypes[5]; - internal__static_unittest_issues_MyMessageBReferenceA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_MyMessageBReferenceA__Descriptor, - new string[] { "Value", }); - internal__static_unittest_issues_NegativeEnumMessage__Descriptor = Descriptor.MessageTypes[6]; - internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_NegativeEnumMessage__Descriptor, - new string[] { "Value", "Values", "PackedValues", }); - internal__static_unittest_issues_DeprecatedChild__Descriptor = Descriptor.MessageTypes[7]; - internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_DeprecatedChild__Descriptor, - new string[] { }); - internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor = Descriptor.MessageTypes[8]; - internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor, - new string[] { "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray", }); - internal__static_unittest_issues_ItemField__Descriptor = Descriptor.MessageTypes[9]; - internal__static_unittest_issues_ItemField__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_ItemField__Descriptor, - new string[] { "Item", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Enums - public enum NegativeEnum { - FiveBelow = -5, - MinusOne = -1, - Zero = 0, - } - - public enum DeprecatedEnum { - one = 1, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class A : pb::GeneratedMessage { - private A() { } - private static readonly A defaultInstance = new A().MakeReadOnly(); - private static readonly string[] _aFieldNames = new string[] { "_A" }; - private static readonly uint[] _aFieldTags = new uint[] { 8 }; - public static A DefaultInstance { - get { return defaultInstance; } - } - - public override A DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override A ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_A__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_A__FieldAccessorTable; } - } - - public const int A_FieldNumber = 1; - private bool hasA_; - private int A_; - public bool HasA_ { - get { return hasA_; } - } - public int A_ { - get { return A_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aFieldNames; - if (hasA_) { - output.WriteInt32(1, field_names[0], A_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA_) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static A ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static A ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static A ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static A ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static A ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static A ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static A ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static A ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static A ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static A ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private A MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(A prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(A cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private A result; - - private A PrepareBuilder() { - if (resultIsReadOnly) { - A original = result; - result = new A(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override A MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.A.Descriptor; } - } - - public override A DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.A.DefaultInstance; } - } - - public override A BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is A) { - return MergeFrom((A) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(A other) { - if (other == global::UnitTest.Issues.TestProtos.A.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA_) { - A_ = other.A_; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA_ = input.ReadInt32(ref result.A_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA_ { - get { return result.hasA_; } - } - public int A_ { - get { return result.A_; } - set { SetA_(value); } - } - public Builder SetA_(int value) { - PrepareBuilder(); - result.hasA_ = true; - result.A_ = value; - return this; - } - public Builder ClearA_() { - PrepareBuilder(); - result.hasA_ = false; - result.A_ = 0; - return this; - } - } - static A() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class B : pb::GeneratedMessage { - private B() { } - private static readonly B defaultInstance = new B().MakeReadOnly(); - private static readonly string[] _bFieldNames = new string[] { "B_" }; - private static readonly uint[] _bFieldTags = new uint[] { 8 }; - public static B DefaultInstance { - get { return defaultInstance; } - } - - public override B DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override B ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_B__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_B__FieldAccessorTable; } - } - - public const int B_FieldNumber = 1; - private bool hasB_; - private int b_; - public bool HasB_ { - get { return hasB_; } - } - public int B_ { - get { return b_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _bFieldNames; - if (hasB_) { - output.WriteInt32(1, field_names[0], B_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasB_) { - size += pb::CodedOutputStream.ComputeInt32Size(1, B_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static B ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static B ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static B ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static B ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static B ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static B ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static B ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static B ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static B ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static B ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private B MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(B prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(B cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private B result; - - private B PrepareBuilder() { - if (resultIsReadOnly) { - B original = result; - result = new B(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override B MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.B.Descriptor; } - } - - public override B DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.B.DefaultInstance; } - } - - public override B BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is B) { - return MergeFrom((B) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(B other) { - if (other == global::UnitTest.Issues.TestProtos.B.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasB_) { - B_ = other.B_; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_bFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _bFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasB_ = input.ReadInt32(ref result.b_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasB_ { - get { return result.hasB_; } - } - public int B_ { - get { return result.B_; } - set { SetB_(value); } - } - public Builder SetB_(int value) { - PrepareBuilder(); - result.hasB_ = true; - result.b_ = value; - return this; - } - public Builder ClearB_() { - PrepareBuilder(); - result.hasB_ = false; - result.b_ = 0; - return this; - } - } - static B() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class AB : pb::GeneratedMessage { - private AB() { } - private static readonly AB defaultInstance = new AB().MakeReadOnly(); - private static readonly string[] _aBFieldNames = new string[] { "a_b" }; - private static readonly uint[] _aBFieldTags = new uint[] { 8 }; - public static AB DefaultInstance { - get { return defaultInstance; } - } - - public override AB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override AB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_AB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_AB__FieldAccessorTable; } - } - - public const int AB_FieldNumber = 1; - private bool hasAB_; - private int aB_; - public bool HasAB_ { - get { return hasAB_; } - } - public int AB_ { - get { return aB_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aBFieldNames; - if (hasAB_) { - output.WriteInt32(1, field_names[0], AB_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasAB_) { - size += pb::CodedOutputStream.ComputeInt32Size(1, AB_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static AB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private AB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(AB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private AB result; - - private AB PrepareBuilder() { - if (resultIsReadOnly) { - AB original = result; - result = new AB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override AB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.AB.Descriptor; } - } - - public override AB DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.AB.DefaultInstance; } - } - - public override AB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AB) { - return MergeFrom((AB) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AB other) { - if (other == global::UnitTest.Issues.TestProtos.AB.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasAB_) { - AB_ = other.AB_; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aBFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aBFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasAB_ = input.ReadInt32(ref result.aB_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasAB_ { - get { return result.hasAB_; } - } - public int AB_ { - get { return result.AB_; } - set { SetAB_(value); } - } - public Builder SetAB_(int value) { - PrepareBuilder(); - result.hasAB_ = true; - result.aB_ = value; - return this; - } - public Builder ClearAB_() { - PrepareBuilder(); - result.hasAB_ = false; - result.aB_ = 0; - return this; - } - } - static AB() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NumberField : pb::GeneratedMessage { - private NumberField() { } - private static readonly NumberField defaultInstance = new NumberField().MakeReadOnly(); - private static readonly string[] _numberFieldFieldNames = new string[] { "_01" }; - private static readonly uint[] _numberFieldFieldTags = new uint[] { 8 }; - public static NumberField DefaultInstance { - get { return defaultInstance; } - } - - public override NumberField DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NumberField ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NumberField__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NumberField__FieldAccessorTable; } - } - - public const int 01FieldNumber = 1; - private bool has01; - private int 01_; - public bool Has01 { - get { return has01; } - } - public int 01 { - get { return 01_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _numberFieldFieldNames; - if (has01) { - output.WriteInt32(1, field_names[0], 01); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (has01) { - size += pb::CodedOutputStream.ComputeInt32Size(1, 01); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NumberField ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NumberField ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NumberField ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NumberField ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NumberField ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NumberField ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NumberField ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NumberField ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NumberField ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NumberField ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NumberField MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NumberField prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NumberField cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NumberField result; - - private NumberField PrepareBuilder() { - if (resultIsReadOnly) { - NumberField original = result; - result = new NumberField(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NumberField MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.NumberField.Descriptor; } - } - - public override NumberField DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.NumberField.DefaultInstance; } - } - - public override NumberField BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NumberField) { - return MergeFrom((NumberField) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NumberField other) { - if (other == global::UnitTest.Issues.TestProtos.NumberField.DefaultInstance) return this; - PrepareBuilder(); - if (other.Has01) { - 01 = other.01; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_numberFieldFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _numberFieldFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.has01 = input.ReadInt32(ref result.01_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool Has01 { - get { return result.has01; } - } - public int 01 { - get { return result.01; } - set { Set01(value); } - } - public Builder Set01(int value) { - PrepareBuilder(); - result.has01 = true; - result.01_ = value; - return this; - } - public Builder Clear01() { - PrepareBuilder(); - result.has01 = false; - result.01_ = 0; - return this; - } - } - static NumberField() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MyMessageAReferenceB : pb::GeneratedMessage { - private MyMessageAReferenceB() { } - private static readonly MyMessageAReferenceB defaultInstance = new MyMessageAReferenceB().MakeReadOnly(); - private static readonly string[] _myMessageAReferenceBFieldNames = new string[] { "value" }; - private static readonly uint[] _myMessageAReferenceBFieldTags = new uint[] { 10 }; - public static MyMessageAReferenceB DefaultInstance { - get { return defaultInstance; } - } - - public override MyMessageAReferenceB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MyMessageAReferenceB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_MyMessageAReferenceB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_MyMessageAReferenceB__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private global::UnitTest.Issues.TestProtos.MyMessageBReferenceA value_; - public bool HasValue { - get { return hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageBReferenceA Value { - get { return value_ ?? global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasValue) return false; - if (!Value.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _myMessageAReferenceBFieldNames; - if (hasValue) { - output.WriteMessage(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MyMessageAReferenceB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MyMessageAReferenceB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MyMessageAReferenceB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MyMessageAReferenceB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MyMessageAReferenceB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MyMessageAReferenceB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MyMessageAReferenceB result; - - private MyMessageAReferenceB PrepareBuilder() { - if (resultIsReadOnly) { - MyMessageAReferenceB original = result; - result = new MyMessageAReferenceB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MyMessageAReferenceB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.Descriptor; } - } - - public override MyMessageAReferenceB DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance; } - } - - public override MyMessageAReferenceB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MyMessageAReferenceB) { - return MergeFrom((MyMessageAReferenceB) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MyMessageAReferenceB other) { - if (other == global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - MergeValue(other.Value); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_myMessageAReferenceBFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _myMessageAReferenceBFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.Builder subBuilder = global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.CreateBuilder(); - if (result.hasValue) { - subBuilder.MergeFrom(Value); - } - input.ReadMessage(subBuilder, extensionRegistry); - Value = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageBReferenceA Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageBReferenceA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = builderForValue.Build(); - return this; - } - public Builder MergeValue(global::UnitTest.Issues.TestProtos.MyMessageBReferenceA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasValue && - result.value_ != global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance) { - result.value_ = global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.CreateBuilder(result.value_).MergeFrom(value).BuildPartial(); - } else { - result.value_ = value; - } - result.hasValue = true; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = null; - return this; - } - } - static MyMessageAReferenceB() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MyMessageBReferenceA : pb::GeneratedMessage { - private MyMessageBReferenceA() { } - private static readonly MyMessageBReferenceA defaultInstance = new MyMessageBReferenceA().MakeReadOnly(); - private static readonly string[] _myMessageBReferenceAFieldNames = new string[] { "value" }; - private static readonly uint[] _myMessageBReferenceAFieldTags = new uint[] { 10 }; - public static MyMessageBReferenceA DefaultInstance { - get { return defaultInstance; } - } - - public override MyMessageBReferenceA DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MyMessageBReferenceA ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_MyMessageBReferenceA__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_MyMessageBReferenceA__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private global::UnitTest.Issues.TestProtos.MyMessageAReferenceB value_; - public bool HasValue { - get { return hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageAReferenceB Value { - get { return value_ ?? global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasValue) return false; - if (!Value.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _myMessageBReferenceAFieldNames; - if (hasValue) { - output.WriteMessage(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MyMessageBReferenceA ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MyMessageBReferenceA ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MyMessageBReferenceA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MyMessageBReferenceA MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MyMessageBReferenceA prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MyMessageBReferenceA cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MyMessageBReferenceA result; - - private MyMessageBReferenceA PrepareBuilder() { - if (resultIsReadOnly) { - MyMessageBReferenceA original = result; - result = new MyMessageBReferenceA(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MyMessageBReferenceA MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.Descriptor; } - } - - public override MyMessageBReferenceA DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance; } - } - - public override MyMessageBReferenceA BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MyMessageBReferenceA) { - return MergeFrom((MyMessageBReferenceA) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MyMessageBReferenceA other) { - if (other == global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - MergeValue(other.Value); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_myMessageBReferenceAFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _myMessageBReferenceAFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.Builder subBuilder = global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.CreateBuilder(); - if (result.hasValue) { - subBuilder.MergeFrom(Value); - } - input.ReadMessage(subBuilder, extensionRegistry); - Value = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageAReferenceB Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageAReferenceB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = builderForValue.Build(); - return this; - } - public Builder MergeValue(global::UnitTest.Issues.TestProtos.MyMessageAReferenceB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasValue && - result.value_ != global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance) { - result.value_ = global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.CreateBuilder(result.value_).MergeFrom(value).BuildPartial(); - } else { - result.value_ = value; - } - result.hasValue = true; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = null; - return this; - } - } - static MyMessageBReferenceA() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NegativeEnumMessage : pb::GeneratedMessage { - private NegativeEnumMessage() { } - private static readonly NegativeEnumMessage defaultInstance = new NegativeEnumMessage().MakeReadOnly(); - private static readonly string[] _negativeEnumMessageFieldNames = new string[] { "packed_values", "value", "values" }; - private static readonly uint[] _negativeEnumMessageFieldTags = new uint[] { 26, 8, 16 }; - public static NegativeEnumMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NegativeEnumMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NegativeEnumMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.FiveBelow; - public bool HasValue { - get { return hasValue; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum Value { - get { return value_; } - } - - public const int ValuesFieldNumber = 2; - private pbc::PopsicleList values_ = new pbc::PopsicleList(); - public scg::IList ValuesList { - get { return pbc::Lists.AsReadOnly(values_); } - } - public int ValuesCount { - get { return values_.Count; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetValues(int index) { - return values_[index]; - } - - public const int PackedValuesFieldNumber = 3; - private int packedValuesMemoizedSerializedSize; - private pbc::PopsicleList packedValues_ = new pbc::PopsicleList(); - public scg::IList PackedValuesList { - get { return pbc::Lists.AsReadOnly(packedValues_); } - } - public int PackedValuesCount { - get { return packedValues_.Count; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetPackedValues(int index) { - return packedValues_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _negativeEnumMessageFieldNames; - if (hasValue) { - output.WriteEnum(1, field_names[1], (int) Value, Value); - } - if (values_.Count > 0) { - output.WriteEnumArray(2, field_names[2], values_); - } - if (packedValues_.Count > 0) { - output.WritePackedEnumArray(3, field_names[0], packedValuesMemoizedSerializedSize, packedValues_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Value); - } - { - int dataSize = 0; - if (values_.Count > 0) { - foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in values_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * values_.Count; - } - } - { - int dataSize = 0; - if (packedValues_.Count > 0) { - foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in packedValues_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - packedValuesMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NegativeEnumMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NegativeEnumMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NegativeEnumMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NegativeEnumMessage MakeReadOnly() { - values_.MakeReadOnly(); - packedValues_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NegativeEnumMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NegativeEnumMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NegativeEnumMessage result; - - private NegativeEnumMessage PrepareBuilder() { - if (resultIsReadOnly) { - NegativeEnumMessage original = result; - result = new NegativeEnumMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NegativeEnumMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Descriptor; } - } - - public override NegativeEnumMessage DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.NegativeEnumMessage.DefaultInstance; } - } - - public override NegativeEnumMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NegativeEnumMessage) { - return MergeFrom((NegativeEnumMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NegativeEnumMessage other) { - if (other == global::UnitTest.Issues.TestProtos.NegativeEnumMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - Value = other.Value; - } - if (other.values_.Count != 0) { - result.values_.Add(other.values_); - } - if (other.packedValues_.Count != 0) { - result.packedValues_.Add(other.packedValues_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_negativeEnumMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _negativeEnumMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.value_, out unknown)) { - result.hasValue = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 18: - case 16: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.values_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(2, (ulong)(int)rawValue); - } - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.packedValues_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.FiveBelow; - return this; - } - - public pbc::IPopsicleList ValuesList { - get { return PrepareBuilder().values_; } - } - public int ValuesCount { - get { return result.ValuesCount; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetValues(int index) { - return result.GetValues(index); - } - public Builder SetValues(int index, global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.values_[index] = value; - return this; - } - public Builder AddValues(global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.values_.Add(value); - return this; - } - public Builder AddRangeValues(scg::IEnumerable values) { - PrepareBuilder(); - result.values_.Add(values); - return this; - } - public Builder ClearValues() { - PrepareBuilder(); - result.values_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedValuesList { - get { return PrepareBuilder().packedValues_; } - } - public int PackedValuesCount { - get { return result.PackedValuesCount; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetPackedValues(int index) { - return result.GetPackedValues(index); - } - public Builder SetPackedValues(int index, global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.packedValues_[index] = value; - return this; - } - public Builder AddPackedValues(global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.packedValues_.Add(value); - return this; - } - public Builder AddRangePackedValues(scg::IEnumerable values) { - PrepareBuilder(); - result.packedValues_.Add(values); - return this; - } - public Builder ClearPackedValues() { - PrepareBuilder(); - result.packedValues_.Clear(); - return this; - } - } - static NegativeEnumMessage() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DeprecatedChild : pb::GeneratedMessage { - private DeprecatedChild() { } - private static readonly DeprecatedChild defaultInstance = new DeprecatedChild().MakeReadOnly(); - private static readonly string[] _deprecatedChildFieldNames = new string[] { }; - private static readonly uint[] _deprecatedChildFieldTags = new uint[] { }; - public static DeprecatedChild DefaultInstance { - get { return defaultInstance; } - } - - public override DeprecatedChild DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DeprecatedChild ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _deprecatedChildFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DeprecatedChild ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DeprecatedChild ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DeprecatedChild ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DeprecatedChild ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DeprecatedChild MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DeprecatedChild prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DeprecatedChild cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DeprecatedChild result; - - private DeprecatedChild PrepareBuilder() { - if (resultIsReadOnly) { - DeprecatedChild original = result; - result = new DeprecatedChild(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DeprecatedChild MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedChild.Descriptor; } - } - - public override DeprecatedChild DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance; } - } - - public override DeprecatedChild BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DeprecatedChild) { - return MergeFrom((DeprecatedChild) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DeprecatedChild other) { - if (other == global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_deprecatedChildFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _deprecatedChildFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static DeprecatedChild() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DeprecatedFieldsMessage : pb::GeneratedMessage { - private DeprecatedFieldsMessage() { } - private static readonly DeprecatedFieldsMessage defaultInstance = new DeprecatedFieldsMessage().MakeReadOnly(); - private static readonly string[] _deprecatedFieldsMessageFieldNames = new string[] { "EnumArray", "EnumValue", "MessageArray", "MessageValue", "PrimitiveArray", "PrimitiveValue" }; - private static readonly uint[] _deprecatedFieldsMessageFieldTags = new uint[] { 48, 40, 34, 26, 16, 8 }; - public static DeprecatedFieldsMessage DefaultInstance { - get { return defaultInstance; } - } - - public override DeprecatedFieldsMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DeprecatedFieldsMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; } - } - - public const int PrimitiveValueFieldNumber = 1; - private bool hasPrimitiveValue; - private int primitiveValue_; - [global::System.ObsoleteAttribute()] - public bool HasPrimitiveValue { - get { return hasPrimitiveValue; } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveValue { - get { return primitiveValue_; } - } - - public const int PrimitiveArrayFieldNumber = 2; - private pbc::PopsicleList primitiveArray_ = new pbc::PopsicleList(); - [global::System.ObsoleteAttribute()] - public scg::IList PrimitiveArrayList { - get { return pbc::Lists.AsReadOnly(primitiveArray_); } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveArrayCount { - get { return primitiveArray_.Count; } - } - [global::System.ObsoleteAttribute()] - public int GetPrimitiveArray(int index) { - return primitiveArray_[index]; - } - - public const int MessageValueFieldNumber = 3; - private bool hasMessageValue; - private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; - [global::System.ObsoleteAttribute()] - public bool HasMessageValue { - get { return hasMessageValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { - get { return messageValue_ ?? global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance; } - } - - public const int MessageArrayFieldNumber = 4; - private pbc::PopsicleList messageArray_ = new pbc::PopsicleList(); - [global::System.ObsoleteAttribute()] - public scg::IList MessageArrayList { - get { return messageArray_; } - } - [global::System.ObsoleteAttribute()] - public int MessageArrayCount { - get { return messageArray_.Count; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild GetMessageArray(int index) { - return messageArray_[index]; - } - - public const int EnumValueFieldNumber = 5; - private bool hasEnumValue; - private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.one; - [global::System.ObsoleteAttribute()] - public bool HasEnumValue { - get { return hasEnumValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { - get { return enumValue_; } - } - - public const int EnumArrayFieldNumber = 6; - private pbc::PopsicleList enumArray_ = new pbc::PopsicleList(); - [global::System.ObsoleteAttribute()] - public scg::IList EnumArrayList { - get { return pbc::Lists.AsReadOnly(enumArray_); } - } - [global::System.ObsoleteAttribute()] - public int EnumArrayCount { - get { return enumArray_.Count; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum GetEnumArray(int index) { - return enumArray_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _deprecatedFieldsMessageFieldNames; - if (hasPrimitiveValue) { - output.WriteInt32(1, field_names[5], PrimitiveValue); - } - if (primitiveArray_.Count > 0) { - output.WriteInt32Array(2, field_names[4], primitiveArray_); - } - if (hasMessageValue) { - output.WriteMessage(3, field_names[3], MessageValue); - } - if (messageArray_.Count > 0) { - output.WriteMessageArray(4, field_names[2], messageArray_); - } - if (hasEnumValue) { - output.WriteEnum(5, field_names[1], (int) EnumValue, EnumValue); - } - if (enumArray_.Count > 0) { - output.WriteEnumArray(6, field_names[0], enumArray_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPrimitiveValue) { - size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveValue); - } - { - int dataSize = 0; - foreach (int element in PrimitiveArrayList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * primitiveArray_.Count; - } - if (hasMessageValue) { - size += pb::CodedOutputStream.ComputeMessageSize(3, MessageValue); - } - foreach (global::UnitTest.Issues.TestProtos.DeprecatedChild element in MessageArrayList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - if (hasEnumValue) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) EnumValue); - } - { - int dataSize = 0; - if (enumArray_.Count > 0) { - foreach (global::UnitTest.Issues.TestProtos.DeprecatedEnum element in enumArray_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * enumArray_.Count; - } - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DeprecatedFieldsMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DeprecatedFieldsMessage MakeReadOnly() { - primitiveArray_.MakeReadOnly(); - messageArray_.MakeReadOnly(); - enumArray_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DeprecatedFieldsMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DeprecatedFieldsMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DeprecatedFieldsMessage result; - - private DeprecatedFieldsMessage PrepareBuilder() { - if (resultIsReadOnly) { - DeprecatedFieldsMessage original = result; - result = new DeprecatedFieldsMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DeprecatedFieldsMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.Descriptor; } - } - - public override DeprecatedFieldsMessage DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.DefaultInstance; } - } - - public override DeprecatedFieldsMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DeprecatedFieldsMessage) { - return MergeFrom((DeprecatedFieldsMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DeprecatedFieldsMessage other) { - if (other == global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPrimitiveValue) { - PrimitiveValue = other.PrimitiveValue; - } - if (other.primitiveArray_.Count != 0) { - result.primitiveArray_.Add(other.primitiveArray_); - } - if (other.HasMessageValue) { - MergeMessageValue(other.MessageValue); - } - if (other.messageArray_.Count != 0) { - result.messageArray_.Add(other.messageArray_); - } - if (other.HasEnumValue) { - EnumValue = other.EnumValue; - } - if (other.enumArray_.Count != 0) { - result.enumArray_.Add(other.enumArray_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_deprecatedFieldsMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _deprecatedFieldsMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasPrimitiveValue = input.ReadInt32(ref result.primitiveValue_); - break; - } - case 18: - case 16: { - input.ReadInt32Array(tag, field_name, result.primitiveArray_); - break; - } - case 26: { - global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder subBuilder = global::UnitTest.Issues.TestProtos.DeprecatedChild.CreateBuilder(); - if (result.hasMessageValue) { - subBuilder.MergeFrom(MessageValue); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageValue = subBuilder.BuildPartial(); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.messageArray_, global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance, extensionRegistry); - break; - } - case 40: { - object unknown; - if(input.ReadEnum(ref result.enumValue_, out unknown)) { - result.hasEnumValue = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong)(int)unknown); - } - break; - } - case 50: - case 48: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.enumArray_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(6, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.ObsoleteAttribute()] - public bool HasPrimitiveValue { - get { return result.hasPrimitiveValue; } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveValue { - get { return result.PrimitiveValue; } - set { SetPrimitiveValue(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetPrimitiveValue(int value) { - PrepareBuilder(); - result.hasPrimitiveValue = true; - result.primitiveValue_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearPrimitiveValue() { - PrepareBuilder(); - result.hasPrimitiveValue = false; - result.primitiveValue_ = 0; - return this; - } - - [global::System.ObsoleteAttribute()] - public pbc::IPopsicleList PrimitiveArrayList { - get { return PrepareBuilder().primitiveArray_; } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveArrayCount { - get { return result.PrimitiveArrayCount; } - } - [global::System.ObsoleteAttribute()] - public int GetPrimitiveArray(int index) { - return result.GetPrimitiveArray(index); - } - [global::System.ObsoleteAttribute()] - public Builder SetPrimitiveArray(int index, int value) { - PrepareBuilder(); - result.primitiveArray_[index] = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddPrimitiveArray(int value) { - PrepareBuilder(); - result.primitiveArray_.Add(value); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddRangePrimitiveArray(scg::IEnumerable values) { - PrepareBuilder(); - result.primitiveArray_.Add(values); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearPrimitiveArray() { - PrepareBuilder(); - result.primitiveArray_.Clear(); - return this; - } - - [global::System.ObsoleteAttribute()] - public bool HasMessageValue { - get { return result.hasMessageValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { - get { return result.MessageValue; } - set { SetMessageValue(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageValue(global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageValue = true; - result.messageValue_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageValue(global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageValue = true; - result.messageValue_ = builderForValue.Build(); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder MergeMessageValue(global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageValue && - result.messageValue_ != global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance) { - result.messageValue_ = global::UnitTest.Issues.TestProtos.DeprecatedChild.CreateBuilder(result.messageValue_).MergeFrom(value).BuildPartial(); - } else { - result.messageValue_ = value; - } - result.hasMessageValue = true; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearMessageValue() { - PrepareBuilder(); - result.hasMessageValue = false; - result.messageValue_ = null; - return this; - } - - [global::System.ObsoleteAttribute()] - public pbc::IPopsicleList MessageArrayList { - get { return PrepareBuilder().messageArray_; } - } - [global::System.ObsoleteAttribute()] - public int MessageArrayCount { - get { return result.MessageArrayCount; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild GetMessageArray(int index) { - return result.GetMessageArray(index); - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageArray(int index, global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageArray_[index] = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageArray(int index, global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageArray_[index] = builderForValue.Build(); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddMessageArray(global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageArray_.Add(value); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddMessageArray(global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageArray_.Add(builderForValue.Build()); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddRangeMessageArray(scg::IEnumerable values) { - PrepareBuilder(); - result.messageArray_.Add(values); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearMessageArray() { - PrepareBuilder(); - result.messageArray_.Clear(); - return this; - } - - [global::System.ObsoleteAttribute()] - public bool HasEnumValue { - get { return result.hasEnumValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { - get { return result.EnumValue; } - set { SetEnumValue(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetEnumValue(global::UnitTest.Issues.TestProtos.DeprecatedEnum value) { - PrepareBuilder(); - result.hasEnumValue = true; - result.enumValue_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearEnumValue() { - PrepareBuilder(); - result.hasEnumValue = false; - result.enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.one; - return this; - } - - [global::System.ObsoleteAttribute()] - public pbc::IPopsicleList EnumArrayList { - get { return PrepareBuilder().enumArray_; } - } - [global::System.ObsoleteAttribute()] - public int EnumArrayCount { - get { return result.EnumArrayCount; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum GetEnumArray(int index) { - return result.GetEnumArray(index); - } - [global::System.ObsoleteAttribute()] - public Builder SetEnumArray(int index, global::UnitTest.Issues.TestProtos.DeprecatedEnum value) { - PrepareBuilder(); - result.enumArray_[index] = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddEnumArray(global::UnitTest.Issues.TestProtos.DeprecatedEnum value) { - PrepareBuilder(); - result.enumArray_.Add(value); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddRangeEnumArray(scg::IEnumerable values) { - PrepareBuilder(); - result.enumArray_.Add(values); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearEnumArray() { - PrepareBuilder(); - result.enumArray_.Clear(); - return this; - } - } - static DeprecatedFieldsMessage() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ItemField : pb::GeneratedMessage { - private ItemField() { } - private static readonly ItemField defaultInstance = new ItemField().MakeReadOnly(); - private static readonly string[] _itemFieldFieldNames = new string[] { "item" }; - private static readonly uint[] _itemFieldFieldTags = new uint[] { 8 }; - public static ItemField DefaultInstance { - get { return defaultInstance; } - } - - public override ItemField DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ItemField ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__FieldAccessorTable; } - } - - public const int ItemFieldNumber = 1; - private bool hasItem; - private int item_; - public bool HasItem { - get { return hasItem; } - } - public int Item { - get { return item_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _itemFieldFieldNames; - if (hasItem) { - output.WriteInt32(1, field_names[0], Item); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasItem) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Item); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ItemField ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ItemField ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ItemField ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ItemField ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ItemField ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ItemField ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ItemField ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ItemField ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ItemField ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ItemField ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ItemField MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ItemField prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ItemField cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ItemField result; - - private ItemField PrepareBuilder() { - if (resultIsReadOnly) { - ItemField original = result; - result = new ItemField(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ItemField MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.ItemField.Descriptor; } - } - - public override ItemField DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.ItemField.DefaultInstance; } - } - - public override ItemField BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ItemField) { - return MergeFrom((ItemField) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ItemField other) { - if (other == global::UnitTest.Issues.TestProtos.ItemField.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasItem) { - Item = other.Item; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_itemFieldFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _itemFieldFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasItem = input.ReadInt32(ref result.item_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasItem { - get { return result.hasItem; } - } - public int Item { - get { return result.Item; } - set { SetItem(value); } - } - public Builder SetItem(int value) { - PrepareBuilder(); - result.hasItem = true; - result.item_ = value; - return this; - } - public Builder ClearItem() { - PrepareBuilder(); - result.hasItem = false; - result.item_ = 0; - return this; - } - } - static ItemField() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code -- cgit v1.2.3 From 6f7a782934c51a5fbcc3d6b25bf5a340ce86635b Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 21:54:23 -0700 Subject: Regenerated UnittestDropUnknownFields.cs --- .../TestProtos/UnittestDropUnknownFields.cs | 95 ++++------------------ 1 file changed, 18 insertions(+), 77 deletions(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs index 90e14640..3939c9a4 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs @@ -103,38 +103,24 @@ namespace Google.ProtocolBuffers.TestProtos { #endregion public const int Int32ValueFieldNumber = 1; - private bool hasInt32Value; private int int32Value_; - public bool HasInt32Value { - get { return hasInt32Value; } - } public int Int32Value { get { return int32Value_; } } public const int EnumValueFieldNumber = 2; - private bool hasEnumValue; private global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum enumValue_ = global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum.FOO; - public bool HasEnumValue { - get { return hasEnumValue; } - } public global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum EnumValue { get { return enumValue_; } } - public override bool IsInitialized { - get { - return true; - } - } - public override void WriteTo(pb::ICodedOutputStream output) { CalcSerializedSize(); string[] field_names = _fooFieldNames; - if (hasInt32Value) { + if (Int32Value != 0) { output.WriteInt32(1, field_names[1], Int32Value); } - if (hasEnumValue) { + if (EnumValue != global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum.FOO) { output.WriteEnum(2, field_names[0], (int) EnumValue, EnumValue); } UnknownFields.WriteTo(output); @@ -154,10 +140,10 @@ namespace Google.ProtocolBuffers.TestProtos { if (size != -1) return size; size = 0; - if (hasInt32Value) { + if (Int32Value != 0) { size += pb::CodedOutputStream.ComputeInt32Size(1, Int32Value); } - if (hasEnumValue) { + if (EnumValue != global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum.FOO) { size += pb::CodedOutputStream.ComputeEnumSize(2, (int) EnumValue); } size += UnknownFields.SerializedSize; @@ -282,10 +268,10 @@ namespace Google.ProtocolBuffers.TestProtos { public override Builder MergeFrom(Foo other) { if (other == global::Google.ProtocolBuffers.TestProtos.Foo.DefaultInstance) return this; PrepareBuilder(); - if (other.HasInt32Value) { + if (other.Int32Value != 0) { Int32Value = other.Int32Value; } - if (other.HasEnumValue) { + if (other.EnumValue != global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum.FOO) { EnumValue = other.EnumValue; } this.MergeUnknownFields(other.UnknownFields); @@ -332,13 +318,12 @@ namespace Google.ProtocolBuffers.TestProtos { break; } case 8: { - result.hasInt32Value = input.ReadInt32(ref result.int32Value_); + input.ReadInt32(ref result.int32Value_); break; } case 16: { object unknown; if(input.ReadEnum(ref result.enumValue_, out unknown)) { - result.hasEnumValue = true; } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); @@ -357,42 +342,32 @@ namespace Google.ProtocolBuffers.TestProtos { } - public bool HasInt32Value { - get { return result.hasInt32Value; } - } public int Int32Value { get { return result.Int32Value; } set { SetInt32Value(value); } } public Builder SetInt32Value(int value) { PrepareBuilder(); - result.hasInt32Value = true; result.int32Value_ = value; return this; } public Builder ClearInt32Value() { PrepareBuilder(); - result.hasInt32Value = false; result.int32Value_ = 0; return this; } - public bool HasEnumValue { - get { return result.hasEnumValue; } - } public global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum EnumValue { get { return result.EnumValue; } set { SetEnumValue(value); } } public Builder SetEnumValue(global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum value) { PrepareBuilder(); - result.hasEnumValue = true; result.enumValue_ = value; return this; } public Builder ClearEnumValue() { PrepareBuilder(); - result.hasEnumValue = false; result.enumValue_ = global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum.FOO; return this; } @@ -442,51 +417,33 @@ namespace Google.ProtocolBuffers.TestProtos { #endregion public const int Int32ValueFieldNumber = 1; - private bool hasInt32Value; private int int32Value_; - public bool HasInt32Value { - get { return hasInt32Value; } - } public int Int32Value { get { return int32Value_; } } public const int EnumValueFieldNumber = 2; - private bool hasEnumValue; private global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum enumValue_ = global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum.FOO; - public bool HasEnumValue { - get { return hasEnumValue; } - } public global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum EnumValue { get { return enumValue_; } } public const int ExtraInt32ValueFieldNumber = 3; - private bool hasExtraInt32Value; private int extraInt32Value_; - public bool HasExtraInt32Value { - get { return hasExtraInt32Value; } - } public int ExtraInt32Value { get { return extraInt32Value_; } } - public override bool IsInitialized { - get { - return true; - } - } - public override void WriteTo(pb::ICodedOutputStream output) { CalcSerializedSize(); string[] field_names = _fooWithExtraFieldsFieldNames; - if (hasInt32Value) { + if (Int32Value != 0) { output.WriteInt32(1, field_names[2], Int32Value); } - if (hasEnumValue) { + if (EnumValue != global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum.FOO) { output.WriteEnum(2, field_names[0], (int) EnumValue, EnumValue); } - if (hasExtraInt32Value) { + if (ExtraInt32Value != 0) { output.WriteInt32(3, field_names[1], ExtraInt32Value); } UnknownFields.WriteTo(output); @@ -506,13 +463,13 @@ namespace Google.ProtocolBuffers.TestProtos { if (size != -1) return size; size = 0; - if (hasInt32Value) { + if (Int32Value != 0) { size += pb::CodedOutputStream.ComputeInt32Size(1, Int32Value); } - if (hasEnumValue) { + if (EnumValue != global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum.FOO) { size += pb::CodedOutputStream.ComputeEnumSize(2, (int) EnumValue); } - if (hasExtraInt32Value) { + if (ExtraInt32Value != 0) { size += pb::CodedOutputStream.ComputeInt32Size(3, ExtraInt32Value); } size += UnknownFields.SerializedSize; @@ -637,13 +594,13 @@ namespace Google.ProtocolBuffers.TestProtos { public override Builder MergeFrom(FooWithExtraFields other) { if (other == global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.DefaultInstance) return this; PrepareBuilder(); - if (other.HasInt32Value) { + if (other.Int32Value != 0) { Int32Value = other.Int32Value; } - if (other.HasEnumValue) { + if (other.EnumValue != global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum.FOO) { EnumValue = other.EnumValue; } - if (other.HasExtraInt32Value) { + if (other.ExtraInt32Value != 0) { ExtraInt32Value = other.ExtraInt32Value; } this.MergeUnknownFields(other.UnknownFields); @@ -690,13 +647,12 @@ namespace Google.ProtocolBuffers.TestProtos { break; } case 8: { - result.hasInt32Value = input.ReadInt32(ref result.int32Value_); + input.ReadInt32(ref result.int32Value_); break; } case 16: { object unknown; if(input.ReadEnum(ref result.enumValue_, out unknown)) { - result.hasEnumValue = true; } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); @@ -706,7 +662,7 @@ namespace Google.ProtocolBuffers.TestProtos { break; } case 24: { - result.hasExtraInt32Value = input.ReadInt32(ref result.extraInt32Value_); + input.ReadInt32(ref result.extraInt32Value_); break; } } @@ -719,62 +675,47 @@ namespace Google.ProtocolBuffers.TestProtos { } - public bool HasInt32Value { - get { return result.hasInt32Value; } - } public int Int32Value { get { return result.Int32Value; } set { SetInt32Value(value); } } public Builder SetInt32Value(int value) { PrepareBuilder(); - result.hasInt32Value = true; result.int32Value_ = value; return this; } public Builder ClearInt32Value() { PrepareBuilder(); - result.hasInt32Value = false; result.int32Value_ = 0; return this; } - public bool HasEnumValue { - get { return result.hasEnumValue; } - } public global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum EnumValue { get { return result.EnumValue; } set { SetEnumValue(value); } } public Builder SetEnumValue(global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum value) { PrepareBuilder(); - result.hasEnumValue = true; result.enumValue_ = value; return this; } public Builder ClearEnumValue() { PrepareBuilder(); - result.hasEnumValue = false; result.enumValue_ = global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum.FOO; return this; } - public bool HasExtraInt32Value { - get { return result.hasExtraInt32Value; } - } public int ExtraInt32Value { get { return result.ExtraInt32Value; } set { SetExtraInt32Value(value); } } public Builder SetExtraInt32Value(int value) { PrepareBuilder(); - result.hasExtraInt32Value = true; result.extraInt32Value_ = value; return this; } public Builder ClearExtraInt32Value() { PrepareBuilder(); - result.hasExtraInt32Value = false; result.extraInt32Value_ = 0; return this; } -- cgit v1.2.3 From 3aa58085577aa9f2ef7308f5afb26966707e7f71 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 21:56:40 -0700 Subject: Regenerated UnittestExtrasLite.cs --- .../TestProtos/UnittestExtrasLite.cs | 99 +++++++++++----------- 1 file changed, 48 insertions(+), 51 deletions(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasLite.cs b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasLite.cs index 2cb0459b..441a7c60 100644 --- a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasLite.cs +++ b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestExtrasLite.cs @@ -39,20 +39,16 @@ namespace Google.ProtocolBuffers.TestProtos { public const int UnpackedInt64ExtensionLiteFieldNumber = 91; public static pb::GeneratedRepeatExtensionLite UnpackedInt64ExtensionLite; public const int UnpackedUint32ExtensionLiteFieldNumber = 92; - [global::System.CLSCompliant(false)] public static pb::GeneratedRepeatExtensionLite UnpackedUint32ExtensionLite; public const int UnpackedUint64ExtensionLiteFieldNumber = 93; - [global::System.CLSCompliant(false)] public static pb::GeneratedRepeatExtensionLite UnpackedUint64ExtensionLite; public const int UnpackedSint32ExtensionLiteFieldNumber = 94; public static pb::GeneratedRepeatExtensionLite UnpackedSint32ExtensionLite; public const int UnpackedSint64ExtensionLiteFieldNumber = 95; public static pb::GeneratedRepeatExtensionLite UnpackedSint64ExtensionLite; public const int UnpackedFixed32ExtensionLiteFieldNumber = 96; - [global::System.CLSCompliant(false)] public static pb::GeneratedRepeatExtensionLite UnpackedFixed32ExtensionLite; public const int UnpackedFixed64ExtensionLiteFieldNumber = 97; - [global::System.CLSCompliant(false)] public static pb::GeneratedRepeatExtensionLite UnpackedFixed64ExtensionLite; public const int UnpackedSfixed32ExtensionLiteFieldNumber = 98; public static pb::GeneratedRepeatExtensionLite UnpackedSfixed32ExtensionLite; @@ -313,8 +309,12 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasD) hash ^= d_.GetHashCode(); - if (hasEn) hash ^= en_.GetHashCode(); + if (hasD) { + hash ^= d_.GetHashCode(); + } + if (hasEn) { + hash ^= en_.GetHashCode(); + } return hash; } @@ -657,8 +657,12 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasNumber) hash ^= number_.GetHashCode(); - if (hasType) hash ^= type_.GetHashCode(); + if (hasNumber) { + hash ^= number_.GetHashCode(); + } + if (hasType) { + hash ^= type_.GetHashCode(); + } return hash; } @@ -957,7 +961,6 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasZip { get { return hasZip; } } - [global::System.CLSCompliant(false)] public uint Zip { get { return zip_; } } @@ -1027,11 +1030,21 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasAddress) hash ^= address_.GetHashCode(); - if (hasAddress2) hash ^= address2_.GetHashCode(); - if (hasCity) hash ^= city_.GetHashCode(); - if (hasState) hash ^= state_.GetHashCode(); - if (hasZip) hash ^= zip_.GetHashCode(); + if (hasAddress) { + hash ^= address_.GetHashCode(); + } + if (hasAddress2) { + hash ^= address2_.GetHashCode(); + } + if (hasCity) { + hash ^= city_.GetHashCode(); + } + if (hasState) { + hash ^= state_.GetHashCode(); + } + if (hasZip) { + hash ^= zip_.GetHashCode(); + } return hash; } @@ -1330,12 +1343,10 @@ namespace Google.ProtocolBuffers.TestProtos { public bool HasZip { get { return result.hasZip; } } - [global::System.CLSCompliant(false)] public uint Zip { get { return result.Zip; } set { SetZip(value); } } - [global::System.CLSCompliant(false)] public Builder SetZip(uint value) { PrepareBuilder(); result.hasZip = true; @@ -1508,9 +1519,15 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasName) hash ^= name_.GetHashCode(); - if (hasId) hash ^= id_.GetHashCode(); - if (hasEmail) hash ^= email_.GetHashCode(); + if (hasName) { + hash ^= name_.GetHashCode(); + } + if (hasId) { + hash ^= id_.GetHashCode(); + } + if (hasEmail) { + hash ^= email_.GetHashCode(); + } foreach(int i in codes_) hash ^= i.GetHashCode(); foreach(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber i in phone_) @@ -2002,7 +2019,9 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasNumber) hash ^= number_.GetHashCode(); + if (hasNumber) { + hash ^= number_.GetHashCode(); + } return hash; } @@ -2476,28 +2495,24 @@ namespace Google.ProtocolBuffers.TestProtos { public const int UnpackedUint32FieldNumber = 92; private pbc::PopsicleList unpackedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] public scg::IList UnpackedUint32List { get { return pbc::Lists.AsReadOnly(unpackedUint32_); } } public int UnpackedUint32Count { get { return unpackedUint32_.Count; } } - [global::System.CLSCompliant(false)] public uint GetUnpackedUint32(int index) { return unpackedUint32_[index]; } public const int UnpackedUint64FieldNumber = 93; private pbc::PopsicleList unpackedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] public scg::IList UnpackedUint64List { get { return pbc::Lists.AsReadOnly(unpackedUint64_); } } public int UnpackedUint64Count { get { return unpackedUint64_.Count; } } - [global::System.CLSCompliant(false)] public ulong GetUnpackedUint64(int index) { return unpackedUint64_[index]; } @@ -2528,28 +2543,24 @@ namespace Google.ProtocolBuffers.TestProtos { public const int UnpackedFixed32FieldNumber = 96; private pbc::PopsicleList unpackedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] public scg::IList UnpackedFixed32List { get { return pbc::Lists.AsReadOnly(unpackedFixed32_); } } public int UnpackedFixed32Count { get { return unpackedFixed32_.Count; } } - [global::System.CLSCompliant(false)] public uint GetUnpackedFixed32(int index) { return unpackedFixed32_[index]; } public const int UnpackedFixed64FieldNumber = 97; private pbc::PopsicleList unpackedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] public scg::IList UnpackedFixed64List { get { return pbc::Lists.AsReadOnly(unpackedFixed64_); } } public int UnpackedFixed64Count { get { return unpackedFixed64_.Count; } } - [global::System.CLSCompliant(false)] public ulong GetUnpackedFixed64(int index) { return unpackedFixed64_[index]; } @@ -3236,30 +3247,25 @@ namespace Google.ProtocolBuffers.TestProtos { return this; } - [global::System.CLSCompliant(false)] public pbc::IPopsicleList UnpackedUint32List { get { return PrepareBuilder().unpackedUint32_; } } public int UnpackedUint32Count { get { return result.UnpackedUint32Count; } } - [global::System.CLSCompliant(false)] public uint GetUnpackedUint32(int index) { return result.GetUnpackedUint32(index); } - [global::System.CLSCompliant(false)] public Builder SetUnpackedUint32(int index, uint value) { PrepareBuilder(); result.unpackedUint32_[index] = value; return this; } - [global::System.CLSCompliant(false)] public Builder AddUnpackedUint32(uint value) { PrepareBuilder(); result.unpackedUint32_.Add(value); return this; } - [global::System.CLSCompliant(false)] public Builder AddRangeUnpackedUint32(scg::IEnumerable values) { PrepareBuilder(); result.unpackedUint32_.Add(values); @@ -3271,30 +3277,25 @@ namespace Google.ProtocolBuffers.TestProtos { return this; } - [global::System.CLSCompliant(false)] public pbc::IPopsicleList UnpackedUint64List { get { return PrepareBuilder().unpackedUint64_; } } public int UnpackedUint64Count { get { return result.UnpackedUint64Count; } } - [global::System.CLSCompliant(false)] public ulong GetUnpackedUint64(int index) { return result.GetUnpackedUint64(index); } - [global::System.CLSCompliant(false)] public Builder SetUnpackedUint64(int index, ulong value) { PrepareBuilder(); result.unpackedUint64_[index] = value; return this; } - [global::System.CLSCompliant(false)] public Builder AddUnpackedUint64(ulong value) { PrepareBuilder(); result.unpackedUint64_.Add(value); return this; } - [global::System.CLSCompliant(false)] public Builder AddRangeUnpackedUint64(scg::IEnumerable values) { PrepareBuilder(); result.unpackedUint64_.Add(values); @@ -3366,30 +3367,25 @@ namespace Google.ProtocolBuffers.TestProtos { return this; } - [global::System.CLSCompliant(false)] public pbc::IPopsicleList UnpackedFixed32List { get { return PrepareBuilder().unpackedFixed32_; } } public int UnpackedFixed32Count { get { return result.UnpackedFixed32Count; } } - [global::System.CLSCompliant(false)] public uint GetUnpackedFixed32(int index) { return result.GetUnpackedFixed32(index); } - [global::System.CLSCompliant(false)] public Builder SetUnpackedFixed32(int index, uint value) { PrepareBuilder(); result.unpackedFixed32_[index] = value; return this; } - [global::System.CLSCompliant(false)] public Builder AddUnpackedFixed32(uint value) { PrepareBuilder(); result.unpackedFixed32_.Add(value); return this; } - [global::System.CLSCompliant(false)] public Builder AddRangeUnpackedFixed32(scg::IEnumerable values) { PrepareBuilder(); result.unpackedFixed32_.Add(values); @@ -3401,30 +3397,25 @@ namespace Google.ProtocolBuffers.TestProtos { return this; } - [global::System.CLSCompliant(false)] public pbc::IPopsicleList UnpackedFixed64List { get { return PrepareBuilder().unpackedFixed64_; } } public int UnpackedFixed64Count { get { return result.UnpackedFixed64Count; } } - [global::System.CLSCompliant(false)] public ulong GetUnpackedFixed64(int index) { return result.GetUnpackedFixed64(index); } - [global::System.CLSCompliant(false)] public Builder SetUnpackedFixed64(int index, ulong value) { PrepareBuilder(); result.unpackedFixed64_[index] = value; return this; } - [global::System.CLSCompliant(false)] public Builder AddUnpackedFixed64(ulong value) { PrepareBuilder(); result.unpackedFixed64_.Add(value); return this; } - [global::System.CLSCompliant(false)] public Builder AddRangeUnpackedFixed64(scg::IEnumerable values) { PrepareBuilder(); result.unpackedFixed64_.Add(values); @@ -3686,7 +3677,9 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasValue) hash ^= value_.GetHashCode(); + if (hasValue) { + hash ^= value_.GetHashCode(); + } return hash; } @@ -3969,8 +3962,12 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasValue) hash ^= value_.GetHashCode(); - if (hasValue2) hash ^= value2_.GetHashCode(); + if (hasValue) { + hash ^= value_.GetHashCode(); + } + if (hasValue2) { + hash ^= value2_.GetHashCode(); + } return hash; } -- cgit v1.2.3 From 4083104aa4862e22aa5addbfaaa3a49ebbd2c4a0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 21:58:59 -0700 Subject: regenerated UnittestImportPublicLite --- .../ProtocolBuffersLite.Test/TestProtos/UnittestImportPublicLite.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportPublicLite.cs b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportPublicLite.cs index de250899..6dabfcdb 100644 --- a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportPublicLite.cs +++ b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportPublicLite.cs @@ -92,7 +92,9 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasE) hash ^= e_.GetHashCode(); + if (hasE) { + hash ^= e_.GetHashCode(); + } return hash; } -- cgit v1.2.3 From 881995352dfedc23ed62f45d4acc18f948f1785a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 12 May 2015 22:00:38 -0700 Subject: regenerated UnittestImportLite.cs --- csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportLite.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportLite.cs b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportLite.cs index b0ad3155..1fee16e0 100644 --- a/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportLite.cs +++ b/csharp/src/ProtocolBuffersLite.Test/TestProtos/UnittestImportLite.cs @@ -101,7 +101,9 @@ namespace Google.ProtocolBuffers.TestProtos { #region Lite runtime methods public override int GetHashCode() { int hash = GetType().GetHashCode(); - if (hasD) hash ^= d_.GetHashCode(); + if (hasD) { + hash ^= d_.GetHashCode(); + } return hash; } -- cgit v1.2.3 From 998b5ba20d4bacb25c90f2afaddac3900a06d61b Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 13 May 2015 17:34:02 +0100 Subject: Remove the C#-specific field_presence_test.proto, using unittest_no_field_presence.proto instead. This is the start of establishing a C# namespace of "Google.ProtocolBuffers.TestProtos.Proto3" for proto3-syntax protos. We could optionally split the directory structure as well into Proto2 and Proto3 for clarity. --- .../google/protobuf/field_presence_test.proto | 21 - .../src/ProtocolBuffers.Test/FieldPresenceTest.cs | 4 +- .../ProtocolBuffers.Test.csproj | 2 +- .../TestProtos/FieldPresenceTest.cs | 782 ---- .../TestProtos/UnittestNoFieldPresence.cs | 3776 ++++++++++++++++++++ .../protobuf/unittest_no_field_presence.proto | 2 +- 6 files changed, 3780 insertions(+), 807 deletions(-) delete mode 100644 csharp/protos/google/protobuf/field_presence_test.proto delete mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs create mode 100644 csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs (limited to 'csharp/src') diff --git a/csharp/protos/google/protobuf/field_presence_test.proto b/csharp/protos/google/protobuf/field_presence_test.proto deleted file mode 100644 index 14d91312..00000000 --- a/csharp/protos/google/protobuf/field_presence_test.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; - -package Google.ProtocolBuffers.TestProtos.FieldPresence; - -// TODO(jieluo): Add repeated fields, oneof, maps to TestAllTypes -message TestAllTypes { - enum NestedEnum { - FOO = 0; - BAR = 1; - BAZ = 2; - } - message NestedMessage { - optional int32 value = 1; - } - - optional int32 optional_int32 = 1; - optional string optional_string = 2; - optional bytes optional_bytes = 3; - optional NestedEnum optional_nested_enum = 4; - optional NestedMessage optional_nested_message = 5; -} diff --git a/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs b/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs index 9c1fc6af..8f59334e 100644 --- a/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs +++ b/csharp/src/ProtocolBuffers.Test/FieldPresenceTest.cs @@ -33,7 +33,7 @@ using System; using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos.FieldPresence; +using Google.ProtocolBuffers.TestProtos.Proto3; using NUnit.Framework; namespace Google.ProtocolBuffers @@ -177,7 +177,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(ByteString.Empty, message.OptionalBytes); Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); Assert.IsTrue(message.HasOptionalNestedMessage); - Assert.AreEqual(0, message.OptionalNestedMessage.Value); + Assert.AreEqual(0, message.OptionalNestedMessage.Bb); } } } diff --git a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index dd28f34a..b4c562d1 100644 --- a/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -84,7 +84,6 @@ - @@ -96,6 +95,7 @@ + diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs deleted file mode 100644 index b4cb279d..00000000 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/FieldPresenceTest.cs +++ /dev/null @@ -1,782 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protos/google/protobuf/field_presence_test.proto -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos.FieldPresence { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class FieldPresenceTest { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static FieldPresenceTest() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjBwcm90b3MvZ29vZ2xlL3Byb3RvYnVmL2ZpZWxkX3ByZXNlbmNlX3Rlc3Qu", - "cHJvdG8SL0dvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcy5GaWVs", - "ZFByZXNlbmNlIvYCCgxUZXN0QWxsVHlwZXMSFgoOb3B0aW9uYWxfaW50MzIY", - "ASABKAUSFwoPb3B0aW9uYWxfc3RyaW5nGAIgASgJEhYKDm9wdGlvbmFsX2J5", - "dGVzGAMgASgMEmYKFG9wdGlvbmFsX25lc3RlZF9lbnVtGAQgASgOMkguR29v", - "Z2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zLkZpZWxkUHJlc2VuY2Uu", - "VGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SbAoXb3B0aW9uYWxfbmVzdGVkX21l", - "c3NhZ2UYBSABKAsySy5Hb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90", - "b3MuRmllbGRQcmVzZW5jZS5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRoe", - "Cg1OZXN0ZWRNZXNzYWdlEg0KBXZhbHVlGAEgASgFIicKCk5lc3RlZEVudW0S", - "BwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAJiBnByb3RvMw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalString", "OptionalBytes", "OptionalNestedEnum", "OptionalNestedMessage", }); - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor = internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Value", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "optional_bytes", "optional_int32", "optional_nested_enum", "optional_nested_message", "optional_string" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 26, 8, 32, 42, 18 }; - public static TestAllTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 0, - BAR = 1, - BAZ = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "value" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.internal__static_Google_ProtocolBuffers_TestProtos_FieldPresence_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private int value_; - public int Value { - get { return value_; } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (Value != 0) { - output.WriteInt32(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (Value != 0) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.Value != 0) { - Value = other.Value; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - input.ReadInt32(ref result.value_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(int value) { - PrepareBuilder(); - result.value_ = value; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.value_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private int optionalInt32_; - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalStringFieldNumber = 2; - private string optionalString_ = ""; - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 3; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalNestedEnumFieldNumber = 4; - private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalNestedMessageFieldNumber = 5; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (OptionalInt32 != 0) { - output.WriteInt32(1, field_names[1], OptionalInt32); - } - if (OptionalString != "") { - output.WriteString(2, field_names[4], OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) { - output.WriteBytes(3, field_names[0], OptionalBytes); - } - if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - output.WriteEnum(4, field_names[2], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(5, field_names[3], OptionalNestedMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (OptionalInt32 != 0) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (OptionalString != "") { - size += pb::CodedOutputStream.ComputeStringSize(2, OptionalString); - } - if (OptionalBytes != pb::ByteString.Empty) { - size += pb::CodedOutputStream.ComputeBytesSize(3, OptionalBytes); - } - if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int) OptionalNestedEnum); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(5, OptionalNestedMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllTypes) { - return MergeFrom((TestAllTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.OptionalInt32 != 0) { - OptionalInt32 = other.OptionalInt32; - } - if (other.OptionalString != "") { - OptionalString = other.OptionalString; - } - if (other.OptionalBytes != pb::ByteString.Empty) { - OptionalBytes = other.OptionalBytes; - } - if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - input.ReadInt32(ref result.optionalInt32_); - break; - } - case 18: { - input.ReadString(ref result.optionalString_); - break; - } - case 26: { - input.ReadBytes(ref result.optionalBytes_); - break; - } - case 32: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong)(int)unknown); - } - break; - } - case 42: { - global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.optionalInt32_ = 0; - return this; - } - - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.optionalString_ = ""; - return this; - } - - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.FieldPresence.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - } - static TestAllTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.FieldPresence.FieldPresenceTest.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs new file mode 100644 index 00000000..0d212b72 --- /dev/null +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs @@ -0,0 +1,3776 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/unittest_no_field_presence.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace Google.ProtocolBuffers.TestProtos.Proto3 { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class UnittestNoFieldPresence { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static UnittestNoFieldPresence() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjBnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfbm9fZmllbGRfcHJlc2VuY2Uu", + "cHJvdG8SH3Byb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QaHmdvb2ds", + "ZS9wcm90b2J1Zi91bml0dGVzdC5wcm90byKaEQoMVGVzdEFsbFR5cGVzEhYK", + "Dm9wdGlvbmFsX2ludDMyGAEgASgFEhYKDm9wdGlvbmFsX2ludDY0GAIgASgD", + "EhcKD29wdGlvbmFsX3VpbnQzMhgDIAEoDRIXCg9vcHRpb25hbF91aW50NjQY", + "BCABKAQSFwoPb3B0aW9uYWxfc2ludDMyGAUgASgREhcKD29wdGlvbmFsX3Np", + "bnQ2NBgGIAEoEhIYChBvcHRpb25hbF9maXhlZDMyGAcgASgHEhgKEG9wdGlv", + "bmFsX2ZpeGVkNjQYCCABKAYSGQoRb3B0aW9uYWxfc2ZpeGVkMzIYCSABKA8S", + "GQoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBASFgoOb3B0aW9uYWxfZmxvYXQY", + "CyABKAISFwoPb3B0aW9uYWxfZG91YmxlGAwgASgBEhUKDW9wdGlvbmFsX2Jv", + "b2wYDSABKAgSFwoPb3B0aW9uYWxfc3RyaW5nGA4gASgJEhYKDm9wdGlvbmFs", + "X2J5dGVzGA8gASgMElwKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGBIgASgL", + "MjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0dGVzdC5UZXN0QWxsVHlw", + "ZXMuTmVzdGVkTWVzc2FnZRJRChhvcHRpb25hbF9mb3JlaWduX21lc3NhZ2UY", + "EyABKAsyLy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LkZvcmVp", + "Z25NZXNzYWdlEkAKF29wdGlvbmFsX3Byb3RvMl9tZXNzYWdlGBQgASgLMh8u", + "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzElYKFG9wdGlvbmFsX25l", + "c3RlZF9lbnVtGBUgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", + "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bRJLChVvcHRpb25hbF9mb3Jl", + "aWduX2VudW0YFiABKA4yLC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", + "ZXN0LkZvcmVpZ25FbnVtEiEKFW9wdGlvbmFsX3N0cmluZ19waWVjZRgYIAEo", + "CUICCAISGQoNb3B0aW9uYWxfY29yZBgZIAEoCUICCAESXgoVb3B0aW9uYWxf", + "bGF6eV9tZXNzYWdlGB4gASgLMjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91", + "bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZUICKAESFgoOcmVw", + "ZWF0ZWRfaW50MzIYHyADKAUSFgoOcmVwZWF0ZWRfaW50NjQYICADKAMSFwoP", + "cmVwZWF0ZWRfdWludDMyGCEgAygNEhcKD3JlcGVhdGVkX3VpbnQ2NBgiIAMo", + "BBIXCg9yZXBlYXRlZF9zaW50MzIYIyADKBESFwoPcmVwZWF0ZWRfc2ludDY0", + "GCQgAygSEhgKEHJlcGVhdGVkX2ZpeGVkMzIYJSADKAcSGAoQcmVwZWF0ZWRf", + "Zml4ZWQ2NBgmIAMoBhIZChFyZXBlYXRlZF9zZml4ZWQzMhgnIAMoDxIZChFy", + "ZXBlYXRlZF9zZml4ZWQ2NBgoIAMoEBIWCg5yZXBlYXRlZF9mbG9hdBgpIAMo", + "AhIXCg9yZXBlYXRlZF9kb3VibGUYKiADKAESFQoNcmVwZWF0ZWRfYm9vbBgr", + "IAMoCBIXCg9yZXBlYXRlZF9zdHJpbmcYLCADKAkSFgoOcmVwZWF0ZWRfYnl0", + "ZXMYLSADKAwSXAoXcmVwZWF0ZWRfbmVzdGVkX21lc3NhZ2UYMCADKAsyOy5w", + "cm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LlRlc3RBbGxUeXBlcy5O", + "ZXN0ZWRNZXNzYWdlElEKGHJlcGVhdGVkX2ZvcmVpZ25fbWVzc2FnZRgxIAMo", + "CzIvLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuRm9yZWlnbk1l", + "c3NhZ2USQAoXcmVwZWF0ZWRfcHJvdG8yX21lc3NhZ2UYMiADKAsyHy5wcm90", + "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMSVgoUcmVwZWF0ZWRfbmVzdGVk", + "X2VudW0YMyADKA4yOC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0", + "LlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtEksKFXJlcGVhdGVkX2ZvcmVpZ25f", + "ZW51bRg0IAMoDjIsLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3Qu", + "Rm9yZWlnbkVudW0SIQoVcmVwZWF0ZWRfc3RyaW5nX3BpZWNlGDYgAygJQgII", + "AhIZCg1yZXBlYXRlZF9jb3JkGDcgAygJQgIIARJeChVyZXBlYXRlZF9sYXp5", + "X21lc3NhZ2UYOSADKAsyOy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", + "ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlQgIoARIWCgxvbmVvZl91", + "aW50MzIYbyABKA1IABJbChRvbmVvZl9uZXN0ZWRfbWVzc2FnZRhwIAEoCzI7", + "LnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuVGVzdEFsbFR5cGVz", + "Lk5lc3RlZE1lc3NhZ2VIABIWCgxvbmVvZl9zdHJpbmcYcSABKAlIABJOCgpv", + "bmVvZl9lbnVtGHIgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", + "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bUgAGhsKDU5lc3RlZE1lc3Nh", + "Z2USCgoCYmIYASABKAUiJwoKTmVzdGVkRW51bRIHCgNGT08QABIHCgNCQVIQ", + "ARIHCgNCQVoQAkINCgtvbmVvZl9maWVsZCJFChJUZXN0UHJvdG8yUmVxdWly", + "ZWQSLwoGcHJvdG8yGAEgASgLMh8ucHJvdG9idWZfdW5pdHRlc3QuVGVzdFJl", + "cXVpcmVkIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUqQAoLRm9yZWln", + "bkVudW0SDwoLRk9SRUlHTl9GT08QABIPCgtGT1JFSUdOX0JBUhABEg8KC0ZP", + "UkVJR05fQkFaEAJCK6oCKEdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFBy", + "b3Rvcy5Qcm90bzNiBnByb3RvMw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; + internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor, + new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalProto2Message", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "OptionalLazyMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedProto2Message", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "RepeatedLazyMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofEnum", }); + internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor.NestedTypes[0]; + internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor, + new string[] { "Bb", }); + internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor = Descriptor.MessageTypes[1]; + internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor, + new string[] { "Proto2", }); + internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[2]; + internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor, + new string[] { "C", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::Google.ProtocolBuffers.TestProtos.Unittest.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::Google.ProtocolBuffers.TestProtos.Unittest.Descriptor, + }, assigner); + } + #endregion + + } + #region Enums + public enum ForeignEnum { + FOREIGN_FOO = 0, + FOREIGN_BAR = 1, + FOREIGN_BAZ = 2, + } + + #endregion + + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestAllTypes : pb::GeneratedMessage { + private TestAllTypes() { } + private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); + private static readonly string[] _testAllTypesFieldNames = new string[] { "oneof_enum", "oneof_nested_message", "oneof_string", "oneof_uint32", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_int32", "optional_int64", "optional_lazy_message", "optional_nested_enum", "optional_nested_message", "optional_proto2_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_int32", "repeated_int64", "repeated_lazy_message", "repeated_nested_enum", "repeated_nested_message", "repeated_proto2_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64" }; + private static readonly uint[] _testAllTypesFieldTags = new uint[] { 912, 898, 906, 888, 104, 122, 202, 97, 61, 65, 93, 176, 154, 8, 16, 242, 168, 146, 162, 77, 81, 40, 48, 114, 194, 24, 32, 344, 362, 442, 337, 301, 305, 333, 416, 394, 248, 256, 458, 408, 386, 402, 317, 321, 280, 288, 354, 434, 264, 272 }; + public static TestAllTypes DefaultInstance { + get { return defaultInstance; } + } + + public override TestAllTypes DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TestAllTypes ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum NestedEnum { + FOO = 0, + BAR = 1, + BAZ = 2, + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NestedMessage : pb::GeneratedMessage { + private NestedMessage() { } + private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); + private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" }; + private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; + public static NestedMessage DefaultInstance { + get { return defaultInstance; } + } + + public override NestedMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NestedMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } + } + + public const int BbFieldNumber = 1; + private int bb_; + public int Bb { + get { return bb_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _nestedMessageFieldNames; + if (Bb != 0) { + output.WriteInt32(1, field_names[0], Bb); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (Bb != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Bb); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NestedMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NestedMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NestedMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NestedMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NestedMessage result; + + private NestedMessage PrepareBuilder() { + if (resultIsReadOnly) { + NestedMessage original = result; + result = new NestedMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NestedMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Descriptor; } + } + + public override NestedMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public override NestedMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NestedMessage) { + return MergeFrom((NestedMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NestedMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.Bb != 0) { + Bb = other.Bb; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nestedMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.bb_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int Bb { + get { return result.Bb; } + set { SetBb(value); } + } + public Builder SetBb(int value) { + PrepareBuilder(); + result.bb_ = value; + return this; + } + public Builder ClearBb() { + PrepareBuilder(); + result.bb_ = 0; + return this; + } + } + static NestedMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + } + #endregion + + public const int OptionalInt32FieldNumber = 1; + private int optionalInt32_; + public int OptionalInt32 { + get { return optionalInt32_; } + } + + public const int OptionalInt64FieldNumber = 2; + private long optionalInt64_; + public long OptionalInt64 { + get { return optionalInt64_; } + } + + public const int OptionalUint32FieldNumber = 3; + private uint optionalUint32_; + public uint OptionalUint32 { + get { return optionalUint32_; } + } + + public const int OptionalUint64FieldNumber = 4; + private ulong optionalUint64_; + public ulong OptionalUint64 { + get { return optionalUint64_; } + } + + public const int OptionalSint32FieldNumber = 5; + private int optionalSint32_; + public int OptionalSint32 { + get { return optionalSint32_; } + } + + public const int OptionalSint64FieldNumber = 6; + private long optionalSint64_; + public long OptionalSint64 { + get { return optionalSint64_; } + } + + public const int OptionalFixed32FieldNumber = 7; + private uint optionalFixed32_; + public uint OptionalFixed32 { + get { return optionalFixed32_; } + } + + public const int OptionalFixed64FieldNumber = 8; + private ulong optionalFixed64_; + public ulong OptionalFixed64 { + get { return optionalFixed64_; } + } + + public const int OptionalSfixed32FieldNumber = 9; + private int optionalSfixed32_; + public int OptionalSfixed32 { + get { return optionalSfixed32_; } + } + + public const int OptionalSfixed64FieldNumber = 10; + private long optionalSfixed64_; + public long OptionalSfixed64 { + get { return optionalSfixed64_; } + } + + public const int OptionalFloatFieldNumber = 11; + private float optionalFloat_; + public float OptionalFloat { + get { return optionalFloat_; } + } + + public const int OptionalDoubleFieldNumber = 12; + private double optionalDouble_; + public double OptionalDouble { + get { return optionalDouble_; } + } + + public const int OptionalBoolFieldNumber = 13; + private bool optionalBool_; + public bool OptionalBool { + get { return optionalBool_; } + } + + public const int OptionalStringFieldNumber = 14; + private string optionalString_ = ""; + public string OptionalString { + get { return optionalString_; } + } + + public const int OptionalBytesFieldNumber = 15; + private pb::ByteString optionalBytes_ = pb::ByteString.Empty; + public pb::ByteString OptionalBytes { + get { return optionalBytes_; } + } + + public const int OptionalNestedMessageFieldNumber = 18; + private bool hasOptionalNestedMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage optionalNestedMessage_; + public bool HasOptionalNestedMessage { + get { return hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public const int OptionalForeignMessageFieldNumber = 19; + private bool hasOptionalForeignMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage optionalForeignMessage_; + public bool HasOptionalForeignMessage { + get { return hasOptionalForeignMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage OptionalForeignMessage { + get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance; } + } + + public const int OptionalProto2MessageFieldNumber = 20; + private bool hasOptionalProto2Message; + private global::Google.ProtocolBuffers.TestProtos.TestAllTypes optionalProto2Message_; + public bool HasOptionalProto2Message { + get { return hasOptionalProto2Message; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message { + get { return optionalProto2Message_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } + } + + public const int OptionalNestedEnumFieldNumber = 21; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return optionalNestedEnum_; } + } + + public const int OptionalForeignEnumFieldNumber = 22; + private global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO; + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum OptionalForeignEnum { + get { return optionalForeignEnum_; } + } + + public const int OptionalStringPieceFieldNumber = 24; + private string optionalStringPiece_ = ""; + public string OptionalStringPiece { + get { return optionalStringPiece_; } + } + + public const int OptionalCordFieldNumber = 25; + private string optionalCord_ = ""; + public string OptionalCord { + get { return optionalCord_; } + } + + public const int OptionalLazyMessageFieldNumber = 30; + private bool hasOptionalLazyMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage optionalLazyMessage_; + public bool HasOptionalLazyMessage { + get { return hasOptionalLazyMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalLazyMessage { + get { return optionalLazyMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public const int RepeatedInt32FieldNumber = 31; + private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); + public scg::IList RepeatedInt32List { + get { return pbc::Lists.AsReadOnly(repeatedInt32_); } + } + public int RepeatedInt32Count { + get { return repeatedInt32_.Count; } + } + public int GetRepeatedInt32(int index) { + return repeatedInt32_[index]; + } + + public const int RepeatedInt64FieldNumber = 32; + private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); + public scg::IList RepeatedInt64List { + get { return pbc::Lists.AsReadOnly(repeatedInt64_); } + } + public int RepeatedInt64Count { + get { return repeatedInt64_.Count; } + } + public long GetRepeatedInt64(int index) { + return repeatedInt64_[index]; + } + + public const int RepeatedUint32FieldNumber = 33; + private pbc::PopsicleList repeatedUint32_ = new pbc::PopsicleList(); + public scg::IList RepeatedUint32List { + get { return pbc::Lists.AsReadOnly(repeatedUint32_); } + } + public int RepeatedUint32Count { + get { return repeatedUint32_.Count; } + } + public uint GetRepeatedUint32(int index) { + return repeatedUint32_[index]; + } + + public const int RepeatedUint64FieldNumber = 34; + private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); + public scg::IList RepeatedUint64List { + get { return pbc::Lists.AsReadOnly(repeatedUint64_); } + } + public int RepeatedUint64Count { + get { return repeatedUint64_.Count; } + } + public ulong GetRepeatedUint64(int index) { + return repeatedUint64_[index]; + } + + public const int RepeatedSint32FieldNumber = 35; + private pbc::PopsicleList repeatedSint32_ = new pbc::PopsicleList(); + public scg::IList RepeatedSint32List { + get { return pbc::Lists.AsReadOnly(repeatedSint32_); } + } + public int RepeatedSint32Count { + get { return repeatedSint32_.Count; } + } + public int GetRepeatedSint32(int index) { + return repeatedSint32_[index]; + } + + public const int RepeatedSint64FieldNumber = 36; + private pbc::PopsicleList repeatedSint64_ = new pbc::PopsicleList(); + public scg::IList RepeatedSint64List { + get { return pbc::Lists.AsReadOnly(repeatedSint64_); } + } + public int RepeatedSint64Count { + get { return repeatedSint64_.Count; } + } + public long GetRepeatedSint64(int index) { + return repeatedSint64_[index]; + } + + public const int RepeatedFixed32FieldNumber = 37; + private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); + public scg::IList RepeatedFixed32List { + get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } + } + public int RepeatedFixed32Count { + get { return repeatedFixed32_.Count; } + } + public uint GetRepeatedFixed32(int index) { + return repeatedFixed32_[index]; + } + + public const int RepeatedFixed64FieldNumber = 38; + private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); + public scg::IList RepeatedFixed64List { + get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } + } + public int RepeatedFixed64Count { + get { return repeatedFixed64_.Count; } + } + public ulong GetRepeatedFixed64(int index) { + return repeatedFixed64_[index]; + } + + public const int RepeatedSfixed32FieldNumber = 39; + private pbc::PopsicleList repeatedSfixed32_ = new pbc::PopsicleList(); + public scg::IList RepeatedSfixed32List { + get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); } + } + public int RepeatedSfixed32Count { + get { return repeatedSfixed32_.Count; } + } + public int GetRepeatedSfixed32(int index) { + return repeatedSfixed32_[index]; + } + + public const int RepeatedSfixed64FieldNumber = 40; + private pbc::PopsicleList repeatedSfixed64_ = new pbc::PopsicleList(); + public scg::IList RepeatedSfixed64List { + get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); } + } + public int RepeatedSfixed64Count { + get { return repeatedSfixed64_.Count; } + } + public long GetRepeatedSfixed64(int index) { + return repeatedSfixed64_[index]; + } + + public const int RepeatedFloatFieldNumber = 41; + private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); + public scg::IList RepeatedFloatList { + get { return pbc::Lists.AsReadOnly(repeatedFloat_); } + } + public int RepeatedFloatCount { + get { return repeatedFloat_.Count; } + } + public float GetRepeatedFloat(int index) { + return repeatedFloat_[index]; + } + + public const int RepeatedDoubleFieldNumber = 42; + private pbc::PopsicleList repeatedDouble_ = new pbc::PopsicleList(); + public scg::IList RepeatedDoubleList { + get { return pbc::Lists.AsReadOnly(repeatedDouble_); } + } + public int RepeatedDoubleCount { + get { return repeatedDouble_.Count; } + } + public double GetRepeatedDouble(int index) { + return repeatedDouble_[index]; + } + + public const int RepeatedBoolFieldNumber = 43; + private pbc::PopsicleList repeatedBool_ = new pbc::PopsicleList(); + public scg::IList RepeatedBoolList { + get { return pbc::Lists.AsReadOnly(repeatedBool_); } + } + public int RepeatedBoolCount { + get { return repeatedBool_.Count; } + } + public bool GetRepeatedBool(int index) { + return repeatedBool_[index]; + } + + public const int RepeatedStringFieldNumber = 44; + private pbc::PopsicleList repeatedString_ = new pbc::PopsicleList(); + public scg::IList RepeatedStringList { + get { return pbc::Lists.AsReadOnly(repeatedString_); } + } + public int RepeatedStringCount { + get { return repeatedString_.Count; } + } + public string GetRepeatedString(int index) { + return repeatedString_[index]; + } + + public const int RepeatedBytesFieldNumber = 45; + private pbc::PopsicleList repeatedBytes_ = new pbc::PopsicleList(); + public scg::IList RepeatedBytesList { + get { return pbc::Lists.AsReadOnly(repeatedBytes_); } + } + public int RepeatedBytesCount { + get { return repeatedBytes_.Count; } + } + public pb::ByteString GetRepeatedBytes(int index) { + return repeatedBytes_[index]; + } + + public const int RepeatedNestedMessageFieldNumber = 48; + private pbc::PopsicleList repeatedNestedMessage_ = new pbc::PopsicleList(); + public scg::IList RepeatedNestedMessageList { + get { return repeatedNestedMessage_; } + } + public int RepeatedNestedMessageCount { + get { return repeatedNestedMessage_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { + return repeatedNestedMessage_[index]; + } + + public const int RepeatedForeignMessageFieldNumber = 49; + private pbc::PopsicleList repeatedForeignMessage_ = new pbc::PopsicleList(); + public scg::IList RepeatedForeignMessageList { + get { return repeatedForeignMessage_; } + } + public int RepeatedForeignMessageCount { + get { return repeatedForeignMessage_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage GetRepeatedForeignMessage(int index) { + return repeatedForeignMessage_[index]; + } + + public const int RepeatedProto2MessageFieldNumber = 50; + private pbc::PopsicleList repeatedProto2Message_ = new pbc::PopsicleList(); + public scg::IList RepeatedProto2MessageList { + get { return repeatedProto2Message_; } + } + public int RepeatedProto2MessageCount { + get { return repeatedProto2Message_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) { + return repeatedProto2Message_[index]; + } + + public const int RepeatedNestedEnumFieldNumber = 51; + private pbc::PopsicleList repeatedNestedEnum_ = new pbc::PopsicleList(); + public scg::IList RepeatedNestedEnumList { + get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); } + } + public int RepeatedNestedEnumCount { + get { return repeatedNestedEnum_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { + return repeatedNestedEnum_[index]; + } + + public const int RepeatedForeignEnumFieldNumber = 52; + private pbc::PopsicleList repeatedForeignEnum_ = new pbc::PopsicleList(); + public scg::IList RepeatedForeignEnumList { + get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); } + } + public int RepeatedForeignEnumCount { + get { return repeatedForeignEnum_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum GetRepeatedForeignEnum(int index) { + return repeatedForeignEnum_[index]; + } + + public const int RepeatedStringPieceFieldNumber = 54; + private pbc::PopsicleList repeatedStringPiece_ = new pbc::PopsicleList(); + public scg::IList RepeatedStringPieceList { + get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); } + } + public int RepeatedStringPieceCount { + get { return repeatedStringPiece_.Count; } + } + public string GetRepeatedStringPiece(int index) { + return repeatedStringPiece_[index]; + } + + public const int RepeatedCordFieldNumber = 55; + private pbc::PopsicleList repeatedCord_ = new pbc::PopsicleList(); + public scg::IList RepeatedCordList { + get { return pbc::Lists.AsReadOnly(repeatedCord_); } + } + public int RepeatedCordCount { + get { return repeatedCord_.Count; } + } + public string GetRepeatedCord(int index) { + return repeatedCord_[index]; + } + + public const int RepeatedLazyMessageFieldNumber = 57; + private pbc::PopsicleList repeatedLazyMessage_ = new pbc::PopsicleList(); + public scg::IList RepeatedLazyMessageList { + get { return repeatedLazyMessage_; } + } + public int RepeatedLazyMessageCount { + get { return repeatedLazyMessage_.Count; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) { + return repeatedLazyMessage_[index]; + } + + public const int OneofUint32FieldNumber = 111; + private uint oneofUint32_; + public uint OneofUint32 { + get { return oneofUint32_; } + } + + public const int OneofNestedMessageFieldNumber = 112; + private bool hasOneofNestedMessage; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage oneofNestedMessage_; + public bool HasOneofNestedMessage { + get { return hasOneofNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OneofNestedMessage { + get { return oneofNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; } + } + + public const int OneofStringFieldNumber = 113; + private string oneofString_ = ""; + public string OneofString { + get { return oneofString_; } + } + + public const int OneofEnumFieldNumber = 114; + private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum oneofEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OneofEnum { + get { return oneofEnum_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _testAllTypesFieldNames; + if (OptionalInt32 != 0) { + output.WriteInt32(1, field_names[13], OptionalInt32); + } + if (OptionalInt64 != 0L) { + output.WriteInt64(2, field_names[14], OptionalInt64); + } + if (OptionalUint32 != 0) { + output.WriteUInt32(3, field_names[25], OptionalUint32); + } + if (OptionalUint64 != 0UL) { + output.WriteUInt64(4, field_names[26], OptionalUint64); + } + if (OptionalSint32 != 0) { + output.WriteSInt32(5, field_names[21], OptionalSint32); + } + if (OptionalSint64 != 0L) { + output.WriteSInt64(6, field_names[22], OptionalSint64); + } + if (OptionalFixed32 != 0) { + output.WriteFixed32(7, field_names[8], OptionalFixed32); + } + if (OptionalFixed64 != 0UL) { + output.WriteFixed64(8, field_names[9], OptionalFixed64); + } + if (OptionalSfixed32 != 0) { + output.WriteSFixed32(9, field_names[19], OptionalSfixed32); + } + if (OptionalSfixed64 != 0L) { + output.WriteSFixed64(10, field_names[20], OptionalSfixed64); + } + if (OptionalFloat != 0F) { + output.WriteFloat(11, field_names[10], OptionalFloat); + } + if (OptionalDouble != 0D) { + output.WriteDouble(12, field_names[7], OptionalDouble); + } + if (OptionalBool != false) { + output.WriteBool(13, field_names[4], OptionalBool); + } + if (OptionalString != "") { + output.WriteString(14, field_names[23], OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + output.WriteBytes(15, field_names[5], OptionalBytes); + } + if (hasOptionalNestedMessage) { + output.WriteMessage(18, field_names[17], OptionalNestedMessage); + } + if (hasOptionalForeignMessage) { + output.WriteMessage(19, field_names[12], OptionalForeignMessage); + } + if (hasOptionalProto2Message) { + output.WriteMessage(20, field_names[18], OptionalProto2Message); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + output.WriteEnum(21, field_names[16], (int) OptionalNestedEnum, OptionalNestedEnum); + } + if (OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) { + output.WriteEnum(22, field_names[11], (int) OptionalForeignEnum, OptionalForeignEnum); + } + if (OptionalStringPiece != "") { + output.WriteString(24, field_names[24], OptionalStringPiece); + } + if (OptionalCord != "") { + output.WriteString(25, field_names[6], OptionalCord); + } + if (hasOptionalLazyMessage) { + output.WriteMessage(30, field_names[15], OptionalLazyMessage); + } + if (repeatedInt32_.Count > 0) { + output.WriteInt32Array(31, field_names[36], repeatedInt32_); + } + if (repeatedInt64_.Count > 0) { + output.WriteInt64Array(32, field_names[37], repeatedInt64_); + } + if (repeatedUint32_.Count > 0) { + output.WriteUInt32Array(33, field_names[48], repeatedUint32_); + } + if (repeatedUint64_.Count > 0) { + output.WriteUInt64Array(34, field_names[49], repeatedUint64_); + } + if (repeatedSint32_.Count > 0) { + output.WriteSInt32Array(35, field_names[44], repeatedSint32_); + } + if (repeatedSint64_.Count > 0) { + output.WriteSInt64Array(36, field_names[45], repeatedSint64_); + } + if (repeatedFixed32_.Count > 0) { + output.WriteFixed32Array(37, field_names[31], repeatedFixed32_); + } + if (repeatedFixed64_.Count > 0) { + output.WriteFixed64Array(38, field_names[32], repeatedFixed64_); + } + if (repeatedSfixed32_.Count > 0) { + output.WriteSFixed32Array(39, field_names[42], repeatedSfixed32_); + } + if (repeatedSfixed64_.Count > 0) { + output.WriteSFixed64Array(40, field_names[43], repeatedSfixed64_); + } + if (repeatedFloat_.Count > 0) { + output.WriteFloatArray(41, field_names[33], repeatedFloat_); + } + if (repeatedDouble_.Count > 0) { + output.WriteDoubleArray(42, field_names[30], repeatedDouble_); + } + if (repeatedBool_.Count > 0) { + output.WriteBoolArray(43, field_names[27], repeatedBool_); + } + if (repeatedString_.Count > 0) { + output.WriteStringArray(44, field_names[46], repeatedString_); + } + if (repeatedBytes_.Count > 0) { + output.WriteBytesArray(45, field_names[28], repeatedBytes_); + } + if (repeatedNestedMessage_.Count > 0) { + output.WriteMessageArray(48, field_names[40], repeatedNestedMessage_); + } + if (repeatedForeignMessage_.Count > 0) { + output.WriteMessageArray(49, field_names[35], repeatedForeignMessage_); + } + if (repeatedProto2Message_.Count > 0) { + output.WriteMessageArray(50, field_names[41], repeatedProto2Message_); + } + if (repeatedNestedEnum_.Count > 0) { + output.WriteEnumArray(51, field_names[39], repeatedNestedEnum_); + } + if (repeatedForeignEnum_.Count > 0) { + output.WriteEnumArray(52, field_names[34], repeatedForeignEnum_); + } + if (repeatedStringPiece_.Count > 0) { + output.WriteStringArray(54, field_names[47], repeatedStringPiece_); + } + if (repeatedCord_.Count > 0) { + output.WriteStringArray(55, field_names[29], repeatedCord_); + } + if (repeatedLazyMessage_.Count > 0) { + output.WriteMessageArray(57, field_names[38], repeatedLazyMessage_); + } + if (OneofUint32 != 0) { + output.WriteUInt32(111, field_names[3], OneofUint32); + } + if (hasOneofNestedMessage) { + output.WriteMessage(112, field_names[1], OneofNestedMessage); + } + if (OneofString != "") { + output.WriteString(113, field_names[2], OneofString); + } + if (OneofEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + output.WriteEnum(114, field_names[0], (int) OneofEnum, OneofEnum); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (OptionalInt32 != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); + } + if (OptionalInt64 != 0L) { + size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64); + } + if (OptionalUint32 != 0) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32); + } + if (OptionalUint64 != 0UL) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64); + } + if (OptionalSint32 != 0) { + size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32); + } + if (OptionalSint64 != 0L) { + size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64); + } + if (OptionalFixed32 != 0) { + size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32); + } + if (OptionalFixed64 != 0UL) { + size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64); + } + if (OptionalSfixed32 != 0) { + size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32); + } + if (OptionalSfixed64 != 0L) { + size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64); + } + if (OptionalFloat != 0F) { + size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat); + } + if (OptionalDouble != 0D) { + size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble); + } + if (OptionalBool != false) { + size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool); + } + if (OptionalString != "") { + size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString); + } + if (OptionalBytes != pb::ByteString.Empty) { + size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes); + } + if (hasOptionalNestedMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage); + } + if (hasOptionalForeignMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage); + } + if (hasOptionalProto2Message) { + size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalProto2Message); + } + if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum); + } + if (OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum); + } + if (OptionalStringPiece != "") { + size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece); + } + if (OptionalCord != "") { + size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord); + } + if (hasOptionalLazyMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(30, OptionalLazyMessage); + } + { + int dataSize = 0; + foreach (int element in RepeatedInt32List) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedInt32_.Count; + } + { + int dataSize = 0; + foreach (long element in RepeatedInt64List) { + dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedInt64_.Count; + } + { + int dataSize = 0; + foreach (uint element in RepeatedUint32List) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedUint32_.Count; + } + { + int dataSize = 0; + foreach (ulong element in RepeatedUint64List) { + dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedUint64_.Count; + } + { + int dataSize = 0; + foreach (int element in RepeatedSint32List) { + dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedSint32_.Count; + } + { + int dataSize = 0; + foreach (long element in RepeatedSint64List) { + dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedSint64_.Count; + } + { + int dataSize = 0; + dataSize = 4 * repeatedFixed32_.Count; + size += dataSize; + size += 2 * repeatedFixed32_.Count; + } + { + int dataSize = 0; + dataSize = 8 * repeatedFixed64_.Count; + size += dataSize; + size += 2 * repeatedFixed64_.Count; + } + { + int dataSize = 0; + dataSize = 4 * repeatedSfixed32_.Count; + size += dataSize; + size += 2 * repeatedSfixed32_.Count; + } + { + int dataSize = 0; + dataSize = 8 * repeatedSfixed64_.Count; + size += dataSize; + size += 2 * repeatedSfixed64_.Count; + } + { + int dataSize = 0; + dataSize = 4 * repeatedFloat_.Count; + size += dataSize; + size += 2 * repeatedFloat_.Count; + } + { + int dataSize = 0; + dataSize = 8 * repeatedDouble_.Count; + size += dataSize; + size += 2 * repeatedDouble_.Count; + } + { + int dataSize = 0; + dataSize = 1 * repeatedBool_.Count; + size += dataSize; + size += 2 * repeatedBool_.Count; + } + { + int dataSize = 0; + foreach (string element in RepeatedStringList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedString_.Count; + } + { + int dataSize = 0; + foreach (pb::ByteString element in RepeatedBytesList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedBytes_.Count; + } + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(48, element); + } + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage element in RepeatedForeignMessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(49, element); + } + foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes element in RepeatedProto2MessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(50, element); + } + { + int dataSize = 0; + if (repeatedNestedEnum_.Count > 0) { + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) { + dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); + } + size += dataSize; + size += 2 * repeatedNestedEnum_.Count; + } + } + { + int dataSize = 0; + if (repeatedForeignEnum_.Count > 0) { + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum element in repeatedForeignEnum_) { + dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); + } + size += dataSize; + size += 2 * repeatedForeignEnum_.Count; + } + } + { + int dataSize = 0; + foreach (string element in RepeatedStringPieceList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedStringPiece_.Count; + } + { + int dataSize = 0; + foreach (string element in RepeatedCordList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 2 * repeatedCord_.Count; + } + foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage element in RepeatedLazyMessageList) { + size += pb::CodedOutputStream.ComputeMessageSize(57, element); + } + if (OneofUint32 != 0) { + size += pb::CodedOutputStream.ComputeUInt32Size(111, OneofUint32); + } + if (hasOneofNestedMessage) { + size += pb::CodedOutputStream.ComputeMessageSize(112, OneofNestedMessage); + } + if (OneofString != "") { + size += pb::CodedOutputStream.ComputeStringSize(113, OneofString); + } + if (OneofEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + size += pb::CodedOutputStream.ComputeEnumSize(114, (int) OneofEnum); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TestAllTypes ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TestAllTypes MakeReadOnly() { + repeatedInt32_.MakeReadOnly(); + repeatedInt64_.MakeReadOnly(); + repeatedUint32_.MakeReadOnly(); + repeatedUint64_.MakeReadOnly(); + repeatedSint32_.MakeReadOnly(); + repeatedSint64_.MakeReadOnly(); + repeatedFixed32_.MakeReadOnly(); + repeatedFixed64_.MakeReadOnly(); + repeatedSfixed32_.MakeReadOnly(); + repeatedSfixed64_.MakeReadOnly(); + repeatedFloat_.MakeReadOnly(); + repeatedDouble_.MakeReadOnly(); + repeatedBool_.MakeReadOnly(); + repeatedString_.MakeReadOnly(); + repeatedBytes_.MakeReadOnly(); + repeatedNestedMessage_.MakeReadOnly(); + repeatedForeignMessage_.MakeReadOnly(); + repeatedProto2Message_.MakeReadOnly(); + repeatedNestedEnum_.MakeReadOnly(); + repeatedForeignEnum_.MakeReadOnly(); + repeatedStringPiece_.MakeReadOnly(); + repeatedCord_.MakeReadOnly(); + repeatedLazyMessage_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TestAllTypes prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TestAllTypes cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TestAllTypes result; + + private TestAllTypes PrepareBuilder() { + if (resultIsReadOnly) { + TestAllTypes original = result; + result = new TestAllTypes(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TestAllTypes MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Descriptor; } + } + + public override TestAllTypes DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.DefaultInstance; } + } + + public override TestAllTypes BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TestAllTypes) { + return MergeFrom((TestAllTypes) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TestAllTypes other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.DefaultInstance) return this; + PrepareBuilder(); + if (other.OptionalInt32 != 0) { + OptionalInt32 = other.OptionalInt32; + } + if (other.OptionalInt64 != 0L) { + OptionalInt64 = other.OptionalInt64; + } + if (other.OptionalUint32 != 0) { + OptionalUint32 = other.OptionalUint32; + } + if (other.OptionalUint64 != 0UL) { + OptionalUint64 = other.OptionalUint64; + } + if (other.OptionalSint32 != 0) { + OptionalSint32 = other.OptionalSint32; + } + if (other.OptionalSint64 != 0L) { + OptionalSint64 = other.OptionalSint64; + } + if (other.OptionalFixed32 != 0) { + OptionalFixed32 = other.OptionalFixed32; + } + if (other.OptionalFixed64 != 0UL) { + OptionalFixed64 = other.OptionalFixed64; + } + if (other.OptionalSfixed32 != 0) { + OptionalSfixed32 = other.OptionalSfixed32; + } + if (other.OptionalSfixed64 != 0L) { + OptionalSfixed64 = other.OptionalSfixed64; + } + if (other.OptionalFloat != 0F) { + OptionalFloat = other.OptionalFloat; + } + if (other.OptionalDouble != 0D) { + OptionalDouble = other.OptionalDouble; + } + if (other.OptionalBool != false) { + OptionalBool = other.OptionalBool; + } + if (other.OptionalString != "") { + OptionalString = other.OptionalString; + } + if (other.OptionalBytes != pb::ByteString.Empty) { + OptionalBytes = other.OptionalBytes; + } + if (other.HasOptionalNestedMessage) { + MergeOptionalNestedMessage(other.OptionalNestedMessage); + } + if (other.HasOptionalForeignMessage) { + MergeOptionalForeignMessage(other.OptionalForeignMessage); + } + if (other.HasOptionalProto2Message) { + MergeOptionalProto2Message(other.OptionalProto2Message); + } + if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + OptionalNestedEnum = other.OptionalNestedEnum; + } + if (other.OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) { + OptionalForeignEnum = other.OptionalForeignEnum; + } + if (other.OptionalStringPiece != "") { + OptionalStringPiece = other.OptionalStringPiece; + } + if (other.OptionalCord != "") { + OptionalCord = other.OptionalCord; + } + if (other.HasOptionalLazyMessage) { + MergeOptionalLazyMessage(other.OptionalLazyMessage); + } + if (other.repeatedInt32_.Count != 0) { + result.repeatedInt32_.Add(other.repeatedInt32_); + } + if (other.repeatedInt64_.Count != 0) { + result.repeatedInt64_.Add(other.repeatedInt64_); + } + if (other.repeatedUint32_.Count != 0) { + result.repeatedUint32_.Add(other.repeatedUint32_); + } + if (other.repeatedUint64_.Count != 0) { + result.repeatedUint64_.Add(other.repeatedUint64_); + } + if (other.repeatedSint32_.Count != 0) { + result.repeatedSint32_.Add(other.repeatedSint32_); + } + if (other.repeatedSint64_.Count != 0) { + result.repeatedSint64_.Add(other.repeatedSint64_); + } + if (other.repeatedFixed32_.Count != 0) { + result.repeatedFixed32_.Add(other.repeatedFixed32_); + } + if (other.repeatedFixed64_.Count != 0) { + result.repeatedFixed64_.Add(other.repeatedFixed64_); + } + if (other.repeatedSfixed32_.Count != 0) { + result.repeatedSfixed32_.Add(other.repeatedSfixed32_); + } + if (other.repeatedSfixed64_.Count != 0) { + result.repeatedSfixed64_.Add(other.repeatedSfixed64_); + } + if (other.repeatedFloat_.Count != 0) { + result.repeatedFloat_.Add(other.repeatedFloat_); + } + if (other.repeatedDouble_.Count != 0) { + result.repeatedDouble_.Add(other.repeatedDouble_); + } + if (other.repeatedBool_.Count != 0) { + result.repeatedBool_.Add(other.repeatedBool_); + } + if (other.repeatedString_.Count != 0) { + result.repeatedString_.Add(other.repeatedString_); + } + if (other.repeatedBytes_.Count != 0) { + result.repeatedBytes_.Add(other.repeatedBytes_); + } + if (other.repeatedNestedMessage_.Count != 0) { + result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_); + } + if (other.repeatedForeignMessage_.Count != 0) { + result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_); + } + if (other.repeatedProto2Message_.Count != 0) { + result.repeatedProto2Message_.Add(other.repeatedProto2Message_); + } + if (other.repeatedNestedEnum_.Count != 0) { + result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_); + } + if (other.repeatedForeignEnum_.Count != 0) { + result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_); + } + if (other.repeatedStringPiece_.Count != 0) { + result.repeatedStringPiece_.Add(other.repeatedStringPiece_); + } + if (other.repeatedCord_.Count != 0) { + result.repeatedCord_.Add(other.repeatedCord_); + } + if (other.repeatedLazyMessage_.Count != 0) { + result.repeatedLazyMessage_.Add(other.repeatedLazyMessage_); + } + if (other.OneofUint32 != 0) { + OneofUint32 = other.OneofUint32; + } + if (other.HasOneofNestedMessage) { + MergeOneofNestedMessage(other.OneofNestedMessage); + } + if (other.OneofString != "") { + OneofString = other.OneofString; + } + if (other.OneofEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) { + OneofEnum = other.OneofEnum; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _testAllTypesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.optionalInt32_); + break; + } + case 16: { + input.ReadInt64(ref result.optionalInt64_); + break; + } + case 24: { + input.ReadUInt32(ref result.optionalUint32_); + break; + } + case 32: { + input.ReadUInt64(ref result.optionalUint64_); + break; + } + case 40: { + input.ReadSInt32(ref result.optionalSint32_); + break; + } + case 48: { + input.ReadSInt64(ref result.optionalSint64_); + break; + } + case 61: { + input.ReadFixed32(ref result.optionalFixed32_); + break; + } + case 65: { + input.ReadFixed64(ref result.optionalFixed64_); + break; + } + case 77: { + input.ReadSFixed32(ref result.optionalSfixed32_); + break; + } + case 81: { + input.ReadSFixed64(ref result.optionalSfixed64_); + break; + } + case 93: { + input.ReadFloat(ref result.optionalFloat_); + break; + } + case 97: { + input.ReadDouble(ref result.optionalDouble_); + break; + } + case 104: { + input.ReadBool(ref result.optionalBool_); + break; + } + case 114: { + input.ReadString(ref result.optionalString_); + break; + } + case 122: { + input.ReadBytes(ref result.optionalBytes_); + break; + } + case 146: { + global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOptionalNestedMessage) { + subBuilder.MergeFrom(OptionalNestedMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalNestedMessage = subBuilder.BuildPartial(); + break; + } + case 154: { + global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.CreateBuilder(); + if (result.hasOptionalForeignMessage) { + subBuilder.MergeFrom(OptionalForeignMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalForeignMessage = subBuilder.BuildPartial(); + break; + } + case 162: { + global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(); + if (result.hasOptionalProto2Message) { + subBuilder.MergeFrom(OptionalProto2Message); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalProto2Message = subBuilder.BuildPartial(); + break; + } + case 168: { + object unknown; + if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(21, (ulong)(int)unknown); + } + break; + } + case 176: { + object unknown; + if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(22, (ulong)(int)unknown); + } + break; + } + case 194: { + input.ReadString(ref result.optionalStringPiece_); + break; + } + case 202: { + input.ReadString(ref result.optionalCord_); + break; + } + case 242: { + global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOptionalLazyMessage) { + subBuilder.MergeFrom(OptionalLazyMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OptionalLazyMessage = subBuilder.BuildPartial(); + break; + } + case 250: + case 248: { + input.ReadInt32Array(tag, field_name, result.repeatedInt32_); + break; + } + case 258: + case 256: { + input.ReadInt64Array(tag, field_name, result.repeatedInt64_); + break; + } + case 266: + case 264: { + input.ReadUInt32Array(tag, field_name, result.repeatedUint32_); + break; + } + case 274: + case 272: { + input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); + break; + } + case 282: + case 280: { + input.ReadSInt32Array(tag, field_name, result.repeatedSint32_); + break; + } + case 290: + case 288: { + input.ReadSInt64Array(tag, field_name, result.repeatedSint64_); + break; + } + case 298: + case 301: { + input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); + break; + } + case 306: + case 305: { + input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); + break; + } + case 314: + case 317: { + input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_); + break; + } + case 322: + case 321: { + input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_); + break; + } + case 330: + case 333: { + input.ReadFloatArray(tag, field_name, result.repeatedFloat_); + break; + } + case 338: + case 337: { + input.ReadDoubleArray(tag, field_name, result.repeatedDouble_); + break; + } + case 346: + case 344: { + input.ReadBoolArray(tag, field_name, result.repeatedBool_); + break; + } + case 354: { + input.ReadStringArray(tag, field_name, result.repeatedString_); + break; + } + case 362: { + input.ReadBytesArray(tag, field_name, result.repeatedBytes_); + break; + } + case 386: { + input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); + break; + } + case 394: { + input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance, extensionRegistry); + break; + } + case 402: { + input.ReadMessageArray(tag, field_name, result.repeatedProto2Message_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance, extensionRegistry); + break; + } + case 410: + case 408: { + scg::ICollection unknownItems; + input.ReadEnumArray(tag, field_name, result.repeatedNestedEnum_, out unknownItems); + if (unknownItems != null) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + foreach (object rawValue in unknownItems) + if (rawValue is int) + unknownFields.MergeVarintField(51, (ulong)(int)rawValue); + } + break; + } + case 418: + case 416: { + scg::ICollection unknownItems; + input.ReadEnumArray(tag, field_name, result.repeatedForeignEnum_, out unknownItems); + if (unknownItems != null) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + foreach (object rawValue in unknownItems) + if (rawValue is int) + unknownFields.MergeVarintField(52, (ulong)(int)rawValue); + } + break; + } + case 434: { + input.ReadStringArray(tag, field_name, result.repeatedStringPiece_); + break; + } + case 442: { + input.ReadStringArray(tag, field_name, result.repeatedCord_); + break; + } + case 458: { + input.ReadMessageArray(tag, field_name, result.repeatedLazyMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); + break; + } + case 888: { + input.ReadUInt32(ref result.oneofUint32_); + break; + } + case 898: { + global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(); + if (result.hasOneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder, extensionRegistry); + OneofNestedMessage = subBuilder.BuildPartial(); + break; + } + case 906: { + input.ReadString(ref result.oneofString_); + break; + } + case 912: { + object unknown; + if(input.ReadEnum(ref result.oneofEnum_, out unknown)) { + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(114, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int OptionalInt32 { + get { return result.OptionalInt32; } + set { SetOptionalInt32(value); } + } + public Builder SetOptionalInt32(int value) { + PrepareBuilder(); + result.optionalInt32_ = value; + return this; + } + public Builder ClearOptionalInt32() { + PrepareBuilder(); + result.optionalInt32_ = 0; + return this; + } + + public long OptionalInt64 { + get { return result.OptionalInt64; } + set { SetOptionalInt64(value); } + } + public Builder SetOptionalInt64(long value) { + PrepareBuilder(); + result.optionalInt64_ = value; + return this; + } + public Builder ClearOptionalInt64() { + PrepareBuilder(); + result.optionalInt64_ = 0L; + return this; + } + + public uint OptionalUint32 { + get { return result.OptionalUint32; } + set { SetOptionalUint32(value); } + } + public Builder SetOptionalUint32(uint value) { + PrepareBuilder(); + result.optionalUint32_ = value; + return this; + } + public Builder ClearOptionalUint32() { + PrepareBuilder(); + result.optionalUint32_ = 0; + return this; + } + + public ulong OptionalUint64 { + get { return result.OptionalUint64; } + set { SetOptionalUint64(value); } + } + public Builder SetOptionalUint64(ulong value) { + PrepareBuilder(); + result.optionalUint64_ = value; + return this; + } + public Builder ClearOptionalUint64() { + PrepareBuilder(); + result.optionalUint64_ = 0UL; + return this; + } + + public int OptionalSint32 { + get { return result.OptionalSint32; } + set { SetOptionalSint32(value); } + } + public Builder SetOptionalSint32(int value) { + PrepareBuilder(); + result.optionalSint32_ = value; + return this; + } + public Builder ClearOptionalSint32() { + PrepareBuilder(); + result.optionalSint32_ = 0; + return this; + } + + public long OptionalSint64 { + get { return result.OptionalSint64; } + set { SetOptionalSint64(value); } + } + public Builder SetOptionalSint64(long value) { + PrepareBuilder(); + result.optionalSint64_ = value; + return this; + } + public Builder ClearOptionalSint64() { + PrepareBuilder(); + result.optionalSint64_ = 0L; + return this; + } + + public uint OptionalFixed32 { + get { return result.OptionalFixed32; } + set { SetOptionalFixed32(value); } + } + public Builder SetOptionalFixed32(uint value) { + PrepareBuilder(); + result.optionalFixed32_ = value; + return this; + } + public Builder ClearOptionalFixed32() { + PrepareBuilder(); + result.optionalFixed32_ = 0; + return this; + } + + public ulong OptionalFixed64 { + get { return result.OptionalFixed64; } + set { SetOptionalFixed64(value); } + } + public Builder SetOptionalFixed64(ulong value) { + PrepareBuilder(); + result.optionalFixed64_ = value; + return this; + } + public Builder ClearOptionalFixed64() { + PrepareBuilder(); + result.optionalFixed64_ = 0UL; + return this; + } + + public int OptionalSfixed32 { + get { return result.OptionalSfixed32; } + set { SetOptionalSfixed32(value); } + } + public Builder SetOptionalSfixed32(int value) { + PrepareBuilder(); + result.optionalSfixed32_ = value; + return this; + } + public Builder ClearOptionalSfixed32() { + PrepareBuilder(); + result.optionalSfixed32_ = 0; + return this; + } + + public long OptionalSfixed64 { + get { return result.OptionalSfixed64; } + set { SetOptionalSfixed64(value); } + } + public Builder SetOptionalSfixed64(long value) { + PrepareBuilder(); + result.optionalSfixed64_ = value; + return this; + } + public Builder ClearOptionalSfixed64() { + PrepareBuilder(); + result.optionalSfixed64_ = 0L; + return this; + } + + public float OptionalFloat { + get { return result.OptionalFloat; } + set { SetOptionalFloat(value); } + } + public Builder SetOptionalFloat(float value) { + PrepareBuilder(); + result.optionalFloat_ = value; + return this; + } + public Builder ClearOptionalFloat() { + PrepareBuilder(); + result.optionalFloat_ = 0F; + return this; + } + + public double OptionalDouble { + get { return result.OptionalDouble; } + set { SetOptionalDouble(value); } + } + public Builder SetOptionalDouble(double value) { + PrepareBuilder(); + result.optionalDouble_ = value; + return this; + } + public Builder ClearOptionalDouble() { + PrepareBuilder(); + result.optionalDouble_ = 0D; + return this; + } + + public bool OptionalBool { + get { return result.OptionalBool; } + set { SetOptionalBool(value); } + } + public Builder SetOptionalBool(bool value) { + PrepareBuilder(); + result.optionalBool_ = value; + return this; + } + public Builder ClearOptionalBool() { + PrepareBuilder(); + result.optionalBool_ = false; + return this; + } + + public string OptionalString { + get { return result.OptionalString; } + set { SetOptionalString(value); } + } + public Builder SetOptionalString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalString_ = value; + return this; + } + public Builder ClearOptionalString() { + PrepareBuilder(); + result.optionalString_ = ""; + return this; + } + + public pb::ByteString OptionalBytes { + get { return result.OptionalBytes; } + set { SetOptionalBytes(value); } + } + public Builder SetOptionalBytes(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalBytes_ = value; + return this; + } + public Builder ClearOptionalBytes() { + PrepareBuilder(); + result.optionalBytes_ = pb::ByteString.Empty; + return this; + } + + public bool HasOptionalNestedMessage { + get { return result.hasOptionalNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalNestedMessage { + get { return result.OptionalNestedMessage; } + set { SetOptionalNestedMessage(value); } + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = value; + return this; + } + public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalNestedMessage = true; + result.optionalNestedMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalNestedMessage && + result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalNestedMessage_ = value; + } + result.hasOptionalNestedMessage = true; + return this; + } + public Builder ClearOptionalNestedMessage() { + PrepareBuilder(); + result.hasOptionalNestedMessage = false; + result.optionalNestedMessage_ = null; + return this; + } + + public bool HasOptionalForeignMessage { + get { return result.hasOptionalForeignMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage OptionalForeignMessage { + get { return result.OptionalForeignMessage; } + set { SetOptionalForeignMessage(value); } + } + public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalForeignMessage = true; + result.optionalForeignMessage_ = value; + return this; + } + public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalForeignMessage = true; + result.optionalForeignMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalForeignMessage && + result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance) { + result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalForeignMessage_ = value; + } + result.hasOptionalForeignMessage = true; + return this; + } + public Builder ClearOptionalForeignMessage() { + PrepareBuilder(); + result.hasOptionalForeignMessage = false; + result.optionalForeignMessage_ = null; + return this; + } + + public bool HasOptionalProto2Message { + get { return result.hasOptionalProto2Message; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message { + get { return result.OptionalProto2Message; } + set { SetOptionalProto2Message(value); } + } + public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalProto2Message = true; + result.optionalProto2Message_ = value; + return this; + } + public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalProto2Message = true; + result.optionalProto2Message_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalProto2Message && + result.optionalProto2Message_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) { + result.optionalProto2Message_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(result.optionalProto2Message_).MergeFrom(value).BuildPartial(); + } else { + result.optionalProto2Message_ = value; + } + result.hasOptionalProto2Message = true; + return this; + } + public Builder ClearOptionalProto2Message() { + PrepareBuilder(); + result.hasOptionalProto2Message = false; + result.optionalProto2Message_ = null; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OptionalNestedEnum { + get { return result.OptionalNestedEnum; } + set { SetOptionalNestedEnum(value); } + } + public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.optionalNestedEnum_ = value; + return this; + } + public Builder ClearOptionalNestedEnum() { + PrepareBuilder(); + result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum OptionalForeignEnum { + get { return result.OptionalForeignEnum; } + set { SetOptionalForeignEnum(value); } + } + public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) { + PrepareBuilder(); + result.optionalForeignEnum_ = value; + return this; + } + public Builder ClearOptionalForeignEnum() { + PrepareBuilder(); + result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO; + return this; + } + + public string OptionalStringPiece { + get { return result.OptionalStringPiece; } + set { SetOptionalStringPiece(value); } + } + public Builder SetOptionalStringPiece(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalStringPiece_ = value; + return this; + } + public Builder ClearOptionalStringPiece() { + PrepareBuilder(); + result.optionalStringPiece_ = ""; + return this; + } + + public string OptionalCord { + get { return result.OptionalCord; } + set { SetOptionalCord(value); } + } + public Builder SetOptionalCord(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.optionalCord_ = value; + return this; + } + public Builder ClearOptionalCord() { + PrepareBuilder(); + result.optionalCord_ = ""; + return this; + } + + public bool HasOptionalLazyMessage { + get { return result.hasOptionalLazyMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalLazyMessage { + get { return result.OptionalLazyMessage; } + set { SetOptionalLazyMessage(value); } + } + public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptionalLazyMessage = true; + result.optionalLazyMessage_ = value; + return this; + } + public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptionalLazyMessage = true; + result.optionalLazyMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptionalLazyMessage && + result.optionalLazyMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.optionalLazyMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalLazyMessage_).MergeFrom(value).BuildPartial(); + } else { + result.optionalLazyMessage_ = value; + } + result.hasOptionalLazyMessage = true; + return this; + } + public Builder ClearOptionalLazyMessage() { + PrepareBuilder(); + result.hasOptionalLazyMessage = false; + result.optionalLazyMessage_ = null; + return this; + } + + public pbc::IPopsicleList RepeatedInt32List { + get { return PrepareBuilder().repeatedInt32_; } + } + public int RepeatedInt32Count { + get { return result.RepeatedInt32Count; } + } + public int GetRepeatedInt32(int index) { + return result.GetRepeatedInt32(index); + } + public Builder SetRepeatedInt32(int index, int value) { + PrepareBuilder(); + result.repeatedInt32_[index] = value; + return this; + } + public Builder AddRepeatedInt32(int value) { + PrepareBuilder(); + result.repeatedInt32_.Add(value); + return this; + } + public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedInt32_.Add(values); + return this; + } + public Builder ClearRepeatedInt32() { + PrepareBuilder(); + result.repeatedInt32_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedInt64List { + get { return PrepareBuilder().repeatedInt64_; } + } + public int RepeatedInt64Count { + get { return result.RepeatedInt64Count; } + } + public long GetRepeatedInt64(int index) { + return result.GetRepeatedInt64(index); + } + public Builder SetRepeatedInt64(int index, long value) { + PrepareBuilder(); + result.repeatedInt64_[index] = value; + return this; + } + public Builder AddRepeatedInt64(long value) { + PrepareBuilder(); + result.repeatedInt64_.Add(value); + return this; + } + public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedInt64_.Add(values); + return this; + } + public Builder ClearRepeatedInt64() { + PrepareBuilder(); + result.repeatedInt64_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedUint32List { + get { return PrepareBuilder().repeatedUint32_; } + } + public int RepeatedUint32Count { + get { return result.RepeatedUint32Count; } + } + public uint GetRepeatedUint32(int index) { + return result.GetRepeatedUint32(index); + } + public Builder SetRepeatedUint32(int index, uint value) { + PrepareBuilder(); + result.repeatedUint32_[index] = value; + return this; + } + public Builder AddRepeatedUint32(uint value) { + PrepareBuilder(); + result.repeatedUint32_.Add(value); + return this; + } + public Builder AddRangeRepeatedUint32(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedUint32_.Add(values); + return this; + } + public Builder ClearRepeatedUint32() { + PrepareBuilder(); + result.repeatedUint32_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedUint64List { + get { return PrepareBuilder().repeatedUint64_; } + } + public int RepeatedUint64Count { + get { return result.RepeatedUint64Count; } + } + public ulong GetRepeatedUint64(int index) { + return result.GetRepeatedUint64(index); + } + public Builder SetRepeatedUint64(int index, ulong value) { + PrepareBuilder(); + result.repeatedUint64_[index] = value; + return this; + } + public Builder AddRepeatedUint64(ulong value) { + PrepareBuilder(); + result.repeatedUint64_.Add(value); + return this; + } + public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedUint64_.Add(values); + return this; + } + public Builder ClearRepeatedUint64() { + PrepareBuilder(); + result.repeatedUint64_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedSint32List { + get { return PrepareBuilder().repeatedSint32_; } + } + public int RepeatedSint32Count { + get { return result.RepeatedSint32Count; } + } + public int GetRepeatedSint32(int index) { + return result.GetRepeatedSint32(index); + } + public Builder SetRepeatedSint32(int index, int value) { + PrepareBuilder(); + result.repeatedSint32_[index] = value; + return this; + } + public Builder AddRepeatedSint32(int value) { + PrepareBuilder(); + result.repeatedSint32_.Add(value); + return this; + } + public Builder AddRangeRepeatedSint32(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedSint32_.Add(values); + return this; + } + public Builder ClearRepeatedSint32() { + PrepareBuilder(); + result.repeatedSint32_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedSint64List { + get { return PrepareBuilder().repeatedSint64_; } + } + public int RepeatedSint64Count { + get { return result.RepeatedSint64Count; } + } + public long GetRepeatedSint64(int index) { + return result.GetRepeatedSint64(index); + } + public Builder SetRepeatedSint64(int index, long value) { + PrepareBuilder(); + result.repeatedSint64_[index] = value; + return this; + } + public Builder AddRepeatedSint64(long value) { + PrepareBuilder(); + result.repeatedSint64_.Add(value); + return this; + } + public Builder AddRangeRepeatedSint64(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedSint64_.Add(values); + return this; + } + public Builder ClearRepeatedSint64() { + PrepareBuilder(); + result.repeatedSint64_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedFixed32List { + get { return PrepareBuilder().repeatedFixed32_; } + } + public int RepeatedFixed32Count { + get { return result.RepeatedFixed32Count; } + } + public uint GetRepeatedFixed32(int index) { + return result.GetRepeatedFixed32(index); + } + public Builder SetRepeatedFixed32(int index, uint value) { + PrepareBuilder(); + result.repeatedFixed32_[index] = value; + return this; + } + public Builder AddRepeatedFixed32(uint value) { + PrepareBuilder(); + result.repeatedFixed32_.Add(value); + return this; + } + public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedFixed32_.Add(values); + return this; + } + public Builder ClearRepeatedFixed32() { + PrepareBuilder(); + result.repeatedFixed32_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedFixed64List { + get { return PrepareBuilder().repeatedFixed64_; } + } + public int RepeatedFixed64Count { + get { return result.RepeatedFixed64Count; } + } + public ulong GetRepeatedFixed64(int index) { + return result.GetRepeatedFixed64(index); + } + public Builder SetRepeatedFixed64(int index, ulong value) { + PrepareBuilder(); + result.repeatedFixed64_[index] = value; + return this; + } + public Builder AddRepeatedFixed64(ulong value) { + PrepareBuilder(); + result.repeatedFixed64_.Add(value); + return this; + } + public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedFixed64_.Add(values); + return this; + } + public Builder ClearRepeatedFixed64() { + PrepareBuilder(); + result.repeatedFixed64_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedSfixed32List { + get { return PrepareBuilder().repeatedSfixed32_; } + } + public int RepeatedSfixed32Count { + get { return result.RepeatedSfixed32Count; } + } + public int GetRepeatedSfixed32(int index) { + return result.GetRepeatedSfixed32(index); + } + public Builder SetRepeatedSfixed32(int index, int value) { + PrepareBuilder(); + result.repeatedSfixed32_[index] = value; + return this; + } + public Builder AddRepeatedSfixed32(int value) { + PrepareBuilder(); + result.repeatedSfixed32_.Add(value); + return this; + } + public Builder AddRangeRepeatedSfixed32(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedSfixed32_.Add(values); + return this; + } + public Builder ClearRepeatedSfixed32() { + PrepareBuilder(); + result.repeatedSfixed32_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedSfixed64List { + get { return PrepareBuilder().repeatedSfixed64_; } + } + public int RepeatedSfixed64Count { + get { return result.RepeatedSfixed64Count; } + } + public long GetRepeatedSfixed64(int index) { + return result.GetRepeatedSfixed64(index); + } + public Builder SetRepeatedSfixed64(int index, long value) { + PrepareBuilder(); + result.repeatedSfixed64_[index] = value; + return this; + } + public Builder AddRepeatedSfixed64(long value) { + PrepareBuilder(); + result.repeatedSfixed64_.Add(value); + return this; + } + public Builder AddRangeRepeatedSfixed64(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedSfixed64_.Add(values); + return this; + } + public Builder ClearRepeatedSfixed64() { + PrepareBuilder(); + result.repeatedSfixed64_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedFloatList { + get { return PrepareBuilder().repeatedFloat_; } + } + public int RepeatedFloatCount { + get { return result.RepeatedFloatCount; } + } + public float GetRepeatedFloat(int index) { + return result.GetRepeatedFloat(index); + } + public Builder SetRepeatedFloat(int index, float value) { + PrepareBuilder(); + result.repeatedFloat_[index] = value; + return this; + } + public Builder AddRepeatedFloat(float value) { + PrepareBuilder(); + result.repeatedFloat_.Add(value); + return this; + } + public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedFloat_.Add(values); + return this; + } + public Builder ClearRepeatedFloat() { + PrepareBuilder(); + result.repeatedFloat_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedDoubleList { + get { return PrepareBuilder().repeatedDouble_; } + } + public int RepeatedDoubleCount { + get { return result.RepeatedDoubleCount; } + } + public double GetRepeatedDouble(int index) { + return result.GetRepeatedDouble(index); + } + public Builder SetRepeatedDouble(int index, double value) { + PrepareBuilder(); + result.repeatedDouble_[index] = value; + return this; + } + public Builder AddRepeatedDouble(double value) { + PrepareBuilder(); + result.repeatedDouble_.Add(value); + return this; + } + public Builder AddRangeRepeatedDouble(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedDouble_.Add(values); + return this; + } + public Builder ClearRepeatedDouble() { + PrepareBuilder(); + result.repeatedDouble_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedBoolList { + get { return PrepareBuilder().repeatedBool_; } + } + public int RepeatedBoolCount { + get { return result.RepeatedBoolCount; } + } + public bool GetRepeatedBool(int index) { + return result.GetRepeatedBool(index); + } + public Builder SetRepeatedBool(int index, bool value) { + PrepareBuilder(); + result.repeatedBool_[index] = value; + return this; + } + public Builder AddRepeatedBool(bool value) { + PrepareBuilder(); + result.repeatedBool_.Add(value); + return this; + } + public Builder AddRangeRepeatedBool(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedBool_.Add(values); + return this; + } + public Builder ClearRepeatedBool() { + PrepareBuilder(); + result.repeatedBool_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedStringList { + get { return PrepareBuilder().repeatedString_; } + } + public int RepeatedStringCount { + get { return result.RepeatedStringCount; } + } + public string GetRepeatedString(int index) { + return result.GetRepeatedString(index); + } + public Builder SetRepeatedString(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedString_[index] = value; + return this; + } + public Builder AddRepeatedString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedString_.Add(value); + return this; + } + public Builder AddRangeRepeatedString(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedString_.Add(values); + return this; + } + public Builder ClearRepeatedString() { + PrepareBuilder(); + result.repeatedString_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedBytesList { + get { return PrepareBuilder().repeatedBytes_; } + } + public int RepeatedBytesCount { + get { return result.RepeatedBytesCount; } + } + public pb::ByteString GetRepeatedBytes(int index) { + return result.GetRepeatedBytes(index); + } + public Builder SetRepeatedBytes(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedBytes_[index] = value; + return this; + } + public Builder AddRepeatedBytes(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedBytes_.Add(value); + return this; + } + public Builder AddRangeRepeatedBytes(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedBytes_.Add(values); + return this; + } + public Builder ClearRepeatedBytes() { + PrepareBuilder(); + result.repeatedBytes_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedNestedMessageList { + get { return PrepareBuilder().repeatedNestedMessage_; } + } + public int RepeatedNestedMessageCount { + get { return result.RepeatedNestedMessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { + return result.GetRepeatedNestedMessage(index); + } + public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedNestedMessage_[index] = value; + return this; + } + public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedNestedMessage_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedNestedMessage_.Add(value); + return this; + } + public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedNestedMessage_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedNestedMessage_.Add(values); + return this; + } + public Builder ClearRepeatedNestedMessage() { + PrepareBuilder(); + result.repeatedNestedMessage_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedForeignMessageList { + get { return PrepareBuilder().repeatedForeignMessage_; } + } + public int RepeatedForeignMessageCount { + get { return result.RepeatedForeignMessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage GetRepeatedForeignMessage(int index) { + return result.GetRepeatedForeignMessage(index); + } + public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedForeignMessage_[index] = value; + return this; + } + public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedForeignMessage_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedForeignMessage_.Add(value); + return this; + } + public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedForeignMessage_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedForeignMessage_.Add(values); + return this; + } + public Builder ClearRepeatedForeignMessage() { + PrepareBuilder(); + result.repeatedForeignMessage_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedProto2MessageList { + get { return PrepareBuilder().repeatedProto2Message_; } + } + public int RepeatedProto2MessageCount { + get { return result.RepeatedProto2MessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) { + return result.GetRepeatedProto2Message(index); + } + public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedProto2Message_[index] = value; + return this; + } + public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedProto2Message_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedProto2Message_.Add(value); + return this; + } + public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedProto2Message_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedProto2Message(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedProto2Message_.Add(values); + return this; + } + public Builder ClearRepeatedProto2Message() { + PrepareBuilder(); + result.repeatedProto2Message_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedNestedEnumList { + get { return PrepareBuilder().repeatedNestedEnum_; } + } + public int RepeatedNestedEnumCount { + get { return result.RepeatedNestedEnumCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { + return result.GetRepeatedNestedEnum(index); + } + public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.repeatedNestedEnum_[index] = value; + return this; + } + public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.repeatedNestedEnum_.Add(value); + return this; + } + public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedNestedEnum_.Add(values); + return this; + } + public Builder ClearRepeatedNestedEnum() { + PrepareBuilder(); + result.repeatedNestedEnum_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedForeignEnumList { + get { return PrepareBuilder().repeatedForeignEnum_; } + } + public int RepeatedForeignEnumCount { + get { return result.RepeatedForeignEnumCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum GetRepeatedForeignEnum(int index) { + return result.GetRepeatedForeignEnum(index); + } + public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) { + PrepareBuilder(); + result.repeatedForeignEnum_[index] = value; + return this; + } + public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) { + PrepareBuilder(); + result.repeatedForeignEnum_.Add(value); + return this; + } + public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedForeignEnum_.Add(values); + return this; + } + public Builder ClearRepeatedForeignEnum() { + PrepareBuilder(); + result.repeatedForeignEnum_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedStringPieceList { + get { return PrepareBuilder().repeatedStringPiece_; } + } + public int RepeatedStringPieceCount { + get { return result.RepeatedStringPieceCount; } + } + public string GetRepeatedStringPiece(int index) { + return result.GetRepeatedStringPiece(index); + } + public Builder SetRepeatedStringPiece(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedStringPiece_[index] = value; + return this; + } + public Builder AddRepeatedStringPiece(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedStringPiece_.Add(value); + return this; + } + public Builder AddRangeRepeatedStringPiece(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedStringPiece_.Add(values); + return this; + } + public Builder ClearRepeatedStringPiece() { + PrepareBuilder(); + result.repeatedStringPiece_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedCordList { + get { return PrepareBuilder().repeatedCord_; } + } + public int RepeatedCordCount { + get { return result.RepeatedCordCount; } + } + public string GetRepeatedCord(int index) { + return result.GetRepeatedCord(index); + } + public Builder SetRepeatedCord(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedCord_[index] = value; + return this; + } + public Builder AddRepeatedCord(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedCord_.Add(value); + return this; + } + public Builder AddRangeRepeatedCord(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedCord_.Add(values); + return this; + } + public Builder ClearRepeatedCord() { + PrepareBuilder(); + result.repeatedCord_.Clear(); + return this; + } + + public pbc::IPopsicleList RepeatedLazyMessageList { + get { return PrepareBuilder().repeatedLazyMessage_; } + } + public int RepeatedLazyMessageCount { + get { return result.RepeatedLazyMessageCount; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) { + return result.GetRepeatedLazyMessage(index); + } + public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedLazyMessage_[index] = value; + return this; + } + public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedLazyMessage_[index] = builderForValue.Build(); + return this; + } + public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.repeatedLazyMessage_.Add(value); + return this; + } + public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.repeatedLazyMessage_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRepeatedLazyMessage(scg::IEnumerable values) { + PrepareBuilder(); + result.repeatedLazyMessage_.Add(values); + return this; + } + public Builder ClearRepeatedLazyMessage() { + PrepareBuilder(); + result.repeatedLazyMessage_.Clear(); + return this; + } + + public uint OneofUint32 { + get { return result.OneofUint32; } + set { SetOneofUint32(value); } + } + public Builder SetOneofUint32(uint value) { + PrepareBuilder(); + result.oneofUint32_ = value; + return this; + } + public Builder ClearOneofUint32() { + PrepareBuilder(); + result.oneofUint32_ = 0; + return this; + } + + public bool HasOneofNestedMessage { + get { return result.hasOneofNestedMessage; } + } + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OneofNestedMessage { + get { return result.OneofNestedMessage; } + set { SetOneofNestedMessage(value); } + } + public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOneofNestedMessage = true; + result.oneofNestedMessage_ = value; + return this; + } + public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOneofNestedMessage = true; + result.oneofNestedMessage_ = builderForValue.Build(); + return this; + } + public Builder MergeOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOneofNestedMessage && + result.oneofNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) { + result.oneofNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.oneofNestedMessage_).MergeFrom(value).BuildPartial(); + } else { + result.oneofNestedMessage_ = value; + } + result.hasOneofNestedMessage = true; + return this; + } + public Builder ClearOneofNestedMessage() { + PrepareBuilder(); + result.hasOneofNestedMessage = false; + result.oneofNestedMessage_ = null; + return this; + } + + public string OneofString { + get { return result.OneofString; } + set { SetOneofString(value); } + } + public Builder SetOneofString(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.oneofString_ = value; + return this; + } + public Builder ClearOneofString() { + PrepareBuilder(); + result.oneofString_ = ""; + return this; + } + + public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OneofEnum { + get { return result.OneofEnum; } + set { SetOneofEnum(value); } + } + public Builder SetOneofEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) { + PrepareBuilder(); + result.oneofEnum_ = value; + return this; + } + public Builder ClearOneofEnum() { + PrepareBuilder(); + result.oneofEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; + return this; + } + } + static TestAllTypes() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestProto2Required : pb::GeneratedMessage { + private TestProto2Required() { } + private static readonly TestProto2Required defaultInstance = new TestProto2Required().MakeReadOnly(); + private static readonly string[] _testProto2RequiredFieldNames = new string[] { "proto2" }; + private static readonly uint[] _testProto2RequiredFieldTags = new uint[] { 10 }; + public static TestProto2Required DefaultInstance { + get { return defaultInstance; } + } + + public override TestProto2Required DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TestProto2Required ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable; } + } + + public const int Proto2FieldNumber = 1; + private bool hasProto2; + private global::Google.ProtocolBuffers.TestProtos.TestRequired proto2_; + public bool HasProto2 { + get { return hasProto2; } + } + public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 { + get { return proto2_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _testProto2RequiredFieldNames; + if (hasProto2) { + output.WriteMessage(1, field_names[0], Proto2); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProto2) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Proto2); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TestProto2Required ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestProto2Required ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestProto2Required ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TestProto2Required ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TestProto2Required ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestProto2Required ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TestProto2Required ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TestProto2Required ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TestProto2Required MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TestProto2Required prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TestProto2Required cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TestProto2Required result; + + private TestProto2Required PrepareBuilder() { + if (resultIsReadOnly) { + TestProto2Required original = result; + result = new TestProto2Required(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TestProto2Required MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.Descriptor; } + } + + public override TestProto2Required DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.DefaultInstance; } + } + + public override TestProto2Required BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TestProto2Required) { + return MergeFrom((TestProto2Required) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TestProto2Required other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProto2) { + MergeProto2(other.Proto2); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_testProto2RequiredFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _testProto2RequiredFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(); + if (result.hasProto2) { + subBuilder.MergeFrom(Proto2); + } + input.ReadMessage(subBuilder, extensionRegistry); + Proto2 = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProto2 { + get { return result.hasProto2; } + } + public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 { + get { return result.Proto2; } + set { SetProto2(value); } + } + public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasProto2 = true; + result.proto2_ = value; + return this; + } + public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasProto2 = true; + result.proto2_ = builderForValue.Build(); + return this; + } + public Builder MergeProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasProto2 && + result.proto2_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) { + result.proto2_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.proto2_).MergeFrom(value).BuildPartial(); + } else { + result.proto2_ = value; + } + result.hasProto2 = true; + return this; + } + public Builder ClearProto2() { + PrepareBuilder(); + result.hasProto2 = false; + result.proto2_ = null; + return this; + } + } + static TestProto2Required() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ForeignMessage : pb::GeneratedMessage { + private ForeignMessage() { } + private static readonly ForeignMessage defaultInstance = new ForeignMessage().MakeReadOnly(); + private static readonly string[] _foreignMessageFieldNames = new string[] { "c" }; + private static readonly uint[] _foreignMessageFieldTags = new uint[] { 8 }; + public static ForeignMessage DefaultInstance { + get { return defaultInstance; } + } + + public override ForeignMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ForeignMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable; } + } + + public const int CFieldNumber = 1; + private int c_; + public int C { + get { return c_; } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _foreignMessageFieldNames; + if (C != 0) { + output.WriteInt32(1, field_names[0], C); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (C != 0) { + size += pb::CodedOutputStream.ComputeInt32Size(1, C); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ForeignMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ForeignMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ForeignMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ForeignMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ForeignMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ForeignMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ForeignMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ForeignMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ForeignMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ForeignMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ForeignMessage result; + + private ForeignMessage PrepareBuilder() { + if (resultIsReadOnly) { + ForeignMessage original = result; + result = new ForeignMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ForeignMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Descriptor; } + } + + public override ForeignMessage DefaultInstanceForType { + get { return global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance; } + } + + public override ForeignMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ForeignMessage) { + return MergeFrom((ForeignMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ForeignMessage other) { + if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.C != 0) { + C = other.C; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_foreignMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _foreignMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + input.ReadInt32(ref result.c_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public int C { + get { return result.C; } + set { SetC(value); } + } + public Builder SetC(int value) { + PrepareBuilder(); + result.c_ = value; + return this; + } + public Builder ClearC() { + PrepareBuilder(); + result.c_ = 0; + return this; + } + } + static ForeignMessage() { + object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/google/protobuf/unittest_no_field_presence.proto b/src/google/protobuf/unittest_no_field_presence.proto index 6e71517c..f261b58e 100644 --- a/src/google/protobuf/unittest_no_field_presence.proto +++ b/src/google/protobuf/unittest_no_field_presence.proto @@ -37,7 +37,7 @@ import "google/protobuf/unittest.proto"; package proto2_nofieldpresence_unittest; -option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos.Proto3"; // This proto includes every type of field in both singular and repeated // forms. -- cgit v1.2.3 From 38da6583b1416a7c1594bffec3cdbb8856a72353 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 13 May 2015 13:38:54 -0700 Subject: Regenerate UnittestDropUnknownFields.cs --- .../src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'csharp/src') diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs index 3939c9a4..02af2f50 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestDropUnknownFields.cs @@ -40,8 +40,8 @@ namespace Google.ProtocolBuffers.TestProtos { "X3ZhbHVlGAIgASgOMjsudW5pdHRlc3RfZHJvcF91bmtub3duX2ZpZWxkcy5G", "b29XaXRoRXh0cmFGaWVsZHMuTmVzdGVkRW51bRIZChFleHRyYV9pbnQzMl92", "YWx1ZRgDIAEoBSIwCgpOZXN0ZWRFbnVtEgcKA0ZPTxAAEgcKA0JBUhABEgcK", - "A0JBWhACEgcKA1FVWBADQiSqAiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRl", - "c3RQcm90b3NiBnByb3RvMw==")); + "A0JBWhACEgcKA1FVWBADQjOiAgxEcm9wVW5rbm93bnOqAiFHb29nbGUuUHJv", + "dG9jb2xCdWZmZXJzLlRlc3RQcm90b3NiBnByb3RvMw==")); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_unittest_drop_unknown_fields_Foo__Descriptor = Descriptor.MessageTypes[0]; -- cgit v1.2.3