From 22deadb7d07e2f486c7bbdac9f2ec077a9875859 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 8 Sep 2025 01:25:49 +0100 Subject: [PATCH] [HA] Implement GetAttributes. --- Aaru.Archives/Ha/Files.cs | 15 +++++++++++++++ Aaru.Archives/Ha/Unimplemented.cs | 5 ----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Aaru.Archives/Ha/Files.cs b/Aaru.Archives/Ha/Files.cs index d8a3c30b8..1255cfb0d 100644 --- a/Aaru.Archives/Ha/Files.cs +++ b/Aaru.Archives/Ha/Files.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using Aaru.CommonTypes.Enums; namespace Aaru.Archives; @@ -74,5 +75,19 @@ public sealed partial class Ha return ErrorNumber.NoError; } + /// + public ErrorNumber GetAttributes(int entryNumber, out FileAttributes attributes) + { + attributes = FileAttributes.None; + + if(!Opened) return ErrorNumber.NotOpened; + + if(entryNumber < 0 || entryNumber >= _entries.Count) return ErrorNumber.OutOfRange; + + attributes = _entries[entryNumber].Attributes; + + return ErrorNumber.NoError; + } + #endregion } \ No newline at end of file diff --git a/Aaru.Archives/Ha/Unimplemented.cs b/Aaru.Archives/Ha/Unimplemented.cs index d28919c78..8926099ec 100644 --- a/Aaru.Archives/Ha/Unimplemented.cs +++ b/Aaru.Archives/Ha/Unimplemented.cs @@ -2,7 +2,6 @@ using System; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Interfaces; using Aaru.CommonTypes.Structs; -using FileAttributes = System.IO.FileAttributes; namespace Aaru.Archives; @@ -10,10 +9,6 @@ public sealed partial class Ha { #region IArchive Members - /// - public ErrorNumber GetAttributes(int entryNumber, out FileAttributes attributes) => - throw new NotImplementedException(); - /// /// public ErrorNumber Stat(int entryNumber, out FileEntryInfo stat) => throw new NotImplementedException();