HashlinePatchSection class final

One section of a parsed HashlinePatch: a target file plus the lazily-parsed list of edits that should land on it.

Properties

diff String
The raw section body (ops + payload rows).
final
edits List<HashlineEdit>
Parsed edits for this section.
no setter
fileHash String?
The 4-hex snapshot tag from the section header, when present.
final
hasAnchorScopedEdit bool
True when at least one edit anchors to concrete file content. Pure INS.HEAD: / INS.TAIL: literal inserts do not count: those are safe to apply even when the tagged content drifted.
no setter
hashCode int
The hash code for this object.
no setterinherited
path String
Section path as authored.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
warnings List<String>
Warnings emitted during parsing of this section.
no setter

Methods

applyTo(String text) HashlineApplyResult
Applies this section's edits to text and returns the post-edit result. Pure: does no I/O and does not validate the snapshot tag. The HashlinePatcher owns tag validation; reach for this directly when you've already validated the file content.
collectAnchorLines() List<int>
Anchor lines touched by this section, sorted ascending and deduplicated.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse() HashlineParseResult
Parses this section's diff body. Cached: subsequent calls return the same result object.
toString() String
A string representation of this object.
inherited
withPath(String path) HashlinePatchSection
A copy of this section rebound to a different target path, preserving the snapshot tag, diff body, and any cached parse result. Used by the patcher's tag-based path recovery.

Operators

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