An iterator for json array and objects. More...
#include <json.hpp>
Public Types | |
typedef JSON_TYPE | json_type |
typedef json_type::array_type | array_type |
typedef json_type::object_type | object_type |
Public Member Functions | |
const_json_iterator (const json_type *ptr, bool as_begin) | |
const_json_iterator (const const_json_iterator< JSON_TYPE > &x) | |
const_json_iterator & | operator= (const const_json_iterator< JSON_TYPE > &x) |
const_json_iterator | operator++ () |
const_json_iterator | operator++ (int) |
const_json_iterator | operator-- () |
const_json_iterator | operator-- (int) |
const json & | operator* () const |
const json * | operator-> () const |
bool | operator== (const const_json_iterator< JSON_TYPE > &x) const |
bool | operator!= (const const_json_iterator< JSON_TYPE > &x) const |
An iterator for json array and objects.
The iterator handles elements of json arrays and json objects. If initialized with a non array or object the iterator uses the given json as the element neither as begin or end.
typedef json_type::array_type matador::const_json_iterator< JSON_TYPE >::array_type |
Shortcut for json array type
typedef JSON_TYPE matador::const_json_iterator< JSON_TYPE >::json_type |
Shortcut for json
typedef json_type::object_type matador::const_json_iterator< JSON_TYPE >::object_type |
Shortcut for json object type
|
inline |
Creates a json_iterator for the given json object. In case the json object isn't of type_ object or array the given flag as_begin tells the c'tor if the jsn value is treated like begin or end element.
ptr | Pointer to the json |
as_begin | True if non array/object should be treated as begin iterator |
|
inline |
Copy construct a json_iterator from given iterator
x | The iterator to copy from |
|
inline |
Not equal operator for json_iterator. Depending on the json type the values are compared.
x | The json_iterator to compare |
|
inline |
Indirection operator. Returns the reference to the json object represented by the iterator. If the json type is null a std::logic_error is thrown.
|
inline |
Post increments (++i) the json_iterator step to next array element or next object element
|
inline |
Pre increments (i++) the json_iterator step to next array element or next object element
|
inline |
Post decrements (–i) the json_iterator step to previous array element or next object element
|
inline |
Pre decrements (i–) the json_iterator step to previous array element or next object element
|
inline |
Address of operator. Returns the pointer to the json object represented by the iterator. If the json type is null a std::logic_error is thrown.
|
inline |
Copy assigns a json_iterator from given iterator
x | The iterator to copy assign from |
|
inline |
Equal operator for json_iterator. Depending on the json type the values are compared.
x | The json_iterator to compare |