mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Aaru.Filesystems] Reformat and cleanup.
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user