mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
C++: expose special key codes constants
This commit is contained in:
parent
ad84114bae
commit
0a8f9c585a
5 changed files with 164 additions and 10 deletions
|
@ -33,19 +33,15 @@ 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::slint_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