phing-filters
[ class tree: phing-filters ] [ index: phing-filters ] [ all elements ]

Class: BaseFilterReader

Source Location: /filters/BaseFilterReader.php

Class Overview

Reader
   |
   --FilterReader
      |
      --BaseFilterReader

Base class for core filter readers.


Author(s):

Version:

  • $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

Variables

Methods


Child classes:

StripPhpComments
This is a Php comment and string stripper reader that filters those lexical tokens out for purposes of simple Php parsing.
ExpandProperties
Expands Phing Properties, if any, in the data.
BaseParamFilterReader
Base class for core filter readers.
StripWhitespace
Strips whitespace from [php] files using PHP stripwhitespace() method.
ReplaceRegexp
Performs a regexp find/replace on stream.

Inherited Variables

Inherited Methods

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 36]
Base class for core filter readers.



Tags:

author:  <href="mailto:yl@seasonfive.com" a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
version:  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $
see:  FilterReader
access:  public


[ Top ]


Class Variables

$initialized =  false

[line 39]

Have the parameters passed been interpreted?



Tags:

access:  protected

Type:   mixed


[ Top ]

$project =  null

[line 42]

The Phing project this filter is part of.



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 54]

BaseFilterReader __construct( [Reader $in = null])

Constructor used by Phing's introspection mechanism.

The original filter reader is only used for chaining purposes, never for filtering purposes (and indeed it would be useless for filtering purposes, as it has no real data to filter). ChainedReaderHelper uses this placeholder instance to create a chain of real filters.




Overrides FilterReader::__construct() (parent method not documented)

Parameters:

Reader   $in  

[ Top ]

method eof [line 141]

boolean eof( )

Returns whether the end of file has been reached with input stream.



[ Top ]

method getInitialized [line 67]

boolean getInitialized( )

Returns the initialized status.



Tags:

return:  whether or not the filter is initialized


[ Top ]

method getProject [line 96]

object The getProject( )

Returns the project this filter is part of.



Tags:

return:  project this filter is part of


[ Top ]

method log [line 150]

void log( string $msg, [int $level = Project::MSG_INFO])

Convenience method to support logging in filters.



Parameters:

string   $msg   Message to log.
int   $level   Priority level.

[ Top ]

method read [line 111]

Characters read( [off $len = null], len 1)

Reads characters.



Tags:

return:  read, or -1 if the end of the stream has been reached
throws:  IOException If an I/O error occurs


Overridden in child classes as:

StripPhpComments::read()
Returns the stream without Php comments.
ExpandProperties::read()
Returns the filtered stream.
XincludeFilter::read()
Reads stream, applies XSLT and returns resulting stream.
TailFilter::read()
Returns the last n lines of a file.
TranslateGettext::read()
Returns the filtered stream.
TabToSpaces::read()
Returns stream after converting tabs to the specified number of spaces.
LineContainsRegexp::read()
Returns all lines in a buffer that contain specified strings.
HeadFilter::read()
Returns first n lines of stream.
LineContains::read()
Returns all lines in a buffer that contain specified strings.
ReplaceTokensWithFile::read()
Returns stream with tokens having been replaced with appropriate values.
StripLineComments::read()
Returns stream only including lines from the original stream which don't start with any of the specified comment prefixes.
PrefixLines::read()
Adds a prefix to each line of input stream and returns resulting stream.
StripLineBreaks::read()
Returns the filtered stream, only including characters not in the set of line-breaking characters.
XsltFilter::read()
Reads stream, applies XSLT and returns resulting stream.
ReplaceTokens::read()
Returns stream with tokens having been replaced with appropriate values.
TidyFilter::read()
Reads input and returns Tidy-filtered output.
StripWhitespace::read()
Returns the stream without Php comments and whitespace.
ReplaceRegexp::read()
Returns the filtered stream.

Overrides FilterReader::read() (Read data from source.)

Parameters:

len   1   Maximum number of characters to read.
off   $len   Offset at which to start storing characters.

[ Top ]

method readLine [line 125]

the readLine( )

Reads a line of text ending with '\n' (or until the end of the stream).

The returned String retains the '\n'.




Tags:

return:  line read, or
  1. null
if the end of the
throws:  IOException if the underlying reader throws one during reading


[ Top ]

method setInitialized [line 76]

void setInitialized( boolean $initialized)

Sets the initialized status.



Parameters:

boolean   $initialized   Whether or not the filter is initialized.

[ Top ]

method setProject [line 86]

void setProject( $project)

Sets the project to work with.



Parameters:

object   $project   The project this filter is part of. Should not be
  1. null
.

[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:50:22 +0200 by phpDocumentor 1.4.3