Ditto 4.7.4
Loading...
Searching...
No Matches
AttachmentToken.hpp
1#ifndef _DITTO_ATTACHMENT_TOKEN_
2#define _DITTO_ATTACHMENT_TOKEN_
3
4#include "any.hpp"
5#include "json.hpp"
6
7#include <map>
8#include <string>
9#include <vector>
10
11namespace ditto {
12
18 friend class AttachmentFetcher;
19 friend struct AttachmentFetcherCtx;
20 friend class AbstractDocumentPath;
21 friend class DocumentPath;
22 friend class MutableDocumentPath;
23 friend class Store;
24
25public:
31 std::string get_id() const;
32
38 uint64_t get_len() const;
39
45 std::map<std::string, std::string> get_metadata() const { return metadata; }
46
47private:
48 nlohmann::json::binary_t id;
49 uint64_t len;
50 std::map<std::string, std::string> metadata;
51
52 explicit AttachmentToken(nlohmann::json const &info);
53 explicit AttachmentToken(
54 std::unordered_map<std::string, any> const &map_representation);
55};
56} // namespace ditto
57#endif
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition AbstractDocumentPath.hpp:21
These objects are returned by calls to Store::fetch_attachment.
Definition AttachmentFetcher.hpp:28
Serves as a token for a specific attachment that you can pass to a call to Store::fetch_attachment.
Definition AttachmentToken.hpp:17
std::string get_id() const
Gets the attachment's ID.
Definition AttachmentToken.cpp:80
uint64_t get_len() const
Gets the attachment's size in bytes.
Definition AttachmentToken.cpp:85
std::map< std::string, std::string > get_metadata() const
Gets the attachment's metadata.
Definition AttachmentToken.hpp:45
Provides an interface to specify a path to a key in a document that you can then call a function on t...
Definition DocumentPath.hpp:30
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition MutableDocumentPath.hpp:31
Provides access to Collections and a write transaction API.
Definition Store.hpp:29
basic_json<> json
default JSON class
Definition json.hpp:2933