C# Class ICSharpCode.SharpZipLib.Core.NameFilter

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 ';' 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.
Show file Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method Description
IsExcluded ( string name ) : bool

Test a value to see if it is excluded by the filter.

IsIncluded ( string name ) : bool

Test a value to see if it is included by the filter.

IsMatch ( string name ) : bool

Test a value to see if it matches the filter.

IsValidExpression ( string expression ) : bool

Test a string to see if it is a valid regular expression.

IsValidFilterExpression ( string toTest ) : bool

Test an expression to see if it is valid as a filter.

NameFilter ( string filter ) : System

Construct an instance based on the filter expression passed

SplitQuoted ( string original ) : string[]

Split a string into its component pieces

ToString ( ) : string

Convert this filter to its string equivalent.

Private Methods

Method Description
Compile ( ) : void

Compile this filter.

Method Details

IsExcluded() public method

Test a value to see if it is excluded by the filter.
public IsExcluded ( string name ) : bool
name string The value to test.
return bool

IsIncluded() public method

Test a value to see if it is included by the filter.
public IsIncluded ( string name ) : bool
name string The value to test.
return bool

IsMatch() public method

Test a value to see if it matches the filter.
public IsMatch ( string name ) : bool
name string The value to test.
return bool

IsValidExpression() public static method

Test a string to see if it is a valid regular expression.
public static IsValidExpression ( string expression ) : bool
expression string The expression to test.
return bool

IsValidFilterExpression() public static method

Test an expression to see if it is valid as a filter.
public static IsValidFilterExpression ( string toTest ) : bool
toTest string The filter expression to test.
return bool

NameFilter() public method

Construct an instance based on the filter expression passed
public NameFilter ( string filter ) : System
filter string The filter expression.
return System

SplitQuoted() public static method

Split a string into its component pieces
public static SplitQuoted ( string original ) : string[]
original string The original string
return string[]

ToString() public method

Convert this filter to its string equivalent.
public ToString ( ) : string
return string