*/
function accept()
{
- return !$this->it->isDot();
+ return !$this->getInnerIterator()->isDot();
}
/** @return whether the current entry is a directory
*/
function hasChildren()
{
- return $this->it->hasChildren();
+ return $this->getInnerIterator()->hasChildren();
}
/** @return the current subdirectory as a new DirectoryFilterDots instance.
*/
function getChildren()
{
- return new DirectoryFilterDots($this->it->getPathname());
+ return new DirectoryFilterDots($this->getInnerIterator()->getPathname());
}
/** @return the current entries path name
*/
function key()
{
- return $this->it->getPathname();
+ return $this->getInnerIterator()->getPathname();
}
}
}
\endverbatim
*/
-class InfiniteIterator implements Iterator
+class InfiniteIterator implements OuterIterator
{
/** @internal
* The inner Iterator. */
*/
function rewind()
{
- $this->it->rewind();
+ $this->getInnerIterator()->rewind();
}
/** @return whether the current element is valid
*/
function valid()
{
- return $this->it->valid();
+ return $this->getInnerIterator()->valid();
}
/** @return the current value
*/
function current()
{
- return $this->it->current();
+ return $this->getInnerIterator()->current();
}
/** @return the current key
*/
function key()
{
- return $this->it->key();
+ return $this->getInnerIterator()->key();
}
/** Move the inner Iterator forward to its next element or rewind it.
*/
function next()
{
- $this->it->next();
- if (!$this->it->valid())
+ $this->getInnerIterator()->next();
+ if (!$this->getInnerIterator()->valid())
{
- $this->it->rewind();
+ $this->getInnerIterator()->rewind();
}
}
*/
function __call($func, $params)
{
- return call_user_func_array(array($this->it, $func), $params);
+ return call_user_func_array(array($this->getInnerIterator(), $func), $params);
}
}
* @version 1.0
*
*/
-class NoRewindIterator implements Iterator
+class NoRewindIterator implements OuterIterator
{
protected $it;
function valid()
{
- return $this->it->valid();
+ return $this->getInnerIterator()->valid();
}
function current()
{
- return $this->it->current();
+ return $this->getInnerIterator()->current();
}
function key()
{
- return $this->it->key();
+ return $this->getInnerIterator()->key();
}
function next()
{
- $this->it->next();
+ $this->getInnerIterator()->next();
+ }
+
+ function getInnerIterator()
+ {
+ return $this->it;
}
}