From c32707148292d104c66276b43796d6057c8c7a5d Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:08:42 +0200 Subject: 3.10 --- shared/file_traverser.h | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'shared/file_traverser.h') 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) : returnCode(TRAVERSING_DIR_IGNORE), subDirCb(NULL) {} - ReturnValDir(Loki::Int2Type, TraverseCallback* subDirCallback) : returnCode(TRAVERSING_DIR_CONTINUE), subDirCb(subDirCallback) {} + ReturnValDir(Loki::Int2Type, 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 -- cgit