mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-09 02:26:47 +00:00
moar interfaces
This commit is contained in:
@@ -15,8 +15,8 @@ namespace SharpCompress.Archives.GZip;
|
||||
|
||||
public partial class GZipArchive
|
||||
: AbstractWritableArchive<GZipArchiveEntry, GZipVolume, GZipWriterOptions>,
|
||||
IGZipArchive,
|
||||
IGZipAsyncArchive
|
||||
IGZipWritableArchive,
|
||||
IGZipWritableAsyncArchive
|
||||
{
|
||||
private GZipArchive(SourceStream sourceStream)
|
||||
: base(ArchiveType.GZip, sourceStream) { }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Writers.GZip;
|
||||
|
||||
namespace SharpCompress.Archives.GZip;
|
||||
|
||||
@@ -7,7 +8,19 @@ namespace SharpCompress.Archives.GZip;
|
||||
/// </summary>
|
||||
public interface IGZipArchive : IExtractableArchive { }
|
||||
|
||||
/// <summary>
|
||||
/// Writable GZip archive with GZip-specific writer options.
|
||||
/// </summary>
|
||||
public interface IGZipWritableArchive : IGZipArchive, IWritableArchive<GZipWriterOptions> { }
|
||||
|
||||
/// <summary>
|
||||
/// Async GZip archive supporting random access and entry stream extraction.
|
||||
/// </summary>
|
||||
public interface IGZipAsyncArchive : IExtractableAsyncArchive { }
|
||||
|
||||
/// <summary>
|
||||
/// Async writable GZip archive with GZip-specific writer options.
|
||||
/// </summary>
|
||||
public interface IGZipWritableAsyncArchive
|
||||
: IGZipAsyncArchive,
|
||||
IWritableAsyncArchive<GZipWriterOptions> { }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Writers.Tar;
|
||||
|
||||
namespace SharpCompress.Archives.Tar;
|
||||
|
||||
@@ -7,7 +8,19 @@ namespace SharpCompress.Archives.Tar;
|
||||
/// </summary>
|
||||
public interface ITarArchive : IExtractableArchive { }
|
||||
|
||||
/// <summary>
|
||||
/// Writable TAR archive with TAR-specific writer options.
|
||||
/// </summary>
|
||||
public interface ITarWritableArchive : ITarArchive, IWritableArchive<TarWriterOptions> { }
|
||||
|
||||
/// <summary>
|
||||
/// Async TAR archive supporting random access and entry stream extraction.
|
||||
/// </summary>
|
||||
public interface ITarAsyncArchive : IExtractableAsyncArchive { }
|
||||
|
||||
/// <summary>
|
||||
/// Async writable TAR archive with TAR-specific writer options.
|
||||
/// </summary>
|
||||
public interface ITarWritableAsyncArchive
|
||||
: ITarAsyncArchive,
|
||||
IWritableAsyncArchive<TarWriterOptions> { }
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace SharpCompress.Archives.Tar;
|
||||
|
||||
public partial class TarArchive
|
||||
: AbstractWritableArchive<TarArchiveEntry, TarVolume, TarWriterOptions>,
|
||||
ITarArchive,
|
||||
ITarAsyncArchive
|
||||
ITarWritableArchive,
|
||||
ITarWritableAsyncArchive
|
||||
{
|
||||
private readonly CompressionType _compressionType;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Writers.Zip;
|
||||
|
||||
namespace SharpCompress.Archives.Zip;
|
||||
|
||||
@@ -7,7 +8,19 @@ namespace SharpCompress.Archives.Zip;
|
||||
/// </summary>
|
||||
public interface IZipArchive : IExtractableArchive { }
|
||||
|
||||
/// <summary>
|
||||
/// Writable ZIP archive with ZIP-specific writer options.
|
||||
/// </summary>
|
||||
public interface IZipWritableArchive : IZipArchive, IWritableArchive<ZipWriterOptions> { }
|
||||
|
||||
/// <summary>
|
||||
/// Async ZIP archive supporting random access and entry stream extraction.
|
||||
/// </summary>
|
||||
public interface IZipAsyncArchive : IExtractableAsyncArchive { }
|
||||
|
||||
/// <summary>
|
||||
/// Async writable ZIP archive with ZIP-specific writer options.
|
||||
/// </summary>
|
||||
public interface IZipWritableAsyncArchive
|
||||
: IZipAsyncArchive,
|
||||
IWritableAsyncArchive<ZipWriterOptions> { }
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace SharpCompress.Archives.Zip;
|
||||
|
||||
public partial class ZipArchive
|
||||
: AbstractWritableArchive<ZipArchiveEntry, ZipVolume, ZipWriterOptions>,
|
||||
IZipArchive,
|
||||
IZipAsyncArchive
|
||||
IZipWritableArchive,
|
||||
IZipWritableAsyncArchive
|
||||
{
|
||||
private readonly SeekableZipHeaderFactory? headerFactory;
|
||||
|
||||
|
||||
@@ -206,7 +206,11 @@ public class GZipFactory
|
||||
#region IWriteableArchiveFactory
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IWritableArchive<GZipWriterOptions> CreateArchive() => GZipArchive.CreateArchive();
|
||||
public IGZipWritableArchive CreateArchive() =>
|
||||
(IGZipWritableArchive)GZipArchive.CreateArchive();
|
||||
|
||||
IWritableArchive<GZipWriterOptions> IWriteableArchiveFactory<GZipWriterOptions>.CreateArchive() =>
|
||||
CreateArchive();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -409,7 +409,10 @@ public class TarFactory
|
||||
#region IWriteableArchiveFactory
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IWritableArchive<TarWriterOptions> CreateArchive() => TarArchive.CreateArchive();
|
||||
public ITarWritableArchive CreateArchive() => (ITarWritableArchive)TarArchive.CreateArchive();
|
||||
|
||||
IWritableArchive<TarWriterOptions> IWriteableArchiveFactory<TarWriterOptions>.CreateArchive() =>
|
||||
CreateArchive();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -234,7 +234,10 @@ public class ZipFactory
|
||||
#region IWriteableArchiveFactory
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IWritableArchive<ZipWriterOptions> CreateArchive() => ZipArchive.CreateArchive();
|
||||
public IZipWritableArchive CreateArchive() => (IZipWritableArchive)ZipArchive.CreateArchive();
|
||||
|
||||
IWritableArchive<ZipWriterOptions> IWriteableArchiveFactory<ZipWriterOptions>.CreateArchive() =>
|
||||
CreateArchive();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user