nfx-serialization 0.3.0
Cross-platform C++ JSON serialization library with extensible trait capabilities
Loading...
Searching...
No Matches
nfx::serialization::json::Document::Object::Iterator Class Reference

Forward iterator for Object fields. More...

#include <nfx/serialization/json/Document.h>

Public Types

using iterator_category = std::forward_iterator_tag
 Iterator category tag for STL compatibility.
using value_type = std::pair<std::string, Document>
 Type of value yielded by iterator.
using difference_type = std::ptrdiff_t
 Type for iterator difference.
using pointer = value_type*
 Pointer to value type.
using reference = value_type&
 Reference to value type.

Public Member Functions

 Iterator ()
 Default constructor - creates end iterator.
 Iterator (const Object *obj, size_t index)
 Construct iterator at specific position.
value_type operator* () const
 Dereference 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

Forward iterator for Object fields.

Provides STL-compatible iteration over object key-value pairs. Yields std::pair<std::string, Document> for each field.

Definition at line 542 of file Document.h.

Member Typedef Documentation

◆ difference_type

Type for iterator difference.

Definition at line 554 of file Document.h.

◆ iterator_category

Iterator category tag for STL compatibility.

Definition at line 550 of file Document.h.

◆ pointer

Pointer to value type.

Definition at line 556 of file Document.h.

◆ reference

Reference to value type.

Definition at line 558 of file Document.h.

◆ value_type

using nfx::serialization::json::Document::Object::Iterator::value_type = std::pair<std::string, Document>

Type of value yielded by iterator.

Definition at line 552 of file Document.h.

Constructor & Destructor Documentation

◆ Iterator()

nfx::serialization::json::Document::Object::Iterator::Iterator ( const Object * obj,
size_t index )

Construct iterator at specific position.

Parameters
objPointer to parent Object
indexCurrent position (0 = begin, size = end)

Member Function Documentation

◆ operator!=()

bool nfx::serialization::json::Document::Object::Iterator::operator!= ( const Iterator & other) const

Inequality comparison.

Parameters
otherIterator to compare with
Returns
true if iterators point to different positions
Here is the call graph for this function:

◆ operator*()

value_type nfx::serialization::json::Document::Object::Iterator::operator* ( ) const

Dereference operator.

Returns
Current key-value pair (field name and Document value)

◆ operator++() [1/2]

Iterator & nfx::serialization::json::Document::Object::Iterator::operator++ ( )

Pre-increment operator.

Returns
Reference to this iterator after increment
Here is the call graph for this function:

◆ operator++() [2/2]

Iterator nfx::serialization::json::Document::Object::Iterator::operator++ ( int )

Post-increment operator.

Returns
Copy of iterator before increment
Here is the call graph for this function:

◆ operator==()

bool nfx::serialization::json::Document::Object::Iterator::operator== ( const Iterator & other) const

Equality comparison.

Parameters
otherIterator to compare with
Returns
true if iterators point to same position
Here is the call graph for this function:

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