mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add ByteString::to_number<T>
To mirror the API with StringView and String.
This commit is contained in:
parent
cdf84a3e36
commit
159eda5c6d
Notes:
sideshowbarker
2024-07-17 10:16:43 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/159eda5c6d Pull-request: https://github.com/SerenityOS/serenity/pull/22400
1 changed files with 6 additions and 0 deletions
|
@ -119,6 +119,12 @@ public:
|
|||
[[nodiscard]] Optional<float> to_float(TrimWhitespace = TrimWhitespace::Yes) const;
|
||||
#endif
|
||||
|
||||
template<Arithmetic T>
|
||||
Optional<T> to_number(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const
|
||||
{
|
||||
return view().to_number<T>(trim_whitespace);
|
||||
}
|
||||
|
||||
[[nodiscard]] ByteString to_lowercase() const;
|
||||
[[nodiscard]] ByteString to_uppercase() const;
|
||||
[[nodiscard]] ByteString to_snakecase() const;
|
||||
|
|
Loading…
Reference in a new issue