abla/archive/tar
Generated from source.
Import with import "abla/archive/tar".
Source: abla/archive/tar/entry.ab
TarLimits (class)
class TarLimits(
val maxArchiveBytes: int,
val maxEntries: int,
val maxFileBytes: int,
val maxTotalFileBytes: int
)
Sets upper bounds for archive bytes, entry count, per-file bytes and total file bytes.
TarEntry (class)
class TarEntry(val path: string, val kind: string, val mode: int, val offset: int, val size: int,
val rawPath: string = "")
Describes a ustar member, including its normalized path, mode and payload extent.
TarReadResult (class)
class TarReadResult(val input: string, val entries: array<TarEntry>, val error: string)
Holds the original bytes and parsed entries on success or an error code on failure.
tarRead (fun)
fun tarRead(input: string, limits: TarLimits): TarReadResult
Returns bounded ustar entries, or an error for invalid archives, unsupported entries or exceeded limits.
TarInputChunk (class)
class TarInputChunk(val data: string, val eof: bool, val error: string = "")
The caller owns the source and passes the same source to every operation. A source must return no more than maxBytes, and either data, EOF or an error.
TarSource (interface)
resource interface TarSource
Supplies caller-owned input to a streaming tar reader.
TarSource.readChunk (method)
fun readChunk(maxBytes: int): TarInputChunk
Returns up to maxBytes bytes, signals end of input, or reports a source error.
TarStreamNext (class)
class TarStreamNext(val entry: TarEntry, val done: bool, val error: string)
Reports the next tar entry, end of archive, or an error.
TarStreamData (class)
class TarStreamData(val data: string, val done: bool, val error: string)
Reports file bytes, end of the current payload, or an error.
TarStream (class)
class TarStream(
val limits: TarLimits,
val entries: array<TarEntry> = [],
var archiveBytes: int = 0,
var totalFileBytes: int = 0,
var remaining: int = 0,
var padding: int = 0,
var sourceEof: bool = false,
var finished: bool = false,
var error: string = "",
// The paths seen so far (see tarConflicts).
val kinds: Map<string, int> = Map(),
val ancestors: Map<string, int> = Map()
)
Tracks the current tar entry, archive limits and any terminal error.
tarStream (fun)
fun tarStream(limits: TarLimits): TarStream
Returns an empty streaming tar reader with an error already set if any limit is negative.
TarStream.next (extension fun)
fun TarStream.next(var source: TarSource): TarStreamNext
File bytes are provisional until next() reaches verified EOF. The current file must be completely read before next(); its padding is checked there.
TarStream.readData (extension fun)
fun TarStream.readData(var source: TarSource, maxBytes: int): TarStreamData
Each returned string is at most min(maxBytes, 65536). Empty files are done immediately. An error invalidates all earlier entries and file bytes.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.