summaryrefslogtreecommitdiff
path: root/shared/file_handling.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:42 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:42 +0200
commitc32707148292d104c66276b43796d6057c8c7a5d (patch)
treebb83513f4aff24153e21a4ec92e34e4c27651b1f /shared/file_handling.h
parent3.9 (diff)
downloadFreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.gz
FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.bz2
FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.zip
3.10
Diffstat (limited to 'shared/file_handling.h')
-rw-r--r--shared/file_handling.h71
1 files changed, 45 insertions, 26 deletions
diff --git a/shared/file_handling.h b/shared/file_handling.h
index 36bf976f..af20ccf8 100644
--- a/shared/file_handling.h
+++ b/shared/file_handling.h
@@ -18,6 +18,11 @@
namespace ffs3
{
+struct RemoveDirCallback;
+struct MoveFileCallback;
+struct CopyFileCallback;
+
+
Zstring getFormattedDirectoryName(const Zstring& dirname);
bool fileExists( const Zstring& filename); //throw() replaces wxFileExists()!
@@ -47,21 +52,9 @@ wxULongLong getFilesize(const Zstring& filename); //throw (FileError)
//file handling
void removeFile(const Zstring& filename); //throw (FileError)
-void removeDirectory(const Zstring& directory); //throw (FileError)
+void removeDirectory(const Zstring& directory, RemoveDirCallback* callback = NULL); //throw (FileError)
-struct MoveFileCallback //callback functionality
-{
- virtual ~MoveFileCallback() {}
-
- enum Response
- {
- CONTINUE,
- CANCEL
- };
- virtual Response requestUiRefresh() = 0; //DON'T throw exceptions here, at least in Windows build!
-};
-
//rename file or directory: no copying!!!
void renameFile(const Zstring& oldName, const Zstring& newName); //throw (FileError);
@@ -76,17 +69,6 @@ void moveDirectory(const Zstring& sourceDir, const Zstring& targetDir, bool igno
void createDirectory(const Zstring& directory, const Zstring& templateDir, bool copyDirectorySymLinks, bool copyFilePermissions); //throw (FileError);
void createDirectory(const Zstring& directory); //throw (FileError); -> function overload avoids default parameter ambiguity issues!
-struct CopyFileCallback //callback functionality
-{
- virtual ~CopyFileCallback() {}
-
- enum Response
- {
- CONTINUE,
- CANCEL
- };
- virtual Response updateCopyStatus(const wxULongLong& totalBytesTransferred) = 0; //DON'T throw exceptions here, at least in Windows build!
-};
void copyFile(const Zstring& sourceFile, //throw (FileError);
const Zstring& targetFile,
@@ -98,8 +80,45 @@ void copyFile(const Zstring& sourceFile, //throw (FileError);
CopyFileCallback* callback); //may be NULL
//Note: it MAY happen that copyFile() leaves temp files behind, e.g. temporary network drop.
// => clean them up at an appropriate time (automatically set sync directions to delete them). They have the following ending:
-const Zstring TEMP_FILE_ENDING = DefaultStr(".ffs_tmp");
-}
+const Zstring TEMP_FILE_ENDING = Zstr(".ffs_tmp");
+
+
+
+
+//----------- callbacks ---------------
+struct RemoveDirCallback
+{
+ virtual ~RemoveDirCallback() {}
+ virtual void requestUiRefresh(const Zstring& currentObject) = 0;
+};
+
+
+struct MoveFileCallback //callback functionality
+{
+ virtual ~MoveFileCallback() {}
+
+ enum Response
+ {
+ CONTINUE,
+ CANCEL
+ };
+ virtual Response requestUiRefresh(const Zstring& currentObject) = 0; //DON'T throw exceptions here, at least in Windows build!
+};
+
+
+struct CopyFileCallback //callback functionality
+{
+ virtual ~CopyFileCallback() {}
+
+ enum Response
+ {
+ CONTINUE,
+ CANCEL
+ };
+ virtual Response updateCopyStatus(const wxULongLong& totalBytesTransferred) = 0; //DON'T throw exceptions here, at least in Windows build!
+};
+}
+
#endif //FILE_HANDLING_H_INCLUDED
bgstack15