From e9070532716f24451850b1434606be0802524354 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 3 Jan 2009 18:58:43 +0000 Subject: Compare API for notification on starting to compare a file or directory. --- bin/bbackupquery/BackupQueries.cpp | 6 +++++- bin/bbackupquery/BackupQueries.h | 12 +++++++++++- bin/bbackupquery/BoxBackupCompareParams.h | 4 ++++ 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'bin/bbackupquery') diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index 76ecfcf8..85f659d4 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -1436,6 +1436,8 @@ void BackupQueries::Compare(const std::string &rStoreDir, void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const std::string &rLocalDir, BoxBackupCompareParams &rParams) { + rParams.NotifyDirComparing(rLocalDir, rStoreDir); + // Get info on the local directory struct stat st; if(::lstat(rLocalDir.c_str(), &st) != 0) @@ -1622,6 +1624,8 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, std::string localPath(MakeFullPath(rLocalDir, fileName)); std::string storePath(rStoreDir + "/" + fileName); + rParams.NotifyFileComparing(localPath, storePath); + // Does the file exist locally? string_set_iter_t local(localFiles.find(fileName)); if(local == localFiles.end()) @@ -1631,7 +1635,7 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, storePath); } else - { + { int64_t fileSize = 0; struct stat st; diff --git a/bin/bbackupquery/BackupQueries.h b/bin/bbackupquery/BackupQueries.h index 0744a1c3..392aa428 100644 --- a/bin/bbackupquery/BackupQueries.h +++ b/bin/bbackupquery/BackupQueries.h @@ -213,6 +213,11 @@ public: mExcludedDirs ++; } + virtual void NotifyDirComparing(const std::string& rLocalPath, + const std::string& rRemotePath) + { + } + virtual void NotifyDirCompared( const std::string& rLocalPath, const std::string& rRemotePath, @@ -238,7 +243,12 @@ public: } } } - + + virtual void NotifyFileComparing(const std::string& rLocalPath, + const std::string& rRemotePath) + { + } + virtual void NotifyFileCompared(const std::string& rLocalPath, const std::string& rRemotePath, int64_t NumBytes, bool HasDifferentAttributes, bool HasDifferentContents, diff --git a/bin/bbackupquery/BoxBackupCompareParams.h b/bin/bbackupquery/BoxBackupCompareParams.h index d8c50fc3..7cd75e27 100644 --- a/bin/bbackupquery/BoxBackupCompareParams.h +++ b/bin/bbackupquery/BoxBackupCompareParams.h @@ -90,9 +90,13 @@ public: const std::string& rRemotePath) = 0; virtual void NotifyExcludedDir(const std::string& rLocalPath, const std::string& rRemotePath) = 0; + virtual void NotifyDirComparing(const std::string& rLocalPath, + const std::string& rRemotePath) = 0; virtual void NotifyDirCompared(const std::string& rLocalPath, const std::string& rRemotePath, bool HasDifferentAttributes, bool modifiedAfterLastSync) = 0; + virtual void NotifyFileComparing(const std::string& rLocalPath, + const std::string& rRemotePath) = 0; virtual void NotifyFileCompared(const std::string& rLocalPath, const std::string& rRemotePath, int64_t NumBytes, bool HasDifferentAttributes, bool HasDifferentContents, -- cgit v1.2.3