AUtf8View#
Non-owning, code-point-aware view into a UTF-8 string.
| Header: | #include <AUI/Common/AUtf8.hpp> |
| CMake: | aui_link(my_target PUBLIC aui::core) |
Detailed Description#
AUtf8View is the iterator layer that sits on top of AStringView and AString when you need
to work with individual Unicode characters rather than raw bytes.
Public Methods#
at#
constexpr AChar AUtf8View::at(const size_type i)
Checked access to the Unicode character at the specified index.
- Arguments
iThe index of the Unicode character (not byte offset).- Returns
- The character at the specified position.
Examples:
examples/7guis/cells/src/AST.cpp
7GUIs Cells — Spreadsheet processor (Excel).
length#
Returns the number of Unicode characters in the string
See also: sizeBytes.
substr#
Returns a view of a portion of the string.
- Arguments
posIndex of the first Unicode character to include.countNumber of Unicode characters to include.- Returns
- A new AUtf8View representing the sub-range. !!! note Both `pos` and `count` refer to Unicode characters, not raw bytes.