[Overview][Constants][Types][Classes][Procedures and functions][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Implements the base class used to define and evaluate a mask expression.
Source position: masks.pas line 140
type TMaskBase = class |
||
protected |
||
Type |
||
TMaskParsedCode = ( |
|
Represents op codes found when parsing / compiling a mask expression. |
Literal = 0, |
|
Op code for a literal value in a compiled mask expression. |
Range = 1, |
|
Op code for a range declared in a compiled mask expression. |
Negate = 2, |
|
Op code to exclude a range or set declared in a compiled mask expression. |
AnyChar = 3, |
|
Op code to match any single character in a compiled mask expression. The character is required. |
AnyCharOrNone = 4, |
|
Op code to match any single character in a compiled mask expression. The character is optional. |
AnyCharToNext = 5, |
|
Op code to match any number of characters in a compiled mask expression. On failure, the match is restarted at the next position and continues until the mask is completed or all matching values are used. |
OptionalChar = 6, |
|
Op code to match a single optional character value in the compiled mask expression. |
CharsGroupBegin = 10, |
|
Op code for the '[' character which starts an optional range or set in a compiled mask expression. |
CharsGroupEnd = 11 |
|
Op code for the ']' character which ends an optional range or set in a compiled mask expression. |
); |
||
TMaskFailCause = ( |
|
Represents success or failure conditions when handling mask characters. |
mfcSuccess, |
|
The mask was examined and a match was found. |
mfcMatchStringExhausted, |
|
Characters in a compared value were exhausted before a match was found. |
mfcMaskExhausted, |
|
Values in a mask expression were exhausted before a match was found. |
mfcMaskNotMatch, |
|
The compared value is not a match for a given mask expression. |
mfcUnexpectedEnd |
|
Default error condition when an invalid op code is found for a mask expression. |
); |
||
Const |
||
GROW_BY = 100 |
|
Number bytes used to grow the storage for op codes in a compiled mask expression. |
DefaultSpecialChars = ['*', '?', '['] |
||
procedure Add(); |
|
Adds one or more mask op codes found in the compiled mask expression. |
procedure IncrementLastCounterBy(); |
|
Moves the internal counter for a specified op code when processing a range expression. |
fCaseSensitive: Boolean; |
|
Member with the case sensitivity settings for a mask expression. |
fAutoReverseRange: Boolean; |
|
Member with the value for the AutoReverseRange property. |
fMaskIsCompiled: Boolean; |
|
Member which indicates if the mask expression has been compiled. |
|
Member which stores the op codes needed to evaluate the mask expression and compare specified values. |
|
|
Member with the current offset an op code for the compiled mask expression. |
|
|
Member with the allocated storage for the compiled mask expression. |
|
|
Member with the ordinal position represented in cMaskCompiledIndex. |
|
|
Member with the last position in the mask expression where an op code can be applied. |
|
|
Member with the last position in a compared value that can used to match the mask expression. |
|
|
Member with the minimum number of bytes for a literal character (normally 1). |
|
|
Member with the maximum number of bytes for a literal character (normally 4 for UTF-8 codepoints). |
|
|
Member with the op code identifiers allowed for the mask expression. |
|
|
Member with the escape character for the mask expression. An escape character forces the next mask character to be treated as a literal and not a wildcard. |
|
procedure PrepareCompile; |
|
Resets values in internal members used in the implementation. |
class procedure Exception_InvalidCharMask(); |
|
Raises an exception when the specified mask character or offset is invalid. |
class procedure Exception_MissingCloseChar(); |
|
Raises an EMaskError exception when the closing ']' character is omitted from a set or range expression. |
class procedure Exception_IncompleteMask; |
|
Raises an EMaskError exception when escaped characters in a set is enabled, but range processing has not been enabled. |
class procedure Exception_InvalidEscapeChar; |
|
Raises an EMaskError exception when an invalid value is assigned to the EscapeChar property. |
procedure Exception_InternalError; |
|
Raises an EMaskError exception when a parsed op code does not match an expected value in the mask expression. |
public |
||
constructor Create(); |
|
Constructor for the class instance. |
property CaseSensitive: Boolean; [rw] |
|
Indicates if the mask expression is case sensitive. |
property AutoReverseRange: Boolean; [rw] |
|
Indicates if a range expression is automatically reversed when the starting value is larger than the ending value. |
property EscapeChar: Char; [rw] |
|
Contains the character used to escape the following character in a mask expression. |
property MaskOpCodes: TMaskOpCodes; [rw] |
|
Contains the set of mask op codes enabled for the class instance. |
end; |
|
Implements the base class used to define and evaluate a mask expression. |
|
| | ||
TObject |
TMaskBase provides the framework or API used to examine and handle a mask expression. It provides member fields used to store the compiled op codes for the mask expression as well other state information. Methods are provides to raise exceptions for specific mask error conditions. Properties are also implemented to represent the case sensitivity, escape character, range handling, and op codes enabled for a mask expression.
Please note that TMaskBase does not capture, compile or store the mask expression. Those actions are performed in a descendent class.
|
Implements a class used to define, evaluate, and compare a mask expression using UNIX file system mask conventions. |
|
|
The TMask class represents a mask expression and performs comparisons. |
|
|
Implements a class used to define and evaluate a mask expression using Windows file system mask conventions. |
|
|
Implements the class type used to evaluate and compare Windows-specific mask expressions. |
Version 4.0 | Generated 2025-05-03 | Home |