Public Types | |
enum | { EndOfInput = utf32_char_type(-1) } |
enum | { MaxCodeUnits = EncTraits::utf32_max_code_units } |
typedef EncTraits::code_unit_type | code_unit_type |
Public Member Functions | |
const code_unit_type * | begin () const |
unsigned | codeUnitIdx () const |
const code_unit_type * | cursor () const |
const code_unit_type * | end () const |
utf32_char_type | next () |
void | rewind () |
UTF32Iterator (const code_unit_type *str, unsigned len) | |
Static Public Member Functions | |
static unsigned | codeUnitSize (utf32_char_type chr) |
EncTraits - encoding traits;
Forward - iteration direction.
typedef EncTraits::code_unit_type fe::UTF32Iterator< EncTraits, Forward >::code_unit_type |
anonymous enum |
anonymous enum |
fe::UTF32Iterator< EncTraits, Forward >::UTF32Iterator | ( | const code_unit_type * | str, | |
unsigned | len | |||
) | [inline] |
Initializes the UTF32Iterator with the input code unit sequence. If Forward
template parameter is true
reads code units from the [str, str + len)
region, otherwise from the (str, str - len]
region.
str | pointer to the first input code unit; | |
len | number of available code units in the input sequence. |
void fe::UTF32Iterator< EncTraits, Forward >::rewind | ( | ) | [inline] |
const code_unit_type* fe::UTF32Iterator< EncTraits, Forward >::begin | ( | ) | const [inline] |
If Forward
template parameter is true
returns pointer to the first code unit of the input code unit sequence. Otherwise returns pointer addressing the code unit after the first code unit of the input code unit sequence. The returned value is equal to str
parameter of the ctor.
const code_unit_type* fe::UTF32Iterator< EncTraits, Forward >::end | ( | ) | const [inline] |
If Forward
template parameter is true
returns pointer addressing the code unit after the last code unit of the input sequence. Otherwise returns pointer addressing the last code unit of the input sequence.
const code_unit_type* fe::UTF32Iterator< EncTraits, Forward >::cursor | ( | ) | const [inline] |
utf32_char_type fe::UTF32Iterator< EncTraits, Forward >::next | ( | ) | [inline] |
Returns the next UTF32 character extracted from the input code unit sequence. Decoding begins with a code unit in the sequence pointed by cursor(). Returns either EndOfInput or a legal UTF32 character even if the input code unit sequence encodes illegal UTF32 character or is malformed itself. EndOfInput return value indicates that there are no more code units to read, i.e. cursor() is equal to end(). If method returns value other then EndOfInput cursor is moved to a new position.
unsigned fe::UTF32Iterator< EncTraits, Forward >::codeUnitIdx | ( | ) | const [inline] |
Returns index of the code unit addressed by cursor() in the input code unit sequence.
static unsigned fe::UTF32Iterator< EncTraits, Forward >::codeUnitSize | ( | utf32_char_type | chr | ) | [inline, static] |
Returns number of code units needed to represent the given legal UTF32-encoded character. Return value is always less or equal to MaxCodeUnits.
chr | legal UTF32-encoded character to measure. |