-
Notifications
You must be signed in to change notification settings - Fork 2
The `utf::string_view` class API
Alex Qzminsky edited this page Dec 30, 2020
·
2 revisions
Not ready yet!
Name | Defined as |
---|---|
string_view::char_type |
uint32_t |
string_view::difference_type |
ptrdiff_t |
string_view::unit |
uint8_t |
string_view::pointer |
string::unit* |
string_view::size_type |
ptrdiff_t |
string_view::value_type |
Same as char_type |
iterator |
Itself |
The char_type
, difference_type
, unit
, pointer
, size_type
, value_type
aliases is similar to string
's.
Constructs a view over given C-string.
Returns a pointer to the beginning of the view's data.
Returns a pointer to the ending of the view's data. I.e., bytes() + size() == bytes_end()
.
Predicate. Returns true
if the view does not contains any characters. The effect is equivalent to string_view::operator ! ()
.
Returns the number of Unicode characters in the span.
This is an
O(n)
operation as it requires iteration over every UTF-8 character of the string.
Returns the number of the UTF-8 bytes data used by the span.