mirror of
https://github.com/aaru-dps/Aaru.Helpers.git
synced 2025-12-16 19:24:35 +00:00
Move to file scoped namespaces.
This commit is contained in:
@@ -27,8 +27,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
public static partial class ArrayHelpers
|
public static partial class ArrayHelpers
|
||||||
{
|
{
|
||||||
/// <summary>Fills an array with the specified value</summary>
|
/// <summary>Fills an array with the specified value</summary>
|
||||||
@@ -78,4 +78,3 @@ namespace Aaru.Helpers
|
|||||||
return upper ? sb.ToString().ToUpper() : sb.ToString();
|
return upper ? sb.ToString().ToUpper() : sb.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Helper operations to work with arrays</summary>
|
/// <summary>Helper operations to work with arrays</summary>
|
||||||
public static partial class ArrayHelpers
|
public static partial class ArrayHelpers
|
||||||
{
|
{
|
||||||
@@ -47,4 +47,3 @@ namespace Aaru.Helpers
|
|||||||
/// <returns>True if null</returns>
|
/// <returns>True if null</returns>
|
||||||
public static bool ArrayIsNullOrEmpty(byte[] array) => array?.All(b => b == 0x00) != false;
|
public static bool ArrayIsNullOrEmpty(byte[] array) => array?.All(b => b == 0x00) != false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts base data types to an array of bytes, and an array of bytes to base data types. All info taken from
|
/// 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.
|
/// 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 + 6],
|
||||||
value[8 + startIndex + 7]);
|
value[8 + startIndex + 7]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
// Copyright © 2011-2022 Natalia Portillo
|
// Copyright © 2011-2022 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Describes the endianness of bits on a data structure</summary>
|
/// <summary>Describes the endianness of bits on a data structure</summary>
|
||||||
public enum BitEndian
|
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>
|
/// <summary>PDP-11 endian, little endian except for 32-bit integers where the 16 halves are swapped between them</summary>
|
||||||
Pdp
|
Pdp
|
||||||
}
|
}
|
||||||
}
|
|
||||||
5
CHS.cs
5
CHS.cs
@@ -30,8 +30,8 @@
|
|||||||
// Copyright © 2011-2022 Natalia Portillo
|
// Copyright © 2011-2022 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Helper operations to work with CHS values</summary>
|
/// <summary>Helper operations to work with CHS values</summary>
|
||||||
public static class CHS
|
public static class CHS
|
||||||
{
|
{
|
||||||
@@ -46,4 +46,3 @@ namespace Aaru.Helpers
|
|||||||
maxHead == 0 || maxSector == 0 ? (((cyl * 16) + head) * 63) + sector - 1
|
maxHead == 0 || maxSector == 0 ? (((cyl * 16) + head) * 63) + sector - 1
|
||||||
: (((cyl * maxHead) + head) * maxSector) + sector - 1;
|
: (((cyl * maxHead) + head) * maxSector) + sector - 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
// Copyright © 2011-2022 Natalia Portillo
|
// Copyright © 2011-2022 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
public static partial class ArrayHelpers
|
public static partial class ArrayHelpers
|
||||||
{
|
{
|
||||||
/// <summary>Compares two byte arrays</summary>
|
/// <summary>Compares two byte arrays</summary>
|
||||||
@@ -69,4 +69,3 @@ namespace Aaru.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
// Copyright © 2011-2022 Natalia Portillo
|
// Copyright © 2011-2022 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Helper operations to count bits</summary>
|
/// <summary>Helper operations to count bits</summary>
|
||||||
public static class CountBits
|
public static class CountBits
|
||||||
{
|
{
|
||||||
@@ -46,4 +46,3 @@ namespace Aaru.Helpers
|
|||||||
return (int)((((number + (number >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24);
|
return (int)((((number + (number >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -34,8 +34,8 @@ using System;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Aaru.Console;
|
using Aaru.Console;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Helper operations for timestamp management (date and time)</summary>
|
/// <summary>Helper operations for timestamp management (date and time)</summary>
|
||||||
public static class DateHandlers
|
public static class DateHandlers
|
||||||
{
|
{
|
||||||
@@ -386,4 +386,3 @@ namespace Aaru.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -36,8 +36,8 @@ using System.Reflection;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Provides methods to marshal binary data into C# structs</summary>
|
/// <summary>Provides methods to marshal binary data into C# structs</summary>
|
||||||
public static class Marshal
|
public static class Marshal
|
||||||
{
|
{
|
||||||
@@ -495,4 +495,3 @@ namespace Aaru.Helpers
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -38,8 +38,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>Defines properties to help marshalling structs from binary data</summary>
|
/// <summary>Defines properties to help marshalling structs from binary data</summary>
|
||||||
[AttributeUsage(AttributeTargets.Struct)]
|
[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>
|
/// <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; }
|
public bool HasReferences { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Aaru.Console;
|
using Aaru.Console;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Helper operations to get hexadecimal representations of byte arrays</summary>
|
/// <summary>Helper operations to get hexadecimal representations of byte arrays</summary>
|
||||||
public static class PrintHex
|
public static class PrintHex
|
||||||
{
|
{
|
||||||
@@ -133,4 +133,3 @@ namespace Aaru.Helpers
|
|||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Helper operations to work with strings</summary>
|
/// <summary>Helper operations to work with strings</summary>
|
||||||
public static class StringHandlers
|
public static class StringHandlers
|
||||||
{
|
{
|
||||||
@@ -182,4 +182,3 @@ namespace Aaru.Helpers
|
|||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Aaru.Helpers
|
namespace Aaru.Helpers;
|
||||||
{
|
|
||||||
/// <summary>Helper operations to work with swapping endians</summary>
|
/// <summary>Helper operations to work with swapping endians</summary>
|
||||||
public static class Swapping
|
public static class Swapping
|
||||||
{
|
{
|
||||||
@@ -109,4 +109,3 @@ namespace Aaru.Helpers
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user