Bart
6cd54a131e
LazUtils: Masks: start factoring out CompileAnyCharOrNone (later to be extended and uses by TWindowsMask.CompileOtherSpecialChars).
...
Code is unused for now.
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:39:31 +01:00
Bart
b68d0b882a
LazUtils: Masks: only conditionally compile TMaskUtf8.DumpMaskColpiled.
...
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:16:34 +01:00
Bart
3679a90e37
LazUtils: Masks: rename ReverseRange to AddRangeReverse.
...
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:06:49 +01:00
Bart
ef974cb238
LazUtils: Masks: suppress a hint.
...
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 19:02:50 +01:00
Bart
aae437d605
LazUtils: Masks: disallow #0 in the user supplied mask for TWindowsMask.
...
Note: code contains writeln's, so it will crash if no console is available.
2021-11-09 18:55:15 +01:00
Bart
cd4ce74027
LazUtils: Masks: cleanup.
...
Note: code contains writeln's, so it will crash if no console is available.
2021-11-08 22:54:00 +01:00
Bart
0f77d36d93
LazUtils: Test: TestMasks: fix tests after #3c6c852b (mocAnyCharOrNone not enabled by default anymore).
2021-11-08 22:49:54 +01:00
Bart
3c6c852bc1
LazUtils: Masks: revert most of #78148e42 since wqFileNameEnd no longer requires mocAnyCharOrNone.
...
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 22:43:20 +01:00
Bart
09dcf62106
LazUtils: Masks: use TWindowsMaskUtf8.CompileSpecialChars to handle the wqFileNameEnd quirk.
...
This now no longer depends on mocAnyCharOrNone, so do not enforce that any longer if wqFileNameEnd is enabled.
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 22:31:32 +01:00
Bart
a0d01a5922
LazUtils: Masks: make CompileSpecialChars and CompileEscapeCharPlusLiteral methods of TMaskUtf8 instead of nested procs.
...
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 22:07:30 +01:00
Bart
e76d29f85b
LazUtils: Masks: simplify TWindowsMaskUtf8.CompileOtherSpecialChars.
...
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-08 19:06:36 +01:00
Bart
0be73871b5
LazUtils: Masks: implement a crude TWindowsMaskUtf8.CompileOtherSpecialChars to handle #0 's.
...
Probably this could be sped up by counting the #0 's and adding them all at once?
Note: code contains debug writeln's, so it will crash if no console is available.
2021-11-07 23:17:47 +01:00
Bart
50811399e4
LazUtils: Masks: lay out the infrastructure to handle other special characters in the mask.
...
Will be used for the handling of wqFileNameEnd in TWindowsMaskUTF8.
2021-11-07 18:11:48 +01:00
Bart
2f07ee8783
LazUtils: Masks: factor out the handling of escaped literals and of special chars in TMaskUtf8.Compile.
...
The logic of the main while loop becomes more clear (it spanned too much screens).
Also add a comment about possible dead code in HandleSpecialChar.
2021-11-06 15:39:51 +01:00
Bart
7471fd4635
LazUtils: FileUtil: fix memory leak (created a masklist twice).
2021-11-06 15:00:14 +01:00
Bart
91bde5f636
LazUtils: Masks: fix potential range error in TMaskUtf8.Compile.
2021-11-06 13:39:46 +01:00
Bart
5dff088116
LazUtils: Masks: replace some lines of code with a single AddLiteral.
2021-11-06 13:32:38 +01:00
Bart
f4996fb470
LazUtils: Masks: fix spelling errors in a comment.
2021-11-05 18:32:15 +01:00
Maxim Ganetsky
bdf1cfcd96
Lazutils, tests: correctly set unit output directory and executable filename for TestLazStorageMem project, also made it DPI aware
2021-11-04 01:02:02 +03:00
Maxim Ganetsky
095ca93f94
Lazutils, tests: correctly set unit output directory and executable filename for TestMasks project, also made it DPI aware
2021-11-04 00:53:21 +03:00
Bart
2ce594217a
LazUtils: Masks: fix TWindowsMaskUtf8.Matches not calling Compile.
...
Now all tests in the testsuite are OK again.
2021-11-03 20:04:51 +01:00
Bart
d29512ae6b
LazUtils: TestMasks: adjust test after changes in #78148e42.
2021-11-03 19:30:39 +01:00
Bart
3d0b1cc901
LazUtils: Masks: TMask.Compile: do not call CompileRange when mocAnyCharOrNone is enabled, but mocRange and mocSet are disabled,
...
in taht case '[a' is a valid mask (of 2 literals).
2021-11-03 19:14:22 +01:00
Bart
a9c7e4196b
LazUtils: Masks: fix a deprecated message.
2021-11-03 19:07:31 +01:00
Bart
78148e42f5
LazUtils: Masks: since wqFilenameEnd (internally) requires mocAnyCharOrNone, include the latter in MaskOpCodes if wqFilenameEnd is used.
...
Also include mocAnyCharOrNone in DefaultMaskOpcodes, otherwise the default behaviour between TMask and TWindowsMask
for a mask containing [?] would differ.
Add comments to the long and winding if then else blocks in CompileRange
2021-11-03 19:05:45 +01:00
Bart
a22cac6853
LazUtils: fix not adding '[' as a literal to the internal mask if ranges and sets are disabled:
...
MatchesMask('a[b]c','a[b]c',False,MaskOpCodesDisableRange) now correctly evaluates to True.
2021-11-02 23:09:00 +01:00
Juha
3c7586c0f8
LazUtils: Fix compilation of the unit test project for TMask.
2021-11-02 21:13:37 +02:00
Bart
0ed2398c32
LazUtils: Masks: remove commented out code and associated comment.
2021-11-02 19:03:37 +01:00
Bart
61789da61d
LazUtils: Masks: add comment about EscapeChar property.
2021-11-02 19:01:30 +01:00
Bart
8ba7c4fedc
LazUtils: Masks: move some comments.
2021-11-02 19:00:16 +01:00
Bart
1d8110d62e
LazUtils: Masks: fix comment for mocRange (now that escaping works properly).
2021-11-02 18:52:30 +01:00
Bart
5c7690081c
LazUtils: Masks: vanity change.
2021-11-02 18:49:58 +01:00
Bart
7a80001488
LazUtils: Masks: implement property TMaskList.CaseSensitive.
2021-11-02 18:48:36 +01:00
Bart
becd9a5374
LazUtils: Masks: implement property TMaskList.AutoReverseRange.
2021-11-02 18:44:40 +01:00
Bart
f269492d19
LazUtils: Masks: there is no need to regenerate the the indivual fMasks.Items in TMaskList.SetMaskOpCodes.
2021-11-02 18:39:55 +01:00
Bart
4ae0dac7da
LazUtils: Masks: make property TMaskBase.CaseSensitive read/write.
2021-11-02 18:31:52 +01:00
Bart
88f6d76cfc
LazUtils: Masks: move TMaskFailCause type inside the TMaskBase class. It is not needed outside.
2021-11-02 18:28:26 +01:00
Bart
19feb31030
LazUtils: Masks: add some ToDo comments for properties not yet (r/w) implemented.
2021-11-01 23:22:26 +01:00
Bart
ff2b30b7c0
LazUtils: Masks: also force a new Compile when EscapeChar is changed.
2021-11-01 23:12:17 +01:00
Bart
ca93bfbd58
LazUtils: Masks: property AutoReverseRange needs a setter as well.
2021-11-01 23:07:27 +01:00
Bart
d374385885
LazUtils: Masks: if Compile fails, don't set fMaskIsCompiled to True.
2021-10-31 20:42:34 +01:00
Bart
cf6d6c626c
LazUtils: Masks: make TWindowsMaskList.Quirks read/write.
2021-10-31 20:12:22 +01:00
Bart
3be1973992
LazUtils: Masks: fix TMaskList.SetMask and .SetMaskOpCodes.
2021-10-31 20:06:24 +01:00
Bart
8a550c1678
LazUtils: Masks: implement TMaskList.MaskOpCodes property.
2021-10-31 19:44:31 +01:00
Bart
1a0f808921
LazUtils: Masks: implement TMaskList.Mask property.
2021-10-31 19:41:00 +01:00
Bart
1543c68c73
LazUtils: Masks: make TWindowsMask.Quirks read/write.
2021-10-31 19:07:43 +01:00
Bart
dd4c515dc6
LazUtils: Masks: when setting Mask property invalidate fInternalMask.
2021-10-31 19:02:24 +01:00
Bart
421f894acb
LazUtils: Masks: properly implement property TMaskBase.MaskOpCodes, remove property OPCodesAllowed.
2021-10-31 18:52:32 +01:00
Bart
ebabdd0bba
LazUtils: Masks: implement property TMaskBase.MaskOpCodes.
2021-10-31 18:21:39 +01:00
Bart
71623760cb
LazUtils: Masks: simplify TMaskList.MatchesWindowsMask.
2021-10-31 18:15:39 +01:00
Bart
2cab533808
LazUtils: Masks: also do not compile the mask in the constructor of TWindowsMaskList.
2021-10-31 18:04:51 +01:00
Bart
181e410434
LazUtils: Masks: don not disable ranges and sets in TWindowsMask, and do not compile the mask in the constructor, so the constructor won't fail if a mask is invalid.
2021-10-31 17:27:04 +01:00
Bart
0a32776e98
LazUtils: Masks: an empty negated set is also an empty set, so don't allow that as well.
2021-10-31 16:19:49 +01:00
Bart
20f3e55048
LazUtils: Masks: support escaping in ranges/sets (part 2). Based on original code by Jose Mejuto
...
(https://github.com/JoshyFun/pascal_tmask/blob/main/umask.pas )
2021-10-31 16:17:32 +01:00
Juha Manninen
6e6d618513
Merge branch 'lazutils-hints' into 'main'
...
Suppress compiler hints in LazUtils
See merge request freepascal.org/lazarus/lazarus!35
2021-10-31 07:55:49 +00:00
Juha
cd66ac596b
Formatting, minor simplification.
2021-10-31 09:51:28 +02:00
Juha
9a8163981a
LazUtils: Remove a deprecated function.
2021-10-31 09:51:28 +02:00
Bart
4ba6ff00d7
LazUtils: Masks: support escaping in ranges (part 1). Based on original code by Jose Mejuto
...
(https://github.com/JoshyFun/pascal_tmask/blob/main/umask.pas )
2021-10-30 14:46:59 +02:00
Bart
61a1afe43f
LazUtils: Masks: cosmetic (fix indentation).
2021-10-29 23:08:40 +02:00
Bart
e4f572e8a6
LazUtils: Masks: add a TWindowsQuirks parameter to MatchesWindowsMaskList (MatchesWindowsMask already had this).
2021-10-29 23:02:57 +02:00
Bart
719dd78ada
LazUtils: Masks: rename TMaskWindows to TWindowsMask. (Internal consistency with MatchesWindowsMask* functions.)
2021-10-29 20:24:06 +02:00
Bart
54512301bb
LazUtils: Masks: clarify some deprecated messages.
2021-10-29 17:22:52 +02:00
Bart
54c133cf53
LazUtils: Masks: remove commented out code.
2021-10-29 17:20:00 +02:00
Bart
1282204c12
LazUtils: Masks: rename property RangeAutoReverse to AutoReverseRange.
2021-10-29 17:16:56 +02:00
Bart
742a4e8299
LazUtils: Masks: TMaskFailCause enums do not need to be indexed.
2021-10-29 16:59:58 +02:00
Bart
f36b66d291
LazUtils: Masks: rename TMaskFailCause enums (coding style consistency).
2021-10-29 16:58:31 +02:00
Bart
ac05966190
LazUtils: Masks: move TMaskParsedCode type inside the TMaskBase class definition.
2021-10-29 16:50:33 +02:00
Bart
f972660686
LazUtils: rename some constants in Masks unit for better readability. No functional changes.
2021-10-29 16:48:05 +02:00
Bart
ab65998e7a
LazUtils: rename a private var in Masks unit. No functional changes.
2021-10-29 16:37:56 +02:00
Bart
fcbc9cbb65
LazUtils: the default value for TMaskOpcodes in Masks unit should be as backwards compatible as possible, so remove mocAnyCharOrNone and mocEscapeChar from it.
2021-10-29 16:35:47 +02:00
Bart
b004f8c0d9
LazUtils: remove "*legacy" constructors and functions from Masks unit.
...
Default behaviour should already be as backwards compatible as possible.
And we won't have to deprecate them right from the get go.
2021-10-29 16:32:14 +02:00
Alexey
6970b3aef1
fix compiler hints in LazUtils
2021-10-29 15:08:50 +03:00
Bart
63847a62b4
LazUtils: patch from Jose Mejuto to ensure that sets are only allowed is mocSet is enabled.
...
e.i. [abc] will give an exception if mocSet is not enabled and mocRange is.
2021-10-27 20:53:58 +02:00
Bart
33df1460d5
LazUtils: implement DbgS() for TMaskOpCodes and TWindowsQuirks in Masks unit.
2021-10-27 14:09:12 +02:00
Bart
ddcf2d27db
LazUtils: implement TMaskListWindows in Masks unit.
2021-10-27 13:30:27 +02:00
Bart
cff7df7db8
LazUtils: clarify some comments about TMaskOpcode enums in Masks unit.
2021-10-24 17:57:19 +02:00
Bart
bc3e07560f
LazUtils: fix typo in comment Masks unit.
2021-10-23 23:30:53 +02:00
Bart
a94d0711cf
LazUtils: rename an enum in Masks unit.
2021-10-23 23:29:31 +02:00
Bart
d511c0dfb9
LazUtils: add comments for the TMaskOpCode enums in Masks unit.
2021-10-23 23:27:05 +02:00
Juha
964d5f4d69
LazUtils: Improve naming of types and variables in Masks. Follow naming conventions of other code.
2021-10-23 23:28:30 +03:00
mattias
0354b47bc4
updated makefiles
2021-10-18 14:32:30 +02:00
Juha
c28cc988ec
LazUtils: Implement TMask.MatchesWindowsMask for backwards compatibility.
2021-10-17 09:33:43 +03:00
Juha
67111d9a30
LazUtils, Masks: Turn define RANGES_AUTOREVERSE into a run time option. Add constructors for legacy syntax. More tests.
2021-10-16 23:32:17 +03:00
Juha
a111270ed0
LazUtils: Don't use eWindowsQuirk_Extension3More for Windows mask. Makes *.pas match Unit1.pas.bak
2021-10-16 11:50:13 +03:00
Juha
05fdc3f8f3
LazUtils: Use String instead of RawByteString in Masks. Works equally well.
2021-10-16 11:09:36 +03:00
Juha
04b0a04a45
LazUtils: Restore backwards compatible TMaskOptions to Masks. More tests.
2021-10-15 14:44:54 +03:00
Maxim Ganetsky
cbbe24651e
Lazutils: regenerated translations and updated Russian translation
2021-10-14 00:37:29 +03:00
Maxim Ganetsky
6b27c973ac
Lazutils: fixed Masks resource strings
2021-10-14 00:06:49 +03:00
Juha
ef29ae70cc
LazUtils: Make TMaskList.MatchesWindowsMask work using a hack. Streamline mask constructors. Add author info.
2021-10-13 17:51:02 +03:00
Juha
e1baec480e
LazUtils: Refactoring of masks. Split TMaskUTF8.Compile into parts etc.
2021-10-13 17:51:02 +03:00
Juha
a768a4459b
LazUtils: Add tests for mask when ranges are disabled.
2021-10-13 17:51:02 +03:00
Juha
d7036bb000
LazUtils: Restore the José Mejuto's version of TMask. Faster and better. Can be tested now without hurry.
2021-10-13 17:51:02 +03:00
Juha
814e4ba4e2
Rename CompareMethods to more logical SameMethod. Remove old deprecated functions.
2021-10-10 19:00:49 +03:00
Juha
de4f724924
Revert checking for Pascal keywords in LazIsValidIdent which is used also for unit names etc. Prevent illegal name by other means.
2021-09-28 14:33:36 +03:00
Juha
5a1abf733a
LazUtils: Check for Pascal keywords in LazIsValidIdent. Must be prepended with '&'. Merge request 11 by Abdullahi Usman.
2021-09-26 01:18:05 +03:00
Joost van der Sluis
bbe0b81f62
Lazutils: Fpmake.pp, added conditional dependency on winunits-base
2021-08-27 00:19:05 +02:00
Bart
840389dad3
LazFileUtils: make ResolveDots a little more consitent w.r.t. having the result ending with a PathDelim. Issue #37188 . Do not merge to Fixes 2.2.
2021-08-20 18:43:37 +02:00
juha
e344dcb11e
LazUtils: Restore function KOI8ToUTF8, earlier renamed as KOI8RUToUTF8, and deprecate it.
...
git-svn-id: trunk@65449 -
2021-07-14 15:00:31 +00:00
juha
2255df954a
LazUtils: Fix building when directory is a Windows mount point. Issue #39120 , patch by Alguien.
...
git-svn-id: trunk@65383 -
2021-07-06 18:52:45 +00:00
juha
07fbbd53b3
LazUtils: A minor optimization / tweak.
...
git-svn-id: trunk@65259 -
2021-06-17 22:42:20 +00:00