Class to use to pass a UTF-8, UTF-16, or UTF-32 string as UTF-8.
More...
#include "nn/nlib/unicode/Convert.h"
Class to use to pass a UTF-8, UTF-16, or UTF-32 string as UTF-8.
- Description
- Because
operator const char*
is defined, you can pass to function arguments as a multibyte character string. If the conversion fails and the object is invalid, an empty string is passed instead of a null pointer.
Definition at line 12 of file Convert.h.
nn::nlib::unicode::ToUtf8Obj::ToUtf8Obj |
( |
const wchar_t * |
wstr | ) |
|
|
explicitnoexcept |
Converts a wide character string to a UTF-8 string.
- Parameters
-
[in] | wstr | Wide character string to pass as a UTF-8 string. |
- Description
- Stores the UTF-8 converted string internally in dynamically allocated memory. The object becomes invalid if the conversion fails.
nn::nlib::unicode::ToUtf8Obj::ToUtf8Obj |
( |
const nlib_utf16_t * |
utf16str | ) |
|
|
explicitnoexcept |
Converts a UTF-16 string to a UTF-8 string.
- Parameters
-
[in] | utf16str | UTF-16 string to pass as a UTF-8 string. |
nn::nlib::unicode::ToUtf8Obj::ToUtf8Obj |
( |
const nlib_utf32_t * |
utf32str | ) |
|
|
explicitnoexcept |
Converts a UTF-32 string to a UTF-8 string.
- Parameters
-
[in] | utf32str | UTF-32 string to pass as a UTF-8 string. |
nn::nlib::unicode::ToUtf8Obj::ToUtf8Obj |
( |
const char * |
str | ) |
|
|
inlineexplicitnoexcept |
Sets the UTF-8 string.
- Parameters
-
- Description
- Stores the passed pointer in the object. Does not dynamically allocate memory or copy the string.
Definition at line 17 of file Convert.h.
nn::nlib::unicode::ToUtf8Obj::c_str |
( |
| ) |
|
|
inlinenoexcept |
Explicitly returns a C string.
- Returns
- C string converted to UTF-8.
Definition at line 26 of file Convert.h.
nn::nlib::unicode::ToUtf8Obj::IsOk |
( |
| ) |
const |
|
inlinenoexcept |
: Checks whether the object is valid.
- Returns
- Returns
true
if valid.
Definition at line 27 of file Convert.h.
The documentation for this class was generated from the following files: