Class AnsiWriter
Writes a Document to a ICellSurface.
Inherited Members
Namespace: SadConsole.Ansi
Assembly: SadConsole.dll
Syntax
public class AnsiWriter
Constructors
AnsiWriter(Document, ICellSurface)
Creates a new instance with the source document and target surface.
Declaration
public AnsiWriter(Document ansiDocument, ICellSurface editor)
Parameters
Type | Name | Description |
---|---|---|
Document | ansiDocument | The source document containing ANSI commands. |
ICellSurface | editor | The surface to parse the ANSI to. |
Properties
AnsiDocument
The document used to create this writer.
Declaration
public Document AnsiDocument { get; }
Property Value
Type | Description |
---|---|
Document |
BlinkEffect
The blink effect to apply when the ansi document provides the ANSI blink command.
Declaration
public ICellEffect BlinkEffect { get; set; }
Property Value
Type | Description |
---|---|
ICellEffect |
CharactersPerSecond
How many characters to process a second. When set to 0 reads the entire document at once.
Declaration
public int CharactersPerSecond { get; set; }
Property Value
Type | Description |
---|---|
int |
Cursor
The cursor used to write to the target ICellSurface.
Declaration
public Cursor Cursor { get; }
Property Value
Type | Description |
---|---|
Cursor |
Methods
AnsiInterpret(string)
Interprets an individual ansi code.
Declaration
public void AnsiInterpret(string code)
Parameters
Type | Name | Description |
---|---|---|
string | code | The ANSI.SYS code to read. |
AnsiReadLine(string, bool)
Reads a line of ANSI.SYS code.
Declaration
public bool AnsiReadLine(string line, bool moreLines = false)
Parameters
Type | Name | Description |
---|---|---|
string | line | The line to read. |
bool | moreLines | When true, calls LineFeed(); otherwise does nothing. |
Returns
Type | Description |
---|---|
bool | Returns false when character 26 is encountered; otherwise true. |
Process(double)
Processes the document by the amount of time that has elapsed. If CharactersPerSecond is 0, time elapsed has no affect.
Declaration
public void Process(double timeElapsed)
Parameters
Type | Name | Description |
---|---|---|
double | timeElapsed | The time in seconds. |
ReadEntireDocument()
Loads an ansi file and parses it.
Declaration
public void ReadEntireDocument()
Restart()
Moves the reader back to the start of the file so that the source can .
Declaration
public void Restart()