phing-filters

# Class: LineContains Source Location: /filters/LineContains.php
### Class Overview
    Reader
       |
       --FilterReader
          |
          --BaseFilterReader
             |
             --BaseParamFilterReader
                |
                --LineContains
Filter which includes only those lines that contain all the user-specified strings. #### Author(s): Yannick Lecaillez <yl@seasonfive.com> Hans Lellelid <hans@velum.net> #### Version: $Revision: 557 $ #### Copyright: © 2003 seasonfive. All rights reserved Implements interfaces: ChainableReader | ### Constants CONTAINS_KEY | ### Methods chain createContains getContains read readChar setContains
### 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 54] Filter which includes only those lines that contain all the user-specified strings. Example:
Or:
This will include only those lines that contain foo and bar . #### Tags:
author: | Yannick Lecaillez <yl@seasonfive.com>
author: | Hans Lellelid <hans@velum.net>
version: | $Revision: 557 $
copyright: | © 2003 seasonfive. All rights reserved
see: | PhingFilterReader
[ Top ] ### Class Methods ### method chain [line 206]
`object A chain( $reader)`
Creates a new LineContains 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 createContains [line 161]
`Contains createContains( )`
Adds a <contains> nested element. #### Tags:
return: | The contains element added. Must not be null .
[ Top ] ### method getContains [line 192]
`array getContains( )`
Returns the vector of words 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 words 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 78]
`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 readChar [line 121]
`the readChar( )`
[Deprecated. For reference only, used to be read() method.] Returns the next character in the filtered stream, only including lines from the original stream which contain all of the specified words. #### Tags:
return: | next character in the resulting stream, or -1 if the end of the resulting stream has been reached
exception: | IOException if the underlying stream throws an IOException during reading
[ Top ] ### method setContains [line 174]
`void setContains( array $contains)`
Sets the array of words which must be contained within a line read from the original stream in order for it to match this filter. #### Parameters:
array | $contains | An array of words which must be contained within a line in order for it to match in this filter. Must not be
[ Top ] ### Class Constants #### CONTAINS_KEY = "contains" [line 60] The parameter name for the string to match on. [ Top ] Documentation generated on Mon, 19 Oct 2009 10:51:11 +0200 by phpDocumentor 1.4.3