diff --git a/Aaru.Archives/Arc/Unimplemented.cs b/Aaru.Archives/Arc/Unimplemented.cs index 970f3a943..eaae68eb1 100644 --- a/Aaru.Archives/Arc/Unimplemented.cs +++ b/Aaru.Archives/Arc/Unimplemented.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Interfaces; using Aaru.CommonTypes.Structs; @@ -10,9 +9,6 @@ public sealed partial class Arc { #region IArchive Members - /// - public ErrorNumber ListXAttr(int entryNumber, out List xattrs) => throw new NotImplementedException(); - /// public ErrorNumber GetXattr(int entryNumber, string xattr, ref byte[] buffer) => throw new NotImplementedException(); diff --git a/Aaru.Archives/Arc/Xattrs.cs b/Aaru.Archives/Arc/Xattrs.cs new file mode 100644 index 000000000..5c6de3a47 --- /dev/null +++ b/Aaru.Archives/Arc/Xattrs.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Aaru.CommonTypes.Enums; + +namespace Aaru.Archives; + +public sealed partial class Arc +{ +#region IArchive Members + + /// + public ErrorNumber ListXAttr(int entryNumber, out List xattrs) + { + xattrs = null; + + if(!Opened) return ErrorNumber.NotOpened; + + if(entryNumber < 0 || entryNumber >= _entries.Count) return ErrorNumber.OutOfRange; + + xattrs = []; + + if(_entries[entryNumber].Comment is not null) xattrs.Add("comment"); + + return ErrorNumber.NoError; + } + +#endregion +} \ No newline at end of file