Sign in Join
FPDoc Onlineexperiment

Masks unit

Contains classes for matching file names to file masks.

masks.pas contains classes, types, and routines used implement file and directory masks. Masks are patterns used to match file names found on the local file system. Support is provided for both UNIX- and Windows-style masks. The unit includes utility functions to compare one or more file names to a given mask, including: MatchesMask, MatchesWindowsMask, MatchesMaskList, and MatchesWindowsMaskList.

It is fast and optimized, and fully supports Unicode. Also supports DOS/Windows compatible masks which behave differently from standard masks.

masks.pas is part of the LazUtils package.

Author: José Mejuto

Changes and improvements by: Juha Manninen and Bart Broersma.

Classes and records

EMaskErrorclassException raised for an invalid character in TMask.
TMaskclassThe TMask class represents a mask expression and performs comparisons.
TMaskBaseclassImplements the base class used to define and evaluate a mask expression.
TMaskListclassImplements a list for mask class instances.
TMaskUTF8classImplements a class used to define, evaluate, and compare a mask expression using UNIX file system mask conventions.
TParseStringListclassParses text into a list of strings using a specified line separator.
TWindowsMaskclassImplements the class type used to evaluate and compare Windows-specific mask expressions.
TWindowsMaskListclassImplements a list for mask class instances which support Windows-specific file masks.
TWindowsMaskUTF8classImplements a class used to define and evaluate a mask expression using Windows file system mask conventions.

Procedures and functions

DbgSfunctionGets a string with the value(s) for the specified type. Used to format debugger messages.
MatchesMaskfunctionIndicates whether the file name matches the specified mask.
MatchesMaskListfunctionDetermine whether the specified file name matches at least one of the specified masks.
MatchesWindowsMaskfunctionIndicates whether the file name matches the specified Windows-style file system mask.
MatchesWindowsMaskListfunctionDetermine whether the specified file name matches at least one of the specified Windows-specific masks.

Types

TMaskClasstypeClass type used to create new instances of the TMaskUtf8 type.
TMaskListClasstypeNot used in the current LazUtils implementation.
TMaskOpCodeenumerationRepresents operations needed for an entry in a mask specification.
TMaskOpCodessetSet type used to store values from the TMaskOpcode enumeration.
TMaskOptionenumerationContains options which can be enabled or disabled in TMask comparisons.
TMaskOptionssetSet type used to store values from the TMaskOption enumeration.
TWindowsQuirkenumerationRepresents types of Windows-specific quirks for file and directory masks.
TWindowsQuirkssetSet type used to store values from the TWindowsQuirk enumeration.

Constants

AllMaskOpCodesconstantSet with all of the mask op codes values.
AllWindowsQuirksconstantSets type with all of the Windows-specific quirk values.
DefaultMaskOpCodesconstantContains the default op code values used for mask class instances.
DefaultWindowsQuirksconstantSet with the default Windows-specific quirk values.
MaskOpCodesDisableRangeconstantContains the set of op codes allowed when sets and ranges are disabled in mask expressions.
MaskOpCodesNoEscapeconstantContains op codes enabled when escape characters and single character wildcards are not used.

Uses

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