Skip to content

Commit

Permalink
Version 5.0.0-alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Aug 15, 2024
1 parent d2d440c commit 8d63df7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
6 changes: 3 additions & 3 deletions CBOR.nuspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<package
><metadata><version>5.0.0-alpha1</version><id>PeterO.Cbor</id><requireLicenseAcceptance>false</requireLicenseAcceptance><releaseNotes>Version 5.0:
><metadata><version>5.0.0-alpha2</version><id>PeterO.Cbor</id><requireLicenseAcceptance>false</requireLicenseAcceptance><releaseNotes>Version 5.0:

- Alpha version
- Some deprecated features from earlier versions were obsoleted.
Expand All @@ -13,5 +13,5 @@ Version 4.5:
- CBORObject.ToString renders strings as ASCII
- Add support for deserializing CBOR objects to IReadOnlyList, IReadOnlyCollection, and ReadOnlyDictionary

Note that after version 4.5x, the CBOR library&apos;s repository will stop including special projects for .NET 2.0 and .NET 4.0, leaving the .NET-Standard project for building the library.</releaseNotes><summary></summary><license type='expression'>CC0-1.0</license><projectUrl>https://github.com/peteroupc/CBOR</projectUrl><authors>Peter Occil</authors><description>A C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 8949.</description><owners>Peter Occil</owners><title>CBOR (Concise Binary Object Representation)</title><tags>cbor data serialization binary json</tags><dependencies><group targetFramework='.NETStandard1.0'><dependency id='PolySharp' version='1.13.2' /><dependency id='PeterO.URIUtility' version='1.0.0' /><dependency id='PeterO.Numbers' version='1.8.2' /><dependency id='PeterO.DataUtilities' version='1.1.0' /></group></dependencies></metadata><files><file src='CBOR/bin/Release/netstandard1.0/CBOR.dll' target='/lib/netstandard1.0' /><file src='CBOR/bin/Release/netstandard1.0/CBOR.xml' target='/lib/netstandard1.0' /></files></package
>
Note that after version 4.5x, the CBOR library&apos;s repository will stop including special projects for .NET 2.0 and .NET 4.0, leaving the .NET-Standard project for building the library.</releaseNotes><summary></summary><license type='expression'>Unlicense</license><projectUrl>https://github.com/peteroupc/CBOR</projectUrl><authors>Peter Occil</authors><description>A C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 8949.</description><owners>Peter Occil</owners><title>CBOR (Concise Binary Object Representation)</title><tags>cbor data serialization binary json</tags><dependencies><group targetFramework='.NETStandard1.0'><dependency id='PolySharp' version='1.13.2' /><dependency id='PeterO.URIUtility' version='1.0.0' /><dependency id='PeterO.Numbers' version='1.8.2' /><dependency id='PeterO.DataUtilities' version='1.1.0' /></group></dependencies></metadata><files><file src='CBOR/bin/Release/netstandard1.0/CBOR.dll' target='/lib/netstandard1.0' /><file src='CBOR/bin/Release/netstandard1.0/CBOR.xml' target='/lib/netstandard1.0' /></files></package
>
6 changes: 3 additions & 3 deletions CBOR/CBOR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.0; net6.0</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>5.0.0-alpha1</Version>
<Version>5.0.0-alpha2</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Owners>Peter Occil</Owners>
<Description>A C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 8949.</Description>
<Summary>A C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 8949. </Summary>
<Copyright>Written by Peter O. Any copyright to this work is released to the Public Domain. In case this is not possible, this work is also licensed under Creative Commons Zero (CC0).</Copyright>
<Copyright>Written by Peter O. Any copyright to this work is released to the Public Domain. In case this is not possible, this work is also licensed under the Unlicense.</Copyright>
<Authors>Peter Occil</Authors>
<PackageId>PeterO.Cbor</PackageId>
<PackageLicenseExpression>CC0-1.0</PackageLicenseExpression>
<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/peteroupc/CBOR</PackageProjectUrl>
<PackageReleaseNotes>
Version 5.0:
Expand Down
8 changes: 4 additions & 4 deletions CBOR/PeterO/Cbor/CBORObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3240,8 +3240,8 @@ public static CBORObject NewMap() {
/// undefined order.</summary>
/// <param name='keysAndValues'>A sequence of key-value pairs.</param>
/// <returns>A new CBOR map.</returns>
public static CBORObject FromMap(IEnumerable<Tuple<CBORObject,
CBORObject >> keysAndValues) {
public static CBORObject FromMap(
IEnumerable<Tuple<CBORObject, CBORObject>> keysAndValues) {
var sd = new SortedDictionary<CBORObject, CBORObject>();
foreach (Tuple<CBORObject, CBORObject> kv in keysAndValues) {
sd.Add(kv.Item1, kv.Item2);
Expand All @@ -3264,8 +3264,8 @@ public static CBORObject NewOrderedMap() {
/// in order.</summary>
/// <param name='keysAndValues'>A sequence of key-value pairs.</param>
/// <returns>A new CBOR map.</returns>
public static CBORObject FromOrderedMap(IEnumerable<Tuple<CBORObject,
CBORObject >> keysAndValues) {
public static CBORObject FromOrderedMap(
IEnumerable<Tuple<CBORObject, CBORObject>> keysAndValues) {
IDictionary<CBORObject, CBORObject> oDict;
oDict = PropertyMap.NewOrderedDict();
foreach (Tuple<CBORObject, CBORObject> kv in keysAndValues) {
Expand Down
14 changes: 12 additions & 2 deletions CBORTest/CBORObjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6879,20 +6879,26 @@ public static void TestWriteExtraOne(long longValue) {
}

private void TestWriteUnchangedFloatBits(int bits) {
try {
using (var ms = new Test.DelayingStream()) {
byte[] expectedBytes = {
(byte)0xfa,
(byte)((bits >> 24) & 0xff),
(byte)((bits >> 16) & 0xff),
(byte)((bits >> 8) & 0xff),
(byte)(bits & 0xff)
(byte)(bits & 0xff),
};
CBORObject.WriteFloatingPointBits(ms, bits, 4, true);
TestCommon.AssertByteArraysEqual(expectedBytes, ms.ToArray());
}
} catch (IOException ex) {
Assert.Fail(ex.ToString());
throw new InvalidOperationException(ex.ToString(), ex);
}
}

private void TestWriteUnchangedDoubleBits(long bits) {
try {
using (var ms = new Test.DelayingStream()) {
byte[] expectedBytes = {
(byte)0xfb,
Expand All @@ -6903,11 +6909,15 @@ private void TestWriteUnchangedDoubleBits(long bits) {
(byte)((bits >> 24) & 0xffL),
(byte)((bits >> 16) & 0xffL),
(byte)((bits >> 8) & 0xffL),
(byte)(bits & 0xffL)
(byte)(bits & 0xffL),
};
CBORObject.WriteFloatingPointBits(ms, bits, 8, true);
TestCommon.AssertByteArraysEqual(expectedBytes, ms.ToArray());
}
} catch (IOException ex) {
Assert.Fail(ex.ToString());
throw new InvalidOperationException(ex.ToString(), ex);
}
}

[Test]
Expand Down

0 comments on commit 8d63df7

Please sign in to comment.