Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
utf8::iterator< octet_iterator > Class Template Reference

#include <checked.h>

Public Types

using iterator_category = std::bidirectional_iterator_tag
 
using value_type = uint32_t
 
using difference_type = std::ptrdiff_t
 
using pointer = uint32_t*
 
using reference = uint32_t&
 

Public Member Functions

 iterator ()
 
 iterator (const octet_iterator &octet_it, const octet_iterator &range_start, const octet_iterator &range_end)
 
octet_iterator base () const
 
uint32_t operator* () const
 
bool operator== (const iterator &rhs) const
 
bool operator!= (const iterator &rhs) const
 
iteratoroperator++ ()
 
iterator operator++ (int)
 
iteratoroperator-- ()
 
iterator operator-- (int)
 

Detailed Description

template<typename octet_iterator>
class utf8::iterator< octet_iterator >

Definition at line 268 of file checked.h.

Member Typedef Documentation

◆ difference_type

template<typename octet_iterator >
using utf8::iterator< octet_iterator >::difference_type = std::ptrdiff_t

Definition at line 276 of file checked.h.

◆ iterator_category

template<typename octet_iterator >
using utf8::iterator< octet_iterator >::iterator_category = std::bidirectional_iterator_tag

Definition at line 274 of file checked.h.

◆ pointer

template<typename octet_iterator >
using utf8::iterator< octet_iterator >::pointer = uint32_t*

Definition at line 277 of file checked.h.

◆ reference

template<typename octet_iterator >
using utf8::iterator< octet_iterator >::reference = uint32_t&

Definition at line 278 of file checked.h.

◆ value_type

template<typename octet_iterator >
using utf8::iterator< octet_iterator >::value_type = uint32_t

Definition at line 275 of file checked.h.

Constructor & Destructor Documentation

◆ iterator() [1/2]

template<typename octet_iterator >
utf8::iterator< octet_iterator >::iterator ( )
inline

Definition at line 280 of file checked.h.

280{}

◆ iterator() [2/2]

template<typename octet_iterator >
utf8::iterator< octet_iterator >::iterator ( const octet_iterator< octet_iterator > & octet_it,
const octet_iterator< octet_iterator > & range_start,
const octet_iterator< octet_iterator > & range_end )
inlineexplicit

Definition at line 281 of file checked.h.

283 :
284 it(octet_it), range_start(range_start), range_end(range_end)
285 {
286 if (it < range_start || it > range_end)
287 throw std::out_of_range("Invalid utf-8 iterator position");
288 }

Member Function Documentation

◆ base()

template<typename octet_iterator >
octet_iterator utf8::iterator< octet_iterator >::base ( ) const
inline

Definition at line 290 of file checked.h.

290{ return it; }

◆ operator!=()

template<typename octet_iterator >
bool utf8::iterator< octet_iterator >::operator!= ( const iterator< octet_iterator > & rhs) const
inline

Definition at line 302 of file checked.h.

303 {
304 return !(operator == (rhs));
305 }
bool operator==(const iterator &rhs) const
Definition checked.h:296
Here is the call graph for this function:

◆ operator*()

template<typename octet_iterator >
uint32_t utf8::iterator< octet_iterator >::operator* ( ) const
inline

Definition at line 291 of file checked.h.

292 {
293 octet_iterator temp = it;
294 return utf8::next(temp, range_end);
295 }
uint32_t next(octet_iterator &it, octet_iterator end)
Definition checked.h:137
Here is the call graph for this function:

◆ operator++() [1/2]

template<typename octet_iterator >
iterator & utf8::iterator< octet_iterator >::operator++ ( )
inline

Definition at line 306 of file checked.h.

307 {
308 utf8::next(it, range_end);
309 return *this;
310 }
Here is the call graph for this function:

◆ operator++() [2/2]

template<typename octet_iterator >
iterator utf8::iterator< octet_iterator >::operator++ ( int )
inline

Definition at line 311 of file checked.h.

312 {
313 iterator temp = *this;
314 utf8::next(it, range_end);
315 return temp;
316 }
Here is the call graph for this function:

◆ operator--() [1/2]

template<typename octet_iterator >
iterator & utf8::iterator< octet_iterator >::operator-- ( )
inline

Definition at line 317 of file checked.h.

318 {
319 utf8::prior(it, range_start);
320 return *this;
321 }
uint32_t prior(octet_iterator &it, octet_iterator start)
Definition checked.h:163
Here is the call graph for this function:

◆ operator--() [2/2]

template<typename octet_iterator >
iterator utf8::iterator< octet_iterator >::operator-- ( int )
inline

Definition at line 322 of file checked.h.

323 {
324 iterator temp = *this;
325 utf8::prior(it, range_start);
326 return temp;
327 }
Here is the call graph for this function:

◆ operator==()

template<typename octet_iterator >
bool utf8::iterator< octet_iterator >::operator== ( const iterator< octet_iterator > & rhs) const
inline

Definition at line 296 of file checked.h.

297 {
298 if (range_start != rhs.range_start || range_end != rhs.range_end)
299 throw std::logic_error("Comparing utf-8 iterators defined with different ranges");
300 return (it == rhs.it);
301 }
Here is the caller graph for this function:

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