IArchive.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using SharpCompress.Common;
  4. using SharpCompress.Readers;
  5. namespace SharpCompress.Archives
  6. {
  7. public interface IArchive : IDisposable
  8. {
  9. event EventHandler<ArchiveExtractionEventArgs<IArchiveEntry>> EntryExtractionBegin;
  10. event EventHandler<ArchiveExtractionEventArgs<IArchiveEntry>> EntryExtractionEnd;
  11. event EventHandler<CompressedBytesReadEventArgs> CompressedBytesRead;
  12. event EventHandler<FilePartExtractionBeginEventArgs> FilePartExtractionBegin;
  13. IEnumerable<IArchiveEntry> Entries { get; }
  14. IEnumerable<IVolume> Volumes { get; }
  15. ArchiveType Type { get; }
  16. /// <summary>
  17. /// Use this method to extract all entries in an archive in order.
  18. /// This is primarily for SOLID Rar Archives or 7Zip Archives as they need to be
  19. /// extracted sequentially for the best performance.
  20. /// </summary>
  21. IReader ExtractAllEntries();
  22. /// <summary>
  23. /// Archive is SOLID (this means the Archive saved bytes by reusing information which helps for archives containing many small files).
  24. /// Rar Archives can be SOLID while all 7Zip archives are considered SOLID.
  25. /// </summary>
  26. bool IsSolid { get; }
  27. /// <summary>
  28. /// This checks to see if all the known entries have IsComplete = true
  29. /// </summary>
  30. bool IsComplete { get; }
  31. /// <summary>
  32. /// The total size of the files compressed in the archive.
  33. /// </summary>
  34. long TotalSize { get; }
  35. /// <summary>
  36. /// The total size of the files as uncompressed in the archive.
  37. /// </summary>
  38. long TotalUncompressSize { get; }
  39. }
  40. }