X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/353327844e319db755c2e7a07a4cf5b53cef35c4..25db1b74f1264c27bbf2e5fcc9f3a19ccc56d5fc:/src/common/dircmn.cpp diff --git a/src/common/dircmn.cpp b/src/common/dircmn.cpp index c39290a58c..ca35534dcf 100644 --- a/src/common/dircmn.cpp +++ b/src/common/dircmn.cpp @@ -34,6 +34,7 @@ #include "wx/string.h" #include "wx/log.h" #include "wx/intl.h" + #include "wx/filefn.h" #endif //WX_PRECOMP #include "wx/dir.h" @@ -42,6 +43,29 @@ // implementation // ============================================================================ +// ---------------------------------------------------------------------------- +// wxDir::HasFiles() and HasSubDirs() +// ---------------------------------------------------------------------------- + +// dumb generic implementation + +bool wxDir::HasFiles(const wxString& spec) +{ + wxString s; + return GetFirst(&s, spec, wxDIR_FILES | wxDIR_HIDDEN); +} + +// we have a (much) faster version for Unix +#ifndef __UNIX_LIKE__ + +bool wxDir::HasSubDirs(const wxString& spec) +{ + wxString s; + return GetFirst(&s, spec, wxDIR_DIRS | wxDIR_HIDDEN); +} + +#endif // !Unix + // ---------------------------------------------------------------------------- // wxDir::Traverse() // ----------------------------------------------------------------------------