mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Symbian Installation File] Implement GetXattr().
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user