X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bdfeadcac50e7b4b631a3f6e8c42d2db4e594639..4a09bc4e34a16a5a608d7ae1dca60d29a1765f19:/src/common/dircmn.cpp?ds=sidebyside diff --git a/src/common/dircmn.cpp b/src/common/dircmn.cpp index 2fa41e06da..074cd75f9e 100644 --- a/src/common/dircmn.cpp +++ b/src/common/dircmn.cpp @@ -43,6 +43,31 @@ // 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 +// MBN: Cygwin should use the Unix version, but with the current build sistem +// this is painful +#if defined(__CYGWIN__) || !defined(__UNIX_LIKE__) || defined(__WXMAC__) + +bool wxDir::HasSubDirs(const wxString& spec) +{ + wxString s; + return GetFirst(&s, spec, wxDIR_DIRS | wxDIR_HIDDEN); +} + +#endif // !Unix + // ---------------------------------------------------------------------------- // wxDir::Traverse() // ----------------------------------------------------------------------------