blob: f47c7a54c6b1d5a384311e9a8c21c453bb532a86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// --------------------------------------------------------------------------
//
// File
// Name: BackupClientInodeToIDMap.h
// Purpose: Map of inode numbers to file IDs on the store
// Created: 11/11/03
//
// --------------------------------------------------------------------------
#ifndef BACKUPCLIENTINODETOIDMAP_H
#define BACKUPCLIENTINODETOIDMAP_H
#include <sys/types.h>
#include <map>
#include <utility>
// avoid having to include the DB files when not necessary
#ifndef BACKIPCLIENTINODETOIDMAP_IMPLEMENTATION
struct TDB_CONTEXT;
struct TDB_DATUM;
#endif
// --------------------------------------------------------------------------
//
// Class
// Name: BackupClientInodeToIDMap
// Purpose: Map of inode numbers to file IDs on the store
// Created: 11/11/03
//
// --------------------------------------------------------------------------
class BackupClientInodeToIDMap
{
public:
BackupClientInodeToIDMap();
~BackupClientInodeToIDMap();
private:
BackupClientInodeToIDMap(const BackupClientInodeToIDMap &rToCopy); // not allowed
public:
void Open(const char *Filename, bool ReadOnly, bool CreateNew);
void OpenEmpty();
void AddToMap(InodeRefType InodeRef, int64_t ObjectID, int64_t InDirectory);
bool Lookup(InodeRefType InodeRef, int64_t &rObjectIDOut, int64_t &rInDirectoryOut) const;
void Close();
private:
bool mReadOnly;
bool mEmpty;
std::string mFilename;
TDB_CONTEXT *mpContext;
};
#endif // BACKUPCLIENTINODETOIDMAP_H
|