Ditto 4.7.4
Loading...
Searching...
No Matches
DocumentPath.hpp
1#ifndef _DITTO_DOCUMENT_PATH_
2#define _DITTO_DOCUMENT_PATH_
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
31 friend class Document;
32
33private:
45 DocumentPath(CDocument_t *document, DocumentId id, std::string initial_path);
46
55 DocumentPath(const DocumentPath *document_path, std::string key);
56
65 DocumentPath(const DocumentPath *document_path, std::size_t index);
66
67public:
68 DocumentPath operator[](std::string key);
69 DocumentPath operator[](std::size_t index);
70
80 std::shared_ptr<AttachmentToken> get_attachment_token() const;
81
91 std::shared_ptr<Counter> get_counter() const;
92
102 std::shared_ptr<Register> get_register() const;
103};
104} // namespace ditto
105
106#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
A document belonging to a Collection with an inner value and an identifier (DocumentId).
Definition Document.hpp:17
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
std::shared_ptr< Register > get_register() const
Returns the value at the previously specified key in the document as a std::shared_ptr<Register>....
Definition DocumentPath.cpp:39
std::shared_ptr< Counter > get_counter() const
Returns the value at the previously specified key in the document as a std::shared_ptr<Counter>....
Definition DocumentPath.cpp:34
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...
Definition DocumentPath.cpp:29
An identifier for a Document.
Definition DocumentId.hpp:21