summaryrefslogtreecommitdiff
path: root/zen/file_traverser.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:59 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:59 +0200
commita1c91f4695e208d5a8f80dc37b1818169b7829ff (patch)
tree52f5134376d17c99b6c9e53133a2eb5cf171377c /zen/file_traverser.h
parent5.16 (diff)
downloadFreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.gz
FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.bz2
FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.zip
5.17
Diffstat (limited to 'zen/file_traverser.h')
-rw-r--r--zen/file_traverser.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/zen/file_traverser.h b/zen/file_traverser.h
index 13b76966..a1d8ac9e 100644
--- a/zen/file_traverser.h
+++ b/zen/file_traverser.h
@@ -7,7 +7,7 @@
#ifndef FILETRAVERSER_H_INCLUDED
#define FILETRAVERSER_H_INCLUDED
-#include <memory>
+//#include <memory>
#include "zstring.h"
#include "int64.h"
#include "file_id_def.h"
@@ -20,17 +20,18 @@ struct TraverseCallback
{
virtual ~TraverseCallback() {}
- struct FileInfo
+ struct SymlinkInfo
{
- UInt64 fileSize; //unit: bytes!
Int64 lastWriteTime; //number of seconds since Jan. 1st 1970 UTC
- FileId id; //optional: initial if not supported!
- //std::unique_ptr<SymlinkInfo> symlinkInfo; //only filled if file is dereferenced symlink
};
- struct SymlinkInfo
+ struct FileInfo
{
+ FileInfo() : symlinkInfo() {}
+ UInt64 fileSize; //unit: bytes!
Int64 lastWriteTime; //number of seconds since Jan. 1st 1970 UTC
+ FileId id; //optional: initial if not supported!
+ const SymlinkInfo* symlinkInfo; //only filled if file is a followed symlink
};
enum HandleLink
@@ -45,22 +46,24 @@ struct TraverseCallback
ON_ERROR_IGNORE
};
- virtual std::shared_ptr<TraverseCallback> //nullptr: ignore directory, non-nullptr: traverse into using the (new) callback
- /**/ onDir (const Zchar* shortName, const Zstring& fullName) = 0;
- virtual void onFile (const Zchar* shortName, const Zstring& fullName, const FileInfo& details) = 0;
- virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) = 0;
+ virtual void onFile (const Zchar* shortName, const Zstring& fullName, const FileInfo& details) = 0;
+ virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) = 0;
+ virtual TraverseCallback* onDir (const Zchar* shortName, const Zstring& fullName) = 0;
+ //nullptr: ignore directory, non-nullptr: traverse into using the (new) callback => implement releaseDirTraverser() if necessary!
+ virtual void releaseDirTraverser(TraverseCallback* trav) {}
+
virtual HandleError reportDirError (const std::wstring& msg) = 0; //failed directory traversal -> consider directory data as incomplete!
- virtual HandleError reportItemError(const std::wstring& msg, const Zchar* shortName) = 0; //failed to get single file/dir/symlink only!
+ virtual HandleError reportItemError(const std::wstring& msg, const Zchar* shortName) = 0; //failed to get data for single file/dir/symlink only!
};
-#ifdef FFS_WIN
+#ifdef ZEN_WIN
struct DstHackCallback
{
virtual ~DstHackCallback() {}
virtual void requestUiRefresh(const Zstring& filename) = 0; //applying DST hack imposes significant one-time performance drawback => callback to inform user
};
-#elif defined FFS_LINUX || defined FFS_MAC
+#elif defined ZEN_LINUX || defined ZEN_MAC
struct DstHackCallback; //DST hack not required on Unix
#endif
bgstack15