Class VTParser
VT/ANSI escape sequence parser implementing a finite state machine based on Paul Williams' DEC-compatible parser. Accepts input bytes that may be split across reads (essential for terminal correctness) and emits semantic events to an IVTParserHandler.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public class VTParser
Constructors
VTParser(IVTParserHandler)
Creates a new VT parser that emits events to the specified handler.
Declaration
public VTParser(IVTParserHandler handler)
Parameters
| Type | Name | Description |
|---|---|---|
| IVTParserHandler | handler | The event handler for parsed sequences. |
Methods
Feed(ReadOnlySpan<byte>)
Feeds a chunk of bytes to the parser. Bytes may be split across calls.
Declaration
public void Feed(ReadOnlySpan<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | data | The input bytes to parse. |
FeedString(string)
Feeds a string to the parser (converted to UTF-8 bytes internally). Uses ArrayPool<T> to avoid per-call heap allocations.
Declaration
public void FeedString(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to parse. |
Reset()
Resets the parser to its initial state.
Declaration
public void Reset()