Move to file scoped namespaces.

This commit is contained in:
2022-03-06 13:29:37 +00:00
parent 31750d5978
commit cb79ff60d6
13 changed files with 1461 additions and 1474 deletions

View File

@@ -27,8 +27,8 @@
using System;
using System.Text;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
public static partial class ArrayHelpers
{
/// <summary>Fills an array with the specified value</summary>
@@ -78,4 +78,3 @@ namespace Aaru.Helpers
return upper ? sb.ToString().ToUpper() : sb.ToString();
}
}
}

View File

@@ -32,8 +32,8 @@
using System.Linq;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Helper operations to work with arrays</summary>
public static partial class ArrayHelpers
{
@@ -47,4 +47,3 @@ namespace Aaru.Helpers
/// <returns>True if null</returns>
public static bool ArrayIsNullOrEmpty(byte[] array) => array?.All(b => b == 0x00) != false;
}
}

View File

@@ -33,8 +33,8 @@
using System;
using System.Linq;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>
/// Converts base data types to an array of bytes, and an array of bytes to base data types. All info taken from
/// the meta data of System.BitConverter. This implementation allows for Endianness consideration.
@@ -321,4 +321,3 @@ namespace Aaru.Helpers
value[8 + startIndex + 6],
value[8 + startIndex + 7]);
}
}

View File

@@ -36,8 +36,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Describes the endianness of bits on a data structure</summary>
public enum BitEndian
{
@@ -48,4 +48,3 @@ namespace Aaru.Helpers
/// <summary>PDP-11 endian, little endian except for 32-bit integers where the 16 halves are swapped between them</summary>
Pdp
}
}

5
CHS.cs
View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Helper operations to work with CHS values</summary>
public static class CHS
{
@@ -46,4 +46,3 @@ namespace Aaru.Helpers
maxHead == 0 || maxSector == 0 ? (((cyl * 16) + head) * 63) + sector - 1
: (((cyl * maxHead) + head) * maxSector) + sector - 1;
}
}

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
public static partial class ArrayHelpers
{
/// <summary>Compares two byte arrays</summary>
@@ -69,4 +69,3 @@ namespace Aaru.Helpers
}
}
}
}

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Helper operations to count bits</summary>
public static class CountBits
{
@@ -46,4 +46,3 @@ namespace Aaru.Helpers
return (int)((((number + (number >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24);
}
}
}

View File

@@ -34,8 +34,8 @@ using System;
using System.Text;
using Aaru.Console;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Helper operations for timestamp management (date and time)</summary>
public static class DateHandlers
{
@@ -386,4 +386,3 @@ namespace Aaru.Helpers
}
}
}
}

View File

@@ -36,8 +36,8 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Provides methods to marshal binary data into C# structs</summary>
public static class Marshal
{
@@ -495,4 +495,3 @@ namespace Aaru.Helpers
return count;
}
}
}

View File

@@ -38,8 +38,8 @@
using System;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <inheritdoc />
/// <summary>Defines properties to help marshalling structs from binary data</summary>
[AttributeUsage(AttributeTargets.Struct)]
@@ -59,4 +59,3 @@ namespace Aaru.Helpers
/// <summary>Tells if the structure, or any nested structure, has any non-value type (e.g. arrays, strings, etc).</summary>
public bool HasReferences { get; set; }
}
}

View File

@@ -33,8 +33,8 @@
using System.Text;
using Aaru.Console;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Helper operations to get hexadecimal representations of byte arrays</summary>
public static class PrintHex
{
@@ -133,4 +133,3 @@ namespace Aaru.Helpers
return sb.ToString();
}
}
}

View File

@@ -33,8 +33,8 @@
using System;
using System.Text;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Helper operations to work with strings</summary>
public static class StringHandlers
{
@@ -182,4 +182,3 @@ namespace Aaru.Helpers
return temp;
}
}
}

View File

@@ -32,8 +32,8 @@
using System.Runtime.CompilerServices;
namespace Aaru.Helpers
{
namespace Aaru.Helpers;
/// <summary>Helper operations to work with swapping endians</summary>
public static class Swapping
{
@@ -109,4 +109,3 @@ namespace Aaru.Helpers
return x;
}
}
}