From ac380781cd14863cccac78644f22a0530a2225fa Mon Sep 17 00:00:00 2001 From: Bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sat, 20 Nov 2021 13:21:15 +0100 Subject: [PATCH] LazUtils: Masks: re-arrange some definitions. No functional changes. --- components/lazutils/masks.pas | 57 +++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/components/lazutils/masks.pas b/components/lazutils/masks.pas index 4428567d0c..9707114bcf 100644 --- a/components/lazutils/masks.pas +++ b/components/lazutils/masks.pas @@ -59,6 +59,36 @@ type ); TMaskOpCodes=set of TMaskOpCode; + +const + AllMaskOpCodes=[mocAnyChar, + mocAnyCharOrNone, + mocAnyText, + mocRange, + mocSet, + mocNegateGroup, + mocEscapeChar]; + + + // Match [x] literally, not as a range. + // Leave out mocAnyCharOrNone, mocRange and mocSet. + MaskOpCodesDisableRange=[mocAnyChar, + mocAnyText, + mocNegateGroup, + mocEscapeChar]; + + // Interpret [?] as literal question mark instead of 0..1 chars wildcard. + // Disable backslash escaping characters like "\?". + // Leave out mocAnyCharOrNone and mocEscapeChar + MaskOpCodesNoEscape=[mocAnyChar, + mocAnyText, + mocRange, + mocSet, + mocNegateGroup]; + + DefaultMaskOpCodes=MaskOpCodesNoEscape; + + (* Windows mask works in a different mode than regular mask, it has too many quirks and corner cases inherited from CP/M, then adapted to DOS (8.3) file @@ -69,6 +99,7 @@ type ------- Quirks ------- *) +type TWindowsQuirk=(wqAnyExtension, // Anything*.* : ".*" is removed. wqFilenameEnd, // Anything??.abc : "?" matches 1 or 0 chars (except '.') // (Not the same as "Anything*.abc", but the same @@ -96,32 +127,6 @@ const wqEmptyIsAny, wqNoExtension]; - AllMaskOpCodes=[mocAnyChar, - mocAnyCharOrNone, - mocAnyText, - mocRange, - mocSet, - mocNegateGroup, - mocEscapeChar]; - - - // Match [x] literally, not as a range. - // Leave out mocAnyCharOrNone, mocRange and mocSet. - MaskOpCodesDisableRange=[mocAnyChar, - mocAnyText, - mocNegateGroup, - mocEscapeChar]; - - // Interpret [?] as literal question mark instead of 0..1 chars wildcard. - // Disable backslash escaping characters like "\?". - // Leave out mocAnyCharOrNone and mocEscapeChar - MaskOpCodesNoEscape=[mocAnyChar, - mocAnyText, - mocRange, - mocSet, - mocNegateGroup]; - - DefaultMaskOpCodes=MaskOpCodesNoEscape; type