| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(utf8_string), | intent(out) | :: | utf8 | |||
| character(kind=c_char,len=*), | intent(in) | :: | str |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char,len=:), | intent(out), | allocatable | :: | str | ||
| type(utf8_string), | intent(in) | :: | utf8 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(utf8_string), | intent(out) | :: | utf8 | |||
| character(kind=c_char,len=*), | intent(in) | :: | str | |||
| logical, | intent(in), | optional | :: | escape |
check if the whole string is valid utf8 encoding
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char,len=*), | intent(in) | :: | str |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(utf8_string), | intent(in) | :: | str |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(kind=c_char,len=:), | public, | allocatable | :: | str |
| procedure, public :: iterator |
private helper functions cast char to byte (8-bits integer in Fortran) display: private
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char,len=1), | intent(in) | :: | char |
get the number of bytes of a code point based on its first byte display: private
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=c_int8_t), | intent(in) | :: | byte |
return an iterator of utf8_string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(in), | target | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string_iterator), | intent(inout) | :: | this |
iterator methods
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string_iterator), | intent(in) | :: | this |
return the code point at specified position
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(in) | :: | utf8 | |||
| integer, | intent(in) | :: | idx |
count the substring in utf8_string overlaps are not considered e.g. utf8_count(“AUAUAUAUAUAUAU”,”AUA”) returns 3
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(in) | :: | utf8 | |||
| character(kind=c_char,len=*), | intent(in) | :: | substring |
return the position where substring occurs in utf8_string for the first time
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(in) | :: | utf8 | |||
| character(kind=c_char,len=*), | intent(in) | :: | substring |
check if the whole string is valid utf8 encoding
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char,len=*), | intent(in) | :: | str |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(utf8_string), | intent(in) | :: | str |
return the number of UTF-8 code points
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(in) | :: | utf8 |
return a substring of utf8_string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(in) | :: | utf8 | |||
| integer, | intent(in) | :: | begin | |||
| integer, | intent(in) | :: | end |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char,len=:), | intent(out), | allocatable | :: | str | ||
| type(utf8_string), | intent(in) | :: | utf8 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(utf8_string), | intent(out) | :: | utf8 | |||
| character(kind=c_char,len=*), | intent(in) | :: | str |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(utf8_string), | intent(out) | :: | utf8 | |||
| character(kind=c_char,len=*), | intent(in) | :: | str | |||
| logical, | intent(in), | optional | :: | escape |
reverse the order of code points in place
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(inout) | :: | utf8 |
split utf8_string based on the separation string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(utf8_string), | intent(in), | target | :: | utf8 | ||
| character(kind=c_char,len=*), | intent(in) | :: | sep | |||
| type(utf8_string), | intent(out), | dimension(:), allocatable | :: | list |