[yunqa.de] Re: TDIWildFileFinder not matching wildcard patterns

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Wed, 24 Dec 2008 00:20:37 +0100

Marek Jedlinski wrote:

>Thank you for replying. Since I have the source code version, I have
>derived a descendant that uses SimpleName rather than Fullname just like
>you suggested. However, this raises another small issue:
>
>In my descendant I don't want to call inherited TDIWildFileFinder.Validate,
>but I do need to invoke TDICustomAttributeFileFinder.Validate, otherwise
>filtering by attributes will no longer work. Since there is no clean way to
>"skip" a method in the inherited hierarchy, the only thing I could do was
>to copy and paste TDICustomAttributeFileFinder.Validate to my descendant.
>This works but isn't quite clean.

I saw this, too, and realized that an intermediate TDICustomWildFileFinder 
class it missing - with all the TDIWildFileFinder properties protected and the 
Validate method not yet overridden.

>I think the best solution might be to add a flag property such as
>MatchByFullname to an appropriate ancestor class, and use it in the
>Validate methods of the TDIWildFileFinder and TDIPcreFileFinder components.
>
>> It might feel strange because it works differently from common usage.
>> But it allows to searche path + filename in just a single (user) search 
>> expression.
>
>I understand that, but I still can't quite see the point :) Matching
>against the path doesn't seem useful, since the SearchFolder property is
>already specified without a wildcard. No other folders other than
>SearchFolder will be considered anyway. Matching against full path might
>be useful to select subfolders of SearchFolder, but the subfolders can be
>filtered in or out using other methods of the component.
>
>Perhaps the flag I've suggested may actually allow three states: 1) match
>against Fullname (current behavior); 2) match against Simplename; 3) match
>against the part of the path that follows SearchFolder, i.e. any
>subdirectory of SearchFolder plus the actual filename. What do you think?

Looks like the three modes make sense! I will think more about it after the 
holidays. Any thoughts, anyone?

Wish you all a merry Christmas,

Ralf 

_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: