helly           Sun Jul 16 19:16:40 2006 UTC

  Added files:                 
    /php-src/ext/spl/internal   recursiveregexiterator.inc 

  Modified files:              
    /php-src/ext/spl    spl.php 
  Log:
  - Update docu
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl.php?r1=1.72&r2=1.73&diff_format=u
Index: php-src/ext/spl/spl.php
diff -u php-src/ext/spl/spl.php:1.72 php-src/ext/spl/spl.php:1.73
--- php-src/ext/spl/spl.php:1.72        Sat Mar  4 22:56:11 2006
+++ php-src/ext/spl/spl.php     Sun Jul 16 19:16:40 2006
@@ -46,6 +46,8 @@
  * - class EmptyIterator implements Iterator
  * - class InfiniteIterator extends IteratorIterator
  * - class AppendIterator implements OuterIterator
+ * - class RegexIterator extends FilterIterator
+ * - class RegursiveRegexIterator extends RegexIterator implements 
RecursiveIterator
  * 
  * 2) Directories and Files
  * 

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/recursiveregexiterator.inc?view=markup&rev=1.1
Index: php-src/ext/spl/internal/recursiveregexiterator.inc
+++ php-src/ext/spl/internal/recursiveregexiterator.inc
<?php

/** @file recursiveregexiterator.inc
 * @ingroup SPL
 * @brief class RegexIterator
 * @author  Marcus Boerger
 * @date    2003 - 2006
 *
 * SPL - Standard PHP Library
 */

/**
 * @brief   Recursive regular expression filter for iterators
 * @author  Marcus Boerger
 * @version 1.0
 * @since PHP 5.1
 *
 * This filter iterator assumes that the inner iterator 
 */
class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator
{
        /**
         * Constructs a regular expression filter around an iterator whose 
         * elemnts or keys are strings.
         *
         * @param it     Object that implements at least
         */
        function __construct(RecursiveIterator $it, $regex, $flags = 0, $mode = 
0, $preg_flags = 0) {
                parent::__construct($it, $regex, $flags, $mode, $preg_flags);
        }

        /** @return whether the current element has children
         */
        function hasChildren()
        {
                return $this->getInnerIterator()->hasChildren();
        }

        /** @return an iterator for the current elements children
         *
         * @note the returned iterator will be of the same class as $this
         */
        function getChildren()
        {
                if (empty($this->ref))
                {
                        $this->ref = new ReflectionClass($this);
                }
                return 
$this->ref->newInstance($this->getInnerIterator()->getChildren());
        }
        
        private $ref;
}

?>

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to