Entry.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System;
  2. using System.Collections.Generic;
  3. namespace SharpCompress.Common
  4. {
  5. public abstract class Entry : IEntry
  6. {
  7. /// <summary>
  8. /// The File's 32 bit CRC Hash
  9. /// </summary>
  10. public abstract long Crc { get; }
  11. /// <summary>
  12. /// The string key of the file internal to the Archive.
  13. /// </summary>
  14. public abstract string Key { get; }
  15. /// <summary>
  16. /// The compressed file size
  17. /// </summary>
  18. public abstract long CompressedSize { get; }
  19. /// <summary>
  20. /// The compression type
  21. /// </summary>
  22. public abstract CompressionType CompressionType { get; }
  23. /// <summary>
  24. /// The uncompressed file size
  25. /// </summary>
  26. public abstract long Size { get; }
  27. /// <summary>
  28. /// The entry last modified time in the archive, if recorded
  29. /// </summary>
  30. public abstract DateTime? LastModifiedTime { get; }
  31. /// <summary>
  32. /// The entry create time in the archive, if recorded
  33. /// </summary>
  34. public abstract DateTime? CreatedTime { get; }
  35. /// <summary>
  36. /// The entry last accessed time in the archive, if recorded
  37. /// </summary>
  38. public abstract DateTime? LastAccessedTime { get; }
  39. /// <summary>
  40. /// The entry time when archived, if recorded
  41. /// </summary>
  42. public abstract DateTime? ArchivedTime { get; }
  43. /// <summary>
  44. /// Entry is password protected and encrypted and cannot be extracted.
  45. /// </summary>
  46. public abstract bool IsEncrypted { get; }
  47. /// <summary>
  48. /// Entry is directory.
  49. /// </summary>
  50. public abstract bool IsDirectory { get; }
  51. /// <summary>
  52. /// Entry is split among multiple volumes
  53. /// </summary>
  54. public abstract bool IsSplitAfter { get; }
  55. /// <inheritdoc/>
  56. public override string ToString()
  57. {
  58. return Key;
  59. }
  60. internal abstract IEnumerable<FilePart> Parts { get; }
  61. internal bool IsSolid { get; set; }
  62. internal virtual void Close()
  63. {
  64. }
  65. /// <summary>
  66. /// Entry file attribute.
  67. /// </summary>
  68. public virtual int? Attrib => throw new NotImplementedException();
  69. }
  70. }