[Symbian Installation File] Implement GetUncompressedSize().

This commit is contained in:
2023-10-07 17:59:42 +01:00
parent 50c3aaa07b
commit 9ac2dee484
4 changed files with 19 additions and 4 deletions

View File

@@ -79,5 +79,17 @@ public sealed partial class Symbian
return _files[entryNumber].length;
}
/// <inheritdoc />
public long GetUncompressedSize(int entryNumber)
{
if(!_opened)
return -1;
if(entryNumber < 0 || entryNumber >= _files.Count)
return -1;
return _compressed ? _files[entryNumber].originalLength : _files[entryNumber].length;
}
#endregion
}

View File

@@ -162,8 +162,13 @@ public sealed partial class Symbian
_files = filesWithFixedFilenames;
_features = ArchiveSupportedFeature.SupportsFilenames | ArchiveSupportedFeature.SupportsSubdirectories;
if(_release6 && !sh.options.HasFlag(SymbianOptions.NoCompress))
_features |= ArchiveSupportedFeature.SupportsCompression;
{
_features |= ArchiveSupportedFeature.SupportsCompression;
_compressed = true;
}
if(_files.Any(t => t.mime is not null))
_features |= ArchiveSupportedFeature.SupportsXAttrs;

View File

@@ -42,6 +42,7 @@ namespace Aaru.Archives;
public sealed partial class Symbian : IArchive
{
const string MODULE_NAME = "Symbian Installation File Plugin";
bool _compressed;
Encoding _encoding;
ArchiveSupportedFeature _features;
List<DecodedFileRecord> _files;

View File

@@ -45,9 +45,6 @@ public sealed partial class Symbian
{
#region IArchive Members
/// <inheritdoc />
public long GetUncompressedSize(int entryNumber) => throw new NotImplementedException();
/// <inheritdoc />
public FileAttributes GetAttributes(int entryNumber) => throw new NotImplementedException();