Ditto 4.13.1
 
Loading...
Searching...
No Matches
DocumentPath.hpp
1#ifndef DITTO_DOCUMENT_PATH_H
2#define DITTO_DOCUMENT_PATH_H
3
4#include "AbstractDocumentPath.hpp"
5#include "AttachmentToken.hpp"
6#include "Counter.hpp"
7#include "DocumentId.hpp"
8#include "Register.hpp"
9
10#include "Helpers.hpp"
11#include "document_path_component.hpp"
12
13#include "json.hpp"
14
15#include <memory>
16#include <string>
17#include <vector>
18
19namespace ditto {
20
33class DITTO_DEPRECATED_BECAUSE(
34 "Use DQL (Ditto Query Language) instead. For more information "
35 "see: https://ditto.com/link/legacy-to-dql-guide") DocumentPath
36 : public AbstractDocumentPath {
37 DITTO_DISABLE_DEPRECATED_WARNINGS("The legacy query API is deprecated")
38 friend class Document;
39
40private:
52 DocumentPath(CDocument_t *document, DocumentId id, std::string initial_path);
53
62 DocumentPath(const DocumentPath *document_path, std::string key);
63
72 DocumentPath(const DocumentPath *document_path, std::size_t index);
73
74public:
75 DocumentPath operator[](std::string key);
76 DocumentPath operator[](std::size_t index);
77
87 std::shared_ptr<AttachmentToken> get_attachment_token() const;
88
98 std::shared_ptr<Counter> get_counter() const;
99
109 std::shared_ptr<Register> get_register() const;
110
111 DITTO_REENABLE_WARNINGS
112};
113} // namespace ditto
114
115#endif
AbstractDocumentPath(CDocument_t const *document, DocumentId id, std::string initial_path)
Constructs a new initial AbstractDocumentPath for a document.
std::shared_ptr< Register > get_register() const
Returns the value at the previously specified key in the document as a std::shared_ptr<Register>....
std::shared_ptr< Counter > get_counter() const
Returns the value at the previously specified key in the document as a std::shared_ptr<Counter>....
std::shared_ptr< AttachmentToken > get_attachment_token() const
Returns the value at the previously specified key in the document as a std::shared_ptr<AttachmentToke...
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19
An identifier for a Document.
Definition DocumentId.hpp:23