ANSI
in package
Pure-PHP ANSI Decoder
Tags
Table of Contents
Properties
- $ansi : string
- Current ANSI code
- $attr_cell : object
- The current attribute cell
- $attr_row : array<string|int, mixed>
- An empty attribute row
- $attrs : array<string|int, mixed>
- The current screen attributes
- $base_attr_cell : object
- An empty attribute cell
- $history : array<string|int, mixed>
- History
- $history_attrs : array<string|int, mixed>
- History Attributes
- $max_history : int
- Max History
- $max_x : int
- Max Width
- $max_y : int
- Max Height
- $old_x : int
- Old Column
- $old_y : int
- Old Row
- $screen : array<string|int, mixed>
- The current screen text
- $tokenization : array<string|int, mixed>
- Tokenization
- $x : int
- Current Column
- $y : int
- Current Row
Methods
- __construct() : ANSI
- Default Constructor.
- appendString() : mixed
- Appdend a string
- getHistory() : string
- Returns the current screen and the x previous lines
- getScreen() : string
- Returns the current screen
- loadString() : mixed
- Load a string
- setDimensions() : mixed
- Set terminal width and height
- setHistory() : mixed
- Set the number of lines that should be logged past the terminal height
- getScreenHelper() : string
- Returns the current screen without preformating
- newLine() : mixed
- Add a new line
- processCoordinate() : string
- Returns the current coordinate without preformating
Properties
$ansi
Current ANSI code
private
string
$ansi
Tags
$attr_cell
The current attribute cell
private
object
$attr_cell
Tags
$attr_row
An empty attribute row
private
array<string|int, mixed>
$attr_row
Tags
$attrs
The current screen attributes
private
array<string|int, mixed>
$attrs
Tags
$base_attr_cell
An empty attribute cell
private
object
$base_attr_cell
Tags
$history
History
private
array<string|int, mixed>
$history
Tags
$history_attrs
History Attributes
private
array<string|int, mixed>
$history_attrs
Tags
$max_history
Max History
private
int
$max_history
Tags
$max_x
Max Width
private
int
$max_x
Tags
$max_y
Max Height
private
int
$max_y
Tags
$old_x
Old Column
private
int
$old_x
Tags
$old_y
Old Row
private
int
$old_y
Tags
$screen
The current screen text
private
array<string|int, mixed>
$screen
Tags
$tokenization
Tokenization
private
array<string|int, mixed>
$tokenization
Tags
$x
Current Column
private
int
$x
Tags
$y
Current Row
private
int
$y
Tags
Methods
__construct()
Default Constructor.
public
__construct() : ANSI
Tags
Return values
ANSIappendString()
Appdend a string
public
appendString(string $source) : mixed
Parameters
- $source : string
Tags
getHistory()
Returns the current screen and the x previous lines
public
getHistory() : string
Tags
Return values
stringgetScreen()
Returns the current screen
public
getScreen() : string
Tags
Return values
stringloadString()
Load a string
public
loadString(string $source) : mixed
Parameters
- $source : string
Tags
setDimensions()
Set terminal width and height
public
setDimensions(int $x, int $y) : mixed
Resets the screen as well
Parameters
- $x : int
- $y : int
Tags
setHistory()
Set the number of lines that should be logged past the terminal height
public
setHistory(int $history) : mixed
Parameters
- $history : int
Tags
getScreenHelper()
Returns the current screen without preformating
private
getScreenHelper() : string
Tags
Return values
stringnewLine()
Add a new line
private
newLine() : mixed
Also update the $this->screen and $this->history buffers
Tags
processCoordinate()
Returns the current coordinate without preformating
private
processCoordinate(stdClass $last_attr, stdClass $cur_attr, string $char) : string
Parameters
- $last_attr : stdClass
- $cur_attr : stdClass
- $char : string