ANSI
class ANSI (View source)
Pure-PHP ANSI Decoder
Properties
int | $max_x | Max Width | |
int | $max_y | Max Height | |
int | $max_history | Max History | |
array | $history | History | |
array | $history_attrs | History Attributes | |
int | $x | Current Column | |
int | $y | Current Row | |
int | $old_x | Old Column | |
int | $old_y | Old Row | |
object | $base_attr_cell | An empty attribute cell | |
object | $attr_cell | The current attribute cell | |
array | $attr_row | An empty attribute row | |
array | $screen | The current screen text | |
array | $attrs | The current screen attributes | |
string | $ansi | Current ANSI code | |
array | $tokenization | Tokenization |
Methods
Default Constructor.
Set terminal width and height
Set the number of lines that should be logged past the terminal height
Load a string
Appdend a string
Add a new line
Returns the current coordinate without preformating
Returns the current screen without preformating
Returns the current screen
Returns the current screen and the x previous lines
Details
ANSI
__construct()
Default Constructor.
setDimensions(int $x, int $y)
Set terminal width and height
Resets the screen as well
setHistory(int $history)
Set the number of lines that should be logged past the terminal height
loadString(string $source)
Load a string
appendString(string $source)
Appdend a string
_newLine()
Add a new line
Also update the $this->screen and $this->history buffers
string
_processCoordinate($last_attr, $cur_attr, $char)
Returns the current coordinate without preformating
string
_getScreen()
Returns the current screen without preformating
string
getScreen()
Returns the current screen
string
getHistory()
Returns the current screen and the x previous lines