- // this function uses Select() function to select the files
- // unless the filespec is explicitly given and Compare() function to sort
- // them
- bool Read(wxArrayString& filenames,
- const wxString& filespec = wxEmptyString) const;
-
-protected:
- // this function is called by Read() if filespec is not specified in
- // Read(): it should return TRUE if the file matches our selection
- // criteria and FALSE otherwise
- virtual bool Select(const wxChar* filename);
-
- // This function is called by Read() to sort the array: it should return
- // -1, 0 or +1 if the first file is less than, equal to or greater than
- // the second. The base class version does
- virtual int Compare(const wxChar *filename1, const wxChar *filename2);
-#endif // 0
+ // return the number of files found
+ size_t Traverse(wxDirTraverser& sink,
+ const wxString& filespec = wxEmptyString,
+ int flags = wxDIR_DEFAULT) const;
+
+ // simplest version of Traverse(): get the names of all files under this
+ // directory into filenames array, return the number of files
+ static size_t GetAllFiles(const wxString& dirname,
+ wxArrayString *files,
+ const wxString& filespec = wxEmptyString,
+ int flags = wxDIR_DEFAULT);
+
+ // check if there any files matching the given filespec under the given
+ // directory (i.e. searches recursively), return the file path if found or
+ // empty string otherwise
+ static wxString FindFirst(const wxString& dirname,
+ const wxString& filespec,
+ int flags = wxDIR_DEFAULT);
+
+#if wxUSE_LONGLONG
+ // returns the size of all directories recursively found in given path
+ static wxULongLong GetTotalSize(const wxString &dir, wxArrayString *filesSkipped = NULL);
+#endif // wxUSE_LONGLONG
+
+
+ // static utilities for directory management
+ // (alias to wxFileName's functions for dirs)
+ // -----------------------------------------
+
+ // test for existence of a directory with the given name
+ static bool Exists(const wxString& dir);
+
+ static bool Make(const wxString &dir, int perm = wxS_DIR_DEFAULT,
+ int flags = 0);
+
+ static bool Remove(const wxString &dir, int flags = 0);
+