1#ifndef _DITTO_ABSTRACT_DOCUMENT_PATH_
2#define _DITTO_ABSTRACT_DOCUMENT_PATH_
5#include "UpdateResult.hpp"
8typedef struct CDocument CDocument_t;
13typedef bool (nlohmann::json::*json_callback)() const;
23 CDocument_t
const *document;
39 std::string initial_path);
79 PathAccessorType path_type)
const;
84 PathAccessorType path_type)
const;
88 get_mut_object_or_default(json_callback json_cb,
89 PathAccessorType path_type)
const;
92 nlohmann::json
get_json(PathAccessorType path_type)
const;
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition AbstractDocumentPath.hpp:21
int get_int_value() const
Returns the value at the previously specified key in the document as an int. If the key was invalid a...
Definition AbstractDocumentPath.cpp:147
std::shared_ptr< T > get_object_or_default(json_callback json_cb, PathAccessorType path_type) const
Helper function to retrieve crdt objects.
Definition AbstractDocumentPath.cpp:117
double get_double_value() const
Returns the value at the previously specified key in the document as a double. If the key was invalid...
Definition AbstractDocumentPath.cpp:152
AbstractDocumentPath(CDocument_t const *document, DocumentId id, std::string initial_path)
Constructs a new initial AbstractDocumentPath for a document.
Definition AbstractDocumentPath.cpp:40
float get_float_value() const
Returns the value at the previously specified key in the document as a float. If the key was invalid ...
Definition AbstractDocumentPath.cpp:157
AbstractDocumentPath operator[](std::string path)
Used to specify a path to a key in the document that you can subscript further to access a nested key...
Definition AbstractDocumentPath.cpp:60
T get_primitive_or_default(T default_value, json_callback json_cb, PathAccessorType path_type) const
Get the primitive stored at a given path or the corresponding default value.
Definition AbstractDocumentPath.cpp:91
std::string get_string_value() const
Returns the value at the previously specified key in the document as a std::string....
Definition AbstractDocumentPath.cpp:142
bool get_bool_value() const
Returns the value at the previously specified key in the document as a bool. If the key was invalid a...
Definition AbstractDocumentPath.cpp:162
nlohmann::json get_json() const
Returns the value at the previously specified key in the document as a nlohmann::json object....
Definition AbstractDocumentPath.cpp:167
An identifier for a Document.
Definition DocumentId.hpp:21