summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2009-01-03 18:58:43 +0000
committerChris Wilson <chris+github@qwirx.com>2009-01-03 18:58:43 +0000
commite9070532716f24451850b1434606be0802524354 (patch)
tree498785438f2dbbf2047821963484d9e190653e7e
parentc56e4f5d4049c1c6ede4d899a22c7de87d331153 (diff)
Compare API for notification on starting to compare a file or directory.
-rw-r--r--bin/bbackupquery/BackupQueries.cpp6
-rw-r--r--bin/bbackupquery/BackupQueries.h12
-rw-r--r--bin/bbackupquery/BoxBackupCompareParams.h4
3 files changed, 20 insertions, 2 deletions
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,