[Aaru.Filesystems] Reformat and cleanup.

This commit is contained in:
2023-10-03 23:22:08 +01:00
parent 51f35c80d9
commit 7a608e0061
296 changed files with 21000 additions and 18286 deletions

View File

@@ -32,9 +32,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the squash filesystem</summary>
public sealed partial class Squash
{
#region Nested type: SquashCompression
enum SquashCompression : ushort
{
Zlib = 1, Lzma = 2, Lzo = 3,
Xz = 4, Lz4 = 5, Zstd = 6
Zlib = 1,
Lzma = 2,
Lzo = 3,
Xz = 4,
Lz4 = 5,
Zstd = 6
}
#endregion
}

View File

@@ -40,6 +40,8 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the squash filesystem</summary>
public sealed partial class Squash
{
#region IFilesystem Members
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
{
@@ -51,7 +53,7 @@ public sealed partial class Squash
if(errno != ErrorNumber.NoError)
return false;
uint magic = BitConverter.ToUInt32(sector, 0x00);
var magic = BitConverter.ToUInt32(sector, 0x00);
return magic is SQUASH_MAGIC or SQUASH_CIGAM;
}
@@ -67,10 +69,10 @@ public sealed partial class Squash
if(errno != ErrorNumber.NoError)
return;
uint magic = BitConverter.ToUInt32(sector, 0x00);
var magic = BitConverter.ToUInt32(sector, 0x00);
var sqSb = new SuperBlock();
bool littleEndian = true;
var sqSb = new SuperBlock();
var littleEndian = true;
switch(magic)
{
@@ -89,8 +91,8 @@ public sealed partial class Squash
sbInformation.AppendLine(Localization.Squash_file_system);
sbInformation.AppendLine(littleEndian ? Localization.Little_endian : Localization.Big_endian);
sbInformation.AppendFormat(Localization.Volume_version_0_1, sqSb.s_major, sqSb.s_minor).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes, sqSb.bytes_used).AppendLine();
sbInformation.AppendFormat(Localization.Volume_version_0_1, sqSb.s_major, sqSb.s_minor).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes, sqSb.bytes_used).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes_per_block, sqSb.block_size).AppendLine();
sbInformation.
@@ -145,4 +147,6 @@ public sealed partial class Squash
FreeClusters = 0
};
}
#endregion
}

View File

@@ -35,10 +35,16 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the squash filesystem</summary>
public sealed partial class Squash : IFilesystem
{
#region IFilesystem Members
/// <inheritdoc />
public string Name => Localization.Squash_Name;
/// <inheritdoc />
public Guid Id => new("F8F6E46F-7A2A-48E3-9C0A-46AF4DC29E09");
/// <inheritdoc />
public string Author => Authors.NataliaPortillo;
#endregion
}

View File

@@ -34,6 +34,8 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the squash filesystem</summary>
public sealed partial class Squash
{
#region Nested type: SuperBlock
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SuperBlock
{
@@ -57,4 +59,6 @@ public sealed partial class Squash
public readonly ulong fragment_table_start;
public readonly ulong lookup_table_start;
}
#endregion
}