Table of Contents

Class PackPageSource

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

One pack on its own (an incremental, say) as a sparse IPageSource: a page the pack does not hold is absent (TryReadPage(int, Span<byte>) returns false), the sparse case IPageSource documents.

public sealed class PackPageSource : IPageSource, IDisposable
Inheritance
PackPageSource
Implements
Inherited Members

Properties

Damaged

Damaged pages met so far under ReportAbsent.

public IReadOnlyList<PackPageDamage> Damaged { get; }

Property Value

IReadOnlyList<PackPageDamage>

PageCount

Number of pages addressable in this source. Indices [0, PageCount) are in range.

public int PageCount { get; }

Property Value

int

Methods

Describe()

Human-readable identity of the source, used to anchor findings: a bundle path, a backup id, or "live".

public string Describe()

Returns

string

Dispose()

public void Dispose()

Open(string, PackSourceOptions)

Opens the pack file at path.

public static PackPageSource Open(string path, PackSourceOptions options = null)

Parameters

path string

A .tpack file.

options PackSourceOptions

Damage handling and memory.

Returns

PackPageSource

TryReadPage(int, Span<byte>)

Reads page index into destination.

public bool TryReadPage(int index, Span<byte> destination)

Parameters

index int

Zero-based file-page index.

destination Span<byte>

Buffer of at least PageSize bytes.

Returns

bool

true when the page was read in full; false when it does not exist in this source (out of range, or a hole in a sparse source such as an incremental backup). A false return is not an error — the caller decides whether an absent page is a finding.