27template<
typename IteratorType>
class iteration_proxy;
28template<
typename IteratorType>
class iteration_proxy_value;
46template<
typename BasicJsonType>
57 using object_t =
typename BasicJsonType::object_t;
58 using array_t =
typename BasicJsonType::array_t;
61 "iter_impl only accepts (const) basic_json");
63 static_assert(std::is_base_of<std::bidirectional_iterator_tag, std::bidirectional_iterator_tag>::value
64 && std::is_base_of<std::bidirectional_iterator_tag, typename std::iterator_traits<typename array_t::iterator>::iterator_category>
::value,
65 "basic_json iterator assumes array and object type iterators satisfy the LegacyBidirectionalIterator named requirement.");
80 using pointer =
typename std::conditional<std::is_const<BasicJsonType>::value,
81 typename BasicJsonType::const_pointer,
82 typename BasicJsonType::pointer>
::type;
85 typename std::conditional<std::is_const<BasicJsonType>::value,
86 typename BasicJsonType::const_reference,
87 typename BasicJsonType::reference>
::type;
104 switch (m_object->m_type)
151 : m_object(other.m_object),
m_it(other.m_it)
164 m_object = other.m_object;
176 : m_object(other.m_object),
m_it(other.m_it)
187 m_object = other.m_object;
197 void set_begin() noexcept
201 switch (m_object->m_type)
245 switch (m_object->m_type)
284 switch (m_object->m_type)
328 switch (m_object->m_type)
381 switch (m_object->m_type)
432 switch (m_object->m_type)
468 template <
typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::
nullptr_t > =
nullptr >
479 switch (m_object->m_type)
504 template <
typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::
nullptr_t > =
nullptr >
524 switch (m_object->m_type)
551 return !other.operator < (*this);
580 switch (m_object->m_type)
659 switch (m_object->m_type)
688 switch (m_object->m_type)
722 const typename object_t::key_type&
key()
const
#define WPI_JSON_NAMESPACE_END
Definition: abi_macros.h:59
#define WPI_JSON_NAMESPACE_BEGIN
Definition: abi_macros.h:53
static invalid_iterator create(int id_, const std::string &what_arg, BasicJsonContext context)
Definition: exceptions.h:191
a template for a bidirectional iterator for the basic_json class This class implements a both iterato...
Definition: iter_impl.h:48
iter_impl operator+(difference_type i) const
add to iterator
Definition: iter_impl.h:622
iter_impl & operator=(const iter_impl< typename std::remove_const< BasicJsonType >::type > &other) noexcept
converting assignment
Definition: iter_impl.h:185
bool operator>=(const iter_impl &other) const
comparison: greater than or equal
Definition: iter_impl.h:567
iter_impl(const iter_impl< typename std::remove_const< BasicJsonType >::type > &other) noexcept
converting constructor
Definition: iter_impl.h:175
bool operator<(const iter_impl &other) const
comparison: smaller
Definition: iter_impl.h:514
bool operator<=(const iter_impl &other) const
comparison: less than or equal
Definition: iter_impl.h:549
iter_impl & operator-=(difference_type i)
subtract from iterator
Definition: iter_impl.h:613
iter_impl & operator--()
pre-decrement (–it)
Definition: iter_impl.h:428
const object_t::key_type & key() const
return the key of an object iterator
Definition: iter_impl.h:722
bool operator==(const IterImpl &other) const
comparison: equal
Definition: iter_impl.h:469
iter_impl operator++(int) &
post-increment (it++)
Definition: iter_impl.h:366
iter_impl & operator+=(difference_type i)
add to iterator
Definition: iter_impl.h:576
reference operator[](difference_type n) const
access to successor
Definition: iter_impl.h:684
typename BasicJsonType::difference_type difference_type
a type to represent differences between iterators
Definition: iter_impl.h:78
pointer operator->() const
dereference the iterator
Definition: iter_impl.h:324
internal_iterator< typename std::remove_const< BasicJsonType >::type > m_it
the actual iterator of the associated instance
Definition: iter_impl.h:747
difference_type operator-(const iter_impl &other) const
return difference
Definition: iter_impl.h:655
iter_impl(iter_impl &&) noexcept=default
std::bidirectional_iterator_tag iterator_category
The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17.
Definition: iter_impl.h:73
friend iter_impl operator+(difference_type i, const iter_impl &it)
addition of distance and iterator
Definition: iter_impl.h:633
reference value() const
return the value of an iterator
Definition: iter_impl.h:738
bool operator>(const iter_impl &other) const
comparison: greater than
Definition: iter_impl.h:558
typename std::conditional< std::is_const< BasicJsonType >::value, typename BasicJsonType::const_pointer, typename BasicJsonType::pointer >::type pointer
defines a pointer to the type iterated over (value_type)
Definition: iter_impl.h:82
iter_impl & operator++()
pre-increment (++it)
Definition: iter_impl.h:377
typename BasicJsonType::value_type value_type
the type of the values when the iterator is dereferenced
Definition: iter_impl.h:76
reference operator*() const
return a reference to the value pointed to by the iterator
Definition: iter_impl.h:280
iter_impl operator-(difference_type i) const
subtract from iterator
Definition: iter_impl.h:644
iter_impl & operator=(const iter_impl< const BasicJsonType > &other) noexcept
converting assignment
Definition: iter_impl.h:160
bool operator!=(const IterImpl &other) const
comparison: not equal
Definition: iter_impl.h:505
iter_impl operator--(int) &
post-decrement (it–)
Definition: iter_impl.h:417
typename std::conditional< std::is_const< BasicJsonType >::value, typename BasicJsonType::const_reference, typename BasicJsonType::reference >::type reference
defines a reference to the type iterated over (value_type)
Definition: iter_impl.h:87
iter_impl(const iter_impl< const BasicJsonType > &other) noexcept
const copy constructor
Definition: iter_impl.h:150
void set_end() noexcept
set the iterator past the last value
Definition: iter_impl.h:241
Definition: iteration_proxy.h:37
proxy class for the items() function
Definition: iteration_proxy.h:158
Definition: primitive_iterator.h:30
constexpr bool is_begin() const noexcept
return whether the iterator can be dereferenced
Definition: primitive_iterator.h:59
void set_end() noexcept
set iterator to a defined past the end
Definition: primitive_iterator.h:53
constexpr difference_type get_value() const noexcept
Definition: primitive_iterator.h:41
void set_begin() noexcept
set iterator to a defined beginning
Definition: primitive_iterator.h:47
#define JSON_HEDLEY_LIKELY(expr)
Definition: hedley.h:1395
#define JSON_HEDLEY_UNLIKELY(expr)
Definition: hedley.h:1396
#define JSON_PRIVATE_UNLESS_TESTED
Definition: macro_scope.h:199
#define JSON_ASSERT(x)
Definition: macro_scope.h:192
#define JSON_THROW(exception)
Definition: macro_scope.h:163
detail namespace with internal helper functions
Definition: xchar.h:20
@ number_integer
number value (signed integer)
@ discarded
discarded by the parser callback function
@ binary
binary array (ordered collection of bytes)
@ object
object (unordered set of name/value pairs)
@ number_float
number value (floating-point)
@ number_unsigned
number value (unsigned integer)
@ array
array (ordered collection of values)
type
Definition: core.h:556
an iterator value
Definition: internal_iterator.h:25
BasicJsonType::array_t::iterator array_iterator
iterator for JSON arrays
Definition: internal_iterator.h:29
primitive_iterator_t primitive_iterator
generic iterator for all other types
Definition: internal_iterator.h:31
BasicJsonType::object_t::iterator object_iterator
iterator for JSON objects
Definition: internal_iterator.h:27
Definition: type_traits.h:49