From 6efbab0c632bb53ca9b7b09b68bc5a08a0a4839b Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 6 Feb 2026 16:05:52 +0000 Subject: [PATCH] [SFS] Promote to IReadOnlyFilesystem --- Aaru.Filesystems/SFS/Consts.cs | 1 - Aaru.Filesystems/SFS/Enums.cs | 1 - Aaru.Filesystems/SFS/Info.cs | 1 - Aaru.Filesystems/SFS/SFS.cs | 13 +++- Aaru.Filesystems/SFS/Structs.cs | 1 - Aaru.Filesystems/SFS/Unimplemented.cs | 87 +++++++++++++++++++++++++++ 6 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 Aaru.Filesystems/SFS/Unimplemented.cs diff --git a/Aaru.Filesystems/SFS/Consts.cs b/Aaru.Filesystems/SFS/Consts.cs index b7398e468..52d105238 100644 --- a/Aaru.Filesystems/SFS/Consts.cs +++ b/Aaru.Filesystems/SFS/Consts.cs @@ -29,7 +29,6 @@ namespace Aaru.Filesystems; /// -/// Implements detection of the Smart File System public sealed partial class SFS { /// Identifier for SFS v1 diff --git a/Aaru.Filesystems/SFS/Enums.cs b/Aaru.Filesystems/SFS/Enums.cs index a0c10d34d..156abc31b 100644 --- a/Aaru.Filesystems/SFS/Enums.cs +++ b/Aaru.Filesystems/SFS/Enums.cs @@ -31,7 +31,6 @@ using System; namespace Aaru.Filesystems; /// -/// Implements detection of the Smart File System public sealed partial class SFS { #region Nested type: Flags diff --git a/Aaru.Filesystems/SFS/Info.cs b/Aaru.Filesystems/SFS/Info.cs index 5d949ca7b..56c86651d 100644 --- a/Aaru.Filesystems/SFS/Info.cs +++ b/Aaru.Filesystems/SFS/Info.cs @@ -36,7 +36,6 @@ using Partition = Aaru.CommonTypes.Partition; namespace Aaru.Filesystems; /// -/// Implements detection of the Smart File System public sealed partial class SFS { #region IFilesystem Members diff --git a/Aaru.Filesystems/SFS/SFS.cs b/Aaru.Filesystems/SFS/SFS.cs index b93406ae7..5635ff4f3 100644 --- a/Aaru.Filesystems/SFS/SFS.cs +++ b/Aaru.Filesystems/SFS/SFS.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 Smart File System -public sealed partial class SFS : IFilesystem +/// Implements the Smart File System +public sealed partial class SFS : 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/SFS/Structs.cs b/Aaru.Filesystems/SFS/Structs.cs index 770623480..6c6e7d43d 100644 --- a/Aaru.Filesystems/SFS/Structs.cs +++ b/Aaru.Filesystems/SFS/Structs.cs @@ -32,7 +32,6 @@ using Aaru.CommonTypes.Attributes; namespace Aaru.Filesystems; /// -/// Implements detection of the Smart File System public sealed partial class SFS { #region Nested type: BlockHeader diff --git a/Aaru.Filesystems/SFS/Unimplemented.cs b/Aaru.Filesystems/SFS/Unimplemented.cs new file mode 100644 index 000000000..4914c5ddb --- /dev/null +++ b/Aaru.Filesystems/SFS/Unimplemented.cs @@ -0,0 +1,87 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Unimplemented.cs +// Author(s) : Natalia Portillo +// +// Component : SmartFileSystem 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; + +/// +/// Implements the Smart File System +public sealed partial class SFS +{ + /// + public ErrorNumber Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, + Dictionary options, string @namespace) => + throw new NotImplementedException(); + + /// + public ErrorNumber Unmount() => throw new NotImplementedException(); + + /// + public ErrorNumber GetAttributes(string path, out FileAttributes attributes) => 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