Back to index

php5  5.3.10
keyfilter.inc
Go to the documentation of this file.
00001 <?php
00002 
00022 class KeyFilter extends FilterIterator
00023 {
00025        private $regex;
00026 
00035        function __construct(Iterator $it, $regex)
00036        {
00037               parent::__construct($it);
00038               $this->regex = $regex;
00039        }
00040 
00043        function accept()
00044        {
00045               return ereg($this->regex, $this->getInnerIterator()->key());
00046        }
00047        
00050        function getRegex()
00051        {
00052               return $this->regex;
00053        }
00054 
00058        protected function __clone()
00059        {
00060               // disallow clone 
00061        }
00062 }
00063 
00064 ?>