MeVisLab Toolbox Reference
|
Class implementing the StringLineFilterFieldAddOn which manages fields for line based filtering of a text string. More...
#include <mlStringLineFilterFieldAddOn.h>
Public Types | |
enum | { NumFilters = 2 } |
The number of currently supported filter expressions. More... | |
![]() | |
enum | FieldChangeState { NoChange = 0 , StatusOnlyChange , RecalculationRequired } |
Describes the type of a field changes detected in handleFieldChanges(Field *field). More... | |
Public Member Functions | |
StringLineFilterFieldAddOn (FieldContainer &fieldContainerRef) | |
Constructor, setting the reference of the FieldContainer managing the fields. More... | |
void | addFields () override |
Add fields to field container of module. More... | |
void | handleFieldActivationChanges () override |
Do the activateAttachment-like stuff in this method. More... | |
FieldAddOnBase::FieldChangeState | handleFieldChanges (Field *field) override |
Handle field notifications. More... | |
void | filterString (const std::string &stringToBeFiltered) |
Update the filter results according to the new string stringToBeFiltered; the string is not copied nor stored. More... | |
![]() | |
FieldAddOnBase (FieldContainer &fieldContainerRef) | |
Constructor, setting the reference of the FieldContainer managing the fields. More... | |
virtual | ~FieldAddOnBase () |
Destructor. More... | |
FieldContainer & | getFieldContainer () |
Returns the referenced container. More... | |
const FieldContainer & | getFieldContainer () const |
Returns the referenced container. More... | |
std::vector< Field * > & | getFields () |
Return modification access to the list of managed fields, use at own risk! More... | |
const std::vector< Field * > & | getFields () const |
Return constant access to the list of managed fields! More... | |
virtual FieldChangeState | getMergedFieldChangeState (FieldChangeState state1, FieldChangeState state2) const |
Returns a FieldChangeState which best represents a merge of the two given states. More... | |
virtual bool | hasField (Field *field) const |
Returns true if the passed fieldPtr is in _fieldPointers, otherwise false. More... | |
Static Public Member Functions | |
static ReleaseToolsIO::StringVector | determineFilterLines (const std::string &inString, bool simplify) |
Searches lines in inStr which match a prefix expression followed somewhere later by a post fix expression and return the value between. More... | |
Protected Attributes | |
The managed fields. | |
BoolField * | _compressWhiteSpacesFld |
If true then all white spaces are replaced by spaces and multiple occurrences are compressed to single ones. More... | |
BoolField * | _useRegularExpressionFld [NumFilters] |
If disabled then the content of _firstExpressionFld is used as line start, otherwise it is interpreted as regular expression which must match the searched line. More... | |
StringField * | _firstExpressionFld [NumFilters] |
Expression which must match the line begin section before the desired value starts if _useRegularExpressionFld is off, otherwise it is the regular which must match the line. More... | |
StringField * | _lineEndFld [NumFilters] |
Expression which must match the line section after the desired value starts. More... | |
IntField * | _occurenceFld [NumFilters] |
Selects which matched line shall be used for output, 0=first, -1=last. More... | |
StringField * | _foundValue1Fld [NumFilters] |
The value found between firstExpression and lineEnd or empty if not found. More... | |
BoolField * | _foundValue1IsValidFld [NumFilters] |
True if a value between firstExpression and lineEnd was found, otherwise false. More... | |
StringField * | _foundValue2Fld [NumFilters] |
The second match value of a regular expression is valid, otherwise empty. More... | |
BoolField * | _foundValue2IsValidFld [NumFilters] |
True if a second match value from regular expression exists, otherwise false. More... | |
Additional Inherited Members | |
![]() | |
void | _addFieldPointer (Field *field) |
Helper routine to add a Field pointer to _fieldPointers, empty pointers and pointers added more than once will be handled fatally. More... | |
Class implementing the StringLineFilterFieldAddOn which manages fields for line based filtering of a text string.
Definition at line 28 of file mlStringLineFilterFieldAddOn.h.
anonymous enum |
The number of currently supported filter expressions.
Enumerator | |
---|---|
NumFilters |
Definition at line 35 of file mlStringLineFilterFieldAddOn.h.
|
inline |
Constructor, setting the reference of the FieldContainer managing the fields.
Definition at line 32 of file mlStringLineFilterFieldAddOn.h.
|
overridevirtual |
Add fields to field container of module.
Implements ml::FieldAddOnBase.
|
static |
Searches lines in inStr which match a prefix expression followed somewhere later by a post fix expression and return the value between.
inString | The string to be (perhaps compressed) and decomposed into lines. |
simplify | If true then all characters < ASCII 32 and white spaces except of line feed and carriage return are replaced by spaces and then multiple occurrences of spaces are compressed to single ones, or - if false - the string is left unchanged. |
void ml::StringLineFilterFieldAddOn::filterString | ( | const std::string & | stringToBeFiltered | ) |
Update the filter results according to the new string stringToBeFiltered; the string is not copied nor stored.
For updates always this routine must be called.
|
overridevirtual |
Do the activateAttachment-like stuff in this method.
Reimplemented from ml::FieldAddOnBase.
|
overridevirtual |
Handle field notifications.
If a call of filterString() because filter results need an update then FieldAddOnBase::RecalculationRequired is returned.
Reimplemented from ml::FieldAddOnBase.
|
protected |
If true then all white spaces are replaced by spaces and multiple occurrences are compressed to single ones.
Definition at line 71 of file mlStringLineFilterFieldAddOn.h.
|
protected |
Expression which must match the line begin section before the desired value starts if _useRegularExpressionFld is off, otherwise it is the regular which must match the line.
Definition at line 80 of file mlStringLineFilterFieldAddOn.h.
|
protected |
The value found between firstExpression and lineEnd or empty if not found.
Definition at line 89 of file mlStringLineFilterFieldAddOn.h.
|
protected |
True if a value between firstExpression and lineEnd was found, otherwise false.
Definition at line 92 of file mlStringLineFilterFieldAddOn.h.
|
protected |
The second match value of a regular expression is valid, otherwise empty.
Definition at line 95 of file mlStringLineFilterFieldAddOn.h.
|
protected |
True if a second match value from regular expression exists, otherwise false.
Definition at line 98 of file mlStringLineFilterFieldAddOn.h.
|
protected |
Expression which must match the line section after the desired value starts.
Definition at line 83 of file mlStringLineFilterFieldAddOn.h.
|
protected |
Selects which matched line shall be used for output, 0=first, -1=last.
Definition at line 86 of file mlStringLineFilterFieldAddOn.h.
|
protected |
If disabled then the content of _firstExpressionFld is used as line start, otherwise it is interpreted as regular expression which must match the searched line.
Definition at line 75 of file mlStringLineFilterFieldAddOn.h.