From e8310aa25940f9e062b8352e1d485bb804aba714 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 28 Apr 2015 17:00:42 +0100 Subject: Remove a bunch of files which are no longer relevant: 1) Project files for different configurations - we're going to look at all this again, ideally to just have a single PCL-compatible build 2) ProtoGen - the C++ generator is now the only one we care about 3) Proto files - these are mostly duplicates (or older versions) of the ones in the common directories --- .../src/ProtoGen.Test/DependencyResolutionTest.cs | 150 --- .../src/ProtoGen.Test/Properties/AssemblyInfo.cs | 30 - csharp/src/ProtoGen.Test/ProtoGen.Test.csproj | 99 -- csharp/src/ProtoGen.Test/ProtocGenCsUnittests.cs | 683 ----------- csharp/src/ProtoGen.Test/TempFile.cs | 59 - csharp/src/ProtoGen.Test/TestPreprocessing.cs | 733 ------------ csharp/src/ProtoGen.Test/protoc-gen-cs.Test.csproj | 101 -- .../src/ProtoGen/DependencyResolutionException.cs | 55 - csharp/src/ProtoGen/DescriptorUtil.cs | 106 -- csharp/src/ProtoGen/EnumFieldGenerator.cs | 148 --- csharp/src/ProtoGen/EnumGenerator.cs | 62 - csharp/src/ProtoGen/ExtensionGenerator.cs | 183 --- csharp/src/ProtoGen/FieldGeneratorBase.cs | 389 ------- csharp/src/ProtoGen/Generator.cs | 267 ----- csharp/src/ProtoGen/GeneratorOptions.cs | 330 ------ csharp/src/ProtoGen/Helpers.cs | 45 - csharp/src/ProtoGen/IFieldSourceGenerator.cs | 53 - csharp/src/ProtoGen/ISourceGenerator.cs | 43 - csharp/src/ProtoGen/InvalidOptionsException.cs | 77 -- csharp/src/ProtoGen/MessageFieldGenerator.cs | 174 --- csharp/src/ProtoGen/MessageGenerator.cs | 893 --------------- csharp/src/ProtoGen/PluginProtoFile.cs | 1187 -------------------- csharp/src/ProtoGen/PrimitiveFieldGenerator.cs | 140 --- csharp/src/ProtoGen/Program.cs | 105 -- csharp/src/ProtoGen/ProgramPreprocess.cs | 276 ----- csharp/src/ProtoGen/Properties/AssemblyInfo.cs | 29 - csharp/src/ProtoGen/ProtoGen.csproj | 98 -- csharp/src/ProtoGen/ProtocGenCs.cs | 76 -- csharp/src/ProtoGen/RepeatedEnumFieldGenerator.cs | 212 ---- .../src/ProtoGen/RepeatedMessageFieldGenerator.cs | 184 --- .../ProtoGen/RepeatedPrimitiveFieldGenerator.cs | 207 ---- csharp/src/ProtoGen/ServiceGenerator.cs | 190 ---- csharp/src/ProtoGen/ServiceInterfaceGenerator.cs | 300 ----- csharp/src/ProtoGen/SourceGeneratorBase.cs | 167 --- csharp/src/ProtoGen/SourceGenerators.cs | 87 -- csharp/src/ProtoGen/UmbrellaClassGenerator.cs | 294 ----- csharp/src/ProtoGen/app.config | 7 - csharp/src/ProtoGen/protoc-gen-cs.csproj | 101 -- .../ProtocolBuffers/ProtocolBuffers.CF20.csproj | 166 --- .../ProtocolBuffers/ProtocolBuffers.CF35.csproj | 167 --- .../ProtocolBuffers/ProtocolBuffers.NET20.csproj | 154 --- .../ProtocolBuffers/ProtocolBuffers.NET35.csproj | 155 --- .../ProtocolBuffers/ProtocolBuffers.NET40.csproj | 155 --- .../ProtocolBuffers/ProtocolBuffers.PL40.csproj | 158 --- .../ProtocolBuffers/ProtocolBuffers.SL20.csproj | 169 --- .../ProtocolBuffers/ProtocolBuffers.SL30.csproj | 170 --- .../ProtocolBuffers/ProtocolBuffers.SL40.csproj | 171 --- .../ProtocolBuffersLite.CF20.csproj | 111 -- .../ProtocolBuffersLite.CF35.csproj | 112 -- .../ProtocolBuffersLite.NET20.csproj | 99 -- .../ProtocolBuffersLite.NET35.csproj | 100 -- .../ProtocolBuffersLite.NET40.csproj | 100 -- .../ProtocolBuffersLite.PL40.csproj | 103 -- .../ProtocolBuffersLite.SL20.csproj | 114 -- .../ProtocolBuffersLite.SL30.csproj | 115 -- .../ProtocolBuffersLite.SL40.csproj | 116 -- csharp/src/ProtocolBuffersLibrary.CF20.sln | 55 - csharp/src/ProtocolBuffersLibrary.CF35.sln | 55 - csharp/src/ProtocolBuffersLibrary.NET20.sln | 55 - csharp/src/ProtocolBuffersLibrary.NET35.sln | 55 - csharp/src/ProtocolBuffersLibrary.NET40.sln | 55 - csharp/src/ProtocolBuffersLibrary.PL40.sln | 55 - csharp/src/ProtocolBuffersLibrary.SL20.sln | 55 - csharp/src/ProtocolBuffersLibrary.SL30.sln | 55 - csharp/src/ProtocolBuffersLibrary.SL40.sln | 55 - csharp/src/UseVS2008.bat | 8 - csharp/src/UseVS2010.bat | 8 - 67 files changed, 11286 deletions(-) delete mode 100644 csharp/src/ProtoGen.Test/DependencyResolutionTest.cs delete mode 100644 csharp/src/ProtoGen.Test/Properties/AssemblyInfo.cs delete mode 100644 csharp/src/ProtoGen.Test/ProtoGen.Test.csproj delete mode 100644 csharp/src/ProtoGen.Test/ProtocGenCsUnittests.cs delete mode 100644 csharp/src/ProtoGen.Test/TempFile.cs delete mode 100644 csharp/src/ProtoGen.Test/TestPreprocessing.cs delete mode 100644 csharp/src/ProtoGen.Test/protoc-gen-cs.Test.csproj delete mode 100644 csharp/src/ProtoGen/DependencyResolutionException.cs delete mode 100644 csharp/src/ProtoGen/DescriptorUtil.cs delete mode 100644 csharp/src/ProtoGen/EnumFieldGenerator.cs delete mode 100644 csharp/src/ProtoGen/EnumGenerator.cs delete mode 100644 csharp/src/ProtoGen/ExtensionGenerator.cs delete mode 100644 csharp/src/ProtoGen/FieldGeneratorBase.cs delete mode 100644 csharp/src/ProtoGen/Generator.cs delete mode 100644 csharp/src/ProtoGen/GeneratorOptions.cs delete mode 100644 csharp/src/ProtoGen/Helpers.cs delete mode 100644 csharp/src/ProtoGen/IFieldSourceGenerator.cs delete mode 100644 csharp/src/ProtoGen/ISourceGenerator.cs delete mode 100644 csharp/src/ProtoGen/InvalidOptionsException.cs delete mode 100644 csharp/src/ProtoGen/MessageFieldGenerator.cs delete mode 100644 csharp/src/ProtoGen/MessageGenerator.cs delete mode 100644 csharp/src/ProtoGen/PluginProtoFile.cs delete mode 100644 csharp/src/ProtoGen/PrimitiveFieldGenerator.cs delete mode 100644 csharp/src/ProtoGen/Program.cs delete mode 100644 csharp/src/ProtoGen/ProgramPreprocess.cs delete mode 100644 csharp/src/ProtoGen/Properties/AssemblyInfo.cs delete mode 100644 csharp/src/ProtoGen/ProtoGen.csproj delete mode 100644 csharp/src/ProtoGen/ProtocGenCs.cs delete mode 100644 csharp/src/ProtoGen/RepeatedEnumFieldGenerator.cs delete mode 100644 csharp/src/ProtoGen/RepeatedMessageFieldGenerator.cs delete mode 100644 csharp/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs delete mode 100644 csharp/src/ProtoGen/ServiceGenerator.cs delete mode 100644 csharp/src/ProtoGen/ServiceInterfaceGenerator.cs delete mode 100644 csharp/src/ProtoGen/SourceGeneratorBase.cs delete mode 100644 csharp/src/ProtoGen/SourceGenerators.cs delete mode 100644 csharp/src/ProtoGen/UmbrellaClassGenerator.cs delete mode 100644 csharp/src/ProtoGen/app.config delete mode 100644 csharp/src/ProtoGen/protoc-gen-cs.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.CF20.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.CF35.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.NET20.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.NET35.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.NET40.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.PL40.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.SL20.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.SL30.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffers.SL40.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF20.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.CF35.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET20.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET35.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.NET40.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.PL40.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL20.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL30.csproj delete mode 100644 csharp/src/ProtocolBuffers/ProtocolBuffersLite.SL40.csproj delete mode 100644 csharp/src/ProtocolBuffersLibrary.CF20.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.CF35.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.NET20.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.NET35.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.NET40.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.PL40.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.SL20.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.SL30.sln delete mode 100644 csharp/src/ProtocolBuffersLibrary.SL40.sln delete mode 100644 csharp/src/UseVS2008.bat delete mode 100644 csharp/src/UseVS2010.bat (limited to 'csharp/src') 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