nfx-stringutils 1.2.0
Cross-platform C++ string utilities library with validation and manipulation functions
Loading...
Searching...
No Matches
nfx::string::Splitter::Iterator Class Reference

Forward iterator for string segments. More...

#include <nfx/string/Splitter.h>

Public Types

using iterator_category = std::forward_iterator_tag
 Iterator category tag.
using value_type = std::string_view
 Type of values returned by dereferencing the iterator.
using difference_type = std::ptrdiff_t
 Type for representing distances between iterators.
using pointer = const std::string_view*
 Pointer type to the value_type.
using reference = std::string_view
 Reference type returned by dereferencing.

Public Member Functions

 Iterator () noexcept=default
 Default constructor.
 Iterator (const Splitter &splitter, bool at_end=false) noexcept
 Constructs iterator at beginning or end position.
std::string_view operator* () const noexcept
 Dereferences iterator to get current string segment.
Iteratoroperator++ () noexcept
 Pre-increment operator to advance to next segment.
Iterator operator++ (int) noexcept
 Post-increment operator to advance to next segment.
bool operator== (const Iterator &other) const noexcept
 Compares iterators for equality.
bool operator!= (const Iterator &other) const noexcept
 Compares iterators for inequality.

Detailed Description

Forward iterator for string segments.

Definition at line 94 of file Splitter.h.

Member Typedef Documentation

◆ difference_type

Type for representing distances between iterators.

Used by STL algorithms like std::distance and std::advance

Definition at line 117 of file Splitter.h.

◆ iterator_category

using nfx::string::Splitter::Iterator::iterator_category = std::forward_iterator_tag

Iterator category tag.

Defines this as a forward iterator, supporting multi-pass guarantee

Definition at line 105 of file Splitter.h.

◆ pointer

using nfx::string::Splitter::Iterator::pointer = const std::string_view*

Pointer type to the value_type.

Pointer to const string_view for safety

Definition at line 123 of file Splitter.h.

◆ reference

Reference type returned by dereferencing.

Returns string_view by value (not a true reference)

Definition at line 129 of file Splitter.h.

◆ value_type

Type of values returned by dereferencing the iterator.

Returns std::string_view for zero-copy string segments

Definition at line 111 of file Splitter.h.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

nfx::string::Splitter::Iterator::Iterator ( )
inlinedefaultnoexcept

Default constructor.

Creates an invalid iterator that must be assigned before use

Here is the caller graph for this function:

◆ Iterator() [2/2]

nfx::string::Splitter::Iterator::Iterator ( const Splitter & splitter,
bool at_end = false )
inlineexplicitnoexcept

Constructs iterator at beginning or end position.

Parameters
splitterReference to the parent Splitter object
at_endWhether to position iterator at end (default: false for begin)
Here is the call graph for this function:

Member Function Documentation

◆ operator!=()

bool nfx::string::Splitter::Iterator::operator!= ( const Iterator & other) const
inlinenoexcept

Compares iterators for inequality.

Parameters
otherIterator to compare with
Returns
true if iterators are not equal, false otherwise
Here is the call graph for this function:

◆ operator*()

std::string_view nfx::string::Splitter::Iterator::operator* ( ) const
inlinenoexcept

Dereferences iterator to get current string segment.

Returns
String view of the current segment

◆ operator++() [1/2]

Iterator & nfx::string::Splitter::Iterator::operator++ ( )
inlinenoexcept

Pre-increment operator to advance to next segment.

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

◆ operator++() [2/2]

Iterator nfx::string::Splitter::Iterator::operator++ ( int )
inlinenoexcept

Post-increment operator to advance to next segment.

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

◆ operator==()

bool nfx::string::Splitter::Iterator::operator== ( const Iterator & other) const
inlinenoexcept

Compares iterators for equality.

Parameters
otherIterator to compare with
Returns
true if iterators are equal, false otherwise
Here is the call graph for this function:

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