NameFilter is a string matching class which allows for both positive and negative matching. A filter is a sequence of independant regular expressions separated by semi-colons ';'. To include a semi-colon it may be quoted as in \;. Each expression can be prefixed by a plus '+' sign or a minus '-' sign to denote the expression is intended to include or exclude names. If neither a plus or minus sign is found include is the default. A given name is tested for inclusion before checking exclusions. Only names matching an include spec and not matching an exclude spec are deemed to match the filter. An empty filter matches any name.
More...
|
| | NameFilter (string filter) |
| | Construct an instance based on the filter expression passed.
|
| override string | ToString () |
| | Convert this filter to its string equivalent.
|
| bool | IsIncluded (string name) |
| | Test a value to see if it is included by the filter.
|
| bool | IsExcluded (string name) |
| | Test a value to see if it is excluded by the filter.
|
| bool | IsMatch (string name) |
| | Test a value to see if it matches the filter.
|
|
| static bool | IsValidExpression (string expression) |
| | Test a string to see if it is a valid regular expression.
|
| static bool | IsValidFilterExpression (string toTest) |
| | Test an expression to see if it is valid as a filter.
|
| static string[] | SplitQuoted (string original) |
| | Split a string into its component pieces.
|
|
| void | Compile () |
| | Compile this filter.
|
NameFilter is a string matching class which allows for both positive and negative matching. A filter is a sequence of independant regular expressions separated by semi-colons ';'. To include a semi-colon it may be quoted as in \;. Each expression can be prefixed by a plus '+' sign or a minus '-' sign to denote the expression is intended to include or exclude names. If neither a plus or minus sign is found include is the default. A given name is tested for inclusion before checking exclusions. Only names matching an include spec and not matching an exclude spec are deemed to match the filter. An empty filter matches any name.
The following expression includes all name ending in '.dat' with the exception of 'dummy.dat' "+\.dat$;-^dummy\.dat$"
◆ NameFilter()
| ICSharpCode.SharpZipLib.Core.NameFilter.NameFilter |
( |
string | filter | ) |
|
Construct an instance based on the filter expression passed.
- Parameters
-
| filter | The filter expression. |
◆ Compile()
| void ICSharpCode.SharpZipLib.Core.NameFilter.Compile |
( |
| ) |
|
|
private |
◆ IsExcluded()
| bool ICSharpCode.SharpZipLib.Core.NameFilter.IsExcluded |
( |
string | name | ) |
|
Test a value to see if it is excluded by the filter.
- Parameters
-
- Returns
- True if the value is excluded, false otherwise.
◆ IsIncluded()
| bool ICSharpCode.SharpZipLib.Core.NameFilter.IsIncluded |
( |
string | name | ) |
|
Test a value to see if it is included by the filter.
- Parameters
-
- Returns
- True if the value is included, false otherwise.
◆ IsMatch()
| bool ICSharpCode.SharpZipLib.Core.NameFilter.IsMatch |
( |
string | name | ) |
|
◆ IsValidExpression()
| bool ICSharpCode.SharpZipLib.Core.NameFilter.IsValidExpression |
( |
string | expression | ) |
|
|
static |
Test a string to see if it is a valid regular expression.
- Parameters
-
| expression | The expression to test. |
- Returns
- True if expression is a valid System.Text.RegularExpressions.Regex false otherwise.
◆ IsValidFilterExpression()
| bool ICSharpCode.SharpZipLib.Core.NameFilter.IsValidFilterExpression |
( |
string | toTest | ) |
|
|
static |
Test an expression to see if it is valid as a filter.
- Parameters
-
| toTest | The filter expression to test. |
- Returns
- True if the expression is valid, false otherwise.
◆ SplitQuoted()
| string[] ICSharpCode.SharpZipLib.Core.NameFilter.SplitQuoted |
( |
string | original | ) |
|
|
static |
Split a string into its component pieces.
- Parameters
-
| original | The original string |
- Returns
- Returns an array of T:System.String values containing the individual filter elements.
◆ ToString()
| override string ICSharpCode.SharpZipLib.Core.NameFilter.ToString |
( |
| ) |
|
Convert this filter to its string equivalent.
- Returns
- The string equivalent for this filter.
◆ exclusions_
| ArrayList ICSharpCode.SharpZipLib.Core.NameFilter.exclusions_ |
|
private |
◆ filter_
| string ICSharpCode.SharpZipLib.Core.NameFilter.filter_ |
|
private |
◆ inclusions_
| ArrayList ICSharpCode.SharpZipLib.Core.NameFilter.inclusions_ |
|
private |
The documentation for this class was generated from the following file: