Some zip classes are made final. Moved some internal comments.

This commit is contained in:
Timofey Solomko
2017-05-27 19:59:02 +03:00
parent 11c60bd4ab
commit a5dc7dc88f
2 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -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>";
+5 -4
View File
@@ -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 }