Table of Contents

Class AnsiLinesSnapshot

Namespace
SharpConsoleUI.Diagnostics.Snapshots
Assembly
SharpConsoleUI.dll

Captures the ANSI-encoded output lines from CharacterBuffer.ToLines(). Used to validate ANSI generation and optimization.

public class AnsiLinesSnapshot
Inheritance
AnsiLinesSnapshot
Inherited Members

Properties

FrameNumber

Gets the frame number this snapshot represents.

public int FrameNumber { get; init; }

Property Value

int

Lines

Gets the list of ANSI-encoded lines.

public List<string> Lines { get; init; }

Property Value

List<string>

Timestamp

Gets the timestamp when this snapshot was taken.

public DateTime Timestamp { get; init; }

Property Value

DateTime

TotalAnsiEscapes

Gets the total number of ANSI escape sequences across all lines.

public int TotalAnsiEscapes { get; init; }

Property Value

int

TotalCharacters

Gets the total number of visible characters (excluding ANSI codes).

public int TotalCharacters { get; init; }

Property Value

int

Methods

CountEscapeSequences(string)

Counts ANSI escape sequences matching a specific pattern.

public int CountEscapeSequences(string pattern)

Parameters

pattern string

Returns

int

GetAllEscapeSequences()

Returns all ANSI escape sequences in the output.

public List<string> GetAllEscapeSequences()

Returns

List<string>

GetLine(int)

Gets the line at the specified index.

public string GetLine(int y)

Parameters

y int

Returns

string

ParseLine(int)

Parses a line into segments of text and ANSI codes.

public List<AnsiSegment> ParseLine(int y)

Parameters

y int

Returns

List<AnsiSegment>