class StringInputStream implements InputStream

Properties

$errors Parse errors.

Methods

__construct($data, $encoding = 'UTF-8', $debug = '')

Create a new InputStream wrapper.

currentLine()

Returns the current line that the tokenizer is at.

getCurrentLine()

No description

int
columnOffset()

Returns the current column of the current line that the tokenizer is at.

getColumnOffset()

No description

string
current()

Get the current character.

next()

Advance the pointer.

rewind()

Rewind to the start of the string.

bool
valid()

Is the current pointer location valid.

remainingChars()

Get all characters until EOF.

mixed
charsUntil( string $bytes, int $max = null)

Read to a particular match (or until $max bytes are consumed).

charsWhile( string $bytes, int $max = null)

Returns the string so long as $bytes matches.

unconsume( int $howMany = 1)

Unconsume characters.

peek()

Look ahead without moving cursor.

key()

No description

Details

at line line 71
__construct($data, $encoding = 'UTF-8', $debug = '')

Create a new InputStream wrapper.

Parameters

$data
$encoding
$debug

at line line 112
currentLine()

Returns the current line that the tokenizer is at.

at line line 127
getCurrentLine()

at line line 139
int columnOffset()

Returns the current column of the current line that the tokenizer is at.

Newlines are column 0. The first char after a newline is column 1.

Return Value

int The column number.

at line line 170
getColumnOffset()

at line line 180
string current()

Get the current character.

Return Value

string The current character.

at line line 189
next()

Advance the pointer.

This is part of the Iterator interface.

at line line 197
rewind()

Rewind to the start of the string.

at line line 207
bool valid()

Is the current pointer location valid.

Return Value

bool Is the current pointer location valid.

at line line 227
remainingChars()

Get all characters until EOF.

This reads to the end of the file, and sets the read marker at the end of the file.

at line line 254
mixed charsUntil( string $bytes, int $max = null)

Read to a particular match (or until $max bytes are consumed).

This operates on byte sequences, not characters.

Matches as far as possible until we reach a certain set of bytes and returns the matched substring.

Parameters

string $bytes Bytes to match.
int $max Maximum number of bytes to scan.

Return Value

mixed Index or false if no match is found. You should use strong equality when checking the result, since index could be 0.

at line line 285
charsWhile( string $bytes, int $max = null)

Returns the string so long as $bytes matches.

Matches as far as possible with a certain set of bytes and returns the matched substring.

Parameters

string $bytes A mask of bytes to match. If ANY byte in this mask matches the current char, the pointer advances and the char is part of the substring.
int $max The max number of chars to read.

at line line 308
unconsume( int $howMany = 1)

Unconsume characters.

Parameters

int $howMany The number of characters to move the pointer back.

at line line 318
peek()

Look ahead without moving cursor.

at line line 327
key()