Class PackPageSource
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
PageCount
Number of pages addressable in this source. Indices [0, PageCount) are in range.
public int PageCount { get; }
Property Value
Methods
Describe()
Human-readable identity of the source, used to anchor findings: a bundle path, a backup id, or "live".
public string Describe()
Returns
Dispose()
public void Dispose()
Open(string, PackSourceOptions)
Opens the pack file at path.
public static PackPageSource Open(string path, PackSourceOptions options = null)
Parameters
pathstringA
.tpackfile.optionsPackSourceOptionsDamage handling and memory.
Returns
TryReadPage(int, Span<byte>)
Reads page index into destination.
public bool TryReadPage(int index, Span<byte> destination)
Parameters
Returns
- bool
truewhen the page was read in full;falsewhen it does not exist in this source (out of range, or a hole in a sparse source such as an incremental backup). Afalsereturn is not an error — the caller decides whether an absent page is a finding.