String functions with UNICODE support.
More...
String functions with UNICODE support.
◆ gui_string_compare()
Compare 2 strings.
- Parameters
-
| [in] | s1 | First string address |
| [in] | s2 | Second string address |
- Returns
0 if equal, non-zero otherwise
◆ gui_string_copy()
Copy string from source to destination no matter of GUI_CFG_USE_UNICODE selection.
- Parameters
-
| [out] | dst | Destination memory address |
| [in] | src | Source memory address |
- Returns
- Pointer to destination memory
◆ gui_string_copyn()
Copy string from source to destination with selectable number of bytes.
- Parameters
-
| [out] | dst | Destination memory address |
| [in] | src | Source memory address |
| [in] | len | Number of bytes to copy |
- Returns
- Pointer to destination memory
◆ gui_string_getch()
| uint8_t gui_string_getch |
( |
gui_string_t *const |
s, |
|
|
uint32_t *const |
out, |
|
|
uint8_t *const |
len |
|
) |
| |
Get next decoded character from source string.
- Note
- When GUI_CFG_USE_UNICODE is set to
1, multiple bytes may be used for single character
- Parameters
-
| [in,out] | s | Pointer to gui_string_t structure with input string. Function will internally change pointer of actual string where it points to to next character |
| [out] | out | Pointer to output memory where output character will be saved |
| [out] | len | Pointer to output memory where number of bytes for string will be saved |
- Returns
1 on success, 0 otherwis
- See also
- gui_string_getchreverse
◆ gui_string_getchreverse()
| uint8_t gui_string_getchreverse |
( |
gui_string_t *const |
str, |
|
|
uint32_t *const |
out, |
|
|
uint8_t *const |
len |
|
) |
| |
Get character by character from end of string up.
- Note
- Functionality is the same as gui_string_getch except order is swapped
-
String must be at the last character before function is first time called
- Note
- When GUI_CFG_USE_UNICODE is set to
1, multiple bytes may be used for single character
- Parameters
-
| [in,out] | *str | Pointer to gui_string_t structure with input string. Function will internally change pointer of actual string where it points to to next character |
| [out] | out | Pointer to output memory where output character will be saved |
| [out] | len | Pointer to output memory where number of bytes for string will be saved |
- Returns
1 on success, 0 otherwise
◆ gui_string_gotoend()
Set character pointer to the last character in sequence.
- Parameters
-
| [in,out] | str | Pointer to gui_string_t structure with string informations |
- Returns
1 on success, 0 otherwise
◆ gui_string_isprintable()
| uint8_t gui_string_isprintable |
( |
uint32_t |
ch | ) |
|
Check if character is printable.
- Parameters
-
| [in] | ch | First memory address |
- Returns
1 on success, 0 otherwise
◆ gui_string_length()
| size_t gui_string_length |
( |
const gui_char *const |
src | ) |
|
Return length of string.
Example input string: EasyGUI\\xDF\\x8F
1. When \ref GUI_CFG_USE_UNICODE is set to `1`, function will try to parse unicode characters
and will return `8` on top input string
2. When \ref GUI_CFG_USE_UNICODE is set to `0`, function will count all the bytes until string termination is reached
and will return `9` on top input string
- Parameters
-
| [in] | src | Pointer to source string to get length |
- Returns
- Number of visible characters in string
◆ gui_string_lengthtotal()
| size_t gui_string_lengthtotal |
( |
const gui_char *const |
src | ) |
|
Return total number of bytes required for string.
- Note
- When GUI_CFG_USE_UNICODE is set to
0, this function returns the same as gui_string_length
- Parameters
-
| [in] | src | Pointer to source string to get length |
- Returns
- Number of visible characters in string
◆ gui_string_prepare()