jubilant-funicular
|
#include <Json.h>
Public Types | |
using | value_type = typename std::conditional< c, const Json, Json >::type |
using | difference_type = std::ptrdiff_t |
using | pointer = typename std::conditional< c, const Json *, Json * >::type |
using | reference = typename std::conditional< c, const Json &, Json & >::type |
using | iterator_category = std::bidirectional_iterator_tag |
Public Member Functions | |
iterator (pointer json) | |
reference | operator* () const |
pointer | operator-> () const |
iterator & | operator++ () |
iterator | operator++ (int) |
iterator & | operator-- () |
iterator | operator-- (int) |
bool | operator== (const iterator &rhs) const |
bool | operator!= (const iterator &rhs) const |
std::string | key () |
reference | value () |
void | set_begin (SetBeginEndKey _) |
void | set_end (SetBeginEndKey _) |
Private Attributes | |
pointer | m_json |
union { | |
JsonObject::iterator | m_obj_iter |
JsonArray::iterator | m_arr_iter |
}; | |
Custom iterator for looping over Json values
For Arrays: loops over the elements
For Objects: loops over the values (keys accessible via Json::iterator::key())
For None: empty iterator
For anything else (except None): returns the value itself (see tests/utils/json_tests.cpp)
c=0 gives a regular iterator and c=1 gives a const_iterator