Sign in Join
FPDoc Onlineexperiment

TWindowsMaskUTF8 class

In unit Masks

Implements a class used to define and evaluate a mask expression using Windows file system mask conventions.

Declaration

pascal
TWindowsMaskUTF8 = class(TMask)

Inheritance

  1. TWindowsMaskUTF8
  2. TMask
  3. TMaskUTF8
  4. TMaskBase

Descends from it: TWindowsMask

Description

TWindowsMaskUTF8 is a TMask descendant which implements a class used for mask expressions using Windows file system conventions. It extends the ancestor class with support for a UTF-8-encoded Mask expression. The mask expression uses wildcards and other notation specific to Windows/DOS file systems, including:

'?'
Represents any single required character in a file or directory name. For instance, 'c?t' matches 'cat' and 'cut', but not 'coat' or 'cult'. An expression like 'cl??' would matches values like 'clap' and 'clot', but not 'clean' or 'clt'.
'*'
Matches any entries found in a directory. This includes files that have a file extension. Behaves the same as '*.*'.
'*.*'
Matches all entries in a directory. The file extension is optional. Please note that this notation is different than the behavior in TMaskUTF8 / TMask.
'*.ext'
Matches all entries which have a '.ext' file extension.
'file*
Matches all entries that start with 'file' and may contain any number of additional optional characters or an optional file extension. Matches 'file', 'filename' and 'filename.ext'.
'[]' (square brackets)
Represents a choice of characters that may represent a match on the file system. They are used in both set and range expressions. A set is expressed using notation like 'c[au]t'. This would match entries like 'cat' or 'cut', but not 'cot'. A range uses notation like 'g[a-f]z'. This would match values like 'gaz', 'gbz', and 'gcz'. It would not match 'ggz', 'gxz', or 'gz'.
'[!]'
Used to negate a set or range expression. It matches any character value which is NOT in the set or range.
'\' (Backslash)
The default escape character which forces the following character to be interpreted as a literal and not a wildcard. The escape character is configurable in the class instance using the EscapeChar property.

TWindowsMaskUTF8 provides an overridden Compile method which examines and converts the Mask expression into a list of op codes needed in Matches and MatchesWindowsMask. TWindowsMaskUTF8 re-implements the read and write access specifiers for the Mask property to use the FWindowsMask member for the property value.

See also

Properties

QuirkspublicContains the TWindowsQuirk enumeration values for file system quirks enabled in the class instance.

Methods

CompileOtherSpecialCharsprotectedGenerates MaskOpCodes for optional characters or groups in a Windows-specific mask expression.
IsSpecialCharprotectedReturns True if the specified character contains a Null character (#0) (ASCII NUL).
SplitFileNameExtensionprotectedSeparates the specified value into file name and extension values.
CreatepublicConstructor for the class instance.
CompilepublicExamines and converts the mask expression into a list of op codes.
MatchespublicIndicates whether the specified value is a match for the Mask expression.

Fields

fWindowsQuirkAllowedprotectedMember with the set of quirks enabled in the class instance,
fWindowsQuirkInUseprotectedMember with the set of quirks in use in the compiled mask expression.
fWindowsMaskprotectedMember with the Windows-specific mask expression for the class instance.

Inherited

From TMaskUTF8 (3)

CompareUTF8Sequences intfMatches Mask

From TMaskBase (16)

Add AutoReverseRange CaseSensitive DefaultSpecialChars EscapeChar Exception_IncompleteMask Exception_InternalError Exception_InvalidCharMask Exception_InvalidEscapeChar Exception_MissingCloseChar GROW_BY IncrementLastCounterBy MaskOpCodes PrepareCompile TMaskFailCause TMaskParsedCode

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.