mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
AK: Implement UTF-16 string-to-number conversions
This commit is contained in:
parent
6e0290ecaa
commit
d40e3af697
Notes:
github-actions[bot]
2025-07-18 16:47:05 +00:00
Author: https://github.com/trflynn89
Commit: d40e3af697
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5388
Reviewed-by: https://github.com/shannonbooth ✅
6 changed files with 163 additions and 45 deletions
|
@ -88,6 +88,12 @@ public:
|
|||
StringView ascii_view() const&& = delete;
|
||||
Utf16View utf16_view() const&& = delete;
|
||||
|
||||
template<Arithmetic T>
|
||||
ALWAYS_INLINE Optional<T> to_number(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const
|
||||
{
|
||||
return utf16_view().to_number<T>(trim_whitespace);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Utf16StringBase& operator=(Utf16StringBase const& other)
|
||||
{
|
||||
if (&other != this) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue