mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General code cleanup and style refactor.
This commit is contained in:
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
/// <inheritdoc cref="Aaru.CommonTypes.Interfaces.IMediaImage" />
|
||||
/// <summary>Implements reading DiscFerret flux images</summary>
|
||||
public sealed partial class DiscFerret : IMediaImage, IVerifiableSectorsImage
|
||||
|
||||
@@ -30,22 +30,22 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
public sealed partial class DiscFerret
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public bool Identify(IFilter imageFilter)
|
||||
{
|
||||
var magicB = new byte[4];
|
||||
byte[] magicB = new byte[4];
|
||||
Stream stream = imageFilter.GetDataForkStream();
|
||||
stream.EnsureRead(magicB, 0, 4);
|
||||
var magic = BitConverter.ToUInt32(magicB, 0);
|
||||
uint magic = BitConverter.ToUInt32(magicB, 0);
|
||||
|
||||
return magic is DFI_MAGIC or DFI_MAGIC2;
|
||||
}
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
public sealed partial class DiscFerret
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -40,15 +38,17 @@ using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
public sealed partial class DiscFerret
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ErrorNumber Open(IFilter imageFilter)
|
||||
{
|
||||
var magicB = new byte[4];
|
||||
byte[] magicB = new byte[4];
|
||||
Stream stream = imageFilter.GetDataForkStream();
|
||||
stream.EnsureRead(magicB, 0, 4);
|
||||
var magic = BitConverter.ToUInt32(magicB, 0);
|
||||
uint magic = BitConverter.ToUInt32(magicB, 0);
|
||||
|
||||
if(magic != DFI_MAGIC &&
|
||||
magic != DFI_MAGIC2)
|
||||
@@ -64,7 +64,7 @@ public sealed partial class DiscFerret
|
||||
{
|
||||
long thisOffset = stream.Position;
|
||||
|
||||
var blk = new byte[Marshal.SizeOf<BlockHeader>()];
|
||||
byte[] blk = new byte[Marshal.SizeOf<BlockHeader>()];
|
||||
stream.EnsureRead(blk, 0, Marshal.SizeOf<BlockHeader>());
|
||||
BlockHeader blockHeader = Marshal.ByteArrayToStructureBigEndian<BlockHeader>(blk);
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
public sealed partial class DiscFerret
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
public sealed partial class DiscFerret
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user