Ditto 4.7.5-rc.1
Loading...
Searching...
No Matches
DiskUsage.hpp
1#ifndef _DITTO_DISK_USAGE_
2#define _DITTO_DISK_USAGE_
3
4#include "DittoHandleWrapper.hpp"
5#include "dittoffi.hpp"
6#include "json.hpp"
7
8#include <string>
9#include <vector>
10
11namespace ditto {
12
13class DittoHandleWrapper;
14class Store;
15
16enum FileSystemType {
17 Directory,
18 File,
19 SymLink,
20};
21
23 friend class DiskUsage;
24
25public:
26 FileSystemType fs_type;
27 std::string path;
28 uint64_t size_in_bytes;
29 std::vector<DiskUsageChild> children;
30};
31
36typedef std::function<void(DiskUsageChild)> DiskUsageCallback;
37
39 friend class DiskUsage;
40
45 DiskUsageObserver_t *inner_context;
46 DiskUsageCallback cb;
47
48 explicit DiskObserverContext(DiskUsageCallback callback);
56 static void on_event(void *ctx, slice_ref_uint8_t cbor);
57 void set_handle(DiskUsageObserver_t *inner_context);
58
59public:
61};
62
66class DiskUsage {
67 friend class Ditto;
68 friend class Store;
69 friend class Attachment;
70 friend class Authenticator;
71
72private:
73 DiskUsage();
74 DiskUsage(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
75 FsComponent component);
79 FsComponent component;
80 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
81
82public:
83 std::shared_ptr<DiskObserverContext> observe(DiskUsageCallback cb);
84 DiskUsageChild exec();
85};
86
87} // namespace ditto
88
89#endif
Represents an attachment and can be used to insert the associated attachment into a document at a spe...
Definition Attachment.hpp:22
Provides access to authentication information and methods for logging on to Ditto Cloud....
Definition Authenticator.hpp:27
Definition DiskUsage.hpp:38
Definition DiskUsage.hpp:22
Provides an interface to be able to monitor local files.
Definition DiskUsage.hpp:66
The entrypoint to the Ditto SDK.
Definition Ditto.hpp:32
Provides access to Collections and a write transaction API.
Definition Store.hpp:29