[Archive interface] Indicate that archive features can change with an opened archive.

This commit is contained in:
2023-10-07 17:32:28 +01:00
parent 776974e4ae
commit f36a7235c1
3 changed files with 16 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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 |
ArchiveSupportedFeature.SupportsCompression |
ArchiveSupportedFeature.SupportsSubdirectories;
public ArchiveSupportedFeature GetArchiveFeatures() =>
!_opened
? ArchiveSupportedFeature.SupportsFilenames |
ArchiveSupportedFeature.SupportsCompression |
ArchiveSupportedFeature.SupportsSubdirectories |
ArchiveSupportedFeature.SupportsXAttrs
: _features;
#endregion
}