mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-22 00:19:19 +01:00
csharp: add license, rename filename/namespace.
This commit is contained in:
parent
33498d3673
commit
6cfea98501
14
.gitignore
vendored
14
.gitignore
vendored
@ -6,10 +6,10 @@ ruby/Makefile
|
|||||||
*.6
|
*.6
|
||||||
_obj
|
_obj
|
||||||
_test
|
_test
|
||||||
/csharp/msgpack.suo
|
/csharp/MsgPack.suo
|
||||||
/csharp/msgpack/bin
|
/csharp/MsgPack/bin
|
||||||
/csharp/msgpack/obj
|
/csharp/MsgPack/obj
|
||||||
/csharp/msgpack/msgpack.csproj.user
|
/csharp/MsgPack/MsgPack.csproj.user
|
||||||
/csharp/msgpack.tests/obj
|
/csharp/MsgPack.Test/obj
|
||||||
/csharp/msgpack.tests/bin
|
/csharp/MsgPack.Test/bin
|
||||||
/csharp/msgpack.tests/msgpack.tests.csproj.user
|
/csharp/MsgPack.Test/MsgPack.Test.csproj.user
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
TARGET=msgpack.dll
|
TARGET=MsgPack.dll
|
||||||
TEST_TARGET=msgpack.tests.dll
|
TEST_TARGET=MsgPack.Test.dll
|
||||||
|
|
||||||
SRC=$(shell find msgpack -name "*.cs")
|
SRC=$(shell find MsgPack -name "*.cs")
|
||||||
TEST_SRC=$(shell find msgpack.tests -name "*.cs")
|
TEST_SRC=$(shell find MsgPack.Test -name "*.cs")
|
||||||
|
|
||||||
MONO_CC=mcs
|
MONO_CC=mcs
|
||||||
NUNIT_CONSOLE=nunit-console
|
NUNIT_CONSOLE=nunit-console
|
||||||
@ -15,7 +15,7 @@ run-test:
|
|||||||
$(NUNIT_CONSOLE) $(TEST_TARGET)
|
$(NUNIT_CONSOLE) $(TEST_TARGET)
|
||||||
|
|
||||||
$(TARGET): $(SRC)
|
$(TARGET): $(SRC)
|
||||||
$(MONO_CC) -out:$@ -t:library -unsafe+ $^
|
$(MONO_CC) -out:$@ -t:library -unsafe+ $(SRC)
|
||||||
|
|
||||||
$(TEST_TARGET): $(TEST_SRC)
|
$(TEST_TARGET): $(TEST_SRC) $(TARGET)
|
||||||
$(MONO_CC) -out:$@ -t:library -r:$(TARGET) -r:nunit.framework.dll $^
|
$(MONO_CC) -out:$@ -t:library -r:$(TARGET) -r:nunit.framework.dll $(TEST_SRC)
|
||||||
|
26
csharp/MsgPack.Test/AssemblyInfo.cs
Normal file
26
csharp/MsgPack.Test/AssemblyInfo.cs
Normal file
@ -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.*")]
|
@ -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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace msgpack.tests
|
namespace MsgPack.Test
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class BoxingPackerTests
|
public class BoxingPackerTests
|
@ -1,10 +1,24 @@
|
|||||||
using System;
|
//
|
||||||
using System.Collections.Generic;
|
// Copyright 2011 Kazuki Oikawa
|
||||||
using NUnit.Framework;
|
//
|
||||||
using TestA_Class = msgpack.tests.ObjectPackerTests.TestA_Class;
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
using TestB_Class = msgpack.tests.ObjectPackerTests.TestB_Class;
|
// 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]
|
[TestFixture]
|
||||||
public class CompiledPackerTests
|
public class CompiledPackerTests
|
@ -8,8 +8,8 @@
|
|||||||
<ProjectGuid>{CE24167B-8F0A-4670-BD1E-3C283311E86B}</ProjectGuid>
|
<ProjectGuid>{CE24167B-8F0A-4670-BD1E-3C283311E86B}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>msgpack.tests</RootNamespace>
|
<RootNamespace>MsgPack.Test</RootNamespace>
|
||||||
<AssemblyName>msgpack.tests</AssemblyName>
|
<AssemblyName>MsgPack.Test</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
@ -49,9 +49,9 @@
|
|||||||
<Compile Include="ReaderWriterTests.cs" />
|
<Compile Include="ReaderWriterTests.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\msgpack\msgpack.csproj">
|
<ProjectReference Include="..\MsgPack\MsgPack.csproj">
|
||||||
<Project>{E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F}</Project>
|
<Project>{E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F}</Project>
|
||||||
<Name>msgpack</Name>
|
<Name>MsgPack</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
@ -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;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace msgpack.tests
|
namespace MsgPack.Test
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class ObjectPackerTests
|
public class ObjectPackerTests
|
@ -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.IO;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace msgpack.tests
|
namespace MsgPack.Test
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class ReaderWriterTests
|
public class ReaderWriterTests
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
# Visual Studio 2010
|
# 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
|
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
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
28
csharp/MsgPack/AssemblyInfo.cs
Normal file
28
csharp/MsgPack/AssemblyInfo.cs
Normal file
@ -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)]
|
@ -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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace msgpack
|
namespace MsgPack
|
||||||
{
|
{
|
||||||
public class BoxingPacker
|
public class BoxingPacker
|
||||||
{
|
{
|
@ -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.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using msgpack.Compiler;
|
using MsgPack.Compiler;
|
||||||
|
|
||||||
namespace msgpack
|
namespace MsgPack
|
||||||
{
|
{
|
||||||
public class CompiledPacker
|
public class CompiledPacker
|
||||||
{
|
{
|
@ -1,11 +1,24 @@
|
|||||||
using System;
|
//
|
||||||
using System.Collections.Generic;
|
// Copyright 2011 Kazuki Oikawa
|
||||||
using System.Linq;
|
//
|
||||||
using System.Text;
|
// 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;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
|
|
||||||
namespace msgpack.Compiler
|
namespace MsgPack.Compiler
|
||||||
{
|
{
|
||||||
public static class EmitExtensions
|
public static class EmitExtensions
|
||||||
{
|
{
|
@ -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.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace msgpack.Compiler
|
namespace MsgPack.Compiler
|
||||||
{
|
{
|
||||||
static class PackILGenerator
|
static class PackILGenerator
|
||||||
{
|
{
|
42
csharp/MsgPack/Compiler/Variable.cs
Normal file
42
csharp/MsgPack/Compiler/Variable.cs
Normal file
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
24
csharp/MsgPack/Compiler/VariableType.cs
Normal file
24
csharp/MsgPack/Compiler/VariableType.cs
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
@ -8,8 +8,8 @@
|
|||||||
<ProjectGuid>{E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F}</ProjectGuid>
|
<ProjectGuid>{E1809531-EC2A-4EA6-B0E8-CC815EDFAA2F}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>msgpack</RootNamespace>
|
<RootNamespace>MsgPack</RootNamespace>
|
||||||
<AssemblyName>msgpack</AssemblyName>
|
<AssemblyName>MsgPack</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
@ -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.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace msgpack
|
namespace MsgPack
|
||||||
{
|
{
|
||||||
public class MsgPackReader
|
public class MsgPackReader
|
||||||
{
|
{
|
@ -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.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace msgpack
|
namespace MsgPack
|
||||||
{
|
{
|
||||||
public class MsgPackWriter
|
public class MsgPackWriter
|
||||||
{
|
{
|
@ -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.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace msgpack
|
namespace MsgPack
|
||||||
{
|
{
|
||||||
public class ObjectPacker
|
public class ObjectPacker
|
||||||
{
|
{
|
@ -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;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace msgpack
|
namespace MsgPack
|
||||||
{
|
{
|
||||||
public static class ReflectionCache
|
public static class ReflectionCache
|
||||||
{
|
{
|
@ -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.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace msgpack
|
namespace MsgPack
|
||||||
{
|
{
|
||||||
public class ReflectionCacheEntry
|
public class ReflectionCacheEntry
|
||||||
{
|
{
|
48
csharp/MsgPack/TypePrefixes.cs
Normal file
48
csharp/MsgPack/TypePrefixes.cs
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
@ -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")]
|
|
@ -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)]
|
|
@ -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; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace msgpack.Compiler
|
|
||||||
{
|
|
||||||
public enum VariableType
|
|
||||||
{
|
|
||||||
Local,
|
|
||||||
Arg
|
|
||||||
}
|
|
||||||
}
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user