Skip to content

Commit

Permalink
v5: .NET Core support.
Browse files Browse the repository at this point in the history
  • Loading branch information
SolalPirelli committed Sep 24, 2016
1 parent 6f0752b commit 2d8df07
Show file tree
Hide file tree
Showing 85 changed files with 791 additions and 1,429 deletions.
15 changes: 5 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# User-specific files
.vs/
*.vs
*.user

# NuGet packages
[Pp]ackages/

# Build results
[Dd]ebug/
[Rr]elease/
[Bb]in/
[Oo]bj/

# NuGet build results
*.nupkg
bin/
obj/
*.lock.json
*.nuget.props

# VS test results
TestResults/
40 changes: 20 additions & 20 deletions License.txt → License.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-16 Solal Pirelli
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
The MIT License (MIT)

Copyright (c) Solal Pirelli

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
17 changes: 12 additions & 5 deletions ThriftSharp.Benchmarking/MemoryBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-16 Solal Pirelli
// Copyright (c) Solal Pirelli
// This code is licensed under the MIT License (see Licence.txt for details)

using System;
Expand All @@ -15,16 +15,23 @@ public sealed class MemoryBuffer : IThriftTransport
private MemoryStream _memory;


public static byte[] Serialize<T>( T obj )
public static ArraySegment<byte> Serialize<T>( T obj )
{
var buffer = new MemoryBuffer() { _memory = new MemoryStream() };
ThriftStructWriter.Write( obj, new ThriftBinaryProtocol( buffer ) );
return buffer._memory.GetBuffer();

ArraySegment<byte> result;
if( buffer._memory.TryGetBuffer( out result ) )
{
return result;
}

throw new Exception( "What now?" );
}

public static T Deserialize<T>( byte[] bytes )
public static T Deserialize<T>( ArraySegment<byte> bytes )
{
var buffer = new MemoryBuffer { _memory = new MemoryStream( bytes ) };
var buffer = new MemoryBuffer { _memory = new MemoryStream( bytes.Array, bytes.Offset, bytes.Count ) };
return ThriftStructReader.Read<T>( new ThriftBinaryProtocol( buffer ) );
}

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/AllTypesContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class AllTypesContainer : TBase
{

Expand Down
4 changes: 1 addition & 3 deletions ThriftSharp.Benchmarking/Models/Thrift/BinaryContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class BinaryContainer : TBase
{

Expand Down
4 changes: 1 addition & 3 deletions ThriftSharp.Benchmarking/Models/Thrift/BoolContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class BoolContainer : TBase
{

Expand Down
4 changes: 1 addition & 3 deletions ThriftSharp.Benchmarking/Models/Thrift/ByteContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class ByteContainer : TBase
{

Expand Down
4 changes: 1 addition & 3 deletions ThriftSharp.Benchmarking/Models/Thrift/DoubleContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class DoubleContainer : TBase
{

Expand Down
4 changes: 1 addition & 3 deletions ThriftSharp.Benchmarking/Models/Thrift/EmptyStruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class EmptyStruct : TBase
{

Expand Down
4 changes: 1 addition & 3 deletions ThriftSharp.Benchmarking/Models/Thrift/Int16Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class Int16Container : TBase
{

Expand Down
4 changes: 1 addition & 3 deletions ThriftSharp.Benchmarking/Models/Thrift/Int32Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class Int32Container : TBase
{

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/Int64Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class Int64Container : TBase
{

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/ListContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class ListContainer : TBase
{

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/MapContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class MapContainer : TBase
{

Expand Down
9 changes: 2 additions & 7 deletions ThriftSharp.Benchmarking/Models/Thrift/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class Person : TBase
{
private string _lastName;
Expand Down Expand Up @@ -62,9 +59,7 @@ public int Age


public Isset __isset;
#if !SILVERLIGHT
[Serializable]
#endif

public struct Isset {
public bool lastName;
public bool age;
Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/PersonAvailability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class PersonAvailability : TBase
{

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/SetContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class SetContainer : TBase
{

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/StringContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class StringContainer : TBase
{

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/StructContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class StructContainer : TBase
{

Expand Down
5 changes: 1 addition & 4 deletions ThriftSharp.Benchmarking/Models/Thrift/TimePeriod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace ThriftSharp.Benchmarking.Models.Thrift
{

#if !SILVERLIGHT
[Serializable]
#endif

public partial class TimePeriod : TBase
{

Expand Down
Loading

0 comments on commit 2d8df07

Please sign in to comment.