Skip to content

Commit

Permalink
Version 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Sep 3, 2018
1 parent 15b6457 commit f2aab0a
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 108 deletions.
16 changes: 6 additions & 10 deletions CBOR.nuspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<package
><metadata><version>3.2.1</version><id>PeterO.Cbor</id><requireLicenseAcceptance>false</requireLicenseAcceptance><releaseNotes>Version 3.2.1
><metadata><version>3.3.0</version><id>PeterO.Cbor</id><requireLicenseAcceptance>false</requireLicenseAcceptance><releaseNotes>Version 3.3:

- Add .NET Framework 4.0 targeted assembly to avoid compiler warnings that can appear when this package is added to a project that targets .NET Framework 4.0 or later.

Version 3.2

- Added build targeting the .NET Framework 2.0
- Obsoleted much of the existing API in CBOREncodeOptions and added new APIs to replace it.
- Documentation for some CBORObject methods now points to the use of CBOREncodeOptions.Default
- Documentation edited in other places</releaseNotes><summary></summary><licenseUrl>http://creativecommons.org/publicdomain/zero/1.0/</licenseUrl><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 7049.</description><owners>Peter Occil</owners><title>CBOR (Concise Binary Object Representation)</title><tags>cbor data serialization binary json numbers arithmetic</tags><dependencies><group><dependency id='PeterO.Numbers' version='1.1.2' /></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' /><file src='CBOR20/bin/Release/CBOR.dll' target='/lib/net20' /><file src='CBOR20/bin/Release/CBOR.xml' target='/lib/net20' /><file src='CBOR40/bin/Release/CBOR.dll' target='/lib/net40' /><file src='CBOR40/bin/Release/CBOR.xml' target='/lib/net40' /></files></package
>
- Added Clear, RemoveAt and Remove(object) methods to CBORObject class. Formerly, it was very hard with existing methods to remove items from CBOR maps and arrays.
- Added CodePointLength and ToUpperCaseAscii methods to DataUtilities class.
- Added WriteValue family of methods to CBORObject class. This can be used for lower-level encoding of CBOR objects. Examples on its use were included in the documentation.
- Bug fixes.</releaseNotes><summary></summary><licenseUrl>http://creativecommons.org/publicdomain/zero/1.0/</licenseUrl><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 7049.</description><owners>Peter Occil</owners><title>CBOR (Concise Binary Object Representation)</title><tags>cbor data serialization binary json numbers arithmetic</tags><dependencies><group><dependency id='PeterO.Numbers' version='1.1.2' /></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' /><file src='CBOR20/bin/Release/CBOR.dll' target='/lib/net20' /><file src='CBOR20/bin/Release/CBOR.xml' target='/lib/net20' /><file src='CBOR40/bin/Release/CBOR.dll' target='/lib/net40' /><file src='CBOR40/bin/Release/CBOR.xml' target='/lib/net40' /></files></package
>
4 changes: 2 additions & 2 deletions CBOR/CBOR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>3.2.1</Version>
<Version>3.3.0</Version>
<Owners>Peter Occil</Owners>
<Description>A C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 7049.</Description>
<Summary>A C# implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 7049. </Summary>
Expand Down Expand Up @@ -61,4 +61,4 @@ Version 3.3:
<ItemGroup>
<PackageReference Include="PeterO.Numbers" Version="1.1.2" />
</ItemGroup>
</Project>
</Project>
164 changes: 79 additions & 85 deletions CBOR/docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1984,8 +1984,7 @@
<param name='index'>The index, starting at 0, of the item to remove.
</param>
<returns>Returns "true" if the object was removed. Returns "false" if the given
index is less than 0, or is at least the number of items in
the array.
index is less than 0, or is at least as high as the number of items in the array.
</returns>
<exception cref='InvalidOperationException'>This object is not a CBOR array.
</exception>
Expand Down Expand Up @@ -2520,89 +2519,84 @@

