mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature: - int StringType::to_int(bool& ok) const And replace it with sensible new signature: - Optional<int> StringType::to_int() const
This commit is contained in:
parent
15f4043a7a
commit
fdfda6dec2
55 changed files with 354 additions and 455 deletions
|
@ -39,9 +39,9 @@ enum class CaseSensitivity {
|
|||
namespace StringUtils {
|
||||
|
||||
bool matches(const StringView& str, const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive);
|
||||
int convert_to_int(const StringView&, bool& ok);
|
||||
unsigned convert_to_uint(const StringView&, bool& ok);
|
||||
unsigned convert_to_uint_from_hex(const StringView&, bool& ok);
|
||||
Optional<int> convert_to_int(const StringView&);
|
||||
Optional<unsigned> convert_to_uint(const StringView&);
|
||||
Optional<unsigned> convert_to_uint_from_hex(const StringView&);
|
||||
bool equals_ignoring_case(const StringView&, const StringView&);
|
||||
bool ends_with(const StringView& a, const StringView& b, CaseSensitivity);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue