by::cpIter Class Reference

Iterator for codepoint of string. More...

#include <cpIter.hpp>

Public Member Functions

 cpIter (const nchar *begin, const nchar *from)
 
 cpIter (const std::string &from, nbool isReversed=false)
 
 cpIter (std::string &&from, nbool isReversed=false)=delete
 
me operator+ (ncnt step)
 
me & operator++ ()
 
me operator++ (int)
 
me & operator+= (ncnt step)
 
std::string operator* () const
 
 operator nbool () const
 
nbool operator== (const me &rhs) const
 
nbool isEnd () const
 
void rel ()
 
ncnt next (ncnt step)
 
ncnt stepForward (ncnt step)
 
ncnt stepBackward (ncnt step)
 
std::string get () const
 
ncnt remainLen () const
 

Detailed Description

Iterator for codepoint of string.

Provides Unicode-aware string iteration capabilities for processing multi-byte character sequences.

Constructor & Destructor Documentation

◆ cpIter()

by::cpIter::cpIter ( const std::string &  from,
nbool  isReversed = false 
)
explicit
Parameters
fromexternally memory-managed string object.

Member Function Documentation

◆ next()

ncnt by::cpIter::next ( ncnt  step)

Moves the iterator in the direction you specified when you created it. if you created a reverse iterator, this func will move it by steps in the reverse direction.

Returns
stepped count.

◆ stepForward()

ncnt by::cpIter::stepForward ( ncnt  step)

moves iterator to unconditionally forward by the given step. note that creating a reverse iterator doesn't affect this function. so it'll also move to forward direction.

Returns
stepped count.

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