mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +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
1 changed files with 6 additions and 0 deletions
|
@ -119,6 +119,12 @@ public:
|
||||||
[[nodiscard]] Optional<float> to_float(TrimWhitespace = TrimWhitespace::Yes) const;
|
[[nodiscard]] Optional<float> to_float(TrimWhitespace = TrimWhitespace::Yes) const;
|
||||||
#endif
|
#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_lowercase() const;
|
||||||
[[nodiscard]] ByteString to_uppercase() const;
|
[[nodiscard]] ByteString to_uppercase() const;
|
||||||
[[nodiscard]] ByteString to_snakecase() const;
|
[[nodiscard]] ByteString to_snakecase() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue