PHP Class Kraken\Util\Buffer\BufferIterator

Inheritance: implements SeekableIterato\SeekableIterator
显示文件 Open project: kraken-php/framework Class Usage Examples

Public Methods

Method Description
__construct ( Kraken\Util\Buffer\BufferInterface $buffer )
__destruct ( )
current ( ) : string Return the current character in the buffer at the iterator position.
insert ( string $data ) Insert the given string into the buffer at the current iterator position.
key ( ) : integer Return the current position (key) of the iterator.
next ( ) Move to the next character in the buffer.
prev ( ) Move to the previous character in the buffer.
remove ( ) : string Remove the byte at the current iterator position and moves the iterator to the previous character.
replace ( string $data ) : string Replace the byte at the current iterator position with the given string.
rewind ( ) Rewind the iterator to the beginning of the buffer.
seek ( integer $position ) Move to the given position in the buffer.
valid ( ) : boolean Determine if the iterator is valid.

Method Details

__construct() public method

public __construct ( Kraken\Util\Buffer\BufferInterface $buffer )
$buffer Kraken\Util\Buffer\BufferInterface

__destruct() public method

public __destruct ( )

current() public method

Return the current character in the buffer at the iterator position.
public current ( ) : string
return string

insert() public method

Insert the given string into the buffer at the current iterator position.
public insert ( string $data )
$data string

key() public method

Return the current position (key) of the iterator.
public key ( ) : integer
return integer

next() public method

Move to the next character in the buffer.
public next ( )

prev() public method

Move to the previous character in the buffer.
public prev ( )

remove() public method

Remove the byte at the current iterator position and moves the iterator to the previous character.
public remove ( ) : string
return string

replace() public method

Replace the byte at the current iterator position with the given string.
public replace ( string $data ) : string
$data string
return string

rewind() public method

Rewind the iterator to the beginning of the buffer.
public rewind ( )

seek() public method

Move to the given position in the buffer.
public seek ( integer $position )
$position integer

valid() public method

Determine if the iterator is valid.
public valid ( ) : boolean
return boolean