[Symbian Installation File] Implement Stat().

This commit is contained in:
2023-10-07 18:30:16 +01:00
parent 039f2c5837
commit 585aaeefbd
2 changed files with 23 additions and 5 deletions

View File

@@ -31,8 +31,9 @@
// ****************************************************************************/
using System;
using System.IO;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
using FileAttributes = System.IO.FileAttributes;
namespace Aaru.Archives;
@@ -124,5 +125,26 @@ public sealed partial class Symbian
return ErrorNumber.NoError;
}
/// <inheritdoc />
public ErrorNumber Stat(int entryNumber, out FileEntryInfo stat)
{
stat = null;
if(!Opened)
return ErrorNumber.NotOpened;
if(entryNumber < 0 || entryNumber >= _files.Count)
return ErrorNumber.OutOfRange;
stat = new FileEntryInfo
{
Length = _compressed ? _files[entryNumber].originalLength : _files[entryNumber].length,
Attributes = CommonTypes.Structs.FileAttributes.File,
Inode = (ulong)entryNumber
};
return ErrorNumber.NoError;
}
#endregion
}

View File

@@ -34,7 +34,6 @@ using System;
using System.Diagnostics.CodeAnalysis;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
namespace Aaru.Archives;
@@ -44,9 +43,6 @@ public sealed partial class Symbian
{
#region IArchive Members
/// <inheritdoc />
public ErrorNumber Stat(int entryNumber, out FileEntryInfo stat) => throw new NotImplementedException();
/// <inheritdoc />
public ErrorNumber GetEntry(int entryNumber, out IFilter filter) => throw new NotImplementedException();