helly Sun Jul 16 19:16:04 2006 UTC
Added files:
/php-src/ext/spl/internal regexiterator.inc
Modified files:
/php-src/ext/spl/internal filteriterator.inc
Log:
- Update docu
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/filteriterator.inc?r1=1.9&r2=1.10&diff_format=u
Index: php-src/ext/spl/internal/filteriterator.inc
diff -u php-src/ext/spl/internal/filteriterator.inc:1.9
php-src/ext/spl/internal/filteriterator.inc:1.10
--- php-src/ext/spl/internal/filteriterator.inc:1.9 Tue Feb 21 23:21:53 2006
+++ php-src/ext/spl/internal/filteriterator.inc Sun Jul 16 19:16:03 2006
@@ -10,7 +10,7 @@
*/
/**
- * @brief Regular expression filter for string iterators
+ * @brief Abstract filter for iterators
* @author Marcus Boerger
* @version 1.1
* @since PHP 5.0
@@ -28,11 +28,9 @@
private $it;
/**
- * Constructs a filter around an iterator whose elemnts are strings.
- * If the given iterator is of type spl_sequence then its rewind()
- * method is called.
+ * Constructs a filter around another iterator.
*
- * @param it Object that implements at least spl_forward
+ * @param it Iterator to filter
*/
function __construct(Iterator $it) {
$this->it = $it;
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/regexiterator.inc?view=markup&rev=1.1
Index: php-src/ext/spl/internal/regexiterator.inc
+++ php-src/ext/spl/internal/regexiterator.inc
<?php
/** @file regexiterator.inc
* @ingroup SPL
* @brief class RegexIterator
* @author Marcus Boerger
* @date 2003 - 2006
*
* SPL - Standard PHP Library
*/
/**
* @brief Regular expression filter for iterators
* @author Marcus Boerger
* @version 1.0
* @since PHP 5.1
*
* This filter iterator assumes that the inner iterator
*/
class RegexIterator implements FilterIterator
{
const USE_KEY = 0x00000001;
private $regex; /**< the regular expression to match against */
private $flags; /**< special flags (USE_KEY) */
/**
* Constructs a regular expression filter around an iterator whose
* elemnts or keys are strings.
*
* @param it Object that implements at least
*/
function __construct(Iterator $it, $regex, $flags = 0) {
parent::__construct($it);
$this->regex = $regex;
$this->flags = $flags;
}
/**
* Match current or key against regular expression.
*
* @return whether this is a match
*/
function accept()
{
$subject = ($this->flags & self::USE_KEY) ? parent::key() :
parent::current();
return preg_match($this->regex, $subject);
}
}
?>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php