#pragma once #include #include #include namespace jvalidate { template struct ParserContext { using Object = decltype(std::declval().as_object()); Schema & root; A schema; std::optional parent = std::nullopt; schema::Version version; detail::Reference where = {}; ParserContext child(A const & child, std::string const & key) const { return {root, child, schema.as_object(), version, where / key}; } ParserContext child(A const & child, size_t index) const { return {root, child, std::nullopt, version, where / index}; } ParserContext neighbor(std::string const & key) const { return {root, (*parent)[key], parent, version, where.parent() / key}; } schema::Node const * resolve(std::string_view uri) const; schema::Node const * node() const; }; }