diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:55:48 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:55:48 +0200 |
commit | daea231de0ae28fc8343f29f09d0457cc0591461 (patch) | |
tree | a1d572442d2c903e40741a859ad47c8b0d740969 /library/fileHandling.h | |
parent | 1.13 (diff) | |
download | FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.tar.gz FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.tar.bz2 FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.zip |
1.14
Diffstat (limited to 'library/fileHandling.h')
-rw-r--r-- | library/fileHandling.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/library/fileHandling.h b/library/fileHandling.h index a4f43391..cd86333b 100644 --- a/library/fileHandling.h +++ b/library/fileHandling.h @@ -3,7 +3,7 @@ #include "globalFunctions.h" #include <wx/dir.h> - +#include "zstring.h" class FileError //Exception class used to notify file/directory copy/delete errors { @@ -22,15 +22,38 @@ private: namespace FreeFileSync { - void getAllFilesAndDirs(const wxString& sourceDir, wxArrayString& files, wxArrayString& directories) throw(FileError); + void getAllFilesAndDirs(const Zstring& sourceDir, vector<Zstring>& files, vector<Zstring>& directories) throw(FileError); //recycler bool recycleBinExists(); //test existence of Recycle Bin API on current system //file handling - void removeDirectory(const wxString& directory, const bool useRecycleBin); - void removeFile(const wxString& filename, const bool useRecycleBin); - void createDirectory(const wxString& directory, int level = 0); //level is used internally only + void removeDirectory(const Zstring& directory, const bool useRecycleBin); + void removeFile(const Zstring& filename, const bool useRecycleBin); + void createDirectory(const Zstring& directory, const int level = 0); //level is used internally only + void copyFolderAttributes(const Zstring& source, const Zstring& target); + +//################################ + //custom traverser with detail information about files + + struct FileInfo + { + wxULongLong fileSize; //unit: bytes! + time_t lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC + }; + + //traverser interface + class FullDetailFileTraverser + { + public: + virtual ~FullDetailFileTraverser() {} + virtual wxDirTraverseResult OnFile(const Zstring& filename, const FileInfo& details) = 0; + virtual wxDirTraverseResult OnDir(const Zstring& dirname) = 0; + virtual wxDirTraverseResult OnError(const Zstring& errorText) = 0; + }; + + bool traverseInDetail(const Zstring& directory, FullDetailFileTraverser* sink, const int level = 0); //return value and level are used internally only +//################################ } |