diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:08:42 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:08:42 +0200 |
commit | c32707148292d104c66276b43796d6057c8c7a5d (patch) | |
tree | bb83513f4aff24153e21a4ec92e34e4c27651b1f /shared/file_traverser.h | |
parent | 3.9 (diff) | |
download | FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.gz FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.bz2 FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.zip |
3.10
Diffstat (limited to 'shared/file_traverser.h')
-rw-r--r-- | shared/file_traverser.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/shared/file_traverser.h b/shared/file_traverser.h index d61ff1cd..61237834 100644 --- a/shared/file_traverser.h +++ b/shared/file_traverser.h @@ -33,9 +33,8 @@ public: bool dirLink; //"true": point to dir; "false": point to file (or broken Link on Linux) }; - class ReturnValDir + struct ReturnValDir { - public: enum ReturnValueEnh { TRAVERSING_DIR_IGNORE, @@ -43,7 +42,7 @@ public: }; ReturnValDir(Loki::Int2Type<TRAVERSING_DIR_IGNORE>) : returnCode(TRAVERSING_DIR_IGNORE), subDirCb(NULL) {} - ReturnValDir(Loki::Int2Type<TRAVERSING_DIR_CONTINUE>, TraverseCallback* subDirCallback) : returnCode(TRAVERSING_DIR_CONTINUE), subDirCb(subDirCallback) {} + ReturnValDir(Loki::Int2Type<TRAVERSING_DIR_CONTINUE>, TraverseCallback& subDirCallback) : returnCode(TRAVERSING_DIR_CONTINUE), subDirCb(&subDirCallback) {} const ReturnValueEnh returnCode; TraverseCallback* const subDirCb; @@ -51,14 +50,28 @@ public: //overwrite these virtual methods virtual void onError(const wxString& errorText) = 0; - virtual void onFile( const DefaultChar* shortName, const Zstring& fullName, const FileInfo& details) = 0; - virtual void onSymlink( const DefaultChar* shortName, const Zstring& fullName, const SymlinkInfo& details) = 0; - virtual ReturnValDir onDir(const DefaultChar* shortName, const Zstring& fullName) = 0; + virtual void onFile( const Zchar* shortName, const Zstring& fullName, const FileInfo& details) = 0; + virtual void onSymlink( const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) = 0; + virtual ReturnValDir onDir(const Zchar* shortName, const Zstring& fullName) = 0; }; + +#ifdef FFS_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 +}; +#else +struct DstHackCallback; //DST hack not required on Linux +#endif + //custom traverser with detail information about files //directory may end with PATH_SEPARATOR -void traverseFolder(const Zstring& directory, bool followSymlinks, TraverseCallback* sink); //throw(); +void traverseFolder(const Zstring& directory, //throw(); + bool followSymlinks, + TraverseCallback& sink, + DstHackCallback* dstCallback = NULL); //apply DST hack if callback is supplied //followSymlinks: //"true": Symlinks dereferenced and reported via onFile() and onDir() => onSymlink not used! //"false": Symlinks directly reported via onSymlink(), directory symlinks are not followed |