</doc>
<doc name="M:PeterO.Cbor.CBORObject.WriteTo(System.IO.Stream)">
<summary><para><b>At the moment, use the overload of this method
that takes a <see cref='T:PeterO.Cbor.CBOREncodeOptions'/> object.
The object <c>CBOREncodeOptions.Default</c>
contains recommended
settings for CBOREncodeOptions, and those settings may be adopted
by this overload (without a CBOREncodeOptions argument) in the next
major version.</b>
</para>
<para>Writes this CBOR object to a data
stream. If the CBOR object contains CBOR maps, or is a CBOR map,
the keys to the map are written out to the data stream in an
undefined order. See the examples (written in C# for the .NET
version) for ways to write out certain keys of a CBOR map in a
given order.</para>
</summary>
<param name='stream'>A writable data stream.</param>
<exception cref='T:System.ArgumentNullException'>The parameter
<paramref name='stream'/> is null.</exception>
<exception cref='T:System.IO.IOException'>An I/O error
occurred.</exception>
<example><para>The following example shows a method that writes each key of
'mapObj' to 'outputStream', in the order given in 'keys', where
'mapObj' is written out in the form of a CBOR <b>definite-length
map</b>
. Only keys found in 'keys' will be written if they exist
in 'mapObj'.</para>
<code>private static void WriteKeysToMap&#x28;CBORObject
mapObj, IList&lt;CBORObject&gt; keys, Stream outputStream)&#x7b;
if&#x28;mapObj == null)&#x7b; throw new
ArgumentNullException&#x28;nameof(mapObj));&#x7d;
if&#x28;keys == null)&#x7b;throw new
ArgumentNullException&#x28;nameof(keys));&#x7d;
if&#x28;outputStream == null)&#x7b;throw new
ArgumentNullException&#x28;nameof(outputStream));&#x7d;
if&#x28;obj.Type!=CBORType.Map)&#x7b; throw new ArgumentException("'obj'
is not a map."); &#x7d;
int keyCount = 0;
for (CBORObject key in keys) &#x7b;
if&#x28;mapObj.ContainsKey(key))&#x7b; keyCount++;
&#x7d; &#x7d;
CBORObject.WriteValue(outputStream, 5, keyCount);
for (CBORObject key in keys) &#x7b;
if&#x28;mapObj.ContainsKey(key))&#x7b; key.WriteTo(outputStream);
mapObj[key].WriteTo(outputStream); &#x7d; &#x7d;
&#x7d;
</code>
<para>The following example shows a method that writes each key of
'mapObj' to 'outputStream', in the order given in 'keys', where
'mapObj' is written out in the form of a CBOR <b>indefinite-length
map</b>
. Only keys found in 'keys' will be written if they exist
in 'mapObj'.</para>
<code>private static void WriteKeysToIndefMap&#x28;CBORObject
mapObj, IList&lt;CBORObject&gt; keys, Stream outputStream)&#x7b;
if&#x28;mapObj == null)&#x7b; throw new
ArgumentNullException&#x28;nameof(mapObj));&#x7d;
if&#x28;keys == null)&#x7b;throw new
ArgumentNullException&#x28;nameof(keys));&#x7d;
if&#x28;outputStream == null)&#x7b;throw new
ArgumentNullException&#x28;nameof(outputStream));&#x7d;
if&#x28;obj.Type!=CBORType.Map)&#x7b; throw new ArgumentException("'obj'
is not a map."); &#x7d; outputStream.WriteByte((byte)0xBF);
for (CBORObject key in keys) &#x7b;
if&#x28;mapObj.ContainsKey(key))&#x7b; key.WriteTo(outputStream);
mapObj[key].WriteTo(outputStream); &#x7d; &#x7d;
outputStream.WriteByte((byte)0xff); &#x7d;
</code>
<para>The following example shows a method that writes out a list
of objects to 'outputStream' as an <b>indefinite-length CBOR
array</b>
.</para>
<code>private static void WriteToIndefArray&#x28;
IList&lt;object&gt; list, Stream outputStream)&#x7b;
if&#x28;list == null)&#x7b; throw new
ArgumentNullException&#x28;nameof(list));&#x7d;
if&#x28;outputStream == null)&#x7b;throw new
ArgumentNullException&#x28;nameof(outputStream));&#x7d;
outputStream.WriteByte((byte)0x9f);
for (object item in list) &#x7b;
new CBORObject(item).WriteTo(outputStream); &#x7d;
outputStream.WriteByte((byte)0xff); &#x7d;
</code>
</example>
<summary><para><b>At the moment, use the overload of this method that takes a
<see cref='T:PeterO.Cbor.CBOREncodeOptions'/>
object. The object
<c>CBOREncodeOptions.Default</c>
contains recommended settings for CBOREncodeOptions, and those
settings may be adopted by this overload (without a CBOREncodeOptions
argument) in the next major version.</b>
</para>
<para>Writes this CBOR object to a data stream. If the CBOR object contains
CBOR maps, or is a CBOR map, the keys to the map are written out to the
data stream in an undefined order. See the examples (written in C# for
the .NET version) for ways to write out certain keys of a CBOR map in a
given order.
</para>
</summary>
<param name='stream'>A writable data stream.
</param>
<exception cref='T:System.ArgumentNullException'>The parameter
<paramref name='stream'/>
is null.
</exception>
<exception cref='T:System.IO.IOException'>An I/O error occurred.
</exception>
<example><para>The following example shows a method that writes each key of 'mapObj' to
'outputStream', in the order given in 'keys', where 'mapObj' is written
out in the form of a CBOR
<b>definite-length map</b>
. Only keys found in 'keys' will be written if they exist in 'mapObj'.
</para>
<code>private static void WriteKeysToMap&#x28;CBORObject mapObj,
IList&lt;CBORObject&gt; keys, Stream outputStream)&#x7b; if&#x28;mapObj
== null)&#x7b; throw new
ArgumentNullException&#x28;nameof(mapObj));&#x7d; if&#x28;keys ==
null)&#x7b;throw new ArgumentNullException&#x28;nameof(keys));&#x7d;
if&#x28;outputStream == null)&#x7b;throw new
ArgumentNullException&#x28;nameof(outputStream));&#x7d;
if&#x28;obj.Type!=CBORType.Map)&#x7b; throw new ArgumentException("'obj'
is not a map."); &#x7d; int keyCount = 0; for (CBORObject key in keys)
&#x7b; if&#x28;mapObj.ContainsKey(key))&#x7b; keyCount++; &#x7d; &#x7d;
CBORObject.WriteValue(outputStream, 5, keyCount); for (CBORObject key in
keys) &#x7b; if&#x28;mapObj.ContainsKey(key))&#x7b;
key.WriteTo(outputStream); mapObj[key].WriteTo(outputStream); &#x7d;
&#x7d; &#x7d;
</code>
<para>The following example shows a method that writes each key of 'mapObj' to
'outputStream', in the order given in 'keys', where 'mapObj' is written
out in the form of a CBOR
<b>indefinite-length map</b>
. Only keys found in 'keys' will be written if they exist in 'mapObj'.
</para>
<code>private static void WriteKeysToIndefMap&#x28;CBORObject mapObj,
IList&lt;CBORObject&gt; keys, Stream outputStream)&#x7b; if&#x28;mapObj
== null)&#x7b; throw new
ArgumentNullException&#x28;nameof(mapObj));&#x7d; if&#x28;keys ==
null)&#x7b;throw new ArgumentNullException&#x28;nameof(keys));&#x7d;
if&#x28;outputStream == null)&#x7b;throw new
ArgumentNullException&#x28;nameof(outputStream));&#x7d;
if&#x28;obj.Type!=CBORType.Map)&#x7b; throw new ArgumentException("'obj'
is not a map."); &#x7d; outputStream.WriteByte((byte)0xBF); for
(CBORObject key in keys) &#x7b; if&#x28;mapObj.ContainsKey(key))&#x7b;
key.WriteTo(outputStream); mapObj[key].WriteTo(outputStream); &#x7d;
&#x7d; outputStream.WriteByte((byte)0xff); &#x7d;
</code>
<para>The following example shows a method that writes out a list of objects
to 'outputStream' as an
<b>indefinite-length CBOR array</b>
.
</para>
<code>private static void WriteToIndefArray&#x28; IList&lt;object&gt; list,
Stream outputStream)&#x7b; if&#x28;list == null)&#x7b; throw new
ArgumentNullException&#x28;nameof(list));&#x7d; if&#x28;outputStream ==
null)&#x7b;throw new
ArgumentNullException&#x28;nameof(outputStream));&#x7d;
outputStream.WriteByte((byte)0x9f); for (object item in list) &#x7b; new
CBORObject(item).WriteTo(outputStream); &#x7d;
outputStream.WriteByte((byte)0xff); &#x7d;
</code>
</example>
</doc>
<doc name="M:PeterO.Cbor.CBORObject.WriteTo(System.IO.Stream,PeterO.Cbor.CBOREncodeOptions)">

