diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-05-28 15:24:05 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-05-28 15:24:05 +0000 |
commit | 1aaa7a42e7bd65902a07f29881b68acb45255d24 (patch) | |
tree | fe8983cd01778c757dea772933ca6654c852ab3c /bin/bbackupd/BackupClientDeleteList.h | |
parent | 441373e3cf2b6c1f4f119c4a4b0d494a6645b5c2 (diff) |
Track and log file deletions by name.
Split crypto init and file sync process into its own method, to reduce
call depth and facilitate calling in process from tests.
Differentiate between 3 uses of stat in BackupClientDirectoryRecord by
renaming the structures.
Use stat instead of lstat when checking the filesystem that's holding an
entity, in case it's a symbolic link to a different filesystem.
Diffstat (limited to 'bin/bbackupd/BackupClientDeleteList.h')
-rw-r--r-- | bin/bbackupd/BackupClientDeleteList.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/bin/bbackupd/BackupClientDeleteList.h b/bin/bbackupd/BackupClientDeleteList.h index 5940cf50..b0fbf51a 100644 --- a/bin/bbackupd/BackupClientDeleteList.h +++ b/bin/bbackupd/BackupClientDeleteList.h @@ -28,22 +28,46 @@ class BackupClientContext; // -------------------------------------------------------------------------- class BackupClientDeleteList { +private: + class FileToDelete + { + public: + int64_t mDirectoryID; + BackupStoreFilename mFilename; + std::string mLocalPath; + FileToDelete(int64_t DirectoryID, + const BackupStoreFilename& rFilename, + const std::string& rLocalPath); + }; + + class DirToDelete + { + public: + int64_t mObjectID; + std::string mLocalPath; + DirToDelete(int64_t ObjectID, const std::string& rLocalPath); + }; + public: BackupClientDeleteList(); ~BackupClientDeleteList(); - void AddDirectoryDelete(int64_t ObjectID); - void AddFileDelete(int64_t DirectoryID, const BackupStoreFilename &rFilename); + void AddDirectoryDelete(int64_t ObjectID, + const std::string& rLocalPath); + void AddFileDelete(int64_t DirectoryID, + const BackupStoreFilename &rFilename, + const std::string& rLocalPath); void StopDirectoryDeletion(int64_t ObjectID); - void StopFileDeletion(int64_t DirectoryID, const BackupStoreFilename &rFilename); + void StopFileDeletion(int64_t DirectoryID, + const BackupStoreFilename &rFilename); void PerformDeletions(BackupClientContext &rContext); private: - std::vector<int64_t> mDirectoryList; + std::vector<DirToDelete> mDirectoryList; std::set<int64_t> mDirectoryNoDeleteList; // note: things only get in this list if they're not present in mDirectoryList when they are 'added' - std::vector<std::pair<int64_t, BackupStoreFilename> > mFileList; + std::vector<FileToDelete> mFileList; std::vector<std::pair<int64_t, BackupStoreFilename> > mFileNoDeleteList; }; |