1#ifndef SOURCEMETA_CORE_JSONPATH_H_
2#define SOURCEMETA_CORE_JSONPATH_H_
4#ifndef SOURCEMETA_CORE_JSONPATH_EXPORT
5#include <sourcemeta/core/jsonpath_export.h>
9#include <sourcemeta/core/jsonpath_error.h>
12#include <sourcemeta/core/json.h>
13#include <sourcemeta/core/jsonpointer.h>
14#include <sourcemeta/core/regex.h>
31namespace sourcemeta::core {
38#pragma warning(disable : 4251)
43class SOURCEMETA_CORE_JSONPATH_EXPORT
JSONPath {
54 JSON::Object::hash_type
hash;
69 std::optional<std::int64_t>
start;
71 std::optional<std::int64_t> end;
140 std::variant<JSON, FilterQuery, FilterFunctionCall>
value;
158 std::variant<FilterQuery, FilterFunctionCall>
subject;
187 enum class FilterExpressionKind : std::uint8_t {
217 enum class SelectorKind : std::uint8_t {
324 JSON::String expression_;
std::basic_string< Char, CharTraits, Allocator< Char > > String
The string type used by the JSON document.
Definition json_value.h:52
std::basic_string_view< Char, CharTraits > StringView
The string view type used by the JSON document.
Definition json_value.h:54
@ Index
A map of index labels carrying no RDF ranging over an object.
Definition jsonld_materialize.h:116
static auto from_json(const JSON &value) -> std::optional< JSONPath >
static auto normalize(const WeakPointer &location) -> JSON::String
SegmentKind
The precomputed shape of a query segment.
Definition jsonpath.h:227
FilterFunctionName
The function extensions that filter expressions can invoke.
Definition jsonpath.h:77
std::function< void(const JSON &value, const WeakPointer &location)> Callback
The callback invoked for every query result node.
Definition jsonpath.h:46
auto evaluate(const JSON &document, const Callback &callback) const -> void
JSONPath(const JSON::StringView expression)
auto to_json() const -> JSON
FilterComparisonOperator
The operators that filter comparisons can use.
Definition jsonpath.h:91
std::variant< SelectorName, SelectorWildcard, SelectorIndex, SelectorSlice, SelectorFilter > Selector
A single selector within a query segment.
Definition jsonpath.h:212
GenericPointer< std::reference_wrapper< const std::string >, PropertyHashJSON< JSON::String > > WeakPointer
Definition jsonpointer.h:44
@ Match
The verifier corresponds to the challenge.
Definition oauth_pkce.h:36