Re: [Lazarus] unit Masks vs. unit FPMasks

2021-03-02 Thread José Mejuto via lazarus
El 02/03/2021 a las 15:22, Bart via lazarus escribió: Hello, First we will fork Lazarus 2.2 Then work in mask unit can proceed. The advantage of this is that the new implementation is not hindered by the old implementation. So, no need to implement TMask.MatchesWindowsMask in the new impleme

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-03-02 Thread Bart via lazarus
On Mon, Mar 1, 2021 at 8:16 PM José Mejuto via lazarus wrote: > I've uploaded last TMask* code to my github, this way its easier to > track changes. > > https://github.com/JoshyFun/pascal_tmask First we will fork Lazarus 2.2 Then work in mask unit can proceed. I wonder if we could have both im

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-03-01 Thread José Mejuto via lazarus
El 25/02/2021 a las 15:21, Juha Manninen via lazarus escribió: Hello, Ok, true. Escaping special characters would be very handy. A pity. I've uploaded last TMask* code to my github, this way its easier to track changes. https://github.com/JoshyFun/pascal_tmask Have a nice day!. -- --

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-27 Thread Juha Manninen via lazarus
On Fri, Feb 26, 2021 at 10:24 PM Bart via lazarus < lazarus@lists.lazarus-ide.org> wrote: > On Fri, Feb 26, 2021 at 7:15 PM Bart wrote: > My backup and some related programs still compile, but instatly raise > an exception when they start to perform their main task. > Thank you very much. > > The

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-26 Thread Bart via lazarus
On Fri, Feb 26, 2021 at 7:15 PM Bart wrote: > TMask.MatchesWindowsMask now raises an exception. > Seriously?? > This is INSANE. Let me explain. My backup and some related programs still compile, but instatly raise an exception when they start to perform their main task. Thank you very much. The

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-26 Thread Bart via lazarus
On Thu, Feb 25, 2021 at 3:22 PM Juha Manninen via lazarus wrote: TMask.MatchesWindowsMask now raises an exception. Seriously?? This is INSANE. Bart -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazaru

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-25 Thread Juha Manninen via lazarus
On Thu, Feb 25, 2021 at 12:44 PM José Mejuto via lazarus < lazarus@lists.lazarus-ide.org> wrote: > Backwards compatibility, in special the escape character which can be > used in old masks like: "C:\*.*". The other functions can be kept > active, but escape char could be a compatibility problem. >

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-25 Thread José Mejuto via lazarus
El 25/02/2021 a las 10:39, Juha Manninen via lazarus escribió: Hello, UTF8 is also Unicode, one of its encodings. The name UnicodeString is misleading. It should be UTF16String. Please remember our Unicode solution uses UTF-8. It is done by changing the default encoding of AnsiString and trigg

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-25 Thread Juha Manninen via lazarus
On Thu, Feb 25, 2021 at 10:47 AM José Mejuto via lazarus < lazarus@lists.lazarus-ide.org> wrote: > In fact I think that the whole unit is needed. It has (info for other > readers) 3 classes TMaskUTF8, TMaskAnsi and TMaskUnicode, maybe > TMaskAnsi can be omitted but UTF8 and Unicode should be prese

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-25 Thread José Mejuto via lazarus
El 24/02/2021 a las 21:53, Juha Manninen via lazarus escribió: Hello, I am interested in how well your TMask version compares with Delphi's version. Does it match the speed or even surpass it? Not tested because in my code strings are allways UTF8 stored so for Delphi comparison I must conv

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-25 Thread José Mejuto via lazarus
El 24/02/2021 a las 22:36, Bart via lazarus escribió: Filename:='test.txt' Mask:='test??.txt?' Match must be true That sucks big time. A ? is supposed to match EXACTLY 1 character (not optional). Bloody @#$%$#@#$ Micro$uck, X-D This quirk has its explanation which is 8.3 backwards compatibil

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Bart via lazarus
On Wed, Feb 24, 2021 at 12:28 PM José Mejuto via lazarus wrote: > Filename:='test.txt' > Mask:='test??.txt?' > Match must be true That sucks big time. A ? is supposed to match EXACTLY 1 character (not optional). Bloody @#$%$#@#$ Micro$uck, -- Bart -- _

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Bart via lazarus
On Wed, Feb 24, 2021 at 9:54 PM Juha Manninen via lazarus wrote: > I am interested in how well your TMask version compares with Delphi's version. > Does it match the speed or even surpass it? > > Anyway this unit looks very promising! > It works with Unicode as advertised. It passes all cases in

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Bart via lazarus
On Wed, Feb 24, 2021 at 12:28 PM José Mejuto via lazarus wrote: > Filename:='test.txt' > Mask:='test??.txt?' > Match must be true That sucks big time. ? is supposed to match exactly 1 character (non-optional). Bloody #$%$#!! M$uck. -- Bart -- ___ la

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Juha Manninen via lazarus
On Wed, Feb 24, 2021 at 1:05 PM José Mejuto via lazarus < lazarus@lists.lazarus-ide.org> wrote: > Note: Just to put in context, my "explore" in the TMask world started > when writing my NTFS filesystem reader, when all file names are read > (400,000) I can search for them using masks. When compile

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Bart via lazarus
On Wed, Feb 24, 2021 at 12:11 PM Juha Manninen via lazarus wrote: >> I tested that extensively on my machine with all scenarios I could think of. > Please add your tests to the project I mentioned. I did that when writing the code. I never saved the tested masks I used anywhere AFAIK. The comme

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Juha Manninen via lazarus
MaskList is used in TCustomShellTreeView.GetFilesInDir(). It sets a mask option *moDisableSets*. Why are sets disabled? Is it to stay compatible with FindFirstUTF8() syntax? I don't fully understand the comment. Why would EConvertError be raised? //Disable the use of sets in the masklist.

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread José Mejuto via lazarus
El 24/02/2021 a las 13:31, Juha Manninen via lazarus escribió: Hello, I was thinking in import the NTFS (the filesystem) case comparison tables which are 128 KB "only". That is not necessary. LazUTF8 has functions like UTF8CompareText(), UTF8CompareTextP() and the The code was origin

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Juha Manninen via lazarus
On Wed, Feb 24, 2021 at 12:22 PM José Mejuto via lazarus < lazarus@lists.lazarus-ide.org> wrote: > In my code there is non 100% unicode compatibility when using the > "CaseInsensitive" mode as as it uses lowercase mask and lowercase string > to perform the test which is wrong by definition but I w

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread José Mejuto via lazarus
El 24/02/2021 a las 11:58, Bart via lazarus escribió: Hello, In my code there is non 100% unicode compatibility when using the "CaseInsensitive" mode as as it uses lowercase mask and lowercase string to perform the test which is wrong by definition Currently Masks unit does the same. Yes, b

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Juha Manninen via lazarus
On Wed, Feb 24, 2021 at 1:00 PM Bart via lazarus < lazarus@lists.lazarus-ide.org> wrote: > > > There are no tests for MatchesWindowsMask() yet. > I tested that extensively on my machine with all scenarios I could think > of. > Please add your tests to the project I mentioned. Juha -- __

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread José Mejuto via lazarus
El 24/02/2021 a las 11:47, Bart via lazarus escribió: On Wed, Feb 24, 2021 at 10:02 AM Bart wrote: Of course that is NOT a reason not to improve it: O(n^4) is just terrible. To put this discussion in a little perspective. Given a string S (UTF8 encoded) with Utf8Length=1000. GetCodePoint(S,1

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Bart via lazarus
On Wed, Feb 24, 2021 at 11:22 AM José Mejuto via lazarus wrote: > In my code there is non 100% unicode compatibility when using the > "CaseInsensitive" mode as as it uses lowercase mask and lowercase string > to perform the test which is wrong by definition Currently Masks unit does the same. >

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Bart via lazarus
On Wed, Feb 24, 2021 at 10:02 AM Bart wrote: > Of course that is NOT a reason not to improve it: O(n^4) is just terrible. To put this discussion in a little perspective. Given a string S (UTF8 encoded) with Utf8Length=1000. GetCodePoint(S,1000) on my laptop takes 0.00439 msecs to perform. So 10

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread José Mejuto via lazarus
El 24/02/2021 a las 10:31, Juha Manninen via lazarus escribió: José Mejuto's code is a major rewrite for Masks. It supports Unicode in masks, too. I try to make it compatible by changing some class and method names, and then run the unit tests. Hello, In my code there is non 100% unicode com

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Juha Manninen via lazarus
I will not touch MaskEdit. Don't worry. On Wed, Feb 24, 2021 at 11:03 AM Bart via lazarus < lazarus@lists.lazarus-ide.org> wrote: > Without a major rewrite (which increases the cange of breaking > compatibility). > José Mejuto's code is a major rewrite for Masks. It supports Unicode in masks, to

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Bart via lazarus
On Wed, Feb 24, 2021 at 9:11 AM Juha Manninen via lazarus wrote: >> TMask (unit masks) deals with masks with wildcards (*,? and sets of >> single byte chars). ... > TMask also supports ranges and sets. See the unit test. > Eg. '[a-b]', '[!a-b]', '[abc]', '[0-9]' By single byte chars I meant ASC

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-24 Thread Juha Manninen via lazarus
On Wed, Feb 24, 2021 at 12:08 AM Bart via lazarus < lazarus@lists.lazarus-ide.org> wrote: > TMask (unit masks) deals with masks with wildcards (*,? and sets of > single byte chars). > It is mainly used for matching filenames (similar to the Path supplied > to FindFirst). > > TMaskEdit gives you th

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Bart via lazarus
On Tue, Feb 23, 2021 at 6:55 PM Juha Manninen via lazarus wrote: > How about TMask? Does it have the same syntax as TMaskEdit or are they > different? TMask (unit masks) deals with masks with wildcards (*,? and sets of single byte chars). It is mainly used for matching filenames (similar to the

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Juha Manninen via lazarus
On Tue, Feb 23, 2021 at 7:38 PM Bart via lazarus < lazarus@lists.lazarus-ide.org> wrote: > I have copied in the past some of the TMaskEdit logic and methods to > the MaskUtils unit. > Ok, the TEditMask thing was in MaskUtils. I didn't pay attention. How about TMask? Does it have the same syntax a

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Bart via lazarus
On Tue, Feb 23, 2021 at 3:27 PM Juha Manninen via lazarus wrote: > Does it mean the mask syntax is different? I found this: > http://docwiki.embarcadero.com/Libraries/Sydney/en/System.MaskUtils.TEditMask > Is TEditMask the same as TMaskEdit? Or is TEditMask used for TMask? Can you > please expl

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread José Mejuto via lazarus
El 23/02/2021 a las 10:41, Juha Manninen via lazarus escribió: > > Masks in LazUtils has a slow implementation. > I planned to optimize it but now I realize we may have overlapping code. > Q: Are Masks (LazUtils) and FPMasks (fpindexer) compatible? > If they are, we should dump the LazUtils Masks

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Juha Manninen via lazarus
On Tue, Feb 23, 2021 at 2:54 PM Bart via lazarus < lazarus@lists.lazarus-ide.org> wrote: > MaskEdit is a LCL control and hence has nothing to do in fpc. > I am not suggesting to move MaskEdit to FPC libs obviously. I have in the past copied bits of TMaskEdit to a related fpc unit > (cannot reme

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Bart via lazarus
On Tue, Feb 23, 2021 at 10:41 AM Juha Manninen via lazarus wrote: > LazUtils has unit Masks with classes TMask and TMaskList. > FPC's packages/fpindexer has unit FPMasks also with classes TMask and > TMaskList. MaskEdit is a LCL control and hence has nothing to do in fpc. I have in the past cop

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Juha Manninen via lazarus
On Tue, Feb 23, 2021 at 12:56 PM Juha Manninen wrote: > Oops, now I understand that FPMasks does not really support Unicode. > Type UTF8String only converts encoding automatically when assigning values. > There is no code to identify codepoints. > The LazUtils Masks iterates codepoints, although

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Juha Manninen via lazarus
On Tue, Feb 23, 2021 at 12:00 PM Michael Van Canneyt via lazarus < lazarus@lists.lazarus-ide.org> wrote: > Since it comes from Lazarus in the first place, they are supposed to be > compatible, yes. If not, then the unit in FPC can be updated to add missing > things. > Oops, now I understand that

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Juha Manninen via lazarus
A related thing. I am confused with different mask classes. Embarcadero docs for TMask http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Masks.TMask says: "*Note:* Do not confuse TMask with the EditMask of a field or masked edit object. While both are used for comparing strings to a symbol

Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Michael Van Canneyt via lazarus
On Tue, 23 Feb 2021, Juha Manninen via lazarus wrote: Hello LazUtils has unit Masks with classes TMask and TMaskList. FPC's packages/fpindexer has unit FPMasks also with classes TMask and TMaskList. A comment in FPMasks says "Moved here from LCL". Revision control shows it was added 9 years a

[Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Juha Manninen via lazarus
Hello LazUtils has unit Masks with classes TMask and TMaskList. FPC's packages/fpindexer has unit FPMasks also with classes TMask and TMaskList. A comment in FPMasks says "Moved here from LCL". Revision control shows it was added 9 years ago in 2012. Since 2.5 years ago it supports Unicode by usin