mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
parent
b42c187ed1
commit
59e1361388
2 changed files with 15 additions and 2 deletions
|
@ -39,6 +39,19 @@ struct SharedString
|
|||
/// Creates a new SharedString from the null-terminated string pointer \a s. The underlying
|
||||
/// string data is copied. It is assumed that the string is UTF-8 encoded.
|
||||
SharedString(const char *s) : SharedString(std::string_view(s)) { }
|
||||
#if defined(__cpp_char8_t) || __cplusplus >= 202002L
|
||||
/// Creates a new SharedString from the null-terminated string pointer \a s. The underlying
|
||||
/// string data is copied.
|
||||
SharedString(const char8_t *s) : SharedString(reinterpret_cast<const char*>(s)) { }
|
||||
#endif
|
||||
#ifdef __cpp_lib_char8_t
|
||||
/// Creates a new SharedString from the string view \a s. The underlying string data is copied.
|
||||
SharedString(std::u8string_view s)
|
||||
{
|
||||
cbindgen_private::sixtyfps_shared_string_from_bytes(
|
||||
this, reinterpret_cast<const char*>(s.data()), s.size());
|
||||
}
|
||||
#endif
|
||||
/// Creates a new SharedString from \a other.
|
||||
SharedString(const SharedString &other)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue