Ditto 4.6.0
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#include <string>
8#include <vector>
9
10namespace ditto {
11
12class DittoHandleWrapper;
13class Store;
14
15enum FileSystemType {
16 Directory,
17 File,
18 SymLink,
19};
20
22 friend class DiskUsage;
23
24public:
25 FileSystemType fs_type;
26 std::string path;
27 uint64_t size_in_bytes;
28 std::vector<DiskUsageChild> children;
29};
30
35typedef std::function<void(DiskUsageChild)> DiskUsageCallback;
36
38 friend class DiskUsage;
39
44 DiskUsageObserver_t *inner_context;
45 DiskUsageCallback cb;
46
47 explicit DiskObserverContext(DiskUsageCallback callback);
55 static void on_event(void *ctx, slice_ref_uint8_t cbor);
56 void set_handle(DiskUsageObserver_t *inner_context);
57
58public:
60};
61
65class DiskUsage {
66 friend class Ditto;
67 friend class Store;
68 friend class Attachment;
69 friend class Authenticator;
70
71private:
72 DiskUsage();
73 DiskUsage(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
74 FsComponent component);
78 FsComponent component;
79 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
80
81public:
82 std::shared_ptr<DiskObserverContext> observe(DiskUsageCallback cb);
83 DiskUsageChild exec();
84};
85
86} // namespace ditto
87
88#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:37
Definition DiskUsage.hpp:21
Provides an interface to be able to monitor local files.
Definition DiskUsage.hpp:65
The entrypoint to the Ditto SDK.
Definition Ditto.hpp:32
Provides access to Collections and a write transaction API.
Definition Store.hpp:29
Definition Arc.hpp:10