How to wxDir::GetAllFiles for multiple filespec criterias! Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

How to wxDir::GetAllFiles for multiple filespec criterias!

Post by tomay3000 »

Hello,
I need to call wxDir::GetAllFiles for multiple filespec criterias, I thought about calling it multiple times for each filespec criteria since from the documentation it preserves the old content of wxArrayString * files, but this will imply performance issues, because the traversal will be repeated multiple times.

What I want to do is to combine all the file specs into one string using a char separator like '|' for example "*.exe|*.dll|*.ocx" or simply an overload with a const wxArrayString& filespecs.

Is this a missing feature! or I am missing something?

TIA.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to wxDir::GetAllFiles for multiple filespec criterias!

Post by doublemax »

Filespecs with multiple extensions are not supported. You'll have to write your own wxDirTraverser, but this is not hard.
https://docs.wxwidgets.org/trunk/classw ... erser.html
Use the source, Luke!
Post Reply