classes/phing/filters/PrefixLines.php

\PrefixLines

Attaches a prefix to every line.

Example:

Or:


 
Extends from
\BaseParamFilterReader
Implements
\ChainableReader
see
\FilterReader
access
public
author
Yannick Lecaillez
author
hans lellelid, hans@velum.net
copyright
© 2003 seasonfive. All rights reserved
package
phing.filters
version
$Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

Constants

Constantstring  PREFIX_KEY = 'lines'

Parameter name for the prefix.

string

Properties

Propertyprivatestring  $_prefix= 'null'

The prefix to be used.

Default valuenullDetails
Type
string

Methods

methodprivate  _initialize( ) :
Initializes the prefix if it is available from the parameters.
methodpublic  chain( object $reader ) : object
Creates a new PrefixLines filter using the passed in Reader for instantiation.
Parameters
Name Type Description
$reader object

A Reader object providing the underlying stream. Must not be null.

Returns
Type Description
object
methodpublic  getPrefix( ) : string
Returns the prefix which will be added at the start of each input line.
Returns
Type Description
string
methodpublic  read(  $len = null ) : mixed
Adds a prefix to each line of input stream and returns resulting stream.
Parameters
Name Type Description
$len
Returns
Type Description
mixed
methodpublic  setPrefix( string $prefix ) :
Sets the prefix to add at the start of each input line.
Parameters
Name Type Description
$prefix string

The prefix to add at the start of each input line. May be null, in which case no prefix is added.

Documentation was generated by DocBlox 0.13.1.