[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'Masks' (#lazutils)

TMask

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The TMask class represents a mask and performs comparisons.

Declaration

Source position: masks.pas line 45

type TMask = class

public

  constructor Create();

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  function Matches();

  

Determines whether the specified file name matches the mask value.

  function MatchesWindowsMask();

  

Determines whether a filename matches the mask using Windows file system masks.

end;

Inheritance

TMask

  

The TMask class represents a mask and performs comparisons.

|

TObject

Description

A mask is a comparison pattern built using wildcards, sets and/or literal characters. The mask is limited to the single-byte code points in the UTF-8 encoding. Using multi-byte code points in TMask causes an EMaskError exception to be raised.

Each literal character must match a single character in the string. Case sensitivity requires the value moCaseSensitive in the options passed to the constructor.

A set starts with "[" and ends with "]". Each element of a set is a literal character and or a range. A range is defined as a first-to-last literal character string. One character of a set must match a single character in the string. A set [!...] matches if the character is not in the set. The option value moDisableSets passed to the constructor disables set processing and treats the brackets as literal characters.

Wildcards are the * and ? characters. An asterisk matches any number of characters. A question mark matches a single character.

For example: 'Hello world' matches to the mask 'H?ll[xoy] w*d'.

See also

EMaskError

  

Exception raised for an invalid character in TMask.

Masks Overview

  

Masks Overview.