source: box/trunk/bin/bbackupd/BackupClientDeleteList.h @ 2181

Revision 2181, 1.9 KB checked in by chris, 4 years ago (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.

  • Property svn:eol-style set to native
Line 
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
15class 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// --------------------------------------------------------------------------
29class BackupClientDeleteList
30{
31private:
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
51public:
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       
67private:
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
Note: See TracBrowser for help on using the repository browser.