1#ifndef DITTO_ABSTRACT_DOCUMENT_PATH_H
2#define DITTO_ABSTRACT_DOCUMENT_PATH_H
5#include "UpdateResult.hpp"
8using CDocument_t =
struct CDocument;
16using json_callback DITTO_DEPRECATED_BECAUSE(
17 "Use DQL (Ditto Query Language) instead. For more information "
18 "see: https://ditto.com/link/legacy-to-dql-guide") =
19 bool (nlohmann::json::*)()
const;
31class DITTO_DEPRECATED_BECAUSE(
32 "Use DQL (Ditto Query Language) instead. For more information "
37 CDocument_t
const *document;
55 std::string initial_path);
95 PathAccessorType path_type)
const;
99 std::shared_ptr<T> get_object_or_default(json_callback json_cb,
100 PathAccessorType path_type)
const;
102 template <
typename T>
104 get_mut_object_or_default(json_callback json_cb,
105 PathAccessorType path_type)
const;
108 nlohmann::json get_json(PathAccessorType path_type)
const;
194 nlohmann::json get_json()
const;
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...
double get_double_value() const
Returns the value at the previously specified key in the document as a double. If the key was invalid...
AbstractDocumentPath(CDocument_t const *document, DocumentId id, std::string initial_path)
Constructs a new initial AbstractDocumentPath for a document.
float get_float_value() const
Returns the value at the previously specified key in the document as a float. If the key was invalid ...
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...
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.
std::string get_string_value() const
Returns the value at the previously specified key in the document as a std::string....
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...
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19
An identifier for a Document.
Definition DocumentId.hpp:23