UtfString
|
An iterator that iterates through the code points in a UTF-16 string in reverse order. More...
#include <Utf16String.h>
Inherits iterator< std::random_access_iterator_tag, Utf16Char >.
Public Member Functions | |
reverse_iterator (std::basic_string< UInt16 > &basicString, const std::basic_string< UInt16 >::reverse_iterator &basicStringIterator) | |
Constructs a reverse iterator for Utf16String using the base class iterator. More... | |
reverse_iterator (const Utf16String::reverse_iterator &otherIterator) | |
Constructs a reverse iterator for Utf16String using another iterator. More... | |
reverse_iterator (const Utf16String::iterator &iterator) | |
Constructs a reverse iterator for Utf16String using an iterator. More... | |
reverse_iterator & | operator= (const Utf16String::reverse_iterator &otherIterator) |
Assigns the value of another reverse iterator to this reverse iterator. More... | |
~reverse_iterator () | |
Cleans up before the iterator is destroyed. | |
bool | operator== (const reverse_iterator &otherIterator) const |
Compares this reverse iterator with another reverse iterator and tests for equality. More... | |
bool | operator!= (const reverse_iterator &otherIterator) const |
Compares this reverse iterator with another reverse iterator and tests for inequality. More... | |
bool | operator< (const reverse_iterator &otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes before the other iterator in the string. More... | |
bool | operator<= (const reverse_iterator &otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes before or is at the same position the other iterator in the string. More... | |
bool | operator> (const reverse_iterator &otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes after the other iterator in the string. More... | |
bool | operator>= (const reverse_iterator &otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes after or is at the same position the other iterator in the string. More... | |
reverse_iterator & | operator++ () |
Increments this reverse iterator to the previous position in the Utf16String. More... | |
reverse_iterator | operator++ (int) |
Increments this reverse iterator to the previous position in the Utf16String. More... | |
reverse_iterator & | operator+= (size_t offset) |
Increments this iterator by a specific offset. More... | |
reverse_iterator | operator+ (size_t offset) |
Creates an iterator that has the position of this iterator incremented by a specific offset. More... | |
reverse_iterator & | operator-- () |
Decrements this reverse iterator to the next position in the Utf16String. More... | |
reverse_iterator | operator-- (int) |
Decrements this reverse iterator to the next position in the Utf16String. More... | |
reverse_iterator & | operator-= (size_t offset) |
Decrements this iterator by a specific offset. More... | |
reverse_iterator | operator- (size_t offset) |
Creates an iterator that has the position of this iterator decremented by a specific offset. More... | |
Utf16CharReference | operator* () |
Gets the character at the position of this reverse iterator. More... | |
Utf16CharReference * | operator-> () |
Gets a pointer to the character at the position of this reverse iterator. More... | |
An iterator that iterates through the code points in a UTF-16 string in reverse order.
This iterator assumes that the UTF-16 string being iterated over is a valid UTF-16 string.
UtfString::Utf16String::reverse_iterator::reverse_iterator | ( | std::basic_string< UInt16 > & | basicString, |
const std::basic_string< UInt16 >::reverse_iterator & | basicStringIterator | ||
) |
Constructs a reverse iterator for Utf16String using the base class iterator.
This function assumes that basicStringIterator is a valid reverse iterator
[in] | basicString | A reference to the string that baseStringIterator points to |
[in] | basicStringIterator | The base class reverse iterator to use in constructing this iterator |
UtfString::Utf16String::reverse_iterator::reverse_iterator | ( | const Utf16String::reverse_iterator & | otherIterator) |
Constructs a reverse iterator for Utf16String using another iterator.
This iterator will take on the same characteristics and position as the other iterator
[in] | otherIterator | The other reverse iterator to use in constructing this reverse iterator |
UtfString::Utf16String::reverse_iterator::reverse_iterator | ( | const Utf16String::iterator & | iterator) |
Constructs a reverse iterator for Utf16String using an iterator.
This reverse iterator will take on the same position as the iterator.
[in] | iterator | The iterator to use in constructing this reverse iterator |
bool UtfString::Utf16String::reverse_iterator::operator!= | ( | const reverse_iterator & | otherIterator) | const |
Compares this reverse iterator with another reverse iterator and tests for inequality.
[in] | otherIterator | The other reverse iterator to be compared with this reverse iterator |
Utf16CharReference UtfString::Utf16String::reverse_iterator::operator* | ( | ) |
Gets the character at the position of this reverse iterator.
If this reverse iterator is not pointing to a position in a Utf16String, the result will be undefined.
The reference returned by this function will be invalidated if the iterator is changed in any way. Changing the value of the returned object will not change the string.
reverse_iterator UtfString::Utf16String::reverse_iterator::operator+ | ( | size_t | offset) |
Creates an iterator that has the position of this iterator incremented by a specific offset.
Note that since a UTF-16 string contains variable-width characters, we have to iterate over the code units. As a result, this operator has a performance of O(N). Hence, this operator should be used with care.
[in] | offset | The offset to be used when incrementing this position of this iterator |
reverse_iterator& UtfString::Utf16String::reverse_iterator::operator++ | ( | ) |
Increments this reverse iterator to the previous position in the Utf16String.
This is the prefix operator.
reverse_iterator UtfString::Utf16String::reverse_iterator::operator++ | ( | int | ) |
Increments this reverse iterator to the previous position in the Utf16String.
This is a postfix operator.
reverse_iterator& UtfString::Utf16String::reverse_iterator::operator+= | ( | size_t | offset) |
Increments this iterator by a specific offset.
Note that since a UTF-16 string contains variable-width characters, we have to iterate over the code units. As a result, this operator has a performance of O(N). Hence, this operator should be used with care.
[in] | offset | The offset to use in incrementing this iterator |
reverse_iterator UtfString::Utf16String::reverse_iterator::operator- | ( | size_t | offset) |
Creates an iterator that has the position of this iterator decremented by a specific offset.
Note that since a UTF-16 string contains variable-width characters, we have to iterate over the code units. As a result, this operator has a performance of O(N). Hence, this operator should be used with care.
[in] | offset | The offset to use in decrementing the position of this iterator |
reverse_iterator& UtfString::Utf16String::reverse_iterator::operator-- | ( | ) |
Decrements this reverse iterator to the next position in the Utf16String.
This is a prefix operator.
reverse_iterator UtfString::Utf16String::reverse_iterator::operator-- | ( | int | ) |
Decrements this reverse iterator to the next position in the Utf16String.
This is a postfix operator.
reverse_iterator& UtfString::Utf16String::reverse_iterator::operator-= | ( | size_t | offset) |
Decrements this iterator by a specific offset.
Note that since a UTF-16 string contains variable-width characters, we have to iterate over the code units. As a result, this operator has a performance of O(N). Hence, this operator should be used with care.
[in] | offset | The offset to use in decrementing this iterator |
Utf16CharReference* UtfString::Utf16String::reverse_iterator::operator-> | ( | ) |
Gets a pointer to the character at the position of this reverse iterator.
If this reverse iterator is not pointing to a position in a Utf16String, the result will be undefined.
The pointer returned by this function will be invalidated if the iterator is changed in any way.
bool UtfString::Utf16String::reverse_iterator::operator< | ( | const reverse_iterator & | otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes before the other iterator in the string.
This operator has a performance of O(1).
[in] | otherIterator | The other iterator to be compared with this iterator |
bool UtfString::Utf16String::reverse_iterator::operator<= | ( | const reverse_iterator & | otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes before or is at the same position the other iterator in the string.
This operator has a performance of O(1).
[in] | otherIterator | The other iterator to be compared with this iterator |
reverse_iterator& UtfString::Utf16String::reverse_iterator::operator= | ( | const Utf16String::reverse_iterator & | otherIterator) |
Assigns the value of another reverse iterator to this reverse iterator.
This reverse iterator will take on the same characteristics and position as the other reverse iterator
[in] | otherIterator | The other reverse iterator to be assigned to this reverse iterator |
bool UtfString::Utf16String::reverse_iterator::operator== | ( | const reverse_iterator & | otherIterator) | const |
Compares this reverse iterator with another reverse iterator and tests for equality.
[in] | otherIterator | The other reverse iterator to be compared with this reverse iterator |
bool UtfString::Utf16String::reverse_iterator::operator> | ( | const reverse_iterator & | otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes after the other iterator in the string.
This operator has a performance of O(1).
[in] | otherIterator | The other iterator to be compared with this iterator |
bool UtfString::Utf16String::reverse_iterator::operator>= | ( | const reverse_iterator & | otherIterator) |
Compares this iterator to another iterator and tests whether this iterator comes after or is at the same position the other iterator in the string.
This operator has a performance of O(1).
[in] | otherIterator | The other iterator to be compared with this iterator |