Ditto 4.13.1
 
Loading...
Searching...
No Matches
AttachmentToken.hpp
1#ifndef DITTO_ATTACHMENT_TOKEN_H
2#define DITTO_ATTACHMENT_TOKEN_H
3
4#include "Helpers.hpp"
5#include "any.hpp"
6#include "json.hpp"
7
8#include <map>
9#include <string>
10#include <vector>
11
12namespace ditto {
13
18class AttachmentToken {
19 friend class AttachmentFetcher;
20 friend struct AttachmentFetcherCtx;
21 DITTO_DISABLE_DEPRECATED_WARNINGS(
22 "AbstractDocumentPath is deprecated, and will be removed in v5")
23 friend class AbstractDocumentPath;
24 DITTO_REENABLE_WARNINGS
25 friend class DocumentPath;
26 friend class MutableDocumentPath;
27 friend class Store;
28
29public:
35 std::string get_id() const;
36
42 uint64_t get_len() const;
43
49 std::map<std::string, std::string> get_metadata() const { return metadata; }
50
51private:
52 nlohmann::json::binary_t id;
53 uint64_t len;
54 std::map<std::string, std::string> metadata;
55
56 explicit AttachmentToken(nlohmann::json const &info);
57 explicit AttachmentToken(
58 std::unordered_map<std::string, any> const &map_representation);
59};
60} // namespace ditto
61#endif
Serves as a token for a specific attachment that you can pass to a call to Store::fetch_attachment.
Definition AttachmentToken.hpp:18
std::string get_id() const
Gets the attachment's ID.
uint64_t get_len() const
Gets the attachment's size in bytes.
std::map< std::string, std::string > get_metadata() const
Gets the attachment's metadata.
Definition AttachmentToken.hpp:49
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19