mirror of
https://github.com/matrix-construct/construct
synced 2024-11-19 08:21:09 +01:00
ircd::js: Add an inefficient std::u16string conversion for string.
This commit is contained in:
parent
f92f117edc
commit
a3c06466fb
1 changed files with 8 additions and 0 deletions
|
@ -59,6 +59,7 @@ struct string
|
||||||
char16_t operator[](const size_t &at) const;
|
char16_t operator[](const size_t &at) const;
|
||||||
|
|
||||||
operator std::string() const;
|
operator std::string() const;
|
||||||
|
operator std::u16string() const;
|
||||||
operator JS::Value() const;
|
operator JS::Value() const;
|
||||||
|
|
||||||
using root<JSString *, L>::root;
|
using root<JSString *, L>::root;
|
||||||
|
@ -288,6 +289,13 @@ const
|
||||||
return native(this->get());
|
return native(this->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<lifetime L>
|
||||||
|
string<L>::operator std::u16string()
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return locale::char16::conv(native(this->get()));
|
||||||
|
}
|
||||||
|
|
||||||
template<lifetime L>
|
template<lifetime L>
|
||||||
char *
|
char *
|
||||||
string<L>::c_str()
|
string<L>::c_str()
|
||||||
|
|
Loading…
Reference in a new issue