CPIOArchiveKit Documentation

Structure CPIOArchive​Reader

public struct CPIOArchiveReader  

CPIOArchiveReader reads cpio files.

let bytes = Array<UInt8>(try Data(contentsOf: myURL))
let reader = try CPIOArchiveReader(archive: bytes)
let bytes = reader[0]
let header = reader.headers[0]
%7 CPIOArchiveReader CPIOArchiveReader Sequence Sequence CPIOArchiveReader->Sequence

Conforms To

Sequence

Initializers

init(archive:​)

public init(archive: [UInt8]) throws  

The initializer reads all the cpio headers in preparation for random access to the header's file contents later.

Parameters

archive [UInt8]

The bytes of the archive you want to read.

Throws

ArArchiveError.

Properties

headers

public var headers: [Header] = [] 

The headers that describe the files in this archive.

Use this to find a file in the archive, then use the provided subscript to get the bytes of the file.

let bytes = Array<UInt8>(try Data(contentsOf: myURL))
let reader = try CPIOArchiveReader(archive: bytes)
let bytes = reader[header: reader.headers[0]]
// Use bytes...

count

public var count: Int  

The amount of files in this archive.

Methods

make​Iterator()

public func makeIterator() -> CPIOArchiveReaderIterator