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,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
|
||||
|
||||
// ReSharper disable UnusedMember.Local
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -41,10 +47,6 @@ using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
// ReSharper disable UnusedMember.Local
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Implements detection of the CRAM filesystem</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedType.Local")]
|
||||
@@ -76,14 +78,13 @@ public sealed class Cram : IFilesystem
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return false;
|
||||
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
var magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
return magic == CRAM_MAGIC || magic == CRAM_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.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
@@ -92,10 +93,10 @@ public sealed class Cram : IFilesystem
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return;
|
||||
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
var magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
var crSb = new SuperBlock();
|
||||
bool littleEndian = true;
|
||||
var crSb = new SuperBlock();
|
||||
var littleEndian = true;
|
||||
|
||||
switch(magic)
|
||||
{
|
||||
@@ -136,8 +137,11 @@ public sealed class Cram : IFilesystem
|
||||
|
||||
enum CramCompression : ushort
|
||||
{
|
||||
Zlib = 1, Lzma = 2, Lzo = 3,
|
||||
Xz = 4, Lz4 = 5
|
||||
Zlib = 1,
|
||||
Lzma = 2,
|
||||
Lzo = 3,
|
||||
Xz = 4,
|
||||
Lz4 = 5
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
|
||||
Reference in New Issue
Block a user