--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30215.9
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Formats.Cbor", "src\System.Formats.Cbor.csproj", "{57B5AD1E-D0BA-4811-9276-9BBAFF44AB31}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{00675670-C8E7-4428-A16F-9E6B933586A8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{59B37ECC-D5BB-488A-9571-1E239EDF19A9}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{B3417D0B-D64E-4CC8-AEAA-F0C7C963248F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Formats.Cbor", "ref\System.Formats.Cbor.csproj", "{B17130D2-0A75-464A-A3E7-67123C567CAF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Formats.Cbor.Tests", "tests\System.Formats.Cbor.Tests.csproj", "{1C84C43C-69A8-493E-AC11-0DA9C22BFB46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {57B5AD1E-D0BA-4811-9276-9BBAFF44AB31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {57B5AD1E-D0BA-4811-9276-9BBAFF44AB31}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {57B5AD1E-D0BA-4811-9276-9BBAFF44AB31}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {57B5AD1E-D0BA-4811-9276-9BBAFF44AB31}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B17130D2-0A75-464A-A3E7-67123C567CAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B17130D2-0A75-464A-A3E7-67123C567CAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B17130D2-0A75-464A-A3E7-67123C567CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B17130D2-0A75-464A-A3E7-67123C567CAF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1C84C43C-69A8-493E-AC11-0DA9C22BFB46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1C84C43C-69A8-493E-AC11-0DA9C22BFB46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1C84C43C-69A8-493E-AC11-0DA9C22BFB46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1C84C43C-69A8-493E-AC11-0DA9C22BFB46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {57B5AD1E-D0BA-4811-9276-9BBAFF44AB31} = {59B37ECC-D5BB-488A-9571-1E239EDF19A9}
+ {B17130D2-0A75-464A-A3E7-67123C567CAF} = {B3417D0B-D64E-4CC8-AEAA-F0C7C963248F}
+ {1C84C43C-69A8-493E-AC11-0DA9C22BFB46} = {00675670-C8E7-4428-A16F-9E6B933586A8}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {36EE2FB8-4CD8-4A12-8FD5-9FDF3D0F6D40}
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<Project DefaultTargets="Build">
+ <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
+ <ItemGroup>
+ <ProjectReference Include="..\src\System.Formats.Cbor.csproj">
+ <SupportedFramework>$(NetCoreAppCurrent)</SupportedFramework>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
+</Project>
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+// ------------------------------------------------------------------------------
+// Changes to this file must follow the https://aka.ms/api-review process.
+// ------------------------------------------------------------------------------
+
+namespace System.Formats.Cbor
+{
+ public enum CborConformanceMode
+ {
+ Lax = 0,
+ Strict = 1,
+ Canonical = 2,
+ Ctap2Canonical = 3,
+ }
+ public partial class CborContentException : System.Exception
+ {
+ protected CborContentException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
+ public CborContentException(string? message) { }
+ public CborContentException(string? message, System.Exception? inner) { }
+ }
+ public partial class CborReader
+ {
+ public CborReader(System.ReadOnlyMemory<byte> data, System.Formats.Cbor.CborConformanceMode conformanceMode = System.Formats.Cbor.CborConformanceMode.Strict, bool allowMultipleRootLevelValues = false) { }
+ public bool AllowMultipleRootLevelValues { get { throw null; } }
+ public int BytesRemaining { get { throw null; } }
+ public System.Formats.Cbor.CborConformanceMode ConformanceMode { get { throw null; } }
+ public int CurrentDepth { get { throw null; } }
+ public System.Formats.Cbor.CborReaderState PeekState() { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public System.Formats.Cbor.CborTag PeekTag() { throw null; }
+ public System.Numerics.BigInteger ReadBigInteger() { throw null; }
+ public bool ReadBoolean() { throw null; }
+ public byte[] ReadByteString() { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public ulong ReadCborNegativeIntegerRepresentation() { throw null; }
+ public System.DateTimeOffset ReadDateTimeOffset() { throw null; }
+ public decimal ReadDecimal() { throw null; }
+ public System.ReadOnlyMemory<byte> ReadDefiniteLengthByteString() { throw null; }
+ public System.ReadOnlyMemory<byte> ReadDefiniteLengthTextStringBytes() { throw null; }
+ public double ReadDouble() { throw null; }
+ public System.ReadOnlyMemory<byte> ReadEncodedValue(bool disableConformanceModeChecks = false) { throw null; }
+ public void ReadEndArray() { }
+ public void ReadEndIndefiniteLengthByteString() { }
+ public void ReadEndIndefiniteLengthTextString() { }
+ public void ReadEndMap() { }
+ public int ReadInt32() { throw null; }
+ public long ReadInt64() { throw null; }
+ public void ReadNull() { }
+ public System.Formats.Cbor.CborSimpleValue ReadSimpleValue() { throw null; }
+ public float ReadSingle() { throw null; }
+ public int? ReadStartArray() { throw null; }
+ public void ReadStartIndefiniteLengthByteString() { }
+ public void ReadStartIndefiniteLengthTextString() { }
+ public int? ReadStartMap() { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public System.Formats.Cbor.CborTag ReadTag() { throw null; }
+ public string ReadTextString() { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public uint ReadUInt32() { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public ulong ReadUInt64() { throw null; }
+ public System.DateTimeOffset ReadUnixTimeSeconds() { throw null; }
+ public void SkipToParent(bool disableConformanceModeChecks = false) { }
+ public void SkipValue(bool disableConformanceModeChecks = false) { }
+ public bool TryReadByteString(System.Span<byte> destination, out int bytesWritten) { throw null; }
+ public bool TryReadTextString(System.Span<char> destination, out int charsWritten) { throw null; }
+ }
+ public enum CborReaderState
+ {
+ Undefined = 0,
+ UnsignedInteger = 1,
+ NegativeInteger = 2,
+ ByteString = 3,
+ StartIndefiniteLengthByteString = 4,
+ EndIndefiniteLengthByteString = 5,
+ TextString = 6,
+ StartIndefiniteLengthTextString = 7,
+ EndIndefiniteLengthTextString = 8,
+ StartArray = 9,
+ EndArray = 10,
+ StartMap = 11,
+ EndMap = 12,
+ Tag = 13,
+ SimpleValue = 14,
+ HalfPrecisionFloat = 15,
+ SinglePrecisionFloat = 16,
+ DoublePrecisionFloat = 17,
+ Null = 18,
+ Boolean = 19,
+ Finished = 20,
+ }
+ public enum CborSimpleValue : byte
+ {
+ False = (byte)20,
+ True = (byte)21,
+ Null = (byte)22,
+ Undefined = (byte)23,
+ }
+ [System.CLSCompliantAttribute(false)]
+ public enum CborTag : ulong
+ {
+ DateTimeString = (ulong)0,
+ UnixTimeSeconds = (ulong)1,
+ UnsignedBigNum = (ulong)2,
+ NegativeBigNum = (ulong)3,
+ DecimalFraction = (ulong)4,
+ BigFloat = (ulong)5,
+ Base64UrlLaterEncoding = (ulong)21,
+ Base64StringLaterEncoding = (ulong)22,
+ Base16StringLaterEncoding = (ulong)23,
+ EncodedCborDataItem = (ulong)24,
+ Uri = (ulong)32,
+ Base64Url = (ulong)33,
+ Base64 = (ulong)34,
+ Regex = (ulong)35,
+ MimeMessage = (ulong)36,
+ SelfDescribeCbor = (ulong)55799,
+ }
+ public partial class CborWriter
+ {
+ public CborWriter(System.Formats.Cbor.CborConformanceMode conformanceMode = System.Formats.Cbor.CborConformanceMode.Strict, bool convertIndefiniteLengthEncodings = false, bool allowMultipleRootLevelValues = false) { }
+ public bool AllowMultipleRootLevelValues { get { throw null; } }
+ public int BytesWritten { get { throw null; } }
+ public System.Formats.Cbor.CborConformanceMode ConformanceMode { get { throw null; } }
+ public bool ConvertIndefiniteLengthEncodings { get { throw null; } }
+ public int CurrentDepth { get { throw null; } }
+ public bool IsWriteCompleted { get { throw null; } }
+ public byte[] Encode() { throw null; }
+ public int Encode(System.Span<byte> destination) { throw null; }
+ public void Reset() { }
+ public bool TryEncode(System.Span<byte> destination, out int bytesWritten) { throw null; }
+ public void WriteBigInteger(System.Numerics.BigInteger value) { }
+ public void WriteBoolean(bool value) { }
+ public void WriteByteString(byte[] value) { }
+ public void WriteByteString(System.ReadOnlySpan<byte> value) { }
+ [System.CLSCompliantAttribute(false)]
+ public void WriteCborNegativeIntegerRepresentation(ulong value) { }
+ public void WriteDateTimeOffset(System.DateTimeOffset value) { }
+ public void WriteDecimal(decimal value) { }
+ public void WriteDouble(double value) { }
+ public void WriteEncodedValue(System.ReadOnlySpan<byte> encodedValue) { }
+ public void WriteEndArray() { }
+ public void WriteEndIndefiniteLengthByteString() { }
+ public void WriteEndIndefiniteLengthTextString() { }
+ public void WriteEndMap() { }
+ public void WriteInt32(int value) { }
+ public void WriteInt64(long value) { }
+ public void WriteNull() { }
+ public void WriteSimpleValue(System.Formats.Cbor.CborSimpleValue value) { }
+ public void WriteSingle(float value) { }
+ public void WriteStartArray(int? definiteLength) { }
+ public void WriteStartIndefiniteLengthByteString() { }
+ public void WriteStartIndefiniteLengthTextString() { }
+ public void WriteStartMap(int? definiteLength) { }
+ [System.CLSCompliantAttribute(false)]
+ public void WriteTag(System.Formats.Cbor.CborTag tag) { }
+ public void WriteTextString(System.ReadOnlySpan<char> value) { }
+ public void WriteTextString(string value) { }
+ [System.CLSCompliantAttribute(false)]
+ public void WriteUInt32(uint value) { }
+ [System.CLSCompliantAttribute(false)]
+ public void WriteUInt64(ulong value) { }
+ public void WriteUnixTimeSeconds(double seconds) { }
+ public void WriteUnixTimeSeconds(long seconds) { }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="System.Formats.Cbor.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
+ <ProjectReference Include="..\..\System.Runtime.Numerics\ref\System.Runtime.Numerics.csproj" />
+ </ItemGroup>
+</Project>
<data name="Argument_EncodeDestinationTooSmall" xml:space="preserve">
<value>The destination is too small to hold the encoded value.</value>
</data>
- <data name="Argument_InvalidOidValue" xml:space="preserve">
- <value>The OID value was invalid.</value>
- </data>
- <data name="Cryptography_Asn_EnumeratedValueRequiresNonFlagsEnum" xml:space="preserve">
- <value>ASN.1 Enumerated values only apply to enum types without the [Flags] attribute.</value>
- </data>
- <data name="Cryptography_Asn_NamedBitListRequiresFlagsEnum" xml:space="preserve">
- <value>Named bit list operations require an enum with the [Flags] attribute.</value>
- </data>
- <data name="Cryptography_Asn_NamedBitListValueTooBig" xml:space="preserve">
- <value>The encoded named bit list value is larger than the value size of the '{0}' enum.</value>
- </data>
- <data name="Cryptography_Asn_UniversalValueIsFixed" xml:space="preserve">
- <value>Tags with TagClass Universal must have the appropriate TagValue value for the data type being read or written.</value>
- </data>
- <data name="Cryptography_Asn_UnusedBitCountRange" xml:space="preserve">
- <value>Unused bit count must be between 0 and 7, inclusive.</value>
- </data>
- <data name="Cryptography_AsnSerializer_AmbiguousFieldType" xml:space="preserve">
- <value>Field '{0}' of type '{1}' has ambiguous type '{2}', an attribute derived from AsnTypeAttribute is required.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Choice_AllowNullNonNullable" xml:space="preserve">
- <value>[Choice].AllowNull=true is not valid because type '{0}' cannot have a null value.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Choice_ConflictingTagMapping" xml:space="preserve">
- <value>The tag ({0} {1}) for field '{2}' on type '{3}' already is associated in this context with field '{4}' on type '{5}'.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Choice_DefaultValueDisallowed" xml:space="preserve">
- <value>Field '{0}' on [Choice] type '{1}' has a default value, which is not permitted.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Choice_NoChoiceWasMade" xml:space="preserve">
- <value>An instance of [Choice] type '{0}' has no non-null fields.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Choice_NonNullableField" xml:space="preserve">
- <value>Field '{0}' on [Choice] type '{1}' can not be assigned a null value.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Choice_TooManyValues" xml:space="preserve">
- <value>Fields '{0}' and '{1}' on type '{2}' are both non-null when only one value is permitted.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Choice_TypeCycle" xml:space="preserve">
- <value>Field '{0}' on [Choice] type '{1}' has introduced a type chain cycle.</value>
- </data>
- <data name="Cryptography_AsnSerializer_MultipleAsnTypeAttributes" xml:space="preserve">
- <value>Field '{0}' on type '{1}' has multiple attributes deriving from '{2}' when at most one is permitted.</value>
- </data>
- <data name="Cryptography_AsnSerializer_NoJaggedArrays" xml:space="preserve">
- <value>Type '{0}' cannot be serialized or deserialized because it is an array of arrays.</value>
- </data>
- <data name="Cryptography_AsnSerializer_NoMultiDimensionalArrays" xml:space="preserve">
- <value>Type '{0}' cannot be serialized or deserialized because it is a multi-dimensional array.</value>
- </data>
- <data name="Cryptography_AsnSerializer_NoOpenTypes" xml:space="preserve">
- <value>Type '{0}' cannot be serialized or deserialized because it is not sealed or has unbound generic parameters.</value>
- </data>
- <data name="Cryptography_AsnSerializer_Optional_NonNullableField" xml:space="preserve">
- <value>Field '{0}' on type '{1}' is declared [OptionalValue], but it can not be assigned a null value.</value>
- </data>
- <data name="Cryptography_AsnSerializer_SetValueException" xml:space="preserve">
- <value>Unable to set field {0} on type {1}.</value>
- </data>
- <data name="Cryptography_AsnSerializer_SpecificTagChoice" xml:space="preserve">
- <value>Field '{0}' on type '{1}' has specified an implicit tag value via [ExpectedTag] for [Choice] type '{2}'. ExplicitTag must be true, or the [ExpectedTag] attribute removed.</value>
- </data>
- <data name="Cryptography_AsnSerializer_UnexpectedTypeForAttribute" xml:space="preserve">
- <value>Field '{0}' of type '{1}' has an effective type of '{2}' when one of ({3}) was expected.</value>
- </data>
- <data name="Cryptography_AsnSerializer_UtcTimeTwoDigitYearMaxTooSmall" xml:space="preserve">
- <value>Field '{0}' on type '{1}' has a [UtcTime] TwoDigitYearMax value ({2}) smaller than the minimum (99).</value>
- </data>
- <data name="Cryptography_AsnSerializer_UnhandledType" xml:space="preserve">
- <value>Could not determine how to serialize or deserialize type '{0}'.</value>
- </data>
- <data name="Cryptography_AsnWriter_EncodeUnbalancedStack" xml:space="preserve">
- <value>Encode cannot be called while a Sequence or SetOf is still open.</value>
- </data>
- <data name="Cryptography_AsnWriter_PopWrongTag" xml:space="preserve">
- <value>Cannot pop the requested tag as it is not currently in progress.</value>
- </data>
- <data name="Cryptography_Der_Invalid_Encoding" xml:space="preserve">
- <value>ASN1 corrupted data.</value>
- </data>
- <data name="Cryptography_Invalid_IA5String" xml:space="preserve">
- <value>The string contains a character not in the 7 bit ASCII character set.</value>
- </data>
- <data name="Cryptography_WriteEncodedValue_OneValueAtATime" xml:space="preserve">
- <value>The input to WriteEncodedValue must represent a single encoded value with no trailing data.</value>
- </data>
<data name="Cbor_PopMajorTypeMismatch" xml:space="preserve">
<value>Cannot perform the requested operation, the current context is '{0}'.</value>
</data>
<data name="CborContentException_DefaultMessage" xml:space="preserve">
<value>The CBOR encoding is invalid.</value>
</data>
-</root>
\ No newline at end of file
+</root>
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="$(CommonPath)System\Marvin.cs" Link="Common\System\Marvin.cs" />
+ <Compile Include="$(CommonPath)System\Memory\PointerMemoryManager.cs" Link="Common\System\Memory\PointerMemoryManager.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReaderState.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.PeekState.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.SkipValue.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.Simple.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.Tag.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.Array.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.Integer.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.Map.cs" />
+ <Compile Include="System\Formats\Cbor\Reader\CborReader.String.cs" />
+ <Compile Include="System\Formats\Cbor\Writer\CborWriter.Array.cs" />
+ <Compile Include="System\Formats\Cbor\Writer\CborWriter.Map.cs" />
+ <Compile Include="System\Formats\Cbor\Writer\CborWriter.Simple.cs" />
+ <Compile Include="System\Formats\Cbor\Writer\CborWriter.String.cs" />
+ <Compile Include="System\Formats\Cbor\Writer\CborWriter.cs" />
+ <Compile Include="System\Formats\Cbor\Writer\CborWriter.Integer.cs" />
+ <Compile Include="System\Formats\Cbor\Writer\CborWriter.Tag.cs" />
+ <Compile Include="System\Formats\Cbor\CborConformanceLevel.cs" />
+ <Compile Include="System\Formats\Cbor\CborInitialByte.cs" />
+ <Compile Include="System\Formats\Cbor\CborTag.cs" />
+ <Compile Include="System\Formats\Cbor\CborContentException.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Collections" />
+ <Reference Include="System.Buffers" />
+ <Reference Include="System.Memory" />
+ <Reference Include="System.Runtime" />
+ <Reference Include="System.Runtime.Numerics" />
+ <Reference Include="System.Security.Cryptography.Algorithms" />
+ <Reference Include="System.Threading" />
+ <Reference Include="System.Text.Encoding.Extensions" />
+ </ItemGroup>
+</Project>
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Diagnostics;
using System.Text;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Runtime.Serialization;
namespace System.Formats.Cbor
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Diagnostics;
namespace System.Formats.Cbor
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
-
namespace System.Formats.Cbor
{
/// <summary>
/// Represents a CBOR semantic tag (major type 6).
/// </summary>
-#if CBOR_CLS_COMPLIANCE // remove once migrated from tests project
[CLSCompliant(false)]
-#endif
public enum CborTag : ulong
{
/// <summary>
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
-
namespace System.Formats.Cbor
{
public partial class CborReader
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Buffers.Binary;
namespace System.Formats.Cbor
/// there was an unexpected end of CBOR encoding data. -or-
/// the next value uses a CBOR encoding that is not valid under the current conformance mode.
/// </exception>
-#if CBOR_CLS_COMPLIANCE // remove once migrated from tests project
[CLSCompliant(false)]
-#endif
public uint ReadUInt32()
{
uint value = checked((uint)PeekUnsignedInteger(out int bytesRead));
/// there was an unexpected end of CBOR encoding data. -or-
/// the next value uses a CBOR encoding that is not valid under the current conformance mode.
/// </exception>
-#if CBOR_CLS_COMPLIANCE // remove once migrated from tests project
[CLSCompliant(false)]
-#endif
public ulong ReadUInt64()
{
ulong value = PeekUnsignedInteger(out int bytesRead);
/// This method supports decoding integers between -18446744073709551616 and -1.
/// Useful for handling values that do not fit in the <see cref="long"/> type.
/// </remarks>
-#if CBOR_CLS_COMPLIANCE // remove once migrated from tests project
[CLSCompliant(false)]
-#endif
public ulong ReadCborNegativeIntegerRepresentation()
{
CborInitialByte header = PeekInitialByte(expectedType: CborMajorType.NegativeInteger);
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Collections.Generic;
using System.Diagnostics;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Diagnostics;
namespace System.Formats.Cbor
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Buffers.Binary;
namespace System.Formats.Cbor
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Diagnostics;
namespace System.Formats.Cbor
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Globalization;
using System.Numerics;
/// there was an unexpected end of CBOR encoding data. -or-
/// the next value uses a CBOR encoding that is not valid under the current conformance mode.
/// </exception>
+ [CLSCompliant(false)]
public CborTag ReadTag()
{
CborTag tag = PeekTagCore(out int bytesRead);
/// <remarks>
/// Useful in scenaria where the semantic value decoder needs to be determined at runtime.
/// </remarks>
+ [CLSCompliant(false)]
public CborTag PeekTag() => PeekTagCore(out int _);
/// <summary>
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Collections.Generic;
using System.Diagnostics;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
-
namespace System.Formats.Cbor
{
/// <summary>
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Diagnostics;
namespace System.Formats.Cbor
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Buffers.Binary;
namespace System.Formats.Cbor
/// The major type of the encoded value is not permitted in the parent data item. -or-
/// The written data is not accepted under the current conformance mode.
/// </exception>
-#if CBOR_CLS_COMPLIANCE // remove once migrated from tests project
[CLSCompliant(false)]
-#endif
public void WriteUInt32(uint value) => WriteUInt64(value);
/// <summary>
/// The major type of the encoded value is not permitted in the parent data item. -or-
/// The written data is not accepted under the current conformance mode.
/// </exception>
-#if CBOR_CLS_COMPLIANCE // remove once migrated from tests project
[CLSCompliant(false)]
-#endif
public void WriteUInt64(ulong value)
{
WriteUnsignedInteger(CborMajorType.UnsignedInteger, value);
/// This method supports encoding integers between -18446744073709551616 and -1.
/// Useful for handling values that do not fit in the <see cref="long"/> type.
/// </remarks>
-#if CBOR_CLS_COMPLIANCE // remove once migrated from tests project
[CLSCompliant(false)]
-#endif
public void WriteCborNegativeIntegerRepresentation(ulong value)
{
WriteUnsignedInteger(CborMajorType.NegativeInteger, value);
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Collections.Generic;
using System.Diagnostics;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Buffers.Binary;
namespace System.Formats.Cbor
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
/// The major type of the encoded value is not permitted in the parent data item. -or-
/// The written data is not accepted under the current conformance mode.
/// </exception>
+ [CLSCompliant(false)]
public void WriteTag(CborTag tag)
{
if (!CborConformanceModeHelpers.AllowsTags(ConformanceMode))
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#nullable enable
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
+ <nullable>enable</nullable>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="$(CommonTestPath)System\Security\Cryptography\ByteUtils.cs">
+ <Link>CommonTest\System\Security\Cryptography\ByteUtils.cs</Link>
+ </Compile>
+ <Compile Include="Reader\CborReaderTests.cs" />
+ <Compile Include="Reader\CborReaderTests.ByteString.cs" />
+ <Compile Include="Reader\CborReaderTests.TextString.cs" />
+ <Compile Include="Reader\CborReaderTests.Integer.cs" />
+ <Compile Include="Reader\CborReaderTests.Helpers.cs" />
+ <Compile Include="Reader\CborReaderTests.Map.cs" />
+ <Compile Include="Reader\CborReaderTests.SkipValue.cs" />
+ <Compile Include="Reader\CborReaderTests.Simple.cs" />
+ <Compile Include="Reader\CborReaderTests.Tag.cs" />
+ <Compile Include="Reader\CborReaderTests.Array.cs" />
+ <Compile Include="Writer\CborWriterTests.Helpers.cs" />
+ <Compile Include="Writer\CborWriterTests.Array.cs" />
+ <Compile Include="Writer\CborWriterTests.cs" />
+ <Compile Include="Writer\CborWriterTests.Map.cs" />
+ <Compile Include="Writer\CborWriterTests.Simple.cs" />
+ <Compile Include="Writer\CborWriterTests.Tag.cs" />
+ <Compile Include="Writer\CborWriterTests.Integer.cs" />
+ <Compile Include="Writer\CborWriterTests.ByteString.cs" />
+ <Compile Include="Writer\CborWriterTests.TextString.cs" />
+ <Compile Include="CborRoundtripTests.cs" />
+ <Compile Include="CoseKeyHelpers.cs" />
+ </ItemGroup>
+</Project>
+++ /dev/null
-<Project>
- <ItemGroup>
- <Compile Include="$(CommonPath)System\Marvin.cs" Link="Common\System\Marvin.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReaderState.cs" Link="Common\System\Formats\Cbor\Reader\CborReaderState.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.PeekState.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.PeekState.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.SkipValue.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.SkipValue.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.Simple.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.Simple.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.Tag.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.Tag.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.Array.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.Array.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.Integer.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.Integer.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.Map.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.Map.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborReader.String.cs" Link="Common\System\Formats\Cbor\Reader\CborReader.String.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborWriter.Array.cs" Link="Common\System\Formats\Cbor\Writer\CborWriter.Array.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborWriter.Map.cs" Link="Common\System\Formats\Cbor\Writer\CborWriter.Map.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborWriter.Simple.cs" Link="Common\System\Formats\Cbor\Writer\CborWriter.Simple.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborWriter.String.cs" Link="Common\System\Formats\Cbor\Writer\CborWriter.String.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborWriter.cs" Link="Common\System\Formats\Cbor\Writer\CborWriter.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborWriter.Integer.cs" Link="Common\System\Formats\Cbor\Writer\CborWriter.Integer.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborWriter.Tag.cs" Link="Common\System\Formats\Cbor\Writer\CborWriter.Tag.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborConformanceLevel.cs" Link="Common\System\Formats\Cbor\CborConformanceLevel.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborInitialByte.cs" Link="Common\System\Formats\Cbor\CborInitialByte.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborTag.cs" Link="Common\System\Formats\Cbor\CborTag.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)CborContentException.cs" Link="Common\System\Formats\Cbor\CborContentException.cs" />
- </ItemGroup>
-</Project>
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
<Compile Include="$(CommonTestPath)System\Security\Cryptography\ByteUtils.cs" Link="CommonTest\System\Security\Cryptography\ByteUtils.cs" />
<Compile Include="$(CommonPath)System\Memory\PointerMemoryManager.cs" Link="Common\System\Memory\PointerMemoryManager.cs" />
</ItemGroup>
- <Import Project="Cbor\System.Formats.Cbor.Shared.projitems" />
- <ItemGroup>
- <Compile Include="Cbor.Tests\CborReaderTests.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.ByteString.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.TextString.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.Integer.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.Helpers.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.Map.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.SkipValue.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.Simple.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.Tag.cs" />
- <Compile Include="Cbor.Tests\CborReaderTests.Array.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.Helpers.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.Array.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.Map.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.Simple.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.Tag.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.Integer.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.ByteString.cs" />
- <Compile Include="Cbor.Tests\CborWriterTests.TextString.cs" />
- <Compile Include="Cbor.Tests\CborRoundtripTests.cs" />
- <Compile Include="Cbor.Tests\CoseKeyHelpers.cs" />
- </ItemGroup>
</Project>
"5.0.0.0": "5.0.0"
}
},
+ "System.Formats.Cbor": {
+ "InboxOn": {},
+ "AssemblyVersionInPackageVersion": {
+ "5.0.0.0": "5.0.0"
+ }
+ },
"System.Globalization": {
"StableVersions": [
"4.0.0",
]
},
{
+ "Name": "System.Formats.Cbor",
+ "Description": "Provides classes that can read and write the CBOR data format.",
+ "CommonTypes": [
+ "System.Formats.Cbor.CborReader",
+ "System.Formats.Cbor.CborWriter"
+ ]
+ },
+ {
"Name": "System.Globalization",
"Description": "Provides classes that define culture-related information, including language, country/region, calendars in use, format patterns for dates, currency, and numbers, and sort order for strings.",
"CommonTypes": [