diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:15:39 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:15:39 +0200 |
commit | d2854834e18443876c8f75e0a7f3b88d1d549fc4 (patch) | |
tree | e967b628081e50abc7c34cd264e6586271c7e728 /zen/file_traverser.h | |
parent | 4.1 (diff) | |
download | FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.gz FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.bz2 FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.zip |
4.2
Diffstat (limited to 'zen/file_traverser.h')
-rw-r--r-- | zen/file_traverser.h | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/zen/file_traverser.h b/zen/file_traverser.h index 4dbed9f9..3f4f47d5 100644 --- a/zen/file_traverser.h +++ b/zen/file_traverser.h @@ -7,8 +7,8 @@ #ifndef FILETRAVERSER_H_INCLUDED #define FILETRAVERSER_H_INCLUDED +#include <memory> #include "zstring.h" -#include "type_tools.h" #include "int64.h" //advanced file traverser returning metadata and hierarchical information on files and directories @@ -28,24 +28,9 @@ public: struct SymlinkInfo { - Int64 lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC - Zstring targetPath; //may be empty if something goes wrong - bool dirLink; //"true": point to dir; "false": point to file (or broken Link on Linux) - }; - - struct ReturnValDir - { - enum ReturnValueEnh - { - TRAVERSING_DIR_IGNORE, - TRAVERSING_DIR_CONTINUE - }; - - ReturnValDir(Int2Type<TRAVERSING_DIR_IGNORE>) : returnCode(TRAVERSING_DIR_IGNORE), subDirCb(NULL) {} - ReturnValDir(Int2Type<TRAVERSING_DIR_CONTINUE>, TraverseCallback& subDirCallback) : returnCode(TRAVERSING_DIR_CONTINUE), subDirCb(&subDirCallback) {} - - ReturnValueEnh returnCode; - TraverseCallback* subDirCb; + Int64 lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC + Zstring targetPath; //may be empty if something goes wrong + bool dirLink; //"true": point to dir; "false": point to file (or broken Link on Linux) }; enum HandleError @@ -55,10 +40,11 @@ public: }; //overwrite these virtual methods - 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; - virtual HandleError onError (const std::wstring& errorText) = 0; + virtual std::shared_ptr<TraverseCallback> //nullptr: ignore directory, non-nullptr: traverse into + /**/ onDir (const Zchar* 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 HandleError onError (const std::wstring& errorText) = 0; }; |