Expand Down
7 changes: 3 additions & 4 deletions CBOR20/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Reflection;

[assembly: System.CLSCompliant(true)]
[assembly: AssemblyVersion("3.2.1")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyInformationalVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.3.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
[assembly: AssemblyInformationalVersion("3.3.0.0")]
[assembly: AssemblyProduct("CBOR (Concise Binary Object Representati" +
"on)")]
[assembly: AssemblyTitle("CBOR (Concise Binary Object Representati" +
Expand Down
7 changes: 3 additions & 4 deletions CBOR40/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Reflection;

[assembly: System.CLSCompliant(true)]
[assembly: AssemblyVersion("3.2.1")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyInformationalVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.3.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
[assembly: AssemblyInformationalVersion("3.3.0.0")]
[assembly: AssemblyProduct("CBOR (Concise Binary Object Representati" +
"on)")]
[assembly: AssemblyTitle("CBOR (Concise Binary Object Representati" +
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Reflection;
[assembly: System.CLSCompliant(true)]
[assembly: AssemblyVersion("3.2.1")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyInformationalVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.3.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
[assembly: AssemblyInformationalVersion("3.3.0.0")]
[assembly: AssemblyProduct("CBOR (Concise Binary Object Representati" +
"on)")]
[assembly: AssemblyTitle("CBOR (Concise Binary Object Representati" +
Expand Down

0 comments on commit f2aab0a

Please sign in to comment.