diff options
author | demostanis <demostanis@protonmail.com> | 2022-10-22 15:38:21 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-24 23:29:18 +0100 |
commit | 3e8b5ac92012e19847e536a20a3f0ec7e5c787d3 (patch) | |
tree | 58294f8f5e5eeaa63231876148da783ca81015eb /Meta/Lagom | |
parent | f485db2501c32bd626d58973c8a34a81e09ca5dc (diff) | |
download | serenity-3e8b5ac92012e19847e536a20a3f0ec7e5c787d3.zip |
AK+Everywhere: Turn bool keep_empty to an enum in split* functions
Diffstat (limited to 'Meta/Lagom')
6 files changed, 16 insertions, 16 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp b/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp index 40bf24360e..aab3df4ecd 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibEDID/GeneratePnpIDs.cpp @@ -91,7 +91,7 @@ static ErrorOr<String> decode_html_entities(StringView const& str) static ErrorOr<ApprovalDate> parse_approval_date(StringView const& str) { - auto parts = str.trim_whitespace().split_view('/', true); + auto parts = str.trim_whitespace().split_view('/', SplitBehavior::KeepEmpty); if (parts.size() != 3) return Error::from_string_literal("Failed to parse approval date parts (mm/dd/yyyy)"); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp index 46af3a493d..3ad8d769a3 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GeneratePluralRulesData.cpp @@ -258,7 +258,7 @@ static Relation parse_relation(StringView relation) parsed.symbol = lhs[0]; } - rhs.for_each_split_view(set_operator, false, [&](auto set) { + rhs.for_each_split_view(set_operator, SplitBehavior::Nothing, [&](auto set) { if (auto index = set.find(range_operator); index.has_value()) { auto range_begin = set.substring_view(0, *index).to_uint(); VERIFY(range_begin.has_value()); @@ -313,10 +313,10 @@ static void parse_condition(StringView category, StringView rule, Conditions& ru // and_condition = relation ('and' relation)* // // This affords some simplicity in that disjunctions are never embedded within a conjunction. - condition.for_each_split_view(disjunction_keyword, false, [&](auto disjunction) { + condition.for_each_split_view(disjunction_keyword, SplitBehavior::Nothing, [&](auto disjunction) { Vector<Relation> conjunctions; - disjunction.for_each_split_view(conjunction_keyword, false, [&](auto relation) { + disjunction.for_each_split_view(conjunction_keyword, SplitBehavior::Nothing, [&](auto relation) { conjunctions.append(parse_relation(relation)); }); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp index adac6c3387..0493c5e01e 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp @@ -400,7 +400,7 @@ static ErrorOr<void> parse_time_zone_coordinates(Core::Stream::BufferedFile& fil time_zone_data.time_zone_coordinates.set(zone, { latitude, longitude }); - regions.for_each_split_view(',', false, [&](auto region) { + regions.for_each_split_view(',', SplitBehavior::Nothing, [&](auto region) { auto index = time_zone_data.unique_strings.ensure(zone); time_zone_data.time_zone_regions.ensure(region).append(index); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp index 6a9d53974c..444fd5f475 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateEmojiData.cpp @@ -112,7 +112,7 @@ static ErrorOr<void> parse_emoji_serenity_data(Core::Stream::BufferedFile& file, emoji.group = Unicode::EmojiGroup::SerenityOS; emoji.display_order = display_order++; - line.for_each_split_view(' ', false, [&](auto segment) { + line.for_each_split_view(' ', SplitBehavior::Nothing, [&](auto segment) { if (segment.starts_with(code_point_header)) { segment = segment.substring_view(code_point_header.length()); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp index 46aadc960e..d58bbd974d 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp @@ -223,7 +223,7 @@ static ErrorOr<void> parse_special_casing(Core::Stream::BufferedFile& file, Unic if (auto index = line.find('#'); index.has_value()) line = line.substring_view(0, *index); - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); VERIFY(segments.size() == 5 || segments.size() == 6); SpecialCasing casing {}; @@ -233,7 +233,7 @@ static ErrorOr<void> parse_special_casing(Core::Stream::BufferedFile& file, Unic casing.uppercase_mapping = parse_code_point_list(segments[3]); if (auto condition = segments[4].trim_whitespace(); !condition.is_empty()) { - auto conditions = condition.split_view(' ', true); + auto conditions = condition.split_view(' ', SplitBehavior::KeepEmpty); VERIFY(conditions.size() == 1 || conditions.size() == 2); if (conditions.size() == 2) { @@ -294,7 +294,7 @@ static ErrorOr<void> parse_prop_list(Core::Stream::BufferedFile& file, PropList& if (auto index = line.find('#'); index.has_value()) line = line.substring_view(0, *index); - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); VERIFY(segments.size() == 2); auto code_point_range = parse_code_point_range(segments[0].trim_whitespace()); @@ -344,7 +344,7 @@ static ErrorOr<void> parse_alias_list(Core::Stream::BufferedFile& file, PropList if (current_property != "Binary Properties"sv) continue; - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); VERIFY((segments.size() == 2) || (segments.size() == 3)); auto alias = segments[0].trim_whitespace(); @@ -370,7 +370,7 @@ static ErrorOr<void> parse_name_aliases(Core::Stream::BufferedFile& file, Unicod if (line.is_empty() || line.starts_with('#')) continue; - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); VERIFY(segments.size() == 3); auto code_point = AK::StringUtils::convert_to_uint_from_hex<u32>(segments[0].trim_whitespace()); @@ -417,7 +417,7 @@ static ErrorOr<void> parse_value_alias_list(Core::Stream::BufferedFile& file, St if (auto index = line.find('#'); index.has_value()) line = line.substring_view(0, *index); - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); auto category = segments[0].trim_whitespace(); if (category != desired_category) @@ -450,7 +450,7 @@ static ErrorOr<void> parse_normalization_props(Core::Stream::BufferedFile& file, if (auto index = line.find('#'); index.has_value()) line = line.substring_view(0, *index); - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); VERIFY((segments.size() == 2) || (segments.size() == 3)); auto code_point_range = parse_code_point_range(segments[0].trim_whitespace()); @@ -579,7 +579,7 @@ static ErrorOr<void> parse_block_display_names(Core::Stream::BufferedFile& file, if (line.is_empty() || line.starts_with('#')) continue; - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); VERIFY(segments.size() == 2); auto code_point_range = parse_code_point_range(segments[0].trim_whitespace()); @@ -610,7 +610,7 @@ static ErrorOr<void> parse_unicode_data(Core::Stream::BufferedFile& file, Unicod if (line.is_empty()) continue; - auto segments = line.split_view(';', true); + auto segments = line.split_view(';', SplitBehavior::KeepEmpty); VERIFY(segments.size() == 15); CodePointData data {}; diff --git a/Meta/Lagom/Tools/ConfigureComponents/main.cpp b/Meta/Lagom/Tools/ConfigureComponents/main.cpp index be1464a10f..052d2d1ec1 100644 --- a/Meta/Lagom/Tools/ConfigureComponents/main.cpp +++ b/Meta/Lagom/Tools/ConfigureComponents/main.cpp @@ -195,7 +195,7 @@ static Result<Vector<String>, int> run_whiptail(WhiptailMode mode, Vector<Whipta auto file = Core::File::construct(); file->open(read_fd, Core::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescriptor::Yes); auto data = String::copy(file->read_all()); - return data.split('\n', false); + return data.split('\n'); } static bool run_system_command(String const& command, StringView command_name) |