# classes/phing/filters/util/ChainReaderHelper.php

## \ChainReaderHelper
jump to top

Process a FilterReader chain.

Here, the interesting method is 'getAssembledReader'. The purpose of this one is to create a simple Reader object which apply all filters on another primary Reader object.

For example : In copyFile (phing.util.FileUtils) the primary Reader is a FileReader object (more accuratly, a BufferedReader) previously setted for the source file to copy. So, consider this filterchain :

    <filterchain>
       <stripphpcomments />
       <linecontains>
           <contains value="foo">
       </linecontains>
     <tabtospaces tablength="8" />

</filterchain>

getAssembledReader will return a Reader object wich read on each of these filters. Something like this : ('->' = 'which read data from') :

[TABTOSPACES] -> [LINECONTAINS] -> [STRIPPHPCOMMENTS] -> [FILEREADER] (primary reader)

So, getAssembledReader will return the TABTOSPACES Reader object. Then each read done with this Reader object will follow this path.

Hope this explanation is clear :)

TODO: Implement the classPath feature.

access
  public
author
  Yannick Lecaillez
package
  phing.filters.util
version
  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

### Properties

`$bufferSize= '8192'`

The site of the buffer to be used.

Default value `8192` Details

Type

`$filterChains= 'array'`

Chain of filters

Default value `array` Details

Type

`$primaryReader= 'null'`

Primary reader to wich the reader chain is to be attached

Default value `null` Details

Type

`$project= ''`

The Phing project

Details

Type

### Methods

`getAssembledReader( ) :`
`getProject( ) :`
`setBufferSize( $size ) :`
Parameters

Name | Type | Description
--- | --- | ---
$size |  |

`setFilterChains( $fchain ) :`
Parameters

Name | Type | Description
--- | --- | ---
$fchain |  |

`setPrimaryReader( $reader ) :`
Parameters

Name | Type | Description
--- | --- | ---
$reader |  |

`setProject( $project ) :`
Parameters

Name | Type | Description
--- | --- | ---
$project |  |

Documentation was generated by DocBlox 0.13.1.