FilterableStatement Struct Reference
A kind of sed Statement that can have 0, 1, or 2 filter criteria.
More...
#include <muSED.h>
List of all members.
Detailed Description
A kind of sed Statement that can have 0, 1, or 2 filter criteria.
With zero filter criteria, the statement is always executed. With one filter, the statement is only executed if the filter matches. With 2 filters, the statement is only executed on a range of lines that is defined by the first and second filters. That is, if the first filter has passed on this or some line before it and the second filter has NOT passed on some earlier line. That, is, the second filter defines the end of a group of lines. The statement on that line will be executed, but none after it.
Note that any statement that has filters, can have the logic of the filter range inverted. Here are some examples of filters:
s/fred/bill/g # unfiltered
10s/fred/bill/g # on line 10, replace fred with bill, globally
$p # only on the last line of the input, print the line
10,20p # print only lines 10 through 20, inclusive
10!p # print every line EXCEPT 10 (inverted logic case)
/^begin/,/^end/p # print only lines in a begin/end block
- Note:
- The handling of filter result inversion is not part of the filter class but part of the FilterableStatement class
Definition at line 510 of file muSED.h.
Constructor & Destructor Documentation
Member Function Documentation
return true if the patternBuffer, line number, and isLast_ flag in the specified context match the requirements of the filters.
- Parameters:
-
[in] | context | The runtime context in which to determine if the current statement, as defined both by the statement pointer and by line number information in the context, is active. |
[in] | statement | The statement about to be executed on the current line of input as defined by the line number and is last flag in the context. |
Note that the runtime context keeps track of the activation status of statements, by the statement pointer, based on the filters in a filterable statement. Whenever you have a range filter, the activate function manages the activation state.
Definition at line 316 of file muSED.cxx.
void adoptChild |
( |
Statement * |
newbie |
) |
[inherited] |
Take ownership of a new statement and schedule it for delete when *this is destructed.
Definition at line 444 of file muSED.h.
void clear |
( |
|
) |
[inherited] |
std::string debugPrefix |
( |
|
) |
const [inherited] |
static void debugPrint |
( |
Statement * |
p |
) |
[static, inherited] |
virtual std::string debugString |
( |
|
) |
const [virtual, inherited] |
std::string debugStringPrefix |
( |
|
) |
const [virtual] |
Member Data Documentation
The documentation for this struct was generated from the following files: