From f680220ec5b220e6b3462070c50eddf235aaec6e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 8 Feb 2026 18:23:22 +0000 Subject: [PATCH] [squash] Promote to IReadOnlyFilesystem. --- Aaru.Filesystems/Squash/Consts.cs | 1 - Aaru.Filesystems/Squash/Enums.cs | 1 - Aaru.Filesystems/Squash/Info.cs | 1 - Aaru.Filesystems/Squash/Squash.cs | 13 +++- Aaru.Filesystems/Squash/Structs.cs | 1 - Aaru.Filesystems/Squash/Unimplemented.cs | 83 ++++++++++++++++++++++++ 6 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 Aaru.Filesystems/Squash/Unimplemented.cs diff --git a/Aaru.Filesystems/Squash/Consts.cs b/Aaru.Filesystems/Squash/Consts.cs index 52d2c6754..60edac60d 100644 --- a/Aaru.Filesystems/Squash/Consts.cs +++ b/Aaru.Filesystems/Squash/Consts.cs @@ -29,7 +29,6 @@ namespace Aaru.Filesystems; /// -/// Implements detection of the squash filesystem public sealed partial class Squash { /// Identifier for Squash (little-endian) diff --git a/Aaru.Filesystems/Squash/Enums.cs b/Aaru.Filesystems/Squash/Enums.cs index 4086e2cdd..58e44014f 100644 --- a/Aaru.Filesystems/Squash/Enums.cs +++ b/Aaru.Filesystems/Squash/Enums.cs @@ -31,7 +31,6 @@ using System; namespace Aaru.Filesystems; /// -/// Implements detection of the squash filesystem public sealed partial class Squash { #region Nested type: SquashCompression diff --git a/Aaru.Filesystems/Squash/Info.cs b/Aaru.Filesystems/Squash/Info.cs index a2e9debae..4be1468e1 100644 --- a/Aaru.Filesystems/Squash/Info.cs +++ b/Aaru.Filesystems/Squash/Info.cs @@ -37,7 +37,6 @@ using Partition = Aaru.CommonTypes.Partition; namespace Aaru.Filesystems; /// -/// Implements detection of the squash filesystem public sealed partial class Squash { #region IFilesystem Members diff --git a/Aaru.Filesystems/Squash/Squash.cs b/Aaru.Filesystems/Squash/Squash.cs index 22d0e345a..75a82daaa 100644 --- a/Aaru.Filesystems/Squash/Squash.cs +++ b/Aaru.Filesystems/Squash/Squash.cs @@ -27,14 +27,23 @@ // ****************************************************************************/ using System; +using System.Collections.Generic; +using Aaru.CommonTypes.AaruMetadata; using Aaru.CommonTypes.Interfaces; namespace Aaru.Filesystems; /// -/// Implements detection of the squash filesystem -public sealed partial class Squash : IFilesystem +/// Implements the squash filesystem +public sealed partial class Squash : IReadOnlyFilesystem { + /// + public FileSystem Metadata { get; private set; } + /// + public IEnumerable<(string name, Type type, string description)> SupportedOptions { get; } = []; + /// + public Dictionary Namespaces { get; } = []; + #region IFilesystem Members /// diff --git a/Aaru.Filesystems/Squash/Structs.cs b/Aaru.Filesystems/Squash/Structs.cs index 4c37273b3..b8fc50ca4 100644 --- a/Aaru.Filesystems/Squash/Structs.cs +++ b/Aaru.Filesystems/Squash/Structs.cs @@ -32,7 +32,6 @@ using Aaru.CommonTypes.Attributes; namespace Aaru.Filesystems; /// -/// Implements detection of the squash filesystem public sealed partial class Squash { #region Nested type: SuperBlock diff --git a/Aaru.Filesystems/Squash/Unimplemented.cs b/Aaru.Filesystems/Squash/Unimplemented.cs new file mode 100644 index 000000000..4ef61d3ba --- /dev/null +++ b/Aaru.Filesystems/Squash/Unimplemented.cs @@ -0,0 +1,83 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Squash.cs +// Author(s) : Natalia Portillo +// +// Component : Squash file system plugin. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2026 Natalia Portillo +// ****************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Text; +using Aaru.CommonTypes; +using Aaru.CommonTypes.Enums; +using Aaru.CommonTypes.Interfaces; +using Aaru.CommonTypes.Structs; + +namespace Aaru.Filesystems; + +/// +public sealed partial class Squash +{ + /// + public ErrorNumber Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, + Dictionary options, string @namespace) => + throw new NotImplementedException(); + + /// + public ErrorNumber Unmount() => throw new NotImplementedException(); + + /// + public ErrorNumber ListXAttr(string path, out List xattrs) => throw new NotImplementedException(); + + /// + public ErrorNumber GetXattr(string path, string xattr, ref byte[] buf) => throw new NotImplementedException(); + + /// + public ErrorNumber StatFs(out FileSystemInfo stat) => throw new NotImplementedException(); + + /// + public ErrorNumber Stat(string path, out FileEntryInfo stat) => throw new NotImplementedException(); + + /// + public ErrorNumber ReadLink(string path, out string dest) => throw new NotImplementedException(); + + /// + public ErrorNumber OpenFile(string path, out IFileNode node) => throw new NotImplementedException(); + + /// + public ErrorNumber CloseFile(IFileNode node) => throw new NotImplementedException(); + + /// + public ErrorNumber ReadFile(IFileNode node, long length, byte[] buffer, out long read) => + throw new NotImplementedException(); + + /// + public ErrorNumber OpenDir(string path, out IDirNode node) => throw new NotImplementedException(); + + /// + public ErrorNumber CloseDir(IDirNode node) => throw new NotImplementedException(); + + /// + public ErrorNumber ReadDir(IDirNode node, out string filename) => throw new NotImplementedException(); +} \ No newline at end of file