Selector that filters files based on their size.
It provides support for gathering the parameters together as well as for assigning an error message and throwing a build exception if an error is detected.
author |
Hans Lellelid hans@xmpl.org (Phing) |
---|---|
author |
Bruce Atherton bruce@callenish.com (Ant) |
package |
phing.types.selectors |
circularReference() : \BuildException
dieOnCircularReference( &$stk, \Project $p) : void
If one is included, throw a BuildException created by circularReference
This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.
The general contract of this method is that it shouldn't do anything if checked is true and set it to true on exit.
throws |
---|
\Project
getCheckedRef( $requiredClass, $dataTypeName) : mixed
throws |
---|
mixed
getDescription()
retujrn |
string |
---|---|
getError() : string
string
the error condition
getParameters() : array
array
the set of parameters defined for this selector
getProject() : \Project
isReference() : boolean
boolean
isSelected(\PhingFile $basedir, string $filename, \PhingFile $file) : boolean
{@inheritdoc}
string
The name of the file to check
boolean
whether the file should be selected or not
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
The message to be logged.
integer
The message's priority at this message should have
noChildrenAllowed() : \BuildException
parsingComplete() : void
{@inheritdoc}
pushAndInvokeCircularReferenceCheck(\DataType $dt, &$stk, \Project $p)
setDescription(string $desc) : void
string
setError(string $msg) : void
string
The error message any BuildException should throw.
setParameters(array $parameters) : mixed|void
array
the complete set of parameters for this selector
mixed|void
setProject(\Project $project) : void
setRefid(\Reference $r) : void
Subclasses may need to check whether any other attributes have been set as well or child elements have been created and thus override this method. if they do they must call parent::setRefid()
\Reference
setUnits(array $units) : void
To get around this complexity, a number of standards bodies have proposed the 2^10 standard, and at least one has adopted it. But we are still left with a populace that isn't clear on how capitalization should work.
We therefore ignore capitalization as much as possible. Completely mixed case is not possible, but all upper and lower forms are accepted for all long and short forms. Since we have no need to work with the 0.001 case, this practice works here.
This function translates all the long and short forms that a unit prefix can occur in and translates them into a single multiplier.
array
The units to compare the size to.
setValue(integer $size) : void
This will be further modified by the multiplier to get an actual size limit.
integer
the size to select against expressed in units
setWhen(array $cmp) : void
array
The comparison to perform, an EnumeratedAttribute
tooManyAttributes() : \BuildException
toString() : string
string
validate()
throws | |
---|---|
verifySettings()
SIZE_KEY
UNITS_KEY
WHEN_KEY
size : integer
var |
---|
integer
multiplier : integer
var |
---|
integer
sizelimit : integer
var |
---|
integer
cmp : integer
var |
---|
integer
sizeComparisons : array
var |
---|
array
byteUnits : array
var |
---|
array
parameters :
errmsg : string
var |
---|
string
description : string
var |
---|
string
checked : boolean
Subclasses are responsible for setting this value to false if we'd need to investigate this condition (usually because a child element has been added that is a subclass of DataType).
var |
---|
boolean
project : \Project