mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General cleanup and refactor.
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
@@ -40,8 +42,6 @@ using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Implements detection of the squash filesystem</summary>
|
||||
public sealed class Squash : IFilesystem
|
||||
@@ -72,14 +72,13 @@ public sealed class Squash : IFilesystem
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return false;
|
||||
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
var magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
return magic == SQUASH_MAGIC || magic == SQUASH_CIGAM;
|
||||
}
|
||||
|
||||
/// <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.UTF8;
|
||||
information = "";
|
||||
@@ -88,10 +87,10 @@ public sealed class Squash : IFilesystem
|
||||
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)
|
||||
{
|
||||
@@ -170,8 +169,12 @@ public sealed class Squash : IFilesystem
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
|
||||
Reference in New Issue
Block a user