Ditto
4.7.5-rc.1
Loading...
Searching...
No Matches
include
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
11
namespace
ditto {
12
13
class
DittoHandleWrapper;
14
class
Store;
15
16
enum
FileSystemType {
17
Directory,
18
File,
19
SymLink,
20
};
21
22
class
DiskUsageChild
{
23
friend
class
DiskUsage
;
24
25
public
:
26
FileSystemType fs_type;
27
std::string path;
28
uint64_t size_in_bytes;
29
std::vector<DiskUsageChild> children;
30
};
31
36
typedef
std::function<void(
DiskUsageChild
)> DiskUsageCallback;
37
38
class
DiskObserverContext
{
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
59
public
:
60
~DiskObserverContext
();
61
};
62
66
class
DiskUsage
{
67
friend
class
Ditto
;
68
friend
class
Store
;
69
friend
class
Attachment
;
70
friend
class
Authenticator
;
71
72
private
:
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
82
public
:
83
std::shared_ptr<DiskObserverContext> observe(DiskUsageCallback cb);
84
DiskUsageChild
exec();
85
};
86
87
}
// namespace ditto
88
89
#endif
ditto::Attachment
Represents an attachment and can be used to insert the associated attachment into a document at a spe...
Definition
Attachment.hpp:22
ditto::Authenticator
Provides access to authentication information and methods for logging on to Ditto Cloud....
Definition
Authenticator.hpp:27
ditto::DiskObserverContext
Definition
DiskUsage.hpp:38
ditto::DiskUsageChild
Definition
DiskUsage.hpp:22
ditto::DiskUsage
Provides an interface to be able to monitor local files.
Definition
DiskUsage.hpp:66
ditto::Ditto
The entrypoint to the Ditto SDK.
Definition
Ditto.hpp:32
ditto::Store
Provides access to Collections and a write transaction API.
Definition
Store.hpp:29
Generated by
1.11.0