#include <unicode.h>
Public Types | |
typedef std::input_iterator_tag | iterator_category |
We implement the semantics of an STL input_iterator. | |
typedef unsigned | value_type |
typedef size_t | difference_type |
typedef const unsigned * | pointer |
typedef const unsigned & | reference |
Public Member Functions | |
const char * | raw () const |
Return the raw const char * pointer for the current position. | |
size_t | left () const |
Return the number of bytes left in the iterator's buffer. | |
void | assign (const char *p_, size_t len) |
Assign a new string to the iterator. | |
void | assign (const std::string &s) |
Assign a new string to the iterator. | |
Utf8Iterator (const char *p_) | |
Create an iterator given a pointer to a null terminated string. | |
Utf8Iterator (const char *p_, size_t len) | |
Create an iterator given a pointer and a length. | |
Utf8Iterator (const std::string &s) | |
Create an iterator given a string. | |
Utf8Iterator () | |
Create an iterator which is at the end of its iteration. | |
unsigned | operator * () const |
Get the current unicode character value pointed to by the iterator. | |
Utf8Iterator | operator++ (int) |
Move forward to the next unicode character. | |
Utf8Iterator & | operator++ () |
Move forward to the next unicode character. | |
bool | operator== (const Utf8Iterator &other) const |
Test two Utf8Iterators for equality. | |
bool | operator!= (const Utf8Iterator &other) const |
Test two Utf8Iterators for inequality. |
|
We implement the semantics of an STL input_iterator.
|
|
Create an iterator given a pointer to a null terminated string. The iterator will return characters from the start of the string when next called. The string is not copied into the iterator, so it must remain valid while the iteration is in progress.
|
|
Create an iterator given a pointer and a length. The iterator will return characters from the start of the string when next called. The string is not copied into the iterator, so it must remain valid while the iteration is in progress.
|
|
Create an iterator given a string. The iterator will return characters from the start of the string when next called. The string is not copied into the iterator, so it must remain valid while the iteration is in progress.
|
|
Create an iterator which is at the end of its iteration. This can be compared to another iterator to check if the other iterator has reached its end. |
|
Assign a new string to the iterator. The iterator will forget the string it was iterating through, and return characters from the start of the new string when next called. The string is not copied into the iterator, so it must remain valid while the iteration is in progress.
|
|
Assign a new string to the iterator. The iterator will forget the string it was iterating through, and return characters from the start of the new string when next called. The string is not copied into the iterator, so it must remain valid while the iteration is in progress.
|
|
Return the number of bytes left in the iterator's buffer.
|
|
Get the current unicode character value pointed to by the iterator. Returns unsigned(-1) if the iterator has reached the end of its buffer. |
|
Test two Utf8Iterators for inequality.
|
|
Move forward to the next unicode character.
|
|
Move forward to the next unicode character.
|
|
Test two Utf8Iterators for equality.
|
|
Return the raw const char * pointer for the current position.
|