1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

AK: Add a way to disable the trimming of whitespace in to_*int

This behavior might not always be desirable, and so this patch adds a
way to disable it.
This commit is contained in:
sin-ack 2021-06-18 16:21:27 +00:00 committed by Linus Groh
parent 8be7bdaac3
commit 3abcfcc178
6 changed files with 74 additions and 61 deletions

View file

@ -112,9 +112,9 @@ public:
[[nodiscard]] bool matches(const StringView& mask, Vector<MaskSpan>&, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
template<typename T = int>
[[nodiscard]] Optional<T> to_int() const;
[[nodiscard]] Optional<T> to_int(TrimWhitespace = TrimWhitespace::Yes) const;
template<typename T = unsigned>
[[nodiscard]] Optional<T> to_uint() const;
[[nodiscard]] Optional<T> to_uint(TrimWhitespace = TrimWhitespace::Yes) const;
[[nodiscard]] String to_lowercase() const;
[[nodiscard]] String to_uppercase() const;