mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Archive interface] Indicate that archive features can change with an opened archive.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
@@ -160,6 +161,12 @@ public sealed partial class Symbian
|
||||
|
||||
_files = filesWithFixedFilenames;
|
||||
|
||||
_features = ArchiveSupportedFeature.SupportsFilenames | ArchiveSupportedFeature.SupportsSubdirectories;
|
||||
if(_release6 && !sh.options.HasFlag(SymbianOptions.NoCompress))
|
||||
_features |= ArchiveSupportedFeature.SupportsCompression;
|
||||
if(_files.Any(t => t.mime is not null))
|
||||
_features |= ArchiveSupportedFeature.SupportsXAttrs;
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public sealed partial class Symbian : IArchive
|
||||
{
|
||||
const string MODULE_NAME = "Symbian Installation File Plugin";
|
||||
Encoding _encoding;
|
||||
ArchiveSupportedFeature _features;
|
||||
List<DecodedFileRecord> _files;
|
||||
bool _opened;
|
||||
bool _release6;
|
||||
@@ -56,9 +57,13 @@ public sealed partial class Symbian : IArchive
|
||||
public Guid Id => new("0EC84EC7-EAE6-4196-83FE-943B3FE48DBD");
|
||||
|
||||
/// <inheritdoc />
|
||||
public ArchiveSupportedFeature GetArchiveFeatures() => ArchiveSupportedFeature.SupportsFilenames |
|
||||
public ArchiveSupportedFeature GetArchiveFeatures() =>
|
||||
!_opened
|
||||
? ArchiveSupportedFeature.SupportsFilenames |
|
||||
ArchiveSupportedFeature.SupportsCompression |
|
||||
ArchiveSupportedFeature.SupportsSubdirectories;
|
||||
ArchiveSupportedFeature.SupportsSubdirectories |
|
||||
ArchiveSupportedFeature.SupportsXAttrs
|
||||
: _features;
|
||||
|
||||
#endregion
|
||||
}
|
||||
Submodule Aaru.CommonTypes updated: c53c27fb94...78ec120a8d
Reference in New Issue
Block a user