mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
AK: Add to_{double, float} convenience functions to all string types
These are guarded with #ifndef KERNEL, since doubles (and floats) are not allowed in KERNEL mode. In StringUtils there is convert_to_floating_point which does have a template parameter incase you have a templated type.
This commit is contained in:
parent
2334cd85a2
commit
6fd8e96d53
8 changed files with 68 additions and 0 deletions
|
@ -63,6 +63,10 @@ template<typename T = unsigned>
|
|||
Optional<T> convert_to_uint_from_hex(StringView, TrimWhitespace = TrimWhitespace::Yes);
|
||||
template<typename T = unsigned>
|
||||
Optional<T> convert_to_uint_from_octal(StringView, TrimWhitespace = TrimWhitespace::Yes);
|
||||
#ifndef KERNEL
|
||||
template<typename T>
|
||||
Optional<T> convert_to_floating_point(StringView, TrimWhitespace = TrimWhitespace::Yes);
|
||||
#endif
|
||||
bool equals_ignoring_case(StringView, StringView);
|
||||
bool ends_with(StringView a, StringView b, CaseSensitivity);
|
||||
bool starts_with(StringView, StringView, CaseSensitivity);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue