arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::utility::utf8::code_point::iterator Class Reference

#include <arg_router/utility/utf8/code_point.hpp>

Classes

class  range_t
 

Public Types

using difference_type = std::string_view::difference_type
 
using value_type = std::string_view
 
using pointer = const value_type *
 
using reference = const value_type &
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

constexpr iterator () noexcept=default
 
constexpr iterator (std::string_view str) noexcept
 
constexpr bool operator== (iterator other) const noexcept
 
constexpr bool operator!= (iterator other) const noexcept
 
constexpr value_type operator* () const noexcept
 
constexpr iteratoroperator++ () noexcept
 
constexpr iterator operator++ (int) noexcept
 

Static Public Member Functions

constexpr static range_t range (std::string_view str) noexcept
 

Detailed Description

Forward iterator for a string's code points.

Definition at line 220 of file code_point.hpp.

Member Typedef Documentation

◆ difference_type

using arg_router::utility::utf8::code_point::iterator::difference_type = std::string_view::difference_type

Difference in bytes between two iterator positions.

Definition at line 224 of file code_point.hpp.

◆ iterator_category

Iterator category.

Definition at line 232 of file code_point.hpp.

◆ pointer

Pointer type.

Definition at line 228 of file code_point.hpp.

◆ reference

Reference type/

Definition at line 230 of file code_point.hpp.

◆ value_type

Dereferenced type.

Definition at line 226 of file code_point.hpp.

Constructor & Destructor Documentation

◆ iterator() [1/2]

constexpr arg_router::utility::utf8::code_point::iterator::iterator ( )
constexprdefaultnoexcept

Default constructor.

Represents the end iterator.

◆ iterator() [2/2]

constexpr arg_router::utility::utf8::code_point::iterator::iterator ( std::string_view  str)
inlineexplicitconstexprnoexcept

Constructor.

If str is empty, then this will create an end iterator.

Parameters
strString to iterator over.

Definition at line 286 of file code_point.hpp.

Member Function Documentation

◆ operator!=()

constexpr bool arg_router::utility::utf8::code_point::iterator::operator!= ( iterator  other) const
inlineconstexprnoexcept

Inequality operator.

Parameters
otherInstance to compare against
Returns
False if the start and end positions are the same

Definition at line 307 of file code_point.hpp.

◆ operator*()

constexpr value_type arg_router::utility::utf8::code_point::iterator::operator* ( ) const
inlineconstexprnoexcept

Dereference operator.

Returns
Code point

Definition at line 316 of file code_point.hpp.

◆ operator++() [1/2]

constexpr iterator& arg_router::utility::utf8::code_point::iterator::operator++ ( )
inlineconstexprnoexcept

Pre-increment the iterator by one code point.

Returns
Reference to this after moving the iterator

Definition at line 326 of file code_point.hpp.

◆ operator++() [2/2]

constexpr iterator arg_router::utility::utf8::code_point::iterator::operator++ ( int  )
inlineconstexprnoexcept

Post-increment the iterator by one code point.

Returns
Copy of this before moving the iterator

Definition at line 337 of file code_point.hpp.

◆ operator==()

constexpr bool arg_router::utility::utf8::code_point::iterator::operator== ( iterator  other) const
inlineconstexprnoexcept

Equality operator.

Parameters
otherInstance to compare against
Returns
True if the start and end positions are the same

Definition at line 293 of file code_point.hpp.

◆ range()

constexpr static range_t arg_router::utility::utf8::code_point::iterator::range ( std::string_view  str)
inlinestaticconstexprnoexcept

Returns an object that can be used in range-for loops.

Parameters
strInput string
Returns
Range object

Definition at line 270 of file code_point.hpp.


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