Skip to content
ConsoleMonster
Class

StringTerminalWriter

ConsoleMonster.Output

Namespace
ConsoleMonster.Output
Assembly
ConsoleMonster
Implements
ITerminalWriter IDisposable
Modifiers
sealed

An in-memory ITerminalWriter. Used by tests (VT byte-stream goldens) and by callers that want rendered output as a string, for example to embed it in another log.

Inheritance

  • object
  • StringTerminalWriter

Constructors

public StringTerminalWriter() #

Methods

public void Clear() #

Clears the accumulated text.

public void Dispose() #

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Flush() #

Flushes buffered text to the device.

public override string ToString() #

Returns everything written so far.

Returns

string The accumulated text.
public void Write(string text) #

Writes text. Implementations may buffer until ITerminalWriter.Flush.

Parameters

text string required
Text, possibly containing VT sequences.

Properties

public bool IsConsole { get; } #

Whether this writer targets a real console handle (as opposed to a file, pipe or buffer).

public int FlushCount { get; private set; } #

Number of StringTerminalWriter.Flush calls; a live renderer flushes once per frame.