HashlinePatcher class final

High-level patcher. Wires an ExecutionEnv and a HashlineSnapshotStore together with the parsing + applying core. Construct once per session; reuse across patches.

Constructors

HashlinePatcher({required ExecutionEnv env, required HashlineSnapshotStore snapshots, bool enforceSeenLines = true})
Creates a patcher over env with the session snapshots store.
const

Properties

enforceSeenLines bool
Whether the seen-line guard is enforced (see constructor).
final
env ExecutionEnv
Filesystem/process environment used for all reads and writes.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshots HashlineSnapshotStore
Snapshot store that minted and resolves hashline section tags.
final

Methods

apply(HashlinePatch patch) Future<HashlinePatcherApplyResult>
Applies every section in patch. prepare runs the full apply for each section in memory before any write hits the filesystem, so a multi-section batch is naturally all-or-nothing. Returns one HashlineSectionResult per section in the original patch order.
commit(HashlinePreparedSection prepared) Future<HashlineSectionResult>
Commits a previously prepared section to the filesystem. Restores line endings and BOM, writes via the env, and records a fresh snapshot in the store keyed by the env-canonical path.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare(HashlinePatchSection section) Future<HashlinePreparedSection>
Reads a section's target file, parses the section, validates the snapshot tag, and applies the edits in memory. Returns a HashlinePreparedSection which can be fed to commit to land the result on the filesystem.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited