mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:47:34 +00:00
AK: Run clang-format on StringUtils.{cpp,h}
This commit is contained in:
parent
cccbe43056
commit
0efa47b7ef
2 changed files with 95 additions and 95 deletions
|
@ -33,8 +33,8 @@ namespace AK {
|
|||
|
||||
namespace StringUtils {
|
||||
|
||||
bool matches(const StringView& str, const StringView& mask, CaseSensitivity case_sensitivity)
|
||||
{
|
||||
bool matches(const StringView& str, const StringView& mask, CaseSensitivity case_sensitivity)
|
||||
{
|
||||
if (str.is_null() || mask.is_null())
|
||||
return str.is_null() && mask.is_null();
|
||||
|
||||
|
@ -84,10 +84,10 @@ namespace StringUtils {
|
|||
|
||||
// If we 'ate' all of the mask and the string then we match.
|
||||
return (mask_ptr == mask_end) && string_ptr == string_end;
|
||||
}
|
||||
}
|
||||
|
||||
int convert_to_int(const StringView& str, bool& ok)
|
||||
{
|
||||
int convert_to_int(const StringView& str, bool& ok)
|
||||
{
|
||||
if (str.is_empty()) {
|
||||
ok = false;
|
||||
return 0;
|
||||
|
@ -118,10 +118,10 @@ namespace StringUtils {
|
|||
ok = true;
|
||||
|
||||
return negative ? -value : value;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned convert_to_uint(const StringView& str, bool& ok)
|
||||
{
|
||||
unsigned convert_to_uint(const StringView& str, bool& ok)
|
||||
{
|
||||
if (str.is_empty()) {
|
||||
ok = false;
|
||||
return 0;
|
||||
|
@ -141,7 +141,7 @@ namespace StringUtils {
|
|||
ok = true;
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -38,9 +38,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);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue