#include <kanzi/core.ui/text/text_break_iterator.hpp>
|
static constexpr auto | s_done |
| Value indicating that all boundaries have been returned. More...
|
|
Type of text break iterator.
Enumerator |
---|
Word |
Iterate word boundaries.
|
Line |
Iterate line breaks.
|
kanzi::TextBreakIterator::TextBreakIterator |
( |
Type |
type, |
|
|
const char * |
utf8String, |
|
|
int64_t |
utf8Length |
|
) |
| |
|
explicit |
Constructs a text break iterator for a UTF-8 string.
Indexes returned by TextBreakIterator refer to the elements in the original character array.
- Parameters
-
type | Type of the text break iterator. |
utf8String | String in UTF-8 format. |
utf8Length | A length of the given string. If the string is 0-terminated, -1. |
kanzi::TextBreakIterator::TextBreakIterator |
( |
Type |
type, |
|
|
const char16_t * |
utf16String, |
|
|
int64_t |
utf16Length |
|
) |
| |
|
explicit |
Constructs a text break iterator for a UTF-16 string.
Indexes returned by TextBreakIterator refer to the elements in the original character array.
- Parameters
-
type | Type of the text break iterator. |
utf16String | String in UTF-16 format. |
utf16Length | A length of the given string. If the string is 0-terminated, -1. |
kanzi::TextBreakIterator::~TextBreakIterator |
( |
| ) |
|
size_t kanzi::TextBreakIterator::first |
( |
| ) |
|
Sets the iterator position to the beginning of the string.
- Returns
- New iterator position (zero).
size_t kanzi::TextBreakIterator::last |
( |
| ) |
|
Sets the iterator position to after the last character of the string.
- Returns
- New iterator position.
size_t kanzi::TextBreakIterator::next |
( |
| ) |
|
Advance the iterator to the next boundary.
- Returns
- New iterator position. If all boundaries have already been returned, returns s_done.
size_t kanzi::TextBreakIterator::previous |
( |
| ) |
|
Advance the iterator to the previous boundary.
- Returns
- New iterator position. If all boundaries have already been returned, returns s_done.
size_t kanzi::TextBreakIterator::current |
( |
| ) |
const |
Returns the current position of the iterator.
- Returns
- Current position of the iterator.
size_t kanzi::TextBreakIterator::preceding |
( |
size_t |
offset | ) |
|
Sets the iterator to the first boundary that precedes the given offset.
- Parameters
-
offset | A character offset in the original character array. |
- Returns
- New iterator position. If all boundaries have already been returned, returns s_done.
size_t kanzi::TextBreakIterator::following |
( |
size_t |
offset | ) |
|
Sets the iterator to the first boundary that follows the given offset.
- Parameters
-
offset | A character offset in the original character array. |
- Returns
- New iterator position. If all boundaries have already been returned, returns s_done.
char32_t kanzi::TextBreakIterator::char32At |
( |
size_t |
offset | ) |
const |
Returns the UTF-32 Unicode codepoint at the given offset.
- Parameters
-
offset | A character offset in the original character array. |
- Returns
- UTF-32 Unicode codepoint at the given offset.
constexpr auto kanzi::TextBreakIterator::s_done |
|
static |
Value indicating that all boundaries have been returned.
The documentation for this class was generated from the following file: