mirror of
https://github.com/aaru-dps/Aaru.CommonTypes.git
synced 2025-12-16 19:24:30 +00:00
Disable archives and GUI.
This commit is contained in:
@@ -54,81 +54,80 @@
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System"/>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\CICMMetadata\dotnet\cicm.cs">
|
||||
<Link>Metadata/cicm.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Delegates.cs"/>
|
||||
<Compile Include="Enums\DeviceType.cs"/>
|
||||
<Compile Include="Enums\ErrorNumber.cs"/>
|
||||
<Compile Include="Enums\Images.cs"/>
|
||||
<Compile Include="Exceptions\Images.cs"/>
|
||||
<Compile Include="Extents\ExtentsByte.cs"/>
|
||||
<Compile Include="Extents\ExtentsConverter.cs"/>
|
||||
<Compile Include="Extents\ExtentsInt.cs"/>
|
||||
<Compile Include="Extents\ExtentsLong.cs"/>
|
||||
<Compile Include="Extents\ExtentsSByte.cs"/>
|
||||
<Compile Include="Extents\ExtentsShort.cs"/>
|
||||
<Compile Include="Extents\ExtentsUInt.cs"/>
|
||||
<Compile Include="Extents\ExtentsULong.cs"/>
|
||||
<Compile Include="Extents\ExtentsUShort.cs"/>
|
||||
<Compile Include="Filters.cs"/>
|
||||
<Compile Include="Geometry.cs"/>
|
||||
<Compile Include="Interfaces\IChecksum.cs"/>
|
||||
<Compile Include="Interfaces\IFilesystem.cs"/>
|
||||
<Compile Include="Interfaces\IArchive.cs"/>
|
||||
<Compile Include="Interfaces\IFilter.cs"/>
|
||||
<Compile Include="Interfaces\IFloppyImage.cs"/>
|
||||
<Compile Include="Interfaces\IMediaImage.cs"/>
|
||||
<Compile Include="Interfaces\IOpticalMediaImage.cs"/>
|
||||
<Compile Include="Interfaces\IPartition.cs"/>
|
||||
<Compile Include="Interfaces\IPartitionableMediaImage.cs"/>
|
||||
<Compile Include="Interfaces\IPluginRegister.cs"/>
|
||||
<Compile Include="Interfaces\IReadOnlyFilesystem.cs"/>
|
||||
<Compile Include="Interfaces\ITapeImage.cs"/>
|
||||
<Compile Include="Interfaces\IVerifiableImage.cs"/>
|
||||
<Compile Include="Interfaces\IVerifiableSectorsImage.cs"/>
|
||||
<Compile Include="Interfaces\IWritableFloppyImage.cs"/>
|
||||
<Compile Include="Interfaces\IWritableImage.cs"/>
|
||||
<Compile Include="Interfaces\IWritableOpticalImage.cs"/>
|
||||
<Compile Include="Interfaces\IWritableTapeImage.cs"/>
|
||||
<Compile Include="Interop\DetectOS.cs"/>
|
||||
<Compile Include="Interop\PlatformID.cs"/>
|
||||
<Compile Include="Interop\Version.cs"/>
|
||||
<Compile Include="MediaTypeFromDevice\FromAta.cs"/>
|
||||
<Compile Include="MediaTypeFromDevice\FromMmc.cs"/>
|
||||
<Compile Include="MediaTypeFromDevice\FromOdc.cs"/>
|
||||
<Compile Include="MediaTypeFromDevice\FromScsi.cs"/>
|
||||
<Compile Include="MediaTypeFromDevice\FromSbc.cs"/>
|
||||
<Compile Include="MediaTypeFromDevice\FromSsc.cs"/>
|
||||
<Compile Include="Metadata\CdOffset.cs"/>
|
||||
<Compile Include="Metadata\DeviceReport.cs"/>
|
||||
<Compile Include="Metadata\DeviceReportV2.cs"/>
|
||||
<Compile Include="Metadata\Dimensions.cs"/>
|
||||
<Compile Include="Metadata\MediaType.cs"/>
|
||||
<Compile Include="Metadata\Resume.cs"/>
|
||||
<Compile Include="Metadata\Statistics.cs"/>
|
||||
<Compile Include="Metadata\Version.cs"/>
|
||||
<Compile Include="Partition.cs"/>
|
||||
<Compile Include="MediaType.cs"/>
|
||||
<Compile Include="PluginBase.cs"/>
|
||||
<Compile Include="Structs\Devices\ATA\Identify.cs"/>
|
||||
<Compile Include="Structs\Devices\SCSI\Enums.cs"/>
|
||||
<Compile Include="Structs\Devices\SCSI\Inquiry.cs"/>
|
||||
<Compile Include="Structs\Devices\SCSI\Modes\2A.cs"/>
|
||||
<Compile Include="Structs\Filesystems.cs"/>
|
||||
<Compile Include="Structs\Images.cs"/>
|
||||
<Compile Include="Structs\TapeFile.cs"/>
|
||||
<Compile Include="Structs\TapePartition.cs"/>
|
||||
<Compile Include="Delegates.cs" />
|
||||
<Compile Include="Enums\DeviceType.cs" />
|
||||
<Compile Include="Enums\ErrorNumber.cs" />
|
||||
<Compile Include="Enums\Images.cs" />
|
||||
<Compile Include="Exceptions\Images.cs" />
|
||||
<Compile Include="Extents\ExtentsByte.cs" />
|
||||
<Compile Include="Extents\ExtentsConverter.cs" />
|
||||
<Compile Include="Extents\ExtentsInt.cs" />
|
||||
<Compile Include="Extents\ExtentsLong.cs" />
|
||||
<Compile Include="Extents\ExtentsSByte.cs" />
|
||||
<Compile Include="Extents\ExtentsShort.cs" />
|
||||
<Compile Include="Extents\ExtentsUInt.cs" />
|
||||
<Compile Include="Extents\ExtentsULong.cs" />
|
||||
<Compile Include="Extents\ExtentsUShort.cs" />
|
||||
<Compile Include="Filters.cs" />
|
||||
<Compile Include="Geometry.cs" />
|
||||
<Compile Include="Interfaces\IChecksum.cs" />
|
||||
<Compile Include="Interfaces\IFilesystem.cs" />
|
||||
<Compile Include="Interfaces\IFilter.cs" />
|
||||
<Compile Include="Interfaces\IFloppyImage.cs" />
|
||||
<Compile Include="Interfaces\IMediaImage.cs" />
|
||||
<Compile Include="Interfaces\IOpticalMediaImage.cs" />
|
||||
<Compile Include="Interfaces\IPartition.cs" />
|
||||
<Compile Include="Interfaces\IPartitionableMediaImage.cs" />
|
||||
<Compile Include="Interfaces\IPluginRegister.cs" />
|
||||
<Compile Include="Interfaces\IReadOnlyFilesystem.cs" />
|
||||
<Compile Include="Interfaces\ITapeImage.cs" />
|
||||
<Compile Include="Interfaces\IVerifiableImage.cs" />
|
||||
<Compile Include="Interfaces\IVerifiableSectorsImage.cs" />
|
||||
<Compile Include="Interfaces\IWritableFloppyImage.cs" />
|
||||
<Compile Include="Interfaces\IWritableImage.cs" />
|
||||
<Compile Include="Interfaces\IWritableOpticalImage.cs" />
|
||||
<Compile Include="Interfaces\IWritableTapeImage.cs" />
|
||||
<Compile Include="Interop\DetectOS.cs" />
|
||||
<Compile Include="Interop\PlatformID.cs" />
|
||||
<Compile Include="Interop\Version.cs" />
|
||||
<Compile Include="MediaTypeFromDevice\FromAta.cs" />
|
||||
<Compile Include="MediaTypeFromDevice\FromMmc.cs" />
|
||||
<Compile Include="MediaTypeFromDevice\FromOdc.cs" />
|
||||
<Compile Include="MediaTypeFromDevice\FromScsi.cs" />
|
||||
<Compile Include="MediaTypeFromDevice\FromSbc.cs" />
|
||||
<Compile Include="MediaTypeFromDevice\FromSsc.cs" />
|
||||
<Compile Include="Metadata\CdOffset.cs" />
|
||||
<Compile Include="Metadata\DeviceReport.cs" />
|
||||
<Compile Include="Metadata\DeviceReportV2.cs" />
|
||||
<Compile Include="Metadata\Dimensions.cs" />
|
||||
<Compile Include="Metadata\MediaType.cs" />
|
||||
<Compile Include="Metadata\Resume.cs" />
|
||||
<Compile Include="Metadata\Statistics.cs" />
|
||||
<Compile Include="Metadata\Version.cs" />
|
||||
<Compile Include="Partition.cs" />
|
||||
<Compile Include="MediaType.cs" />
|
||||
<Compile Include="PluginBase.cs" />
|
||||
<Compile Include="Structs\Devices\ATA\Identify.cs" />
|
||||
<Compile Include="Structs\Devices\SCSI\Enums.cs" />
|
||||
<Compile Include="Structs\Devices\SCSI\Inquiry.cs" />
|
||||
<Compile Include="Structs\Devices\SCSI\Modes\2A.cs" />
|
||||
<Compile Include="Structs\Filesystems.cs" />
|
||||
<Compile Include="Structs\Images.cs" />
|
||||
<Compile Include="Structs\TapeFile.cs" />
|
||||
<Compile Include="Structs\TapePartition.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0"/>
|
||||
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0"/>
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0" PrivateAssets="all"/>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
|
||||
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\LICENSE.MIT">
|
||||
@@ -136,16 +135,16 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj"/>
|
||||
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
|
||||
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj" />
|
||||
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj" />
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
<Properties>
|
||||
<Policies>
|
||||
<StandardHeader IncludeInNewFiles="True" Text="/***************************************************************************
Aaru Data Preservation Suite
----------------------------------------------------------------------------
 
