JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
jsonv::parse_index::iterator Class Referencefinal

Public Types

using value_type = ast_node
 

Public Member Functions

iterator & operator++ ()
 
iterator operator++ (int)
 
iterator & skip_subtree ()
 Move to the node after the structure this iterator is on, however much is inside it.
 
value_type operator* () const
 
bool operator== (const iterator &other) const
 
bool operator!= (const iterator &other) const
 
bool operator< (const iterator &other) const
 
bool operator<= (const iterator &other) const
 
bool operator> (const iterator &other) const
 
bool operator>= (const iterator &other) const
 

Friends

class parse_index
 

Detailed Description

Definition at line 32 of file parse_index.hpp.

Member Typedef Documentation

◆ value_type

Member Function Documentation

◆ operator!=()

bool jsonv::parse_index::iterator::operator!= ( const iterator &  other) const
inline

Definition at line 73 of file parse_index.hpp.

◆ operator++()

iterator jsonv::parse_index::iterator::operator++ ( int  )
inline

Definition at line 41 of file parse_index.hpp.

◆ operator<()

bool jsonv::parse_index::iterator::operator< ( const iterator &  other) const
inline

Definition at line 75 of file parse_index.hpp.

◆ operator<=()

bool jsonv::parse_index::iterator::operator<= ( const iterator &  other) const
inline

Definition at line 77 of file parse_index.hpp.

◆ operator==()

bool jsonv::parse_index::iterator::operator== ( const iterator &  other) const
inline

Definition at line 71 of file parse_index.hpp.

◆ operator>()

bool jsonv::parse_index::iterator::operator> ( const iterator &  other) const
inline

Definition at line 79 of file parse_index.hpp.

◆ operator>=()

bool jsonv::parse_index::iterator::operator>= ( const iterator &  other) const
inline

Definition at line 81 of file parse_index.hpp.

◆ skip_subtree()

iterator & jsonv::parse_index::iterator::skip_subtree ( )

Move to the node after the structure this iterator is on, however much is inside it.

This is a constant-time operation. The index records where each structure ends as it parses the matching close token, so stepping over a subtree costs the same whether it holds one element or a million. Use it to ignore a value without paying to walk it.

// `iter` is on the `[` of `"a": [ 1, 2, 3 ]`
iter.skip_subtree(); // now on the key which follows the array
An adapter for enumeration types.

If the structure was never closed – only possible when parse_index::success is false – the error which truncated the document stands in as its end, so this moves to the end of the index.

Exceptions
std::invalid_argumentif this iterator is not on a ast_node_type::document_start, ast_node_type::object_begin or ast_node_type::array_begin.

Friends And Related Symbol Documentation

◆ parse_index

Definition at line 89 of file parse_index.hpp.


The documentation for this class was generated from the following file: