21class deserialize_options;
71 bool operator==(
const iterator& other)
const {
return _iter == other._iter; }
73 bool operator!=(
const iterator& other)
const {
return _iter != other._iter; }
75 bool operator< (
const iterator& other)
const {
return _iter < other._iter; }
77 bool operator<=(
const iterator& other)
const {
return _iter <= other._iter; }
79 bool operator> (
const iterator& other)
const {
return _iter > other._iter; }
81 bool operator>=(
const iterator& other)
const {
return _iter >= other._iter; }
84 explicit iterator(
const std::uintptr_t prefix,
const std::uint64_t* iter) :
89 friend class parse_index;
92 std::uintptr_t _prefix;
93 const std::uint64_t* _iter;
96 using const_iterator = iterator;
103 _impl(
std::exchange(src._impl,
nullptr))
112 swap(_impl, src._impl);
118 ~parse_index() noexcept;
154 bool success() const noexcept;
158 explicit operator
bool() const noexcept;
165 void validate() const;
170 iterator cbegin()
const {
return begin(); }
173 iterator end()
const;
176 iterator cend()
const {
return end(); }
229 impl* _impl =
nullptr;
Utilities for directly dealing with a JSON AST.
Represents an entry in a JSON AST.
Configuration for various deserialization options. This becomes part of the deserialization_context.
iterator & skip_subtree()
Move to the node after the structure this iterator is on, however much is inside it.
Represents the index of a parsed AST.
friend std::string to_string(const parse_index &)
Get a string representation of the AST.
value extract_tree() const
Build a value from the document this index holds.
parse_index() noexcept=default
Creates an empty not-an-AST instance.
friend std::ostream & operator<<(std::ostream &, const parse_index &)
Get a string representation of the AST.
value extract_tree(const deserialize_options &options) const
Build a value from the document this index holds.
Configuration for various parsing options.
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...
Copyright (c) 2014-2020 by Travis Gockel.
#define JSONV_NODISCARD
Warn if the caller discards the result of this function.
#define JSONV_PUBLIC
This function or class is part of the public API for JSON Voorhees.
JSONV_PUBLIC void swap(value &a, value &b) noexcept
Swap the values a and b.
typename detail::optional_type< T >::type optional
Represents a value that may or may not be present.