Feature Suggestion: Parametered WDX

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
whuang
Junior Member
Junior Member
Posts: 2
Joined: 2021-04-26, 13:44 UTC

Feature Suggestion: Parametered WDX

Post by *whuang »

Now, the information fields provided by WDX are fixed. For instance, we need a field, named "1st line" to obtain the 1st line of a text file, and another field "2nd line" to obtain the 2nd line of a text file. Thus, could the content field of the WDX plugins be parametered.

Possible Examples:
(1) Get the line of the given line number. For Instance, a field, named "line", with parameter "1", return the 1st line. It will simplify the PCREsearch WDX. Now it must be configured manually.
(2) Check whether a given pattern in a file, return yes or no. Now we must get the full text, and match the pattern by TC itself. With the support of the parametered plugins, if we have a field named "match" with the parameter "I\s+love\s+TC", it will return the Boolean value whether the file contains the pattern. Thus, we can execute additional functions by plugins not by TC itself. It is very efficient because the plugin need not return the whole text to TC. It will simplify the TextSearch WDX.
(3) Get the color of the given position. For instance, a field named "color" with parameter "(100,20)" to obtain a pixel color of an image.

Feasibility:
Noticed that in the function call, ContentGetValue(char* FileName,int FieldIndex,int UnitIndex, void* FieldValue,int maxlen,int flags), UnitIndex is indeed a parameter. However it is only an integer type. If in the future version it is a string type, the aforementioned examples are easily implemented.
Post Reply