| 1 | // -------------------------------------------------------------------------- |
|---|
| 2 | // |
|---|
| 3 | // File |
|---|
| 4 | // Name: BackupClientDeleteList.h |
|---|
| 5 | // Purpose: List of pending deletes for backup |
|---|
| 6 | // Created: 10/11/03 |
|---|
| 7 | // |
|---|
| 8 | // -------------------------------------------------------------------------- |
|---|
| 9 | |
|---|
| 10 | #ifndef BACKUPCLIENTDELETELIST__H |
|---|
| 11 | #define BACKUPCLIENTDELETELIST__H |
|---|
| 12 | |
|---|
| 13 | #include "BackupStoreFilename.h" |
|---|
| 14 | |
|---|
| 15 | class BackupClientContext; |
|---|
| 16 | |
|---|
| 17 | #include <vector> |
|---|
| 18 | #include <utility> |
|---|
| 19 | #include <set> |
|---|
| 20 | |
|---|
| 21 | // -------------------------------------------------------------------------- |
|---|
| 22 | // |
|---|
| 23 | // Class |
|---|
| 24 | // Name: BackupClientDeleteList |
|---|
| 25 | // Purpose: List of pending deletes for backup |
|---|
| 26 | // Created: 10/11/03 |
|---|
| 27 | // |
|---|
| 28 | // -------------------------------------------------------------------------- |
|---|
| 29 | class BackupClientDeleteList |
|---|
| 30 | { |
|---|
| 31 | private: |
|---|
| 32 | class FileToDelete |
|---|
| 33 | { |
|---|
| 34 | public: |
|---|
| 35 | int64_t mDirectoryID; |
|---|
| 36 | BackupStoreFilename mFilename; |
|---|
| 37 | std::string mLocalPath; |
|---|
| 38 | FileToDelete(int64_t DirectoryID, |
|---|
| 39 | const BackupStoreFilename& rFilename, |
|---|
| 40 | const std::string& rLocalPath); |
|---|
| 41 | }; |
|---|
| 42 | |
|---|
| 43 | class DirToDelete |
|---|
| 44 | { |
|---|
| 45 | public: |
|---|
| 46 | int64_t mObjectID; |
|---|
| 47 | std::string mLocalPath; |
|---|
| 48 | DirToDelete(int64_t ObjectID, const std::string& rLocalPath); |
|---|
| 49 | }; |
|---|
| 50 | |
|---|
| 51 | public: |
|---|
| 52 | BackupClientDeleteList(); |
|---|
| 53 | ~BackupClientDeleteList(); |
|---|
| 54 | |
|---|
| 55 | void AddDirectoryDelete(int64_t ObjectID, |
|---|
| 56 | const std::string& rLocalPath); |
|---|
| 57 | void AddFileDelete(int64_t DirectoryID, |
|---|
| 58 | const BackupStoreFilename &rFilename, |
|---|
| 59 | const std::string& rLocalPath); |
|---|
| 60 | |
|---|
| 61 | void StopDirectoryDeletion(int64_t ObjectID); |
|---|
| 62 | void StopFileDeletion(int64_t DirectoryID, |
|---|
| 63 | const BackupStoreFilename &rFilename); |
|---|
| 64 | |
|---|
| 65 | void PerformDeletions(BackupClientContext &rContext); |
|---|
| 66 | |
|---|
| 67 | private: |
|---|
| 68 | std::vector<DirToDelete> mDirectoryList; |
|---|
| 69 | std::set<int64_t> mDirectoryNoDeleteList; // note: things only get in this list if they're not present in mDirectoryList when they are 'added' |
|---|
| 70 | std::vector<FileToDelete> mFileList; |
|---|
| 71 | std::vector<std::pair<int64_t, BackupStoreFilename> > mFileNoDeleteList; |
|---|
| 72 | }; |
|---|
| 73 | |
|---|
| 74 | #endif // BACKUPCLIENTDELETELIST__H |
|---|
| 75 | |
|---|