Skip to content

Commit

Permalink
[Symbian Installation File] Implement GetEntry().
Browse files Browse the repository at this point in the history
  • Loading branch information
claunia committed Oct 7, 2023
1 parent 585aaee commit 53494a1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 50 deletions.
1 change: 1 addition & 0 deletions Aaru.Archives/Aaru.Archives.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<ItemGroup>
<ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj"/>
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj"/>
<ProjectReference Include="..\Aaru.Filters\Aaru.Filters.csproj"/>
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
</ItemGroup>
<ItemGroup>
Expand Down
28 changes: 28 additions & 0 deletions Aaru.Archives/Symbian/Files.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

using System;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Filters;
using FileAttributes = System.IO.FileAttributes;

namespace Aaru.Archives;
Expand Down Expand Up @@ -146,5 +148,31 @@ public ErrorNumber Stat(int entryNumber, out FileEntryInfo stat)
return ErrorNumber.NoError;
}

/// <inheritdoc />
public ErrorNumber GetEntry(int entryNumber, out IFilter filter)
{
filter = null;
if(!Opened)
return ErrorNumber.NotOpened;

if(entryNumber < 0 || entryNumber >= _files.Count)
return ErrorNumber.OutOfRange;

// TODO: Implement
if(_compressed)
return ErrorNumber.NotSupported;

var offsetStream = new OffsetStream(_stream, _files[entryNumber].pointer,
_files[entryNumber].pointer + _files[entryNumber].length);
filter = new ZZZNoFilter();
ErrorNumber errno = filter.Open(offsetStream);

if(errno == ErrorNumber.NoError)
return ErrorNumber.NoError;

offsetStream.Close();
return errno;
}

#endregion
}
50 changes: 0 additions & 50 deletions Aaru.Archives/Symbian/Unsupported.cs

This file was deleted.

0 comments on commit 53494a1

Please sign in to comment.