New WDX field custommatch flag + ContentCustomMatch func

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: New WDX field custommatch flag + ContentCustomMatch func

Post by *MVV »

That's great, thank you, even with plugin-defined operation names!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New WDX field custommatch flag + ContentCustomMatch func

Post by *ghisler(Author) »

To give you an example of how this is implemented, the new field "tc" -> "partner file with other extension" implements this. For example, if you set this field to CRW and search for *.jpg, you will find all jpg files for which there is a Canon RAW file with the same name in the same directory. It uses the following:
1. Return the following in ContentGetSupportedFieldFlags for this field:
contflags_fieldsearch | contflags_searchpageonly
2. ContentGetSupportedFieldFlags called with index -1 must return all possible values, including the new two values if you have fields returning them
3. ContentGetSupportedOperators returns:
= != =(case) !=(case)
The operators are separated by spaces, to ensure that no one returns operators containing spaces, which isn't supported.
4. ContentFindValueW uses OperationIndex to distinguish between the 4 possible operators. It uses FindFirstFileW to check whether a file with the indicated extension exists.
Author of Total Commander
https://www.ghisler.com
Post Reply