From 6cfea98501e3f56b0c8fbe29334d4a49b1fd57c3 Mon Sep 17 00:00:00 2001 From: Kazuki Oikawa Date: Sat, 23 Apr 2011 14:44:22 +0900 Subject: [PATCH] csharp: add license, rename filename/namespace. --- .gitignore | 14 +++--- csharp/Makefile | 14 +++--- csharp/MsgPack.Test/AssemblyInfo.cs | 26 ++++++++++ .../BoxingPackerTests.cs | 20 +++++++- .../CompiledPackerTests.cs | 26 +++++++--- .../MsgPack.Test.csproj} | 8 ++-- .../ObjectPackerTests.cs | 21 ++++++-- .../ReaderWriterTests.cs | 20 +++++++- csharp/{msgpack.sln => MsgPack.sln} | 4 +- csharp/MsgPack/AssemblyInfo.cs | 28 +++++++++++ csharp/{msgpack => MsgPack}/BoxingPacker.cs | 20 +++++++- csharp/{msgpack => MsgPack}/CompiledPacker.cs | 22 +++++++-- .../Compiler/EmitExtensions.cs | 23 +++++++-- .../Compiler/PackILGenerator.cs | 20 +++++++- csharp/MsgPack/Compiler/Variable.cs | 42 ++++++++++++++++ csharp/MsgPack/Compiler/VariableType.cs | 24 ++++++++++ .../msgpack.csproj => MsgPack/MsgPack.csproj} | 4 +- csharp/{msgpack => MsgPack}/MsgPackReader.cs | 20 +++++++- csharp/{msgpack => MsgPack}/MsgPackWriter.cs | 20 +++++++- csharp/{msgpack => MsgPack}/ObjectPacker.cs | 20 +++++++- .../{msgpack => MsgPack}/ReflectionCache.cs | 20 +++++++- .../ReflectionCacheEntry.cs | 20 +++++++- csharp/MsgPack/TypePrefixes.cs | 48 +++++++++++++++++++ csharp/msgpack.tests/AssemblyInfo.cs | 36 -------------- csharp/msgpack/AssemblyInfo.cs | 37 -------------- csharp/msgpack/Compiler/Variable.cs | 30 ------------ csharp/msgpack/Compiler/VariableType.cs | 13 ----- csharp/msgpack/TypePrefixes.cs | 32 ------------- 28 files changed, 427 insertions(+), 205 deletions(-) create mode 100644 csharp/MsgPack.Test/AssemblyInfo.cs rename csharp/{msgpack.tests => MsgPack.Test}/BoxingPackerTests.cs (76%) rename csharp/{msgpack.tests => MsgPack.Test}/CompiledPackerTests.cs (54%) rename csharp/{msgpack.tests/msgpack.tests.csproj => MsgPack.Test/MsgPack.Test.csproj} (93%) rename csharp/{msgpack.tests => MsgPack.Test}/ObjectPackerTests.cs (80%) rename csharp/{msgpack.tests => MsgPack.Test}/ReaderWriterTests.cs (92%) rename csharp/{msgpack.sln => MsgPack.sln} (78%) create mode 100644 csharp/MsgPack/AssemblyInfo.cs rename csharp/{msgpack => MsgPack}/BoxingPacker.cs (87%) rename csharp/{msgpack => MsgPack}/CompiledPacker.cs (95%) rename csharp/{msgpack => MsgPack}/Compiler/EmitExtensions.cs (87%) rename csharp/{msgpack => MsgPack}/Compiler/PackILGenerator.cs (95%) create mode 100644 csharp/MsgPack/Compiler/Variable.cs create mode 100644 csharp/MsgPack/Compiler/VariableType.cs rename csharp/{msgpack/msgpack.csproj => MsgPack/MsgPack.csproj} (96%) rename csharp/{msgpack => MsgPack}/MsgPackReader.cs (91%) rename csharp/{msgpack => MsgPack}/MsgPackWriter.cs (90%) rename csharp/{msgpack => MsgPack}/ObjectPacker.cs (92%) rename csharp/{msgpack => MsgPack}/ReflectionCache.cs (53%) rename csharp/{msgpack => MsgPack}/ReflectionCacheEntry.cs (56%) create mode 100644 csharp/MsgPack/TypePrefixes.cs delete mode 100644 csharp/msgpack.tests/AssemblyInfo.cs delete mode 100644 csharp/msgpack/AssemblyInfo.cs delete mode 100644 csharp/msgpack/Compiler/Variable.cs delete mode 100644 csharp/msgpack/Compiler/VariableType.cs delete mode 100644 csharp/msgpack/TypePrefixes.cs diff --git a/.gitignore b/.gitignore index 45b7161c..305f896a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,10 @@ ruby/Makefile *.6 _obj _test -/csharp/msgpack.suo -/csharp/msgpack/bin -/csharp/msgpack/obj -/csharp/msgpack/msgpack.csproj.user -/csharp/msgpack.tests/obj -/csharp/msgpack.tests/bin -/csharp/msgpack.tests/msgpack.tests.csproj.user +/csharp/MsgPack.suo +/csharp/MsgPack/bin +/csharp/MsgPack/obj +/csharp/MsgPack/MsgPack.csproj.user +/csharp/MsgPack.Test/obj +/csharp/MsgPack.Test/bin +/csharp/MsgPack.Test/MsgPack.Test.csproj.user diff --git a/csharp/Makefile b/csharp/Makefile index 4f893386..9cf6a243 100644 --- a/csharp/Makefile +++ b/csharp/Makefile @@ -1,8 +1,8 @@ -TARGET=msgpack.dll -TEST_TARGET=msgpack.tests.dll +TARGET=MsgPack.dll +TEST_TARGET=MsgPack.Test.dll -SRC=$(shell find msgpack -name "*.cs") -TEST_SRC=$(shell find msgpack.tests -name "*.cs") +SRC=$(shell find MsgPack -name "*.cs") +TEST_SRC=$(shell find MsgPack.Test -name "*.cs") MONO_CC=mcs NUNIT_CONSOLE=nunit-console @@ -15,7 +15,7 @@ run-test: $(NUNIT_CONSOLE) $(TEST_TARGET) $(TARGET): $(SRC) - $(MONO_CC) -out:$@ -t:library -unsafe+ $^ + $(MONO_CC) -out:$@ -t:library -unsafe+ $(SRC) -$(TEST_TARGET): $(TEST_SRC) - $(MONO_CC) -out:$@ -t:library -r:$(TARGET) -r:nunit.framework.dll $^ +$(TEST_TARGET): $(TEST_SRC) $(TARGET) + $(MONO_CC) -out:$@ -t:library -r:$(TARGET) -r:nunit.framework.dll $(TEST_SRC) diff --git a/csharp/MsgPack.Test/AssemblyInfo.cs b/csharp/MsgPack.Test/AssemblyInfo.cs new file mode 100644 index 00000000..307c6a90 --- /dev/null +++ b/csharp/MsgPack.Test/AssemblyInfo.cs @@ -0,0 +1,26 @@ +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle ("MsgPack UnitTest")] +[assembly: AssemblyProduct ("MsgPack UnitTest")] +[assembly: AssemblyDescription ("MessagePack Serializer for .NET UnitTests")] +[assembly: AssemblyCopyright ("Copyright © 2011 Kazuki Oikawa")] + +[assembly: ComVisible (false)] +[assembly: AssemblyVersion ("0.1.*")] diff --git a/csharp/msgpack.tests/BoxingPackerTests.cs b/csharp/MsgPack.Test/BoxingPackerTests.cs similarity index 76% rename from csharp/msgpack.tests/BoxingPackerTests.cs rename to csharp/MsgPack.Test/BoxingPackerTests.cs index cd631291..a39a3c89 100644 --- a/csharp/msgpack.tests/BoxingPackerTests.cs +++ b/csharp/MsgPack.Test/BoxingPackerTests.cs @@ -1,9 +1,25 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; -namespace msgpack.tests +namespace MsgPack.Test { [TestFixture] public class BoxingPackerTests diff --git a/csharp/msgpack.tests/CompiledPackerTests.cs b/csharp/MsgPack.Test/CompiledPackerTests.cs similarity index 54% rename from csharp/msgpack.tests/CompiledPackerTests.cs rename to csharp/MsgPack.Test/CompiledPackerTests.cs index 583409e8..16daef9b 100644 --- a/csharp/msgpack.tests/CompiledPackerTests.cs +++ b/csharp/MsgPack.Test/CompiledPackerTests.cs @@ -1,10 +1,24 @@ -using System; -using System.Collections.Generic; -using NUnit.Framework; -using TestA_Class = msgpack.tests.ObjectPackerTests.TestA_Class; -using TestB_Class = msgpack.tests.ObjectPackerTests.TestB_Class; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// -namespace msgpack.tests +using NUnit.Framework; +using TestA_Class = MsgPack.Test.ObjectPackerTests.TestA_Class; +using TestB_Class = MsgPack.Test.ObjectPackerTests.TestB_Class; + +namespace MsgPack.Test { [TestFixture] public class CompiledPackerTests diff --git a/csharp/msgpack.tests/msgpack.tests.csproj b/csharp/MsgPack.Test/MsgPack.Test.csproj similarity index 93% rename from csharp/msgpack.tests/msgpack.tests.csproj rename to csharp/MsgPack.Test/MsgPack.Test.csproj index 1991021c..e00c3cca 100644 --- a/csharp/msgpack.tests/msgpack.tests.csproj +++ b/csharp/MsgPack.Test/MsgPack.Test.csproj @@ -8,8 +8,8 @@ {CE24167B-8F0A-4670-BD1E-3C283311E86B} Library Properties - msgpack.tests - msgpack.tests + MsgPack.Test + MsgPack.Test v4.0 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -49,9 +49,9 @@ - + {E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F} - msgpack + MsgPack diff --git a/csharp/msgpack.tests/ObjectPackerTests.cs b/csharp/MsgPack.Test/ObjectPackerTests.cs similarity index 80% rename from csharp/msgpack.tests/ObjectPackerTests.cs rename to csharp/MsgPack.Test/ObjectPackerTests.cs index 70ec9e08..26f3d3bc 100644 --- a/csharp/msgpack.tests/ObjectPackerTests.cs +++ b/csharp/MsgPack.Test/ObjectPackerTests.cs @@ -1,8 +1,23 @@ -using System; -using System.Collections.Generic; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using NUnit.Framework; -namespace msgpack.tests +namespace MsgPack.Test { [TestFixture] public class ObjectPackerTests diff --git a/csharp/msgpack.tests/ReaderWriterTests.cs b/csharp/MsgPack.Test/ReaderWriterTests.cs similarity index 92% rename from csharp/msgpack.tests/ReaderWriterTests.cs rename to csharp/MsgPack.Test/ReaderWriterTests.cs index 10c6f70a..5971285b 100644 --- a/csharp/msgpack.tests/ReaderWriterTests.cs +++ b/csharp/MsgPack.Test/ReaderWriterTests.cs @@ -1,8 +1,24 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.IO; using NUnit.Framework; -namespace msgpack.tests +namespace MsgPack.Test { [TestFixture] public class ReaderWriterTests diff --git a/csharp/msgpack.sln b/csharp/MsgPack.sln similarity index 78% rename from csharp/msgpack.sln rename to csharp/MsgPack.sln index 2aad4419..3cdebef0 100644 --- a/csharp/msgpack.sln +++ b/csharp/MsgPack.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "msgpack", "msgpack\msgpack.csproj", "{E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack", "MsgPack\MsgPack.csproj", "{E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "msgpack.tests", "msgpack.tests\msgpack.tests.csproj", "{CE24167B-8F0A-4670-BD1E-3C283311E86B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack.Test", "MsgPack.Test/MsgPack.Test.csproj", "{CE24167B-8F0A-4670-BD1E-3C283311E86B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/csharp/MsgPack/AssemblyInfo.cs b/csharp/MsgPack/AssemblyInfo.cs new file mode 100644 index 00000000..27f88372 --- /dev/null +++ b/csharp/MsgPack/AssemblyInfo.cs @@ -0,0 +1,28 @@ +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle ("MsgPack")] +[assembly: AssemblyProduct ("MsgPack")] +[assembly: AssemblyDescription ("MessagePack Serializer for .NET")] +[assembly: AssemblyCopyright ("Copyright © 2011 Kazuki Oikawa")] + +[assembly: ComVisible (false)] +[assembly: AssemblyVersion ("0.1.*")] +[assembly: InternalsVisibleTo (MsgPack.CompiledPacker.MethodBuilderPacker.AssemblyName)] diff --git a/csharp/msgpack/BoxingPacker.cs b/csharp/MsgPack/BoxingPacker.cs similarity index 87% rename from csharp/msgpack/BoxingPacker.cs rename to csharp/MsgPack/BoxingPacker.cs index c4608503..05466835 100644 --- a/csharp/msgpack/BoxingPacker.cs +++ b/csharp/MsgPack/BoxingPacker.cs @@ -1,10 +1,26 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Reflection; -namespace msgpack +namespace MsgPack { public class BoxingPacker { diff --git a/csharp/msgpack/CompiledPacker.cs b/csharp/MsgPack/CompiledPacker.cs similarity index 95% rename from csharp/msgpack/CompiledPacker.cs rename to csharp/MsgPack/CompiledPacker.cs index 7245d1b4..1d4b7477 100644 --- a/csharp/msgpack/CompiledPacker.cs +++ b/csharp/MsgPack/CompiledPacker.cs @@ -1,12 +1,28 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Reflection.Emit; using System.Threading; -using msgpack.Compiler; +using MsgPack.Compiler; -namespace msgpack +namespace MsgPack { public class CompiledPacker { diff --git a/csharp/msgpack/Compiler/EmitExtensions.cs b/csharp/MsgPack/Compiler/EmitExtensions.cs similarity index 87% rename from csharp/msgpack/Compiler/EmitExtensions.cs rename to csharp/MsgPack/Compiler/EmitExtensions.cs index ae51e9a8..794aff4f 100644 --- a/csharp/msgpack/Compiler/EmitExtensions.cs +++ b/csharp/MsgPack/Compiler/EmitExtensions.cs @@ -1,11 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Reflection; using System.Reflection.Emit; -namespace msgpack.Compiler +namespace MsgPack.Compiler { public static class EmitExtensions { diff --git a/csharp/msgpack/Compiler/PackILGenerator.cs b/csharp/MsgPack/Compiler/PackILGenerator.cs similarity index 95% rename from csharp/msgpack/Compiler/PackILGenerator.cs rename to csharp/MsgPack/Compiler/PackILGenerator.cs index d413acbe..1f116ad7 100644 --- a/csharp/msgpack/Compiler/PackILGenerator.cs +++ b/csharp/MsgPack/Compiler/PackILGenerator.cs @@ -1,10 +1,26 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Collections.Generic; using System.Reflection; using System.Reflection.Emit; using System.Runtime.Serialization; -namespace msgpack.Compiler +namespace MsgPack.Compiler { static class PackILGenerator { diff --git a/csharp/MsgPack/Compiler/Variable.cs b/csharp/MsgPack/Compiler/Variable.cs new file mode 100644 index 00000000..00c8e51c --- /dev/null +++ b/csharp/MsgPack/Compiler/Variable.cs @@ -0,0 +1,42 @@ +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System.Reflection.Emit; + +namespace MsgPack.Compiler +{ + public class Variable + { + Variable (VariableType type, int index) + { + this.VarType = type; + this.Index = index; + } + + public static Variable CreateLocal (LocalBuilder local) + { + return new Variable (VariableType.Local, local.LocalIndex); + } + + public static Variable CreateArg (int idx) + { + return new Variable (VariableType.Arg, idx); + } + + public VariableType VarType { get; set; } + public int Index { get; set; } + } +} diff --git a/csharp/MsgPack/Compiler/VariableType.cs b/csharp/MsgPack/Compiler/VariableType.cs new file mode 100644 index 00000000..306b516b --- /dev/null +++ b/csharp/MsgPack/Compiler/VariableType.cs @@ -0,0 +1,24 @@ +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +namespace MsgPack.Compiler +{ + public enum VariableType + { + Local, + Arg + } +} diff --git a/csharp/msgpack/msgpack.csproj b/csharp/MsgPack/MsgPack.csproj similarity index 96% rename from csharp/msgpack/msgpack.csproj rename to csharp/MsgPack/MsgPack.csproj index 086b729b..9a8d13de 100644 --- a/csharp/msgpack/msgpack.csproj +++ b/csharp/MsgPack/MsgPack.csproj @@ -8,8 +8,8 @@ {E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F} Library Properties - msgpack - msgpack + MsgPack + MsgPack v4.0 512 Client diff --git a/csharp/msgpack/MsgPackReader.cs b/csharp/MsgPack/MsgPackReader.cs similarity index 91% rename from csharp/msgpack/MsgPackReader.cs rename to csharp/MsgPack/MsgPackReader.cs index 06a37e06..3338a53b 100644 --- a/csharp/msgpack/MsgPackReader.cs +++ b/csharp/MsgPack/MsgPackReader.cs @@ -1,8 +1,24 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.IO; using System.Text; -namespace msgpack +namespace MsgPack { public class MsgPackReader { diff --git a/csharp/msgpack/MsgPackWriter.cs b/csharp/MsgPack/MsgPackWriter.cs similarity index 90% rename from csharp/msgpack/MsgPackWriter.cs rename to csharp/MsgPack/MsgPackWriter.cs index 2bd3929c..39647d87 100644 --- a/csharp/msgpack/MsgPackWriter.cs +++ b/csharp/MsgPack/MsgPackWriter.cs @@ -1,8 +1,24 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.IO; using System.Text; -namespace msgpack +namespace MsgPack { public class MsgPackWriter { diff --git a/csharp/msgpack/ObjectPacker.cs b/csharp/MsgPack/ObjectPacker.cs similarity index 92% rename from csharp/msgpack/ObjectPacker.cs rename to csharp/MsgPack/ObjectPacker.cs index fb0a7bf7..08f47966 100644 --- a/csharp/msgpack/ObjectPacker.cs +++ b/csharp/MsgPack/ObjectPacker.cs @@ -1,11 +1,27 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Runtime.Serialization; using System.Text; -namespace msgpack +namespace MsgPack { public class ObjectPacker { diff --git a/csharp/msgpack/ReflectionCache.cs b/csharp/MsgPack/ReflectionCache.cs similarity index 53% rename from csharp/msgpack/ReflectionCache.cs rename to csharp/MsgPack/ReflectionCache.cs index d7f97264..34d46e7b 100644 --- a/csharp/msgpack/ReflectionCache.cs +++ b/csharp/MsgPack/ReflectionCache.cs @@ -1,7 +1,23 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Collections.Generic; -namespace msgpack +namespace MsgPack { public static class ReflectionCache { diff --git a/csharp/msgpack/ReflectionCacheEntry.cs b/csharp/MsgPack/ReflectionCacheEntry.cs similarity index 56% rename from csharp/msgpack/ReflectionCacheEntry.cs rename to csharp/MsgPack/ReflectionCacheEntry.cs index 9a27f70b..bec4d4c4 100644 --- a/csharp/msgpack/ReflectionCacheEntry.cs +++ b/csharp/MsgPack/ReflectionCacheEntry.cs @@ -1,8 +1,24 @@ -using System; +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; using System.Collections.Generic; using System.Reflection; -namespace msgpack +namespace MsgPack { public class ReflectionCacheEntry { diff --git a/csharp/MsgPack/TypePrefixes.cs b/csharp/MsgPack/TypePrefixes.cs new file mode 100644 index 00000000..a7c97a61 --- /dev/null +++ b/csharp/MsgPack/TypePrefixes.cs @@ -0,0 +1,48 @@ +// +// Copyright 2011 Kazuki Oikawa +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +namespace MsgPack +{ + public enum TypePrefixes : byte + { + PositiveFixNum = 0x00, // 0x00 - 0x7f + NegativeFixNum = 0xe0, // 0xe0 - 0xff + + Nil = 0xc0, + False = 0xc2, + True = 0xc3, + Float = 0xca, + Double = 0xcb, + UInt8 = 0xcc, + UInt16 = 0xcd, + UInt32 = 0xce, + UInt64 = 0xcf, + Int8 = 0xd0, + Int16 = 0xd1, + Int32 = 0xd2, + Int64 = 0xd3, + Raw16 = 0xda, + Raw32 = 0xdb, + Array16 = 0xdc, + Array32 = 0xdd, + Map16 = 0xde, + Map32 = 0xdf, + + FixRaw = 0xa0, // 0xa0 - 0xbf + FixArray = 0x90, // 0x90 - 0x9f + FixMap = 0x80, // 0x80 - 0x8f + } +} diff --git a/csharp/msgpack.tests/AssemblyInfo.cs b/csharp/msgpack.tests/AssemblyInfo.cs deleted file mode 100644 index de7e181e..00000000 --- a/csharp/msgpack.tests/AssemblyInfo.cs +++ /dev/null @@ -1,36 +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 ("msgpack.tests")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("Microsoft")] -[assembly: AssemblyProduct ("msgpack.tests")] -[assembly: AssemblyCopyright ("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible (false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid ("82a4db7c-686b-4206-9cc9-9aae082d7e73")] - -// 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("1.0.*")] -[assembly: AssemblyVersion ("1.0.0.0")] -[assembly: AssemblyFileVersion ("1.0.0.0")] diff --git a/csharp/msgpack/AssemblyInfo.cs b/csharp/msgpack/AssemblyInfo.cs deleted file mode 100644 index 323742f6..00000000 --- a/csharp/msgpack/AssemblyInfo.cs +++ /dev/null @@ -1,37 +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 ("msgpack")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("Microsoft")] -[assembly: AssemblyProduct ("msgpack")] -[assembly: AssemblyCopyright ("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible (false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid ("aae99974-7a7d-4787-83ca-614779d54bd2")] - -// 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("1.0.*")] -[assembly: AssemblyVersion ("1.0.0.0")] -[assembly: AssemblyFileVersion ("1.0.0.0")] -[assembly: InternalsVisibleTo (msgpack.CompiledPacker.MethodBuilderPacker.AssemblyName)] diff --git a/csharp/msgpack/Compiler/Variable.cs b/csharp/msgpack/Compiler/Variable.cs deleted file mode 100644 index bac34340..00000000 --- a/csharp/msgpack/Compiler/Variable.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection.Emit; - -namespace msgpack.Compiler -{ - public class Variable - { - Variable (VariableType type, int index) - { - this.VarType = type; - this.Index = index; - } - - public static Variable CreateLocal (LocalBuilder local) - { - return new Variable (VariableType.Local, local.LocalIndex); - } - - public static Variable CreateArg (int idx) - { - return new Variable (VariableType.Arg, idx); - } - - public VariableType VarType { get; set; } - public int Index { get; set; } - } -} diff --git a/csharp/msgpack/Compiler/VariableType.cs b/csharp/msgpack/Compiler/VariableType.cs deleted file mode 100644 index 9a0dbceb..00000000 --- a/csharp/msgpack/Compiler/VariableType.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace msgpack.Compiler -{ - public enum VariableType - { - Local, - Arg - } -} diff --git a/csharp/msgpack/TypePrefixes.cs b/csharp/msgpack/TypePrefixes.cs deleted file mode 100644 index 633991be..00000000 --- a/csharp/msgpack/TypePrefixes.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace msgpack -{ - public enum TypePrefixes : byte - { - PositiveFixNum = 0x00, // 0x00 - 0x7f - NegativeFixNum = 0xe0, // 0xe0 - 0xff - - Nil = 0xc0, - False = 0xc2, - True = 0xc3, - Float = 0xca, - Double = 0xcb, - UInt8 = 0xcc, - UInt16 = 0xcd, - UInt32 = 0xce, - UInt64 = 0xcf, - Int8 = 0xd0, - Int16 = 0xd1, - Int32 = 0xd2, - Int64 = 0xd3, - Raw16 = 0xda, - Raw32 = 0xdb, - Array16 = 0xdc, - Array32 = 0xdd, - Map16 = 0xde, - Map32 = 0xdf, - - FixRaw = 0xa0, // 0xa0 - 0xbf - FixArray = 0x90, // 0x90 - 0x9f - FixMap = 0x80, // 0x80 - 0x8f - } -}