glibmm 2.80.0
|
The iterator type of Glib::ustring. More...
#include <glibmm/ustring.h>
Public Types | |
using | iterator_category = std::bidirectional_iterator_tag |
using | value_type = gunichar |
using | difference_type = std::string::difference_type |
using | reference = value_type |
using | pointer = void |
Public Member Functions | |
ustring_Iterator () | |
ustring_Iterator (const ustring_Iterator< std::string::iterator > &other) | |
ustring_Iterator & | operator= (const ustring_Iterator &other)=default |
value_type | operator* () const |
ustring_Iterator< T > & | operator++ () |
const ustring_Iterator< T > | operator++ (int) |
ustring_Iterator< T > & | operator-- () |
const ustring_Iterator< T > | operator-- (int) |
ustring_Iterator (T pos) | |
T | base () const |
Related Symbols | |
(Note that these are not member symbols.) | |
bool | operator== (const Glib::ustring::const_iterator &lhs, const Glib::ustring::const_iterator &rhs) |
bool | operator!= (const Glib::ustring::const_iterator &lhs, const Glib::ustring::const_iterator &rhs) |
bool | operator< (const Glib::ustring::const_iterator &lhs, const Glib::ustring::const_iterator &rhs) |
bool | operator> (const Glib::ustring::const_iterator &lhs, const Glib::ustring::const_iterator &rhs) |
bool | operator<= (const Glib::ustring::const_iterator &lhs, const Glib::ustring::const_iterator &rhs) |
bool | operator>= (const Glib::ustring::const_iterator &lhs, const Glib::ustring::const_iterator &rhs) |
The iterator type of Glib::ustring.
Note this is not a random access iterator but a bidirectional one, since all index operations need to iterate over the UTF-8 data. Use std::advance() to move to a certain position. However, all of the relational operators are available: == != < > <= >=
A writeable iterator isn't provided because: The number of bytes of the old UTF-8 character and the new one to write could be different. Therefore, any write operation would invalidate all other iterators pointing into the same string.
The Glib::ustring iterated over must contain only valid UTF-8 data. If it does not, operator++(), operator--() and operator*() may make accesses outside the bounds of the string. A loop such as the following one would not stop at the end of the string.
T | std::string::iterator or std::string::const_iterator |
using Glib::ustring_Iterator< T >::difference_type = std::string::difference_type |
using Glib::ustring_Iterator< T >::iterator_category = std::bidirectional_iterator_tag |
using Glib::ustring_Iterator< T >::pointer = void |
using Glib::ustring_Iterator< T >::reference = value_type |
using Glib::ustring_Iterator< T >::value_type = gunichar |
|
inline |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
default |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |