Ditto  3.0.4
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 
10 namespace ditto {
11 
12 class DittoHandleWrapper;
13 class Store;
14 
15 enum FileSystemType {
16  Directory,
17  File,
18  SymLink,
19 };
20 
22  friend class DiskUsage;
23 
24 public:
25  FileSystemType fs_type;
26  std::string path;
27  uint64_t size_in_bytes;
28  std::vector<DiskUsageChild> children;
29 };
30 
35 typedef 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_boxed_uint8 cbor);
56  void set_handle(DiskUsageObserver_t *inner_context);
57 
58 public:
60 };
61 
65 class DiskUsage {
66  friend class Ditto;
67  friend class Store;
68  friend class Attachment;
69  friend class Authenticator;
70 
71 private:
72  DiskUsage();
73  explicit DiskUsage(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
74  FsComponent component);
78  FsComponent component;
79  std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
80 
81 public:
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:26
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:28
Provides access to Collections and a write transaction API.
Definition: Store.hpp:21