wex v24.10.0
|
Offers find_files method. More...
#include <wex/common/dir.h>
Public Member Functions | |
dir (const path &path, const data::dir &data=data::dir(), wxEvtHandler *eh=nullptr) | |
Constructor. | |
virtual | ~dir ()=default |
Destructor. | |
virtual void | find_files_end () const |
Override for action after find_files has ended. | |
virtual bool | on_dir (const path &) const |
Do something with the dir. | |
virtual bool | on_file (const path &) const |
Do something with the file. | |
const auto & | data () const |
Returns the data. | |
int | find_files () |
Finds matching files. | |
bool | find_files (const tool &tool) |
Finds matching files, and runs specified tool. | |
const auto & | get_path () const |
Returns the path. | |
auto * | handler () |
Returns the event handler. | |
Static Public Member Functions | |
static auto & | get_statistics () |
Returns the statistics. | |
Static Public Member Functions inherited from wex::interruptible | |
static bool | start () |
Starts the interruptible process. | |
static bool | end () |
Stops the interruptible process. | |
static bool | is_running () |
Returns true if process is running. | |
Offers find_files method.
By overriding on_dir and on_file you can take care of what to do with the result.
|
explicit |
Constructor.
path | the path to start finding |
data | the dir data |
eh | event handler to use, this results in using a separate thread for find_files. |
int wex::dir::find_files | ( | ) |
Finds matching files.
This results in recursive calls for on_dir and on_file. Runs as a separate thread if event handler is setup, otherwise runs synchronized. Returns 1 if thread is started, or number of matches for synchronized runs. You can set a limit on retrieving files by setting max_matches in data::dir.
bool wex::dir::find_files | ( | const tool & | tool | ) |
Finds matching files, and runs specified tool.
Returns true if thread is started, the event handler must have been set.
|
virtual |
Do something with the dir.
Default supports find and replace, and adding items to handler.
|
virtual |
Do something with the file.
Default supports find and replace, and adding items to handler.