Page 1 of 1

Find Files plugins

Posted: 2013-09-27, 15:46 UTC
by yrwin
Allow other developers to extend Find Files dialog with custom engine. So we can use more search algorithms.

I look forward to when it's finished :)

I done skeleton of the plugin interface, if it helps. I try to put here everything i find useful. Ofc feel free to change/update it in post, i'll try to update my code asap so it should reflect the latest informations.
This interface should solve the Hacker requests too.

findplugin.h:

Code: Select all

typedef DWORD tSearchFlags;
#define SEARCH_FLAGS_FOR_REGEX        1     // valid is SearchFor (instead of SearchForArray) is in regex format.
#define SEARCH_FLAGS_IN_ARCHIVES      2
#define SEARCH_FLAGS_WHOLE_WORDS_ONLY 4
#define SEARCH_FLAGS_CASE_SENSITIVE   8
#define SEARCH_FLAGS_ASCII_CHARSET    0x10
#define SEARCH_FLAGS_NOT_IN_FILE      0x20
#define SEARCH_FLAGS_UNICODE          0x40
#define SEARCH_FLAGS_HEX              0x80
#define SEARCH_FLAGS_FIND_TEXT_REGEX  0x100 // Value in FindText is in regex format.
#define SEARCH_FLAGS_UTF8             0x200

#define SEARCH_DEPTH_UNLIMITED        0xffffffff

static const FILETIME    = {0xffffffff, 0xffffffff};

typedef enum {
    GreaterThan,
    LessThan,
    GreaterOrEqualThan,
    LessOrEqualThan,
    Equal,
    NotEqual,
    Contains,
    NotContains,
    ContainsCaseInsensitive,
    NotContainsCaseInsensitive,
    EqualCaseInsensitive,
    NotEqualCaseInsensitive,
    MatchesRegex,
    NotMatchesRegex,
} tComparisonOP;

typedef struct {
    WCHAR* Plugin;                    // Field Plugin:
    WCHAR* Property;                  // Field Property:
    tComparisonOP ComparisonOp;       // Field OP:
    WCHAR* Value;                     // Field Value:
} tFindFilesPluginsStructW;

typedef struct {
    // General tab
    union {                           // Field Search in:
        WCHAR* SearchIn;
        WCHAR** SearchInArray;        // <- default valid field
    };
    union {                           // Field Search for:
        WCHAR* SearchFor;
        WCHAR** SearchForArray;       // <- default valid field
    };
    tSearchFlags SearchFlags;         // Various fields with checkboxes.
    DWORD SearchDepth;                // Field Search in subdirectories.
    WCHAR* FindText;                  // Field Find text:
    
    // Advanced tab
    FILETIME DateBetweenLowerLimit;   // Field Date between:
    FILETIME DateBetweenUpperLimit;
    FILETIME NotOlderThan;            // Field Not older than:
    DWORD64 FileSizeLowerLimit;       // Field File size:
    DWORD64 FileSizeUpperLimit;
    DWORD AttributesMask;             // Field Attributes: Mask of valid values in FindFilesStructW.Attributes.
    DWORD Attributes;                 //    Attributes, which you are looking for.
    
    // Plugins tab
    tFindFilesPluginsStructW* SearchInPlugins;
    BOOL FindAnyMatch;                // Fields FALSE = AND (all match), TRUE = OR (any match)

} tFindFilesStructW;

// Function prototypes
extern "C" __declspec(dllexport) HANDLE __stdcall FindFindFirstW(tFindFilesStructW* ffs,WIN32_FIND_DATAW *FindData);
extern "C" __declspec(dllexport) BOOL __stdcall FindFindNextW(HANDLE Hdl,WIN32_FIND_DATAW *FindData);
extern "C" __declspec(dllexport) int __stdcall FindFindClose(HANDLE Hdl);

Posted: 2013-09-27, 17:41 UTC
by MVV
Please be more specific. What kind of search do you miss? Why can't you use content plugins' fields in Plugins search tab in search to extend its possibilities?

Posted: 2013-09-28, 09:48 UTC
by Lefteous
I guess alternate engines could mean an engine that relies on a search index. Personally I don't think it doesn't make sense to add such a plugin system. Having several search engines installed is somewhat overkill.
Just one that works great would be enough. This should be implemented internally. This could be a major feature of one of the next versions.

Posted: 2013-10-22, 16:02 UTC
by yrwin
Lefteous wrote:I guess alternate engines could mean an engine that relies on a search index. Personally I don't think it doesn't make sense to add such a plugin system. Having several search engines installed is somewhat overkill.
Just one that works great would be enough. This should be implemented internally. This could be a major feature of one of the next versions.
This is true. I mean Alt-F7 Something, which allows me to find files quickly instead of waiting minutes. There can be more search engines, each for one file type, so i dont think, it is possible to do this as build-in feature. Maybe this can be done at least for text files.

Posted: 2013-10-22, 20:24 UTC
by MVV
Well, it seems that we need some kind of plugins that will:
1. Accept file name mask(s),
2. Accept search path(s),
3. Return list of matched file paths.
So TC then will only need to apply ignore list. Or maybe even ignore list may be also passed to plugin...

Posted: 2013-10-23, 08:41 UTC
by yrwin
MVV wrote:Well, it seems that we need some kind of plugins that will:
1. Accept file name mask(s),
2. Accept search path(s),
3. Return list of matched file paths.
So TC then will only need to apply ignore list. Or maybe even ignore list may be also passed to plugin...
This is true. I can add just
2.5. Optional: Accept find text or other hints what to find

Posted: 2013-10-23, 11:06 UTC
by Hacker
Perhaps you might support the idea of an Indexed search using WDX plugins.

Roman

Posted: 2017-01-18, 09:15 UTC
by yrwin
Many thanks for supporting Everything as an indexing engine! Now I miss just index of content of files :)

Posted: 2017-01-18, 09:31 UTC
by Horst.Epp
yrwin wrote:Many thanks for supporting Everything as an indexing engine! Now I miss just index of content of files :)
Content indexing is done by Windows and from the results you can enter TC.

Re: Find Files plugins

Posted: 2021-05-28, 07:53 UTC
by tibro1977
hi, i need a plugin they do the following:
i search for with regex for emails in a whole directory.
and the results (only the emails) may save in a new file.
is it possible??

Re: Find Files plugins

Posted: 2021-05-29, 14:09 UTC
by tuska
tibro1977 wrote: 2021-05-28, 07:53 UTC hi, i need a plugin they do the following:
i search for with regex for emails in a whole directory.
Hi,

Example queries using the tool 'Everything' in Total Commander (see my autosignature)
Find files --> field: "Search for:"

Code: Select all

ev:ext:eml content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))
ed:ext:eml content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))

ev:files:regex:^AW
ed:files:regex:^AW

----------------------------------------------------------------------
This does NOT work for extension 'MSG' --> content: ...
ev:ext:msg content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))
ed:ext:msg content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))
RegEx from: stackoverflow.com - Regular expression to find URLs within a string
 
tibro1977 wrote: 2021-05-28, 07:53 UTC... and the results (only the emails) may save in a new file.
is it possible??
I don't know, especially where the file format (.eml, .msg) is unknown.

Have you googled this topic yet?
There is a little bit written about email merging...

Creating a ZIP file is not an option?


Windows 10 Pro (x64) Version 21H1 (OS build 19043.1023)
TC 10.00RC2 x64/x86 | 'Everything' 1.5.0.1262a (x64)
Search queries: TC <=> 'Everything' | 'Everything' 1.4.1.1009 (x64)