Page 2 of 2

Re: New WDX field custommatch flag + ContentCustomMatch func

Posted: 2021-03-17, 07:14 UTC
by MVV
That's great, thank you, even with plugin-defined operation names!

Re: New WDX field custommatch flag + ContentCustomMatch func

Posted: 2021-03-17, 10:12 UTC
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.