Class AnsiStreamParser
- Namespace
- Microlithix.Text.Ansi
- Assembly
- AnsiParser.dll
Parses character streams containing ANSI escape code sequences into a structured representation suitable for higher-level processing.
public class AnsiStreamParser
- Inheritance
-
AnsiStreamParser
- Inherited Members
Remarks
The UTF-16 character input stream may contain printable text, control codes, and ANSI escape sequences. It will be parsed into elements implementing the IAnsiStreamParserElement interface.
Note that this module implements a parser only, and not an interpreter. The interpretation of the elements is domain-dependent and left to the consuming application.
Constructors
- AnsiStreamParser()
Creates a new AnsiStreamParser instance with default settings.
- AnsiStreamParser(AnsiParserSettings)
Creates a new AnsiStreamParser instance with specified settings.
- AnsiStreamParser(AnsiParserSettings, Action<IAnsiStreamParserElement>)
Creates a new AnsiStreamParser instance with specified settings and a specified callback function for receiving the parsed elements.
- AnsiStreamParser(Action<IAnsiStreamParserElement>)
Creates a new AnsiStreamParser instance with default settings and a specified callback function for receiving the parsed elements.
Methods
- Parse(char)
Parses a single character.
Any produced elements will be sent to the callback method provided to the constructor.
- Parse(char, Action<IAnsiStreamParserElement>)
Parses a single character.
Any produced elements will be sent to the provided callback method.
- Reset()
Resets the parser to its initial state.