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

TWindowsMaskUTF8

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

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

Declaration

Source position: masks.pas line 266

type TWindowsMaskUTF8 = class(TMask)

protected

  fWindowsQuirkAllowed: TWindowsQuirks;

  

Member with the set of quirks enabled in the class instance,

  fWindowsQuirkInUse: TWindowsQuirks;

  

Member with the set of quirks in use in the compiled mask expression.

  fWindowsMask: string;

  

Member with the Windows-specific mask expression for the class instance.

  procedure CompileOtherSpecialChars; override;

  

Generates MaskOpCodes for optional characters or groups in a Windows-specific mask expression.

  function IsSpecialChar(); override;

  

Returns True if the specified character contains a Null character (#0) (ASCII NUL).

  class procedure SplitFileNameExtension();

  

Separates the specified value into file name and extension values.

public

  constructor Create();

  

Constructor for the class instance.

  procedure Compile; override;

  

Examines and converts the mask expression into a list of op codes.

  function Matches(); override;

  

Indicates whether the specified value is a match for the Mask expression.

  property Quirks: TWindowsQuirks; [rw]

  

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

end;

Inheritance

TWindowsMaskUTF8

  

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

|

TMask

  

The TMask class represents a mask expression and performs comparisons.

|

TMaskUTF8

  

Implements a class used to define, evaluate, and compare a mask expression using UNIX file system mask conventions.

|

TMaskBase

  

Implements the base class used to define and evaluate a mask expression.

|

TObject

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

TMaskUTF8.Mask

  

Mask expression used to match files or directories in the class instance.

TMaskBase

  

Implements the base class used to define and evaluate a mask expression.

TMask

  

The TMask class represents a mask expression and performs comparisons.

TWindowsMask

  

Implements the class type used to evaluate and compare Windows-specific mask expressions.

Masks Overview

  

Masks Overview.


Version 4.0 Generated 2025-05-03 Home