class File_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

__construct()

Default Constructor.

File_ANSI()

PHP4 compatible Default Constructor.

setDimensions(int $x, int $y)

Set terminal width and height

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

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

Details

File_ANSI __construct()

Default Constructor.

Return Value

File_ANSI

File_ANSI()

PHP4 compatible Default Constructor.

See also

\self::__construct()

setDimensions(int $x, int $y)

Set terminal width and height

Resets the screen as well

Parameters

int $x
int $y

setHistory(int $history)

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

Parameters

int $history

loadString(string $source)

Load a string

Parameters

string $source

appendString(string $source)

Appdend a string

Parameters

string $source

_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

Parameters

$last_attr
$cur_attr
$char

Return Value

string

string _getScreen()

Returns the current screen without preformating

Return Value

string

string getScreen()

Returns the current screen

Return Value

string

string getHistory()

Returns the current screen and the x previous lines

Return Value

string