mirror of
https://github.com/claunia/plist-cil.git
synced 2025-12-16 11:04:26 +00:00
UID: Remove deprecated members
This commit is contained in:
@@ -52,20 +52,6 @@ namespace plistcil.test
|
||||
Assert.Equal(new byte[] {0xAB, 0xCD, 0xEF, 0x00, 0x00, 0xEF, 0xCD, 0xAB}, uid.Bytes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SByteUidTest()
|
||||
{
|
||||
UID uid = new UID("test", (sbyte)0x0F);
|
||||
Assert.Equal(new byte[] {0x0F}, uid.Bytes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShortUidTest()
|
||||
{
|
||||
UID uid = new UID("test", (short)0x0F0F);
|
||||
Assert.Equal(new byte[] {0x0F, 0x0F}, uid.Bytes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UIntUidTest()
|
||||
{
|
||||
|
||||
109
plist-cil/UID.cs
109
plist-cil/UID.cs
@@ -38,20 +38,6 @@ namespace Claunia.PropertyList
|
||||
{
|
||||
readonly ulong value;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="bytes">Bytes.</param>
|
||||
[Obsolete("UIDs have not meaningful names")]
|
||||
public UID(string name, ReadOnlySpan<byte> bytes)
|
||||
{
|
||||
if(bytes.Length != 1 && bytes.Length != 2 && bytes.Length != 4 && bytes.Length != 8)
|
||||
throw new ArgumentException("Type argument is not valid.");
|
||||
|
||||
value = (ulong)BinaryPropertyListParser.ParseLong(bytes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class.
|
||||
/// </summary>
|
||||
@@ -64,17 +50,6 @@ namespace Claunia.PropertyList
|
||||
value = (ulong)BinaryPropertyListParser.ParseLong(bytes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 8-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Unsigned 8-bit number.</param>
|
||||
[Obsolete("UIDs have no meaningful names")]
|
||||
public UID(string name, byte number)
|
||||
{
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 8-bit number.
|
||||
/// </summary>
|
||||
@@ -84,28 +59,6 @@ namespace Claunia.PropertyList
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using a signed 8-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Unsigned 8-bit number.</param>
|
||||
[Obsolete("UIDs must be unsigned values")]
|
||||
public UID(string name, sbyte number)
|
||||
{
|
||||
value = (ulong)number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 16-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Unsigned 16-bit number.</param>
|
||||
[Obsolete("UIDs have no meaningful names")]
|
||||
public UID(string name, ushort number)
|
||||
{
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 16-bit number.
|
||||
/// </summary>
|
||||
@@ -116,28 +69,6 @@ namespace Claunia.PropertyList
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using a signed 16-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Signed 16-bit number.</param>
|
||||
[Obsolete("UIDs must be unsigned values")]
|
||||
public UID(string name, short number)
|
||||
{
|
||||
value = (ulong)number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 32-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Unsigned 32-bit number.</param>
|
||||
[Obsolete("UIDs have no meaningful names")]
|
||||
public UID(string name, uint number)
|
||||
{
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 32-bit number.
|
||||
/// </summary>
|
||||
@@ -147,28 +78,6 @@ namespace Claunia.PropertyList
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using a signed 32-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Signed 32-bit number.</param>
|
||||
[Obsolete("UIDs must be unsigned values")]
|
||||
public UID(string name, int number)
|
||||
{
|
||||
value = (ulong)number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 64-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Unsigned 64-bit number.</param>
|
||||
[Obsolete("UIDs have no meaningful names")]
|
||||
public UID(string name, ulong number)
|
||||
{
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using an unsigned 64-bit number.
|
||||
/// </summary>
|
||||
@@ -178,17 +87,6 @@ namespace Claunia.PropertyList
|
||||
value = number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID" /> class using a signed 64-bit number.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="number">Signed 64-bit number.</param>
|
||||
[Obsolete("UIDs must be unsigned values")]
|
||||
public UID(string name, long number)
|
||||
{
|
||||
value = (ulong)number;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the bytes.
|
||||
/// </summary>
|
||||
@@ -219,13 +117,6 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
[Obsolete("UIDs have no meaningful names")]
|
||||
public string Name => value.ToString();
|
||||
|
||||
/// <summary>
|
||||
/// Writes the bytes required to represent this <see cref="UID" /> to a byte span.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user