-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLocalFilesystem.h
More file actions
71 lines (57 loc) · 2.07 KB
/
LocalFilesystem.h
File metadata and controls
71 lines (57 loc) · 2.07 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef LOCALFILESYSTEM_H
#define LOCALFILESYSTEM_H
#include <Directory.h>
#include <Entry.h>
#include <List.h>
#include <Locker.h>
#include <Looper.h>
#include <Message.h>
#include <NodeMonitor.h>
#include <Path.h>
#include "config.h"
#include "Manager.h"
#define WATCH_FLAGS (B_WATCH_DIRECTORY | B_WATCH_STAT | B_WATCH_NAME)
class LocalFilesystem : public BLooper
{
public:
LocalFilesystem(Manager * manager, const char * rootPath) : BLooper() { fManager = manager; fCloudRootPath = rootPath; };
bool TestLocation(BMessage * dbMessage);
bool ResolveUnreferencedLocals(const char * leaf, BList & remote, BList & local, bool forceFull);
bool SendMissing(BList & items);
void ApplyFullPathToRelativeBasePath(BString &relative);
void ConvertFullPathToCloudRelativePath(BString &full);
void RecursivelyWatchDirectory(const char * fullPath, uint32 flags);
void WatchDirectories(void);
void CheckOrCreateRootFolder(void);
void MessageReceived(BMessage *msg);
void HandleNodeEvent(BMessage *message);
void HandleCreated(BMessage * message);
void HandleMoved(BMessage * message);
void HandleRemoved(BMessage * message);
void HandleChanged(BMessage * message);
void AddToIgnoreList(const char * fullPath);
void RemoveFromIgnoreList(const char * fullPath);
void WatchEntry(BEntry *entry, uint32 flags);
private:
Manager * fManager;
const char * fCloudRootPath;
class trackeddata {
public:
trackeddata(void) { path = new BPath(); };
~trackeddata(void) { delete path; }
node_ref nref;
BPath * path;
};
static BList sTrackedEntries;
static BList sIgnoredEntries;
static BLocker * sIgnoredEntriesLocker;
void StopWatchingNodeRef(node_ref *nref);
static bool IsInRemoteList(const char * path, time_t localModified, BList & remote);
static bool IsInIgnoredList(const char *fullPath);
static trackeddata * FindTrackedEntry(node_ref find);
void RemoveTrackedEntry(node_ref * find);
void RemoveTrackedEntriesForPath(const char *fullPath);
void RecursiveDelete(const char *path);
void RecursiveAddToCloud(const char *fullPath);
};
#endif