<p> Sort a file before and/or after the file.
Examples:
<copy todir="build"> <fileset dir="input" includes="*.txt"/> <filterchain> <sortfilter/> </filterchain> </copy>
Sort all files *.txt
from src location and copy
them into build location. The lines of each file are sorted
in ascendant order comparing the lines.
<copy todir="build"> <fileset dir="input" includes="*.txt"/> <filterchain> <sortfilter reverse="true"/> </filterchain> </copy>
Sort all files *.txt
from src location into reverse
order and copy them into build location. If reverse parameter has
value true
(default value), then the output line of the files
will be in ascendant order.
author |
Siad.ardroumli siad.ardroumli@gmail.com |
---|---|
see | |
package |
phing.filters |
chain(\Reader $rdr) : \SortFilter
\SortFilter
a new filter based on this configuration, but filtering the specified reader
close()
throws |
if there is an error closing stream |
---|---|
eof() : boolean
boolean
getInitialized() : boolean
boolean
whether or not the filter is initialized
getParameters() : array
array
the parameters to be used by this filter
getProject() : object
object
The project this filter is part of
getResource() : string
This is critical for, e.g., ExpatParser's ability to know the filename that is throwing an ExpatParserException, etc.
string
initialize()
isReverse() : boolean
boolean
true
if the sorting process will be in reverse
order, otherwise the sorting process will be in ascendant order.
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
Message to log.
integer
Priority level.
mark()
A subsequent call to reset() will move stream position back to last marker (if supported).
markSupported() : boolean
boolean
read(integer $len = null)
If length is specified, then only that number of chars is read, otherwise stream is read until EOF.
integer
readLine() : string
The returned String retains the '\n'.
throws |
if the underlying reader throws one during reading |
---|---|
string
the line read, or null
if the end of the
stream has already been reached
ready() : boolean
boolean
reset()
setInitialized(boolean $initialized)
boolean
Whether or not the filter is initialized.
setParameters(array $parameters) : void
throws |
---|
array
Array of parameters to be used by this filter.
Should not be null
.
setProject(object|\Project $project)
setReverse(boolean $reverse)
boolean
Boolean representing reverse ordering process.
skip(integer $n)
integer
sort()
REVERSE_KEY :
reverse :
lines :
_parameters : array
var |
---|
array
initialized :
project :