MediaWiki  1.28.1
ExplodeIterator Class Reference

An iterator which works exactly like: More...

Inheritance diagram for ExplodeIterator:
Collaboration diagram for ExplodeIterator:

Public Member Functions

 __construct ($delim, $subject)
 Construct a DelimIterator. More...
 
 current ()
 
 key ()
 
 next ()
 
 refreshCurrent ()
 
 rewind ()
 
 valid ()
 

Public Attributes

 $delimLength
 
 $subjectLength
 

Private Attributes

 $curPos
 
 $current
 
 $delim
 
 $endPos
 
 $subject
 

Detailed Description

An iterator which works exactly like:

foreach ( explode( $delim, $s ) as $element ) { ... }

Except it doesn't use 193 byte per element

Definition at line 30 of file ExplodeIterator.php.

Constructor & Destructor Documentation

ExplodeIterator::__construct (   $delim,
  $subject 
)

Construct a DelimIterator.

Parameters
string$delim
string$subject

Definition at line 51 of file ExplodeIterator.php.

References $delim, $subject, and rewind().

Member Function Documentation

ExplodeIterator::current ( )

Definition at line 80 of file ExplodeIterator.php.

References $current.

Referenced by refreshCurrent().

ExplodeIterator::key ( )
Returns
int|bool Current position or boolean false if invalid

Definition at line 87 of file ExplodeIterator.php.

References $curPos.

ExplodeIterator::next ( )
Returns
string

Definition at line 94 of file ExplodeIterator.php.

References $current, $delimLength, and refreshCurrent().

ExplodeIterator::refreshCurrent ( )

Definition at line 68 of file ExplodeIterator.php.

References current().

Referenced by next(), and rewind().

ExplodeIterator::rewind ( )

Definition at line 62 of file ExplodeIterator.php.

References refreshCurrent().

Referenced by __construct().

ExplodeIterator::valid ( )
Returns
bool

Definition at line 113 of file ExplodeIterator.php.

Member Data Documentation

ExplodeIterator::$curPos
private

Definition at line 38 of file ExplodeIterator.php.

Referenced by key().

ExplodeIterator::$current
private

Definition at line 44 of file ExplodeIterator.php.

Referenced by current(), and next().

ExplodeIterator::$delim
private

Definition at line 35 of file ExplodeIterator.php.

Referenced by __construct().

ExplodeIterator::$delimLength

Definition at line 35 of file ExplodeIterator.php.

Referenced by next().

ExplodeIterator::$endPos
private

Definition at line 41 of file ExplodeIterator.php.

ExplodeIterator::$subject
private

Definition at line 32 of file ExplodeIterator.php.

Referenced by __construct().

ExplodeIterator::$subjectLength

Definition at line 32 of file ExplodeIterator.php.


The documentation for this class was generated from the following file: