#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 |
| We implement the semantics of an STL input_iterator. | |
| typedef size_t | difference_type |
| We implement the semantics of an STL input_iterator. | |
| typedef const unsigned * | pointer |
| We implement the semantics of an STL input_iterator. | |
| typedef const unsigned & | reference |
| We implement the semantics of an STL input_iterator. | |
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. | |
Private Member Functions | |
| void | calculate_sequence_length () const |
| unsigned | get_char () const |
| Utf8Iterator (const unsigned char *p_, const unsigned char *end_, unsigned seqlen_) | |
Private Attributes | |
| const unsigned char * | p |
| const unsigned char * | end |
| unsigned | seqlen |
Definition at line 33 of file unicode.h.
| typedef size_t Xapian::Utf8Iterator::difference_type |
| typedef std::input_iterator_tag Xapian::Utf8Iterator::iterator_category |
| typedef const unsigned* Xapian::Utf8Iterator::pointer |
| typedef const unsigned& Xapian::Utf8Iterator::reference |
| typedef unsigned Xapian::Utf8Iterator::value_type |
| Xapian::Utf8Iterator::Utf8Iterator | ( | const unsigned char * | p_, | |
| const unsigned char * | end_, | |||
| unsigned | seqlen_ | |||
| ) | [inline, private] |
| Xapian::Utf8Iterator::Utf8Iterator | ( | const char * | p_ | ) | [explicit] |
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.
| p_ | A pointer to the start of the null terminated string to read. |
Definition at line 64 of file utf8itor.cc.
References assign().
| Xapian::Utf8Iterator::Utf8Iterator | ( | const char * | p_, | |
| size_t | len | |||
| ) | [inline] |
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.
| p_ | A pointer to the start of the string to read. | |
| len | The length of the string to read. |
| Xapian::Utf8Iterator::Utf8Iterator | ( | const std::string & | s | ) | [inline] |
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.
| s | The string to read. Must not be modified while the iteration is in progress. |
| Xapian::Utf8Iterator::Utf8Iterator | ( | ) | [inline] |
| void Xapian::Utf8Iterator::assign | ( | const std::string & | s | ) | [inline] |
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.
| s | The string to read. Must not be modified while the iteration is in progress. |
Definition at line 85 of file unicode.h.
References assign().
Referenced by assign().
| void Xapian::Utf8Iterator::assign | ( | const char * | p_, | |
| size_t | len | |||
| ) | [inline] |
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.
| p_ | A pointer to the start of the string to read. | |
| len | The length of the string to read. |
Definition at line 65 of file unicode.h.
Referenced by Utf8Iterator().
| void Xapian::Utf8Iterator::calculate_sequence_length | ( | ) | const [private] |
Definition at line 70 of file utf8itor.cc.
References bad_cont(), end, p, and seqlen.
Referenced by operator*().
| unsigned Xapian::Utf8Iterator::get_char | ( | ) | const [private] |
| size_t Xapian::Utf8Iterator::left | ( | ) | const [inline] |
| bool Xapian::Utf8Iterator::operator!= | ( | const Utf8Iterator & | other | ) | const [inline] |
Test two Utf8Iterators for inequality.
| other | The Utf8Iterator to compare this one with. |
Definition at line 172 of file unicode.h.
References p.
| unsigned Xapian::Utf8Iterator::operator* | ( | ) | const |
Get the current Unicode character value pointed to by the iterator.
Returns unsigned(-1) if the iterator has reached the end of its buffer.
Definition at line 112 of file utf8itor.cc.
References calculate_sequence_length(), p, and seqlen.
| Utf8Iterator& Xapian::Utf8Iterator::operator++ | ( | ) | [inline] |
| Utf8Iterator Xapian::Utf8Iterator::operator++ | ( | int | ) | [inline] |
| bool Xapian::Utf8Iterator::operator== | ( | const Utf8Iterator & | other | ) | const [inline] |
Test two Utf8Iterators for equality.
| other | The Utf8Iterator to compare this one with. |
Definition at line 165 of file unicode.h.
References p.
| const char* Xapian::Utf8Iterator::raw | ( | ) | const [inline] |
const unsigned char* Xapian::Utf8Iterator::end [private] |
const unsigned char* Xapian::Utf8Iterator::p [private] |
Definition at line 34 of file unicode.h.
Referenced by calculate_sequence_length(), operator!=(), operator*(), and operator==().
unsigned Xapian::Utf8Iterator::seqlen [mutable, private] |
Definition at line 36 of file unicode.h.
Referenced by calculate_sequence_length(), and operator*().