summaryrefslogtreecommitdiff
path: root/shared/IFileOperation/file_op.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:06 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:08:06 +0200
commitfbe76102e941b9f1edaf236788e42678f05fdf9a (patch)
treef5f538316019fa89be8dc478103490c3a826f3ac /shared/IFileOperation/file_op.h
parent3.8 (diff)
downloadFreeFileSync-fbe76102e941b9f1edaf236788e42678f05fdf9a.tar.gz
FreeFileSync-fbe76102e941b9f1edaf236788e42678f05fdf9a.tar.bz2
FreeFileSync-fbe76102e941b9f1edaf236788e42678f05fdf9a.zip
3.9
Diffstat (limited to 'shared/IFileOperation/file_op.h')
-rw-r--r--shared/IFileOperation/file_op.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/shared/IFileOperation/file_op.h b/shared/IFileOperation/file_op.h
new file mode 100644
index 00000000..8fa6a75b
--- /dev/null
+++ b/shared/IFileOperation/file_op.h
@@ -0,0 +1,47 @@
+// **************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
+// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+//
+#ifndef RECYCLER_DLL_H
+#define RECYCLER_DLL_H
+
+#ifdef FILE_OP_DLL_EXPORTS
+#define FILE_OP_DLL_API extern "C" __declspec(dllexport)
+#else
+#define FILE_OP_DLL_API extern "C" __declspec(dllimport)
+#endif
+
+
+namespace FileOp
+{
+//COM needs to be initialized before calling any of these functions! CoInitializeEx/CoUninitialize
+
+FILE_OP_DLL_API
+bool moveToRecycleBin(const wchar_t* fileNames[],
+ size_t fileNo); //size of fileNames array
+
+FILE_OP_DLL_API
+bool copyFile(const wchar_t* sourceFile,
+ const wchar_t* targetFile);
+
+//if any of the functions above returns 'false', this message returns last error
+FILE_OP_DLL_API
+void getLastError(wchar_t* errorMessage, size_t errorBufferLen);
+
+
+//function typedefs
+typedef bool (*MoveToRecycleBinFct)(const wchar_t* fileNames[], size_t fileNo);
+typedef bool (*CopyFileFct)(const wchar_t* sourceFile, const wchar_t* targetFile);
+typedef void (*GetLastErrorFct)(wchar_t* errorMessage, size_t errorBufferLen);
+
+//function names (use const pointers to ensure internal linkage)
+const char* const moveToRecycleBinFctName = "moveToRecycleBin";
+const char* const copyFileFctName = "copyFile";
+const char* const getLastErrorFctName = "getLastError";
+}
+
+
+
+#endif //RECYCLER_DLL_H
bgstack15