#include <ustring.hh>
Collaboration diagram for otk::ustring_Iterator< T >:
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.
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.
Definition at line 52 of file ustring.hh.
Public Types | |
typedef std::bidirectional_iterator_tag | iterator_category |
typedef unichar | value_type |
typedef std::string::difference_type | difference_type |
typedef void | pointer |
Public Methods | |
ustring_Iterator () | |
ustring_Iterator (const ustring_Iterator< std::string::iterator > &other) | |
value_type | operator * () const |
ustring_Iterator< T > & | operator++ () |
ustring_Iterator< T > & | operator-- () |
ustring_Iterator (T pos) | |
T | base () const |
Private Attributes | |
T | _pos |
|
Definition at line 57 of file ustring.hh. |
|
Definition at line 55 of file ustring.hh. |
|
Definition at line 59 of file ustring.hh. |
|
Definition at line 56 of file ustring.hh. |
|
Definition at line 61 of file ustring.hh.
00061 {} |
|
Definition at line 62 of file ustring.hh. References otk::ustring_Iterator< T >::_pos, and otk::ustring_Iterator< T >::base().
00063 : _pos(other.base()) {} |
|
Definition at line 82 of file ustring.hh. References otk::ustring_Iterator< T >::_pos.
00082 : _pos(pos) {} |
|
Definition at line 83 of file ustring.hh. References otk::ustring_Iterator< T >::_pos. Referenced by otk::ustring_Iterator< T >::ustring_Iterator().
00083 { return _pos; } |
|
Definition at line 66 of file ustring.hh. References otk::ustring_Iterator< T >::_pos, and otk::utf8_get_char().
00066 { 00067 // get an iterator to the internal string 00068 std::string::const_iterator pos = _pos; 00069 return utf8_get_char(&(*pos)); 00070 } |
|
Definition at line 73 of file ustring.hh.
00073 { 00074 pos_ += g_utf8_skip[static_cast<unsigned char>(*pos_)]; 00075 return *this; 00076 } |
|
Definition at line 77 of file ustring.hh. References otk::ustring_Iterator< T >::_pos.
|
|
Definition at line 86 of file ustring.hh. Referenced by otk::ustring_Iterator< T >::base(), otk::ustring_Iterator< T >::operator *(), otk::ustring_Iterator< T >::operator--(), and otk::ustring_Iterator< T >::ustring_Iterator(). |