[TAR] Add basic public initializer to TarEntryInfo

It takes two the most necessary properties of EntryInfo as arguments: name and type.
This commit is contained in:
Timofey Solomko
2018-07-29 18:04:19 +03:00
parent 14a4df3182
commit dcabef6e95
+9
View File
@@ -98,6 +98,15 @@ public struct TarEntryInfo: ContainerEntryInfo {
let blockStartIndex: Int
public init(name: String, type: ContainerEntryType) {
self.name = name
self.type = type
self.linkName = ""
// These properties are only used when entry is loaded from the container.
self.format = .pax
self.blockStartIndex = 0
}
init(_ byteReader: ByteReader, _ global: TarExtendedHeader?, _ local: TarExtendedHeader?,
_ longName: String?, _ longLinkName: String?) throws {
self.blockStartIndex = byteReader.offset