Documentation

ANSI
in package

Pure-PHP ANSI Decoder

Tags
author

Jim Wigginton terrafrost@php.net

access

public

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
access

private

$attr_cell

The current attribute cell

private object $attr_cell
Tags
access

private

$attr_row

An empty attribute row

private array<string|int, mixed> $attr_row
Tags
access

private

$attrs

The current screen attributes

private array<string|int, mixed> $attrs
Tags
access

private

$base_attr_cell

An empty attribute cell

private object $base_attr_cell
Tags
access

private

$history

History

private array<string|int, mixed> $history
Tags
access

private

$history_attrs

History Attributes

private array<string|int, mixed> $history_attrs
Tags
access

private

$max_history

Max History

private int $max_history
Tags
access

private

$max_x

Max Width

private int $max_x
Tags
access

private

$max_y

Max Height

private int $max_y
Tags
access

private

$old_x

Old Column

private int $old_x
Tags
access

private

$old_y

Old Row

private int $old_y
Tags
access

private

$screen

The current screen text

private array<string|int, mixed> $screen
Tags
access

private

$tokenization

Tokenization

private array<string|int, mixed> $tokenization
Tags
access

private

$x

Current Column

private int $x
Tags
access

private

$y

Current Row

private int $y
Tags
access

private

Methods

__construct()

Default Constructor.

public __construct() : ANSI
Tags
access

public

Return values
ANSI

appendString()

Appdend a string

public appendString(string $source) : mixed
Parameters
$source : string
Tags
access

public

getHistory()

Returns the current screen and the x previous lines

public getHistory() : string
Tags
access

public

Return values
string

getScreen()

Returns the current screen

public getScreen() : string
Tags
access

public

Return values
string

loadString()

Load a string

public loadString(string $source) : mixed
Parameters
$source : string
Tags
access

public

setDimensions()

Set terminal width and height

public setDimensions(int $x, int $y) : mixed

Resets the screen as well

Parameters
$x : int
$y : int
Tags
access

public

setHistory()

Set the number of lines that should be logged past the terminal height

public setHistory(int $history) : mixed
Parameters
$history : int
Tags
access

public

getScreenHelper()

Returns the current screen without preformating

private getScreenHelper() : string
Tags
access

private

Return values
string

newLine()

Add a new line

private newLine() : mixed

Also update the $this->screen and $this->history buffers

Tags
access

private

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
Tags
access

private

Return values
string

        
On this page

Search results