phing-filters

# Class: LineContainsRegexp Source Location: /filters/LineContainsRegexp.php
### Class Overview
    Reader
       |
       --FilterReader
          |
          --BaseFilterReader
             |
             --BaseParamFilterReader
                |
                --LineContainsRegexp
Filter which includes only those lines that contain the user-specified regular expression matching strings. #### Author(s): Yannick Lecaillez <yl@seasonfive.com> Hans Lellelid <hans@xmpl.org> #### Version: $Revision: 526 $ #### Copyright: © 2003 seasonfive. All rights reserved Implements interfaces: ChainableReader | ### Constants REGEXP_KEY | ### Methods chain createRegexp getRegexps read setRegexps
### Inherited Variables #### Class: BaseParamFilterReader BaseParamFilterReader::$_parameters #### Class: BaseFilterReader BaseFilterReader::$initialized BaseFilterReader::$project #### Class: FilterReader FilterReader::$in | ### Inherited Methods #### Class: BaseParamFilterReader BaseParamFilterReader::getParameters() BaseParamFilterReader::setParameters() #### Class: BaseFilterReader BaseFilterReader::__construct() Constructor used by Phing's introspection mechanism. BaseFilterReader::eof() Returns whether the end of file has been reached with input stream. BaseFilterReader::getInitialized() Returns the initialized status. BaseFilterReader::getProject() Returns the project this filter is part of. BaseFilterReader::log() Convenience method to support logging in filters. BaseFilterReader::read() Reads characters. BaseFilterReader::readLine() Reads a line of text ending with '\n' (or until the end of the stream). BaseFilterReader::setInitialized() Sets the initialized status. BaseFilterReader::setProject() Sets the project to work with. #### Class: FilterReader FilterReader::__construct() FilterReader::close() FilterReader::getResource() FilterReader::read() Read data from source. FilterReader::reset() FilterReader::setReader() FilterReader::skip() #### Class: Reader Reader::close() Close stream. Reader::getResource() Returns the filename, url, etc. that is being read from. Reader::mark() If supported, places a "marker" (like a bookmark) at current stream position. Reader::markSupported() Whether marking is supported. Reader::read() Read data from source. Reader::ready() Is stream ready for reading. Reader::reset() Reset the current position in stream to beginning or last mark (if supported). Reader::skip() Move stream position relative to current pos.
### Class Details [line 49] Filter which includes only those lines that contain the user-specified regular expression matching strings. Example:
Or:
This will fetch all those lines that contain the pattern foo #### Tags:
author: | Yannick Lecaillez <yl@seasonfive.com>
author: | Hans Lellelid <hans@xmpl.org>
version: | $Revision: 526 $
copyright: | © 2003 seasonfive. All rights reserved
see: | FilterReader
[ Top ] ### Class Methods ### method chain [line 153]
`object A chain( $reader)`
Creates a new LineContainsRegExp using the passed in Reader for instantiation. #### Tags:
return: | new filter based on this configuration, but filtering the specified reader
Implementation of: ChainableReader::chain() Returns a reader with the same configuration as this one, but filtering input from the specified reader. #### Parameters:
object A | $reader | Reader object providing the underlying stream. Must not be null .
[ Top ] ### method createRegexp [line 107]
`object regExp createRegexp( )`
Adds a regexp element. #### Tags:
return: | The regexp element added.
[ Top ] ### method getRegexps [line 139]
`array getRegexps( )`
Returns the array of regular expressions which must be contained within a line read from the original stream in order for it to match this filter. #### Tags:
return: | The array of regular expressions which must be contained within a line read from the original stream in order for it to match this filter. The returned object is "live" - in other words, changes made to the returned object are mirrored in the filter.
[ Top ] ### method read [line 67]
`mixed read( [ $len = null])`
Returns all lines in a buffer that contain specified strings. #### Tags:
return: | buffer, -1 on EOF
Overrides BaseFilterReader::read() (Reads characters.) #### Parameters:
| $len |
[ Top ] ### method setRegexps [line 121]
`void setRegexps( regexps $regexps)`
Sets the vector of regular expressions which must be contained within a line read from the original stream in order for it to match this filter. #### Parameters:
regexps | $regexps | An array of regular expressions which must be contained within a line in order for it to match in this filter. Must not be null .
[ Top ] ### Class Constants #### REGEXP_KEY = "regexp" [line 55] Parameter name for regular expression. [ Top ] Documentation generated on Mon, 19 Oct 2009 10:51:12 +0200 by phpDocumentor 1.4.3