Make Encoding a private field only for IReadOnlyFilesystem implementors.

This commit is contained in:
2022-12-17 23:17:18 +00:00
parent dc26b85c2f
commit 24069676e2
147 changed files with 296 additions and 497 deletions

View File

@@ -77,9 +77,9 @@ public sealed partial class NILFS2
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
out FileSystem metadata)
{
Encoding = encoding ?? Encoding.UTF8;
information = "";
metadata = new FileSystem();
encoding ??= Encoding.UTF8;
information = "";
metadata = new FileSystem();
if(imagePlugin.Info.SectorSize < 512)
return;
@@ -124,7 +124,7 @@ public sealed partial class NILFS2
sb.AppendFormat(Localization._0_bytes_per_inode, nilfsSb.inode_size).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, nilfsSb.uuid).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(nilfsSb.volume_name, Encoding)).
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(nilfsSb.volume_name, encoding)).
AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime)).
@@ -142,7 +142,7 @@ public sealed partial class NILFS2
{
Type = FS_TYPE,
ClusterSize = (uint)(1 << (int)(nilfsSb.log_block_size + 10)),
VolumeName = StringHandlers.CToString(nilfsSb.volume_name, Encoding),
VolumeName = StringHandlers.CToString(nilfsSb.volume_name, encoding),
VolumeSerial = nilfsSb.uuid.ToString(),
CreationDate = DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime),
ModificationDate = DateHandlers.UnixUnsignedToDateTime(nilfsSb.wtime)

View File

@@ -29,7 +29,6 @@
// ReSharper disable UnusedMember.Local
using System;
using System.Text;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Filesystems;
@@ -38,8 +37,6 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the New Implementation of a Log-structured File System v2</summary>
public sealed partial class NILFS2 : IFilesystem
{
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => Localization.NILFS2_Name;
/// <inheritdoc />