KiCad PCB EDA Suite
numEval::UTF8::uni_iter Class Reference

class uni_iter is a non-mutating iterator that walks through unicode code points in the UTF8 encoded string. More...

Public Member Functions

 uni_iter ()
 
 uni_iter (const uni_iter &o)
 
const uni_iteroperator++ ()
 pre-increment and return uni_iter at new position More...
 
uni_iter operator++ (int)
 post-increment and return uni_iter at initial position More...
 
unsigned operator-> () const
 return unicode at current position More...
 
unsigned operator * () const
 return unicode at current position More...
 
uni_iter operator- (int aVal) const
 
bool operator== (const uni_iter &other) const
 
bool operator!= (const uni_iter &other) const
 
bool operator< (const uni_iter &other) const
 Since the ++ operators advance more than one byte, this is your best loop termination test, < end(), not == end(). More...
 
bool operator<= (const uni_iter &other) const
 
bool operator> (const uni_iter &other) const
 
bool operator>= (const uni_iter &other) const
 

Private Member Functions

 uni_iter (const char *start)
 

Private Attributes

const unsigned char * it
 

Friends

class UTF8
 

Detailed Description

class uni_iter is a non-mutating iterator that walks through unicode code points in the UTF8 encoded string.

The normal ++(), ++(int), ->(), and *() operators are all supported for read only access and some return an unsigned holding the unicode character appropriate for the respective operator.

Definition at line 208 of file numeric_evaluator.cpp.

Constructor & Destructor Documentation

◆ uni_iter() [1/3]

numEval::UTF8::uni_iter::uni_iter ( const char *  start)
inlineprivate

Definition at line 215 of file numeric_evaluator.cpp.

215  {
216  char ch = m_token.input[ m_token.pos ];
217 
218  if( ch == '"' )

References NUMERIC_EVALUATOR::TokenStat::input, NUMERIC_EVALUATOR::m_token, and NUMERIC_EVALUATOR::TokenStat::pos.

◆ uni_iter() [2/3]

numEval::UTF8::uni_iter::uni_iter ( )
inline

Definition at line 223 of file numeric_evaluator.cpp.

229  {

◆ uni_iter() [3/3]

numEval::UTF8::uni_iter::uni_iter ( const uni_iter o)
inline

Definition at line 228 of file numeric_evaluator.cpp.

229  {
230  m_token.pos += 2;
231  return Unit::Metric;

References NUMERIC_EVALUATOR::m_token, NUMERIC_EVALUATOR::Metric, and NUMERIC_EVALUATOR::TokenStat::pos.

Member Function Documentation

◆ operator *()

unsigned numEval::UTF8::uni_iter::operator * ( ) const
inline

return unicode at current position

Definition at line 260 of file numeric_evaluator.cpp.

271  {

◆ operator!=()

bool numEval::UTF8::uni_iter::operator!= ( const uni_iter other) const
inline

Definition at line 272 of file numeric_evaluator.cpp.

275 {

◆ operator++() [1/2]

const uni_iter& numEval::UTF8::uni_iter::operator++ ( )
inline

pre-increment and return uni_iter at new position

Definition at line 234 of file numeric_evaluator.cpp.

235  {
236  m_token.pos += 2;
237  return Unit::Inch;
238  }

◆ operator++() [2/2]

uni_iter numEval::UTF8::uni_iter::operator++ ( int  )
inline

post-increment and return uni_iter at initial position

Definition at line 241 of file numeric_evaluator.cpp.

241  {
242  m_token.pos += 3;
243  return Unit::Mil;
244  }
245 
246  if( sizeLeft >= 4 && ch == 't' && cptr[ 1 ] == 'h' && cptr[ 2 ] == 'o' && cptr[ 3 ] == 'u' && !isalnum( cptr[ 4 ] ))
247  {

◆ operator-()

uni_iter numEval::UTF8::uni_iter::operator- ( int  aVal) const
inline

Definition at line 269 of file numeric_evaluator.cpp.

271 {

◆ operator->()

unsigned numEval::UTF8::uni_iter::operator-> ( ) const
inline

return unicode at current position

Definition at line 250 of file numeric_evaluator.cpp.

259  {

◆ operator<()

bool numEval::UTF8::uni_iter::operator< ( const uni_iter other) const
inline

Since the ++ operators advance more than one byte, this is your best loop termination test, < end(), not == end().

Definition at line 276 of file numeric_evaluator.cpp.

◆ operator<=()

bool numEval::UTF8::uni_iter::operator<= ( const uni_iter other) const
inline

Definition at line 277 of file numeric_evaluator.cpp.

◆ operator==()

bool numEval::UTF8::uni_iter::operator== ( const uni_iter other) const
inline

Definition at line 271 of file numeric_evaluator.cpp.

271 {

◆ operator>()

bool numEval::UTF8::uni_iter::operator> ( const uni_iter other) const
inline

Definition at line 278 of file numeric_evaluator.cpp.

◆ operator>=()

bool numEval::UTF8::uni_iter::operator>= ( const uni_iter other) const
inline

Definition at line 279 of file numeric_evaluator.cpp.

Friends And Related Function Documentation

◆ UTF8

friend class UTF8
friend

Definition at line 210 of file numeric_evaluator.cpp.

Member Data Documentation

◆ it

const unsigned char* numEval::UTF8::uni_iter::it
private

Definition at line 212 of file numeric_evaluator.cpp.


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