mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Some zip classes are made final. Moved some internal comments.
This commit is contained in:
@@ -433,10 +433,10 @@
|
||||
06CC187E1DE35607003532F5 /* DeflateTests.swift */,
|
||||
0680E1B21DDA3D0A005C05EB /* GzipTests.swift */,
|
||||
0680E1B01DDA2D7C005C05EB /* ZlibTests.swift */,
|
||||
061FCE2C1DBCC6A30052F7BE /* Constants.swift */,
|
||||
0675183C1E2A883600D16354 /* ZipTests.swift */,
|
||||
06BE1AD81DB410F100EE0F59 /* Info.plist */,
|
||||
0696E5C51ED0B22F00921D4D /* TarTests.swift */,
|
||||
061FCE2C1DBCC6A30052F7BE /* Constants.swift */,
|
||||
06BE1AD81DB410F100EE0F59 /* Info.plist */,
|
||||
);
|
||||
path = Tests;
|
||||
sourceTree = "<group>";
|
||||
|
||||
@@ -52,7 +52,7 @@ public enum ZipError: Error {
|
||||
}
|
||||
|
||||
/// Represents either a file or directory entry inside ZIP archive.
|
||||
public class ZipEntry: ContainerEntry {
|
||||
public final class ZipEntry: ContainerEntry {
|
||||
|
||||
private let cdEntry: CentralDirectoryEntry
|
||||
private var pointerData: DataWithPointer
|
||||
@@ -176,7 +176,7 @@ public class ZipEntry: ContainerEntry {
|
||||
}
|
||||
|
||||
/// Provides function which opens ZIP archives (containers).
|
||||
public class ZipContainer: Container {
|
||||
public final class ZipContainer: Container {
|
||||
|
||||
/**
|
||||
Processes ZIP archive (container) and returns an array of `ContainerEntries` (which are actually `ZipEntries`).
|
||||
@@ -456,7 +456,10 @@ struct CentralDirectoryEntry {
|
||||
|
||||
struct EndOfCentralDirectory {
|
||||
|
||||
/// Number of the current disk.
|
||||
private(set) var currentDiskNumber: UInt32
|
||||
|
||||
/// Number of the disk with the start of CD.
|
||||
private(set) var cdDiskNumber: UInt32
|
||||
private(set) var cdEntries: UInt64
|
||||
private(set) var cdSize: UInt64
|
||||
@@ -466,9 +469,7 @@ struct EndOfCentralDirectory {
|
||||
/// Indicates if Zip64 records should be present.
|
||||
var zip64RecordExists = false
|
||||
|
||||
/// Number of current disk.
|
||||
self.currentDiskNumber = pointerData.uint32FromAlignedBytes(count: 2)
|
||||
/// Number of the disk with the start of CD.
|
||||
self.cdDiskNumber = pointerData.uint32FromAlignedBytes(count: 2)
|
||||
guard self.currentDiskNumber == self.cdDiskNumber
|
||||
else { throw ZipError.multiVolumesNotSupported }
|
||||
|
||||
Reference in New Issue
Block a user