diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:59:06 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:59:06 +0200 |
commit | 4046be06720932a57a0f49416b0144b2858824d0 (patch) | |
tree | 678c37cab05960f48923a23bb46d9e01be89d35a /library/fileHandling.h | |
parent | 1.19 (diff) | |
download | FreeFileSync-4046be06720932a57a0f49416b0144b2858824d0.tar.gz FreeFileSync-4046be06720932a57a0f49416b0144b2858824d0.tar.bz2 FreeFileSync-4046be06720932a57a0f49416b0144b2858824d0.zip |
2.0
Diffstat (limited to 'library/fileHandling.h')
-rw-r--r-- | library/fileHandling.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/library/fileHandling.h b/library/fileHandling.h index de068d1f..3abdbe07 100644 --- a/library/fileHandling.h +++ b/library/fileHandling.h @@ -3,21 +3,7 @@ #include <wx/dir.h> #include "zstring.h" - -class FileError //Exception class used to notify file/directory copy/delete errors -{ -public: - FileError(const Zstring& message) : - errorMessage(message) {} - - const Zstring& show() const - { - return errorMessage; - } - -private: - Zstring errorMessage; -}; +#include "fileError.h" namespace FreeFileSync @@ -50,15 +36,34 @@ namespace FreeFileSync void removeDirectory(const Zstring& directory, const bool useRecycleBin); void removeFile(const Zstring& filename, const bool useRecycleBin); void createDirectory(const Zstring& directory, const Zstring& templateDir, const bool copyDirectorySymLinks); -#ifdef FFS_LINUX - //callback function for status updates whily copying - typedef void (*CopyFileCallback)(const wxULongLong& totalBytesTransferred, void* data); + + class CopyFileCallback //callback functionality + { + public: + virtual ~CopyFileCallback() {} + + enum Response + { + CONTINUE, + CANCEL + }; + virtual Response updateCopyStatus(const wxULongLong& totalBytesTransferred) = 0; + }; + + class ShadowCopy; +#ifdef FFS_WIN void copyFile(const Zstring& sourceFile, const Zstring& targetFile, const bool copyFileSymLinks, - CopyFileCallback callback = NULL, - void* data = NULL); + ShadowCopy* shadowCopyHandler = NULL, //supply handler for making shadow copies + CopyFileCallback* callback = NULL); + +#elif defined FFS_LINUX + void copyFile(const Zstring& sourceFile, + const Zstring& targetFile, + const bool copyFileSymLinks, + CopyFileCallback* callback); #endif } |