General cleanup and refactor.

This commit is contained in:
2022-03-07 07:36:44 +00:00
parent bc6e432565
commit 762e3eb6d2
1321 changed files with 44657 additions and 45479 deletions

View File

@@ -30,6 +30,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Filesystems;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text;
@@ -38,8 +40,6 @@ using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Schemas;
namespace Aaru.Filesystems;
// Information from the Linux kernel
/// <inheritdoc />
/// <summary>Implements detection of the Linux extended filesystem</summary>
@@ -78,21 +78,20 @@ public sealed class extFS : IFilesystem
if(errno != ErrorNumber.NoError)
return false;
byte[] sb = new byte[512];
var sb = new byte[512];
if(sbOff + 512 > sbSector.Length)
return false;
Array.Copy(sbSector, sbOff, sb, 0, 512);
ushort magic = BitConverter.ToUInt16(sb, 0x038);
var magic = BitConverter.ToUInt16(sb, 0x038);
return magic == EXT_MAGIC;
}
/// <inheritdoc />
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information,
Encoding encoding)
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
{
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
information = "";
@@ -113,7 +112,7 @@ public sealed class extFS : IFilesystem
if(errno != ErrorNumber.NoError)
return;
byte[] sbSector = new byte[512];
var sbSector = new byte[512];
Array.Copy(sblock, sbOff, sbSector, 0, 512);
var extSb = new SuperBlock