[Symbian Installation File] Implement GetXattr().

This commit is contained in:
2023-10-07 18:09:28 +01:00
parent a29934114c
commit e1f16e7b2c
2 changed files with 21 additions and 5 deletions

View File

@@ -33,7 +33,6 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Archives;
@@ -44,10 +43,6 @@ public sealed partial class Symbian
{
#region IArchive Members
/// <inheritdoc />
public ErrorNumber GetXattr(int entryNumber, string xattr, out byte[] buffer) =>
throw new NotImplementedException();
/// <inheritdoc />
public FileSystemInfo Stat(int entryNumber) => throw new NotImplementedException();

View File

@@ -31,6 +31,8 @@
// ****************************************************************************/
using System.Collections.Generic;
using System.Text;
using Aaru.CommonTypes.Enums;
namespace Aaru.Archives;
@@ -56,5 +58,24 @@ public sealed partial class Symbian
};
}
/// <inheritdoc />
public ErrorNumber GetXattr(int entryNumber, string xattr, out byte[] buffer)
{
buffer = null;
if(!_opened)
return ErrorNumber.NotOpened;
if(entryNumber < 0 || entryNumber >= _files.Count)
return ErrorNumber.OutOfRange;
if(xattr != "org.iana.mime_type" || _files[entryNumber].mime is null)
return ErrorNumber.NoSuchExtendedAttribute;
buffer = Encoding.ASCII.GetBytes(_files[entryNumber].mime);
return ErrorNumber.NoError;
}
#endregion
}