ZoneScanner class
Scanner parses zone markers from view output.
The scanner is a state machine that scans through the input string,
looking for zone markers in the format: ESC [ <number> z
When a marker is found:
- If it's a start marker (first occurrence of that ID), it records the position
- If it's an end marker (second occurrence), it calculates the zone bounds and emits the completed ZoneInfo
The scanner also tracks newlines to calculate Y coordinates.
Constructors
- ZoneScanner({required String input, required int iteration, required bool enabled, required ZoneEmitter onZone, required String resolveId(String markerId)})
- Creates a scanner for the given input.
Properties
- enabled → bool
-
Whether the zone manager is enabled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- input ↔ String
-
The input string to scan.
getter/setter pair
- iteration → int
-
The current iteration (used for zone cleanup).
final
- onZone → ZoneEmitter
-
Callback when a zone is complete.
final
- resolveId → String Function(String markerId)
-
Resolves a generated marker ID to the user-provided ID.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
) → String - Runs the scanner and returns the input with markers stripped.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited