]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dircmn.cpp
Applied hash copy fix, BC++ makefile fix (though not the lib setup.h one we need...
[wxWidgets.git] / src / common / dircmn.cpp
index c39290a58cdc418f6845ad6478cd424ac44233fd..8591612324134bd927df0dee747edaff21f72645 100644 (file)
@@ -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"
 // 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
+#if !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()
 // ----------------------------------------------------------------------------