nfx-json 1.5.2
Modern C++20 JSON library with schema validation and generation
Loading...
Searching...
No Matches
nfx::json::Document::KeysView::iterator Class Reference

Key iterator. More...

#include <nfx/json/Document.h>

Public Types

using iterator_category = std::forward_iterator_tag
 iterator category (forward iterator)
using value_type = std::string
 iterator value type
using difference_type = std::ptrdiff_t
 iterator difference type
using pointer = const std::string*
 iterator pointer type
using reference = const std::string&
 iterator reference type

Public Member Functions

 iterator (Object::const_iterator it)
 Construct iterator from underlying Object iterator.
 iterator (const iterator &)=default
 Copy constructor.
 iterator (iterator &&) noexcept=default
 Move constructor.
iteratoroperator= (const iterator &)=default
 Copy assignment.
iteratoroperator= (iterator &&) noexcept=default
 Move assignment.
reference operator* () const
 Dereference operator.
pointer operator-> () const
 Arrow operator.
iteratoroperator++ ()
 Pre-increment operator.
iterator operator++ (int)
 Post-increment operator.
bool operator== (const iterator &other) const
 Equality comparison.
bool operator!= (const iterator &other) const
 Inequality comparison.

Detailed Description

Key iterator.

Definition at line 844 of file Document.h.

Member Typedef Documentation

◆ difference_type

iterator difference type

Definition at line 856 of file Document.h.

◆ iterator_category

iterator category (forward iterator)

Definition at line 850 of file Document.h.

◆ pointer

iterator pointer type

Definition at line 859 of file Document.h.

◆ reference

iterator reference type

Definition at line 862 of file Document.h.

◆ value_type

iterator value type

Definition at line 853 of file Document.h.

Constructor & Destructor Documentation

◆ iterator()

nfx::json::Document::KeysView::iterator::iterator ( Object::const_iterator it)
inline

Construct iterator from underlying Object iterator.

Parameters
itThe underlying Object const_iterator

Member Function Documentation

◆ operator!=()

bool nfx::json::Document::KeysView::iterator::operator!= ( const iterator & other) const
inline

Inequality comparison.

Parameters
otherThe iterator to compare with
Returns
true if iterators are not equal, false otherwise

◆ operator*()

reference nfx::json::Document::KeysView::iterator::operator* ( ) const
inline

Dereference operator.

Returns
Const reference to the key string

◆ operator++() [1/2]

iterator & nfx::json::Document::KeysView::iterator::operator++ ( )
inline

Pre-increment operator.

Returns
Reference to this iterator after increment

◆ operator++() [2/2]

iterator nfx::json::Document::KeysView::iterator::operator++ ( int )
inline

Post-increment operator.

Returns
Copy of iterator before increment

◆ operator->()

pointer nfx::json::Document::KeysView::iterator::operator-> ( ) const
inline

Arrow operator.

Returns
Pointer to the key string

◆ operator=() [1/2]

iterator & nfx::json::Document::KeysView::iterator::operator= ( const iterator & )
default

Copy assignment.

Returns
Reference to this iterator

◆ operator=() [2/2]

iterator & nfx::json::Document::KeysView::iterator::operator= ( iterator && )
defaultnoexcept

Move assignment.

Returns
Reference to this iterator

◆ operator==()

bool nfx::json::Document::KeysView::iterator::operator== ( const iterator & other) const
inline

Equality comparison.

Parameters
otherThe iterator to compare with
Returns
true if iterators are equal, false otherwise

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