CopperSpice API  1.9.1
QString16::iterator Class Reference

STL style iterator for QString16. More...

Inherits iterator

Public Methods

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

Detailed Description

The QString16::iterator class provides an STL style iterator which allows you to iterate over a QString16. If you want to modify the QString16 as you iterate over it use QString16::iterator. If you do not need to alter the string use QString16::const_iterator instead.

See also
QString16::const_iterator

Constructor & Destructor Documentation

QString16::iterator::iterator ( )
default

Constructs an uninitialized iterator.

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

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

Method Documentation

bool QString16::iterator::operator!= ( iterator  other) const
inline

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

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

Returns the value this iterator currently points to.

iterator QString16::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-()
iterator & QString16::iterator::operator++ ( )
inline

The prefix ++ operator (++i) 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() leads to undefined behavior.

iterator QString16::iterator::operator++ ( int  n)
inline

The postfix ++ operator (i++) advances the iterator to the next item in the string and returns an iterator to the previously current item.

iterator & QString16::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::iterator::operator- ( 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.

iterator QString16::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+()
iterator & QString16::iterator::operator-- ( )
inline

The prefix – operator (–i) 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() leads to undefined behavior.

iterator QString16::iterator::operator-- ( int  n)
inline

The postfix – operator (i–) 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() leads to undefined behavior.

iterator & QString16::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::iterator::operator-> ( ) const
inline

his 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() ) {
// the first code point in the string is a space
}
bool QString16::iterator::operator== ( 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::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-()