mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user