Filename : ${FileName}
Author(s) : ${AuthorName} <${AuthorEmail}>

Component : Component
 
--[ Description ] ----------------------------------------------------------
 
 Description
 
--[ License ] --------------------------------------------------------------
 
 This library is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as
 published by the Free Software Foundation; either version 2.1 of the
 License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, see <http://www.gnu.org/licenses/>.

----------------------------------------------------------------------------
Copyright © 2011-${Year} ${CopyrightHolder}
****************************************************************************/"/>
|
||||
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp"/>
|
||||
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp"/>
|
||||
<StandardHeader IncludeInNewFiles="True" Text="/***************************************************************************
Aaru Data Preservation Suite
----------------------------------------------------------------------------
 
Filename : ${FileName}
Author(s) : ${AuthorName} <${AuthorEmail}>

Component : Component
 
--[ Description ] ----------------------------------------------------------
 
 Description
 
--[ License ] --------------------------------------------------------------
 
 This library is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as
 published by the Free Software Foundation; either version 2.1 of the
 License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, see <http://www.gnu.org/licenses/>.

----------------------------------------------------------------------------
Copyright © 2011-${Year} ${CopyrightHolder}
****************************************************************************/" />
|
||||
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp" />
|
||||
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp" />
|
||||
</Policies>
|
||||
</Properties>
|
||||
</MonoDevelop>
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IArchive.cs
|
||||
// Author(s) : Michael Drüing <michael@drueing.de>
|
||||
//
|
||||
// Component : Archives.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface for implementing archive plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2018-2019 Michael Drüing
|
||||
// Copyright © 2011-2021 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>Supported archive features</summary>
|
||||
[Flags]
|
||||
public enum ArchiveSupportedFeature : uint
|
||||
{
|
||||
/// <summary>The archive supports filenames for its entries. If this flag is not set, files can only be accessed by number.</summary>
|
||||
SupportsFilenames = 1 << 0,
|
||||
/// <summary>
|
||||
/// The archive supports compression. If this flag is not set, compressed and uncompressed lengths are always the
|
||||
/// same.
|
||||
/// </summary>
|
||||
SupportsCompression = 1 << 1,
|
||||
/// <summary>
|
||||
/// The archive supports subdirectories. If this flag is not set, all filenames are guaranteed to not contain any
|
||||
/// "/" character.
|
||||
/// </summary>
|
||||
SupportsSubdirectories = 1 << 2,
|
||||
/// <summary>
|
||||
/// The archive supports explicit entries for directories (like Zip, for example). If this flag is not set,
|
||||
/// directories are implicit by the relative name of the files.
|
||||
/// </summary>
|
||||
HasExplicitDirectories = 1 << 3,
|
||||
/// <summary>The archive stores a timestamp with each entry if this flag is set.</summary>
|
||||
HasEntryTimestamp = 1 << 4,
|
||||
/// <summary>If this flag is set, individual files or the whole archive might be encrypted or password-protected.</summary>
|
||||
SupportsProtection = 1 << 5, // TODO: not implemented yet
|
||||
|
||||
/// <summary>If this flag is set, the archive supports returning extended attributes (Xattrs) for each entry.</summary>
|
||||
SupportsXAttrs = 1 << 6
|
||||
}
|
||||
|
||||
/// <summary>Defines the interface to handle an archive (e.g. ZIP, WAD, etc)</summary>
|
||||
public interface IArchive
|
||||
{
|
||||
/// <summary>Descriptive name of the plugin</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>Unique UUID of the plugin</summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>Identifies if the specified path contains data recognizable by this archive instance</summary>
|
||||
/// <param name="path">Path.</param>
|
||||
bool Identify(string path);
|
||||
|
||||
/// <summary>Identifies if the specified stream contains data recognizable by this archive instance</summary>
|
||||
/// <param name="stream">Stream.</param>
|
||||
bool Identify(Stream stream);
|
||||
|
||||
/// <summary>Identifies if the specified buffer contains data recognizable by this archive instance</summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
bool Identify(byte[] buffer);
|
||||
|
||||
/// <summary>Opens the specified path with this archive instance</summary>
|
||||
/// <param name="path">Path.</param>
|
||||
void Open(string path);
|
||||
|
||||
/// <summary>Opens the specified stream with this archive instance</summary>
|
||||
/// <param name="stream">Stream.</param>
|
||||
void Open(Stream stream);
|
||||
|
||||
/// <summary>Opens the specified buffer with this archive instance</summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
void Open(byte[] buffer);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the archive has a file/stream/buffer currently opened and no
|
||||
/// <see cref="M:Aaru.Filters.Filter.Close" /> has been issued.
|
||||
/// </summary>
|
||||
bool IsOpened();
|
||||
|
||||
/// <summary>Closes all opened streams.</summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>Return a bitfield indicating the features supported by this archive type.</summary>
|
||||
/// <returns>The <c>ArchiveSupportedFeature</c> bitfield.</returns>
|
||||
/// <remarks>
|
||||
/// This should be a constant, tied to the archive type, not to the particular features used by the
|
||||
/// currently-opened archive file.
|
||||
/// </remarks>
|
||||
ArchiveSupportedFeature GetArchiveFeatures();
|
||||
|
||||
/// <summary>Gets the number of entries (i.e. files) that are contained in this archive.</summary>
|
||||
/// <remarks>
|
||||
/// Entries in this context can also mean directories or volume labels, for some types of archives that store
|
||||
/// these explicitly. Do not rely on all entries being regular files!
|
||||
/// </remarks>
|
||||
/// <returns>The number of files.</returns>
|
||||
int GetNumberOfEntries();
|
||||
|
||||
/// <summary>Gets the file name (and path) of the given entry in the archive.</summary>
|
||||
/// <remarks>
|
||||
/// The path components are separated by a forward slash "/". <br /> The path should not start with a leading
|
||||
/// slash (i.e. it should be relative, not absolute).
|
||||
/// </remarks>
|
||||
/// <seealso cref="Stat(int)" />
|
||||
/// <param name="entryNumber">The entry in the archive for which to return the file name.</param>
|
||||
/// <returns>The file name, with (relative) path</returns>
|
||||
string GetFilename(int entryNumber);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the entry number for a particular file path in the archive. <c>fileName</c> is the relative path of the
|
||||
/// file in the archive. If the file cannot be found, -1 is returned.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The path should be relative (no leading slash), using regular slashes as path separator, and be normalized,
|
||||
/// i.e. no "foo//bar" or "foo/../bar" path components.
|
||||
/// </remarks>
|
||||
/// <param name="fileName">The relative path for which to get the entry number.</param>
|
||||
/// <param name="caseInsensitiveMatch">If set, do a case insensitive matching and return the first file that matches.</param>
|
||||
/// <returns>The number of the entry corresponding to the given path, or -1 if the path does not exist.</returns>
|
||||
int GetEntryNumber(string fileName, bool caseInsensitiveMatch);
|
||||
|
||||
/// <summary>Gets the (compressed) size of the given entry.</summary>
|
||||
/// <param name="entryNumber">The entry for which to get the compressed size.</param>
|
||||
/// <returns>The compressed size of the entry, or 0 if the entry is not a regular file.</returns>
|
||||
/// <remarks>The return value is equal to the return value of <c>GetUncompressedSize()</c> if the file is not compressed.</remarks>
|
||||
/// <seealso cref="GetUncompressedSize(int)" />
|
||||
long GetCompressedSize(int entryNumber);
|
||||
|
||||
/// <summary>Gets the uncompressed size of the given entry.</summary>
|
||||
/// <param name="entryNumber">The entry for which to get the uncompressed size.</param>
|
||||
/// <returns>The uncompressed size of the entry, or 0 if the entry is not a regular file.</returns>
|
||||
/// <remarks>The return value is equal to the return value of <c>GetCompressedSize()</c> if the file is not compressed.</remarks>
|
||||
/// <seealso cref="GetCompressedSize(int)" />
|
||||
long GetUncompressedSize(int entryNumber);
|
||||
|
||||
/// <summary>Gets the attributes of a file or directory.</summary>
|
||||
/// <seealso cref="Stat(int)" />
|
||||
/// <returns>Error number.</returns>
|
||||
/// <param name="entryNumber">The entry in the archive for which to retrieve the attributes.</param>
|
||||
/// <returns>File attributes, or zero if the archive does not support attributes.</returns>
|
||||
FileAttributes GetAttributes(int entryNumber);
|
||||
|
||||
/// <summary>Lists all extended attributes, alternate data streams and forks of the given file.</summary>
|
||||
/// <param name="entryNumber">The entry in the archive for which to retrieve the list of attributes.</param>
|
||||
/// <returns>List of extended attributes, alternate data streams and forks.</returns>
|
||||
List<string> GetXAttrs(int entryNumber);
|
||||
|
||||
/// <summary>Reads an extended attribute, alternate data stream or fork from the given file.</summary>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <param name="entryNumber">The entry in the archive for which to retrieve the XAttr.</param>
|
||||
/// <param name="xattr">Extended attribute, alternate data stream or fork name.</param>
|
||||
/// <returns>Buffer with the XAttr data.</returns>
|
||||
byte[] GetXattr(int entryNumber, string xattr);
|
||||
|
||||
/// <summary>Gets information about an entry in the archive.</summary>
|
||||
/// <remarks>Note that some of the data might be incomplete or not available at all, depending on the type of archive.</remarks>
|
||||
/// <seealso cref="GetAttributes(int)" />
|
||||
/// <seealso cref="GetFilename(int)" />
|
||||
/// <param name="entryNumber">The entry int he archive for which to get the information</param>
|
||||
/// <returns>The available information about the entry in the archive</returns>
|
||||
FileSystemInfo Stat(int entryNumber);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Filter for the given entry. It will return <c>null</c> if the entry in question is not a regular
|
||||
/// file (i.e. directory, volume label, etc.)
|
||||
/// </summary>
|
||||
/// <param name="entryNumber">The entry for which the Filter should be returned.</param>
|
||||
/// <returns>The Filter for the given entry.</returns>
|
||||
IFilter GetEntry(int entryNumber);
|
||||
}
|
||||
}
|
||||
@@ -79,9 +79,5 @@ namespace Aaru.CommonTypes.Interfaces
|
||||
/// <summary>Gets all writable media image plugins</summary>
|
||||
/// <returns>List of writable media image plugins</returns>
|
||||
List<Type> GetAllWritableImagePlugins();
|
||||
|
||||
/// <summary>Gets all archive plugins</summary>
|
||||
/// <returns>List of archive plugins</returns>
|
||||
List<Type> GetAllArchivePlugins();
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,6 @@ namespace Aaru.CommonTypes
|
||||
/// <summary>Contain all plugins (filesystem, partition and image)</summary>
|
||||
public class PluginBase
|
||||
{
|
||||
/// <summary>List of all archive formats</summary>
|
||||
public readonly SortedDictionary<string, IArchive> Archives;
|
||||
/// <summary>List of checksum plugins</summary>
|
||||
public readonly List<IChecksum> Checksums;
|
||||
/// <summary>List of filter plugins</summary>
|
||||
@@ -79,7 +77,6 @@ namespace Aaru.CommonTypes
|
||||
Filters = new SortedDictionary<string, IFilter>();
|
||||
FloppyImages = new SortedDictionary<string, IFloppyImage>();
|
||||
WritableFloppyImages = new SortedDictionary<string, IWritableFloppyImage>();
|
||||
Archives = new SortedDictionary<string, IArchive>();
|
||||
}
|
||||
|
||||
/// <summary>Adds plugins to the central plugin register</summary>
|
||||
@@ -138,12 +135,6 @@ namespace Aaru.CommonTypes
|
||||
{}) is IWritableImage plugin &&
|
||||
!WritableImages.ContainsKey(plugin.Name.ToLower()))
|
||||
WritableImages.Add(plugin.Name.ToLower(), plugin);
|
||||
|
||||
foreach(Type type in pluginRegister.GetAllArchivePlugins() ?? Enumerable.Empty<Type>())
|
||||
if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[]
|
||||
{}) is IArchive plugin &&
|
||||
!Archives.ContainsKey(plugin.Name.ToLower()))
|
||||
Archives.Add(plugin.Name.ToLower(), plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user