CopperSpice API  2.0.0
QString16::const_iterator Class Reference

STL style const iterator for QString16. More...

Inherits const_iterator

Public Methods

 const_iterator () = default
 
bool operator!= (const const_iterator &other) const
 
const QChar32 operator* () const
 
const_iterator operator+ (size_type n) const
 
const_iterator & operator++ ()
 
const_iterator operator++ (int n)
 
const_iterator & operator+= (size_type n)
 
size_type operator- (const_iterator other) const
 
const_iterator operator- (size_type n) const
 
const_iterator & operator-- ()
 
const_iterator operator-- (int n)
 
const_iterator & operator-= (size_type n)
 
QChar32Arrow operator-> () const
 
bool operator== (const const_iterator &other) const
 
QChar32 operator[] (size_type n) const
 

Related Functions

These are not member functions

QString16::const_iterator operator+ (QString16::size_type n, QString16::const_iterator iter)
 

Detailed Description

The QString16::const_iterator class provides an STL style iterator which can be used to traverse the contents of a QString8.

All QString16 iterators are read only. To modify the contents of the string call methods like append(), insert(), or replace().

See also
QString16::iterator

Constructor & Destructor Documentation

QString16::const_iterator::const_iterator ( )
default

Constructs an uninitialized iterator.

Methods like operator++() must not be called on an uninitialized iterator. Use operator=() to assign a value to the iterator before using it.

See also
QString16::constBegin(), QString16::constEnd()

Method Documentation

bool QString16::const_iterator::operator!= ( const const_iterator &  other) const

Returns true if other points to a different item than this iterator, otherwise it returns false.

See also
operator==()
const QChar32 QString16::const_iterator::operator* ( ) const
inline

Returns the value this iterator currently points to.

const_iterator QString16::const_iterator::operator+ ( size_type  n) const
inline

Returns an iterator to the item at n positions forward from this iterator. If n is negative the iterator goes backward.

This operation can be slow for large values of n.

See also
operator-()
const_iterator & QString16::const_iterator::operator++ ( )
inline

The prefix ++ operator advances the iterator to the next item in the string and returns an iterator to the new current item.

Calling this method on QString16::end() causes undefined behavior.

++iter;
const_iterator QString16::const_iterator::operator++ ( int  n)
inline

The postfix ++ operator advances the iterator to the next item in the string and returns an iterator to the previous current item.

Calling this method on QString16::end() causes undefined behavior.

iter++;
const_iterator & QString16::const_iterator::operator+= ( size_type  n)
inline

Advances the iterator by n items. If n is negative the iterator goes backward.

This operation can be slow for large values of n.

See also
operator-=(), operator+()
size_type QString16::const_iterator::operator- ( const_iterator  other) const
inline

Returns the number of code points between the code point pointed to by other and the code point pointed to by this iterator.

const_iterator QString16::const_iterator::operator- ( size_type  n) const
inline

Returns an iterator to the item at n positions backward from this iterator. If n is negative the iterator goes forward.

This operation can be slow for large values of n.

See also
operator+()
const_iterator & QString16::const_iterator::operator-- ( )
inline

The prefix -- operator decrements the iterator to the previous item in the string and returns an iterator to the new current item.

Calling this method on QString16::begin() causes undefined behavior.

--iter;
const_iterator QString16::const_iterator::operator-- ( int  n)
inline

The postfix -- operator decrements the iterator to the previous item in the string and returns an iterator to the previously current item.

Calling this method on QString16::begin() causes undefined behavior.

iter--;
const_iterator & QString16::const_iterator::operator-= ( size_type  n)
inline

Makes the iterator go back by n items. If n is negative the iterator goes forward.

This operation can be slow for large values of n.

See also
operator+=(), operator-()
QChar32Arrow QString16::const_iterator::operator-> ( ) const
inline

This operator is a simplified way to dereference an iterator and access the value in one step.

The expression iter->isSpace() is equivalent to (*iter).isSpace().

QString16 str = "Some text";
auto iter = str.begin();
if (iter->isSpace()) {
return true; // first code point in the given string is a space
} else {
return false; // example reaches this branch
}
bool QString16::const_iterator::operator== ( const const_iterator &  other) const
inline

Returns true if other points to the same item as this iterator, otherwise it returns false.

See also
operator!=()
QChar32 QString16::const_iterator::operator[] ( size_type  n) const
inline

Returns the item at n positions forward from this iterator. If n is negative the iterator goes backward.

This operation can be slow for large values of n.

See also
operator-()

Friends And Related Function Documentation

QString16::const_iterator operator+ ( QString16::size_type  n,
QString16::const_iterator  iter 
)
related

Returns an iterator to the item at n positions forward from iter. If n is negative the iterator goes backward.

This operation can be slow for large values of n.