diff options
Diffstat (limited to 'Userland')
103 files changed, 168 insertions, 168 deletions
diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp index 4fc39a5bdc..ddb99ccd4a 100644 --- a/Userland/Applications/Browser/CookieJar.cpp +++ b/Userland/Applications/Browser/CookieJar.cpp @@ -88,7 +88,7 @@ DeprecatedString CookieJar::get_cookie(const URL& url, Web::Cookie::Source sourc builder.appendff("{}={}", cookie.name, cookie.value); } - return builder.build(); + return builder.to_deprecated_string(); } void CookieJar::set_cookie(const URL& url, Web::Cookie::ParsedCookie const& parsed_cookie, Web::Cookie::Source source) @@ -150,7 +150,7 @@ void CookieJar::dump_cookies() builder.appendff("\t{}SameSite{} = {:s}\n", attribute_color, no_color, Web::Cookie::same_site_to_string(cookie.same_site)); }); - dbgln("{} cookies stored\n{}", total_cookies, builder.build()); + dbgln("{} cookies stored\n{}", total_cookies, builder.to_deprecated_string()); } Vector<Web::Cookie::Cookie> CookieJar::get_all_cookies() diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 64991c0a05..4ce7105f11 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -518,7 +518,7 @@ Optional<URL> Tab::url_from_location_bar(MayAppendTLD may_append_tld) builder.append(".com"sv); } } - DeprecatedString final_text = builder.to_deprecated_string(); + auto final_text = builder.to_deprecated_string(); auto url = url_from_user_input(final_text); return url; diff --git a/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp b/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp index 29e42d56a9..4c87103979 100644 --- a/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp @@ -90,6 +90,6 @@ void CharacterSearchWidget::search() StringBuilder builder; builder.append_code_point(code_point); - model.add_result({ code_point, builder.build(), move(display_name) }); + model.add_result({ code_point, builder.to_deprecated_string(), move(display_name) }); }); } diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index d0b9b5368a..f3c6a46b2a 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -100,7 +100,7 @@ static TitleAndText build_backtrace(Coredump::Reader const& coredump, ELF::Core: return { DeprecatedString::formatted("Thread #{} (TID {})", thread_index, thread_info.tid), - builder.build() + builder.to_deprecated_string() }; } @@ -125,7 +125,7 @@ static TitleAndText build_cpu_registers(const ELF::Core::ThreadInfo& thread_info return { DeprecatedString::formatted("Thread #{} (TID {})", thread_index, thread_info.tid), - builder.build() + builder.to_deprecated_string() }; } diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index 906098fb25..6f61c64588 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -144,7 +144,7 @@ void do_copy(Vector<DeprecatedString> const& selected_file_paths, FileOperation auto url = URL::create_with_file_scheme(path); copy_text.appendff("{}\n", url); } - GUI::Clipboard::the().set_data(copy_text.build().bytes(), "text/uri-list"); + GUI::Clipboard::the().set_data(copy_text.to_deprecated_string().bytes(), "text/uri-list"); } void do_paste(DeprecatedString const& target_directory, GUI::Window* window) @@ -213,7 +213,7 @@ void do_create_archive(Vector<DeprecatedString> const& selected_file_paths, GUI: if (!archive_name.ends_with(".zip"sv)) path_builder.append(".zip"sv); } - auto output_path = path_builder.build(); + auto output_path = path_builder.to_deprecated_string(); pid_t zip_pid = fork(); if (zip_pid < 0) { diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index 44f9262e3c..6d4ad1591f 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -146,7 +146,7 @@ static DeprecatedString get_absolute_path_to_selected_node(SpaceAnalyzer::TreeMa TreeNode const* node = treemapwidget.path_node(k); path_builder.append(node->name()); } - return path_builder.build(); + return path_builder.to_deprecated_string(); } ErrorOr<int> serenity_main(Main::Arguments arguments) diff --git a/Userland/Applications/Spreadsheet/Cell.cpp b/Userland/Applications/Spreadsheet/Cell.cpp index 9b534328ba..d56b48e454 100644 --- a/Userland/Applications/Spreadsheet/Cell.cpp +++ b/Userland/Applications/Spreadsheet/Cell.cpp @@ -42,7 +42,7 @@ void Cell::set_data(JS::Value new_data) StringBuilder builder; builder.append(new_data.to_string_without_side_effects()); - m_data = builder.build(); + m_data = builder.to_deprecated_string(); m_evaluated_data = move(new_data); } diff --git a/Userland/Applications/Spreadsheet/CellType/Format.cpp b/Userland/Applications/Spreadsheet/CellType/Format.cpp index 77b8f32eda..663aa2173d 100644 --- a/Userland/Applications/Spreadsheet/CellType/Format.cpp +++ b/Userland/Applications/Spreadsheet/CellType/Format.cpp @@ -43,7 +43,7 @@ DeprecatedString format_double(char const* format, double value) auto putch = [&](auto, auto ch) { builder.append(ch); }; printf_internal<decltype(putch), PrintfImpl, double, SingleEntryListNext>(putch, nullptr, format, value); - return builder.build(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp index 4c7d27e8dd..3893e3988e 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp @@ -745,7 +745,7 @@ DeprecatedString Sheet::generate_inline_documentation_for(StringView function, s } builder.append(')'); - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString Position::to_cell_identifier(Sheet const& sheet) const diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index c56edd7790..c4c15a402d 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -737,7 +737,7 @@ void Editor::handle_function_parameters_hint_request() } html.append("<style>body { background-color: #dac7b5; }</style>"sv); - s_tooltip_page_view->load_html(html.build(), {}); + s_tooltip_page_view->load_html(html.to_deprecated_string(), {}); auto cursor_rect = current_editor().cursor_content_rect().location().translated(screen_relative_rect().location()); diff --git a/Userland/DevTools/Profiler/DisassemblyModel.cpp b/Userland/DevTools/Profiler/DisassemblyModel.cpp index 447fb4f125..ee085cfc63 100644 --- a/Userland/DevTools/Profiler/DisassemblyModel.cpp +++ b/Userland/DevTools/Profiler/DisassemblyModel.cpp @@ -222,7 +222,7 @@ GUI::Variant DisassemblyModel::data(GUI::ModelIndex const& index, GUI::ModelRole auto const& entry = insn.source_position_with_inlines.source_position.value(); builder.appendff("{}:{}", entry.file_path, entry.line_number); } - return builder.build(); + return builder.to_deprecated_string(); } return {}; diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index ab61f29436..15d18cc8b2 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -381,7 +381,7 @@ static RefPtr<Gfx::Bitmap> get_piece(StringView set, StringView image) builder.append(set); builder.append('/'); builder.append(image); - return Gfx::Bitmap::load_from_file(builder.build()).release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::load_from_file(builder.to_deprecated_string()).release_value_but_fixme_should_propagate_errors(); } void ChessWidget::set_piece_set(StringView set) diff --git a/Userland/Libraries/LibC/semaphore.cpp b/Userland/Libraries/LibC/semaphore.cpp index 12d39eb4ee..10a302c638 100644 --- a/Userland/Libraries/LibC/semaphore.cpp +++ b/Userland/Libraries/LibC/semaphore.cpp @@ -48,7 +48,7 @@ static ErrorOr<DeprecatedString> sem_name_to_path(char const* name) StringBuilder builder; TRY(builder.try_append(sem_path_prefix)); TRY(builder.try_append(name_view)); - return builder.build(); + return builder.to_deprecated_string(); } struct NamedSemaphore { diff --git a/Userland/Libraries/LibC/stdlib.cpp b/Userland/Libraries/LibC/stdlib.cpp index 9d1ef30d47..a8d2b16bb7 100644 --- a/Userland/Libraries/LibC/stdlib.cpp +++ b/Userland/Libraries/LibC/stdlib.cpp @@ -641,7 +641,7 @@ int ptsname_r(int fd, char* buffer, size_t size) return -1; } memset(buffer, 0, devpts_path_builder.length() + 1); - auto full_devpts_path_string = devpts_path_builder.build(); + auto full_devpts_path_string = devpts_path_builder.to_deprecated_string(); if (!full_devpts_path_string.copy_characters_to_buffer(buffer, size)) { errno = ERANGE; return -1; diff --git a/Userland/Libraries/LibC/syslog.cpp b/Userland/Libraries/LibC/syslog.cpp index d509cd863c..5866b59ca7 100644 --- a/Userland/Libraries/LibC/syslog.cpp +++ b/Userland/Libraries/LibC/syslog.cpp @@ -124,7 +124,7 @@ void vsyslog_r(int priority, struct syslog_data* data, char const* message, va_l combined.appendff("{}: ", get_syslog_ident(data)); combined.appendvf(message, args); - DeprecatedString combined_string = combined.build(); + auto combined_string = combined.to_deprecated_string(); if (data->logopt & LOG_CONS) dbgputstr(combined_string.characters(), combined_string.length()); diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp index a83b440ffb..081dff5967 100644 --- a/Userland/Libraries/LibC/time.cpp +++ b/Userland/Libraries/LibC/time.cpp @@ -390,7 +390,7 @@ size_t strftime(char* destination, size_t max_size, char const* format, const st return 0; } - auto str = builder.build(); + auto str = builder.to_deprecated_string(); bool fits = str.copy_characters_to_buffer(destination, max_size); return fits ? str.length() : 0; } diff --git a/Userland/Libraries/LibCards/CardStack.h b/Userland/Libraries/LibCards/CardStack.h index 8645a031cc..1cdcf23e44 100644 --- a/Userland/Libraries/LibCards/CardStack.h +++ b/Userland/Libraries/LibCards/CardStack.h @@ -137,6 +137,6 @@ struct AK::Formatter<Cards::CardStack> : Formatter<FormatString> { first_card = false; } - return Formatter<FormatString>::format(builder, "{:<10} {:>16}: {}"sv, type, stack.bounding_box(), cards.build()); + return Formatter<FormatString>::format(builder, "{:<10} {:>16}: {}"sv, type, stack.bounding_box(), cards.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp index 53aeee2501..b036dabc07 100644 --- a/Userland/Libraries/LibChess/Chess.cpp +++ b/Userland/Libraries/LibChess/Chess.cpp @@ -82,7 +82,7 @@ DeprecatedString Square::to_algebraic() const StringBuilder builder; builder.append(file + 'a'); builder.append(rank + '1'); - return builder.build(); + return builder.to_deprecated_string(); } Move::Move(StringView long_algebraic) @@ -98,7 +98,7 @@ DeprecatedString Move::to_long_algebraic() const builder.append(from.to_algebraic()); builder.append(to.to_algebraic()); builder.append(char_for_piece(promote_to).to_lowercase()); - return builder.build(); + return builder.to_deprecated_string(); } Move Move::from_algebraic(StringView algebraic, const Color turn, Board const& board) @@ -216,7 +216,7 @@ DeprecatedString Move::to_algebraic() const else if (is_check) builder.append('+'); - return builder.build(); + return builder.to_deprecated_string(); } Board::Board() diff --git a/Userland/Libraries/LibChess/UCICommand.cpp b/Userland/Libraries/LibChess/UCICommand.cpp index 3553ca3b69..a53d7367d8 100644 --- a/Userland/Libraries/LibChess/UCICommand.cpp +++ b/Userland/Libraries/LibChess/UCICommand.cpp @@ -105,7 +105,7 @@ DeprecatedString SetOptionCommand::to_deprecated_string() const builder.append(value().value()); } builder.append('\n'); - return builder.build(); + return builder.to_deprecated_string(); } PositionCommand PositionCommand::from_string(StringView command) @@ -141,7 +141,7 @@ DeprecatedString PositionCommand::to_deprecated_string() const builder.append(move.to_long_algebraic()); } builder.append('\n'); - return builder.build(); + return builder.to_deprecated_string(); } GoCommand GoCommand::from_string(StringView command) @@ -227,7 +227,7 @@ DeprecatedString GoCommand::to_deprecated_string() const builder.append(" infinite"sv); builder.append('\n'); - return builder.build(); + return builder.to_deprecated_string(); } StopCommand StopCommand::from_string(StringView command) @@ -256,9 +256,9 @@ IdCommand IdCommand::from_string(StringView command) } if (tokens[1] == "name") { - return IdCommand(Type::Name, value.build()); + return IdCommand(Type::Name, value.to_deprecated_string()); } else if (tokens[1] == "author") { - return IdCommand(Type::Author, value.build()); + return IdCommand(Type::Author, value.to_deprecated_string()); } VERIFY_NOT_REACHED(); } @@ -274,7 +274,7 @@ DeprecatedString IdCommand::to_deprecated_string() const } builder.append(value()); builder.append('\n'); - return builder.build(); + return builder.to_deprecated_string(); } UCIOkCommand UCIOkCommand::from_string(StringView command) @@ -317,7 +317,7 @@ DeprecatedString BestMoveCommand::to_deprecated_string() const builder.append("bestmove "sv); builder.append(move().to_long_algebraic()); builder.append('\n'); - return builder.build(); + return builder.to_deprecated_string(); } InfoCommand InfoCommand::from_string([[maybe_unused]] StringView command) diff --git a/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp b/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp index 51cc01b29e..26230ad3b9 100644 --- a/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp +++ b/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp @@ -81,7 +81,7 @@ Vector<DeprecatedString> const& ShellComprehensionEngine::DocumentData::sourced_ auto name_list = const_cast<::Shell::AST::Node*>(filename.ptr())->run(nullptr)->resolve_as_list(nullptr); StringBuilder builder; builder.join(' ', name_list); - sourced_files.set(builder.build()); + sourced_files.set(builder.to_deprecated_string()); } } } diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index 7f2aaf6324..7c24d07b5c 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -39,7 +39,7 @@ static DeprecatedString get_salt() auto salt_string = MUST(encode_base64({ random_data, sizeof(random_data) })); builder.append(salt_string); - return builder.build(); + return builder.to_deprecated_string(); } static Vector<gid_t> get_extra_gids(passwd const& pwd) @@ -196,7 +196,7 @@ void Account::set_password_enabled(bool enabled) StringBuilder builder; builder.append('!'); builder.append(m_password_hash); - m_password_hash = builder.build(); + m_password_hash = builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp index 0c18654dae..76456c0d34 100644 --- a/Userland/Libraries/LibCore/ArgsParser.cpp +++ b/Userland/Libraries/LibCore/ArgsParser.cpp @@ -77,7 +77,7 @@ bool ArgsParser::parse(int argc, char* const* argv, FailureBehavior failure_beha } long_options.append({ 0, 0, 0, 0 }); - DeprecatedString short_options = short_options_builder.build(); + auto short_options = short_options_builder.to_deprecated_string(); while (true) { int c = getopt_long(argc, argv, short_options.characters(), long_options.data(), nullptr); diff --git a/Userland/Libraries/LibCore/DateTime.cpp b/Userland/Libraries/LibCore/DateTime.cpp index 09e36addf2..add6fca290 100644 --- a/Userland/Libraries/LibCore/DateTime.cpp +++ b/Userland/Libraries/LibCore/DateTime.cpp @@ -273,7 +273,7 @@ DeprecatedString DateTime::to_deprecated_string(StringView format) const } } - return builder.build(); + return builder.to_deprecated_string(); } Optional<DateTime> DateTime::parse(StringView format, DeprecatedString const& string) diff --git a/Userland/Libraries/LibCore/File.cpp b/Userland/Libraries/LibCore/File.cpp index fb235eb3db..5cf699c625 100644 --- a/Userland/Libraries/LibCore/File.cpp +++ b/Userland/Libraries/LibCore/File.cpp @@ -394,7 +394,7 @@ static DeprecatedString get_duplicate_name(DeprecatedString const& path, int dup if (!lexical_path.extension().is_empty()) { duplicated_name.appendff(".{}", lexical_path.extension()); } - return duplicated_name.build(); + return duplicated_name.to_deprecated_string(); } ErrorOr<void, File::CopyError> File::copy_file_or_directory(DeprecatedString const& dst_path, DeprecatedString const& src_path, RecursionMode recursion_mode, LinkMode link_mode, AddDuplicateFileMarker add_duplicate_file_marker, PreserveMode preserve_mode) diff --git a/Userland/Libraries/LibCoredump/Backtrace.cpp b/Userland/Libraries/LibCoredump/Backtrace.cpp index 0ec7527365..54fdfbd221 100644 --- a/Userland/Libraries/LibCoredump/Backtrace.cpp +++ b/Userland/Libraries/LibCoredump/Backtrace.cpp @@ -131,7 +131,7 @@ DeprecatedString Backtrace::Entry::to_deprecated_string(bool color) const builder.appendff("{:p}: ", eip); if (object_name.is_empty()) { builder.append("???"sv); - return builder.build(); + return builder.to_deprecated_string(); } builder.appendff("[{}] {}", object_name, function_name.is_empty() ? "???" : function_name); builder.append(" ("sv); @@ -158,7 +158,7 @@ DeprecatedString Backtrace::Entry::to_deprecated_string(bool color) const builder.append(')'); - return builder.build(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp b/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp index 27a7e47ee0..00c46c8307 100644 --- a/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp +++ b/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp @@ -32,8 +32,8 @@ void SemanticSyntaxHighlighter::rehighlight(Palette const& palette) for (Cpp::Token const& token : m_saved_tokens) previous_tokens_as_lines.appendff("{}\n", token.type_as_deprecated_string()); - auto previous = previous_tokens_as_lines.build(); - auto current = current_tokens_as_lines.build(); + auto previous = previous_tokens_as_lines.to_deprecated_string(); + auto current = current_tokens_as_lines.to_deprecated_string(); // FIXME: Computing the diff on the entire document's tokens is quite inefficient. // An improvement over this could be only including the tokens that are in edited text ranges in the diff. diff --git a/Userland/Libraries/LibCrypto/Authentication/HMAC.h b/Userland/Libraries/LibCrypto/Authentication/HMAC.h index f0f764d26e..3685c908e5 100644 --- a/Userland/Libraries/LibCrypto/Authentication/HMAC.h +++ b/Userland/Libraries/LibCrypto/Authentication/HMAC.h @@ -79,7 +79,7 @@ public: StringBuilder builder; builder.append("HMAC-"sv); builder.append(m_inner_hasher.class_name()); - return builder.build(); + return builder.to_deprecated_string(); } #endif diff --git a/Userland/Libraries/LibCrypto/Cipher/AES.cpp b/Userland/Libraries/LibCrypto/Cipher/AES.cpp index 084ca4f659..9f1ca0f2d2 100644 --- a/Userland/Libraries/LibCrypto/Cipher/AES.cpp +++ b/Userland/Libraries/LibCrypto/Cipher/AES.cpp @@ -30,7 +30,7 @@ DeprecatedString AESCipherBlock::to_deprecated_string() const StringBuilder builder; for (auto value : m_data) builder.appendff("{:02x}", value); - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString AESCipherKey::to_deprecated_string() const @@ -38,7 +38,7 @@ DeprecatedString AESCipherKey::to_deprecated_string() const StringBuilder builder; for (size_t i = 0; i < (rounds() + 1) * 4; ++i) builder.appendff("{:02x}", m_rd_keys[i]); - return builder.build(); + return builder.to_deprecated_string(); } #endif diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h b/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h index 0649e64b8a..405a4ffba6 100644 --- a/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h +++ b/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h @@ -35,7 +35,7 @@ public: StringBuilder builder; builder.append(this->cipher().class_name()); builder.append("_CBC"sv); - return builder.build(); + return builder.to_deprecated_string(); } #endif diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h b/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h index 982ff0d697..a17bb3514c 100644 --- a/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h +++ b/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h @@ -110,7 +110,7 @@ public: StringBuilder builder; builder.append(this->cipher().class_name()); builder.append("_CTR"sv); - return builder.build(); + return builder.to_deprecated_string(); } #endif diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h b/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h index efbdfe0e5c..cb738056ad 100644 --- a/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h +++ b/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h @@ -50,7 +50,7 @@ public: StringBuilder builder; builder.append(this->cipher().class_name()); builder.append("_GCM"sv); - return builder.build(); + return builder.to_deprecated_string(); } #endif diff --git a/Userland/Libraries/LibEDID/EDID.cpp b/Userland/Libraries/LibEDID/EDID.cpp index d50d896426..566f828915 100644 --- a/Userland/Libraries/LibEDID/EDID.cpp +++ b/Userland/Libraries/LibEDID/EDID.cpp @@ -1010,7 +1010,7 @@ DeprecatedString Parser::display_product_name() const break; str.append((char)byte); } - product_name = str.build(); + product_name = str.to_deprecated_string(); return IterationDecision::Break; }); if (result.is_error()) { @@ -1033,7 +1033,7 @@ DeprecatedString Parser::display_product_serial_number() const break; str.append((char)byte); } - product_name = str.build(); + product_name = str.to_deprecated_string(); return IterationDecision::Break; }); if (result.is_error()) { diff --git a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp index a94fcf32d8..ea5e74be1d 100644 --- a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp @@ -118,7 +118,7 @@ void AutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehe fuzzy_str_builder.append(character); fuzzy_str_builder.append('*'); } - return fuzzy_str_builder.build(); + return fuzzy_str_builder.to_deprecated_string(); }; Vector<CodeComprehension::AutocompleteResultEntry> class_entries, identifier_entries; diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp index 75df12e256..68a4e6bc62 100644 --- a/Userland/Libraries/LibGUI/TextDocument.cpp +++ b/Userland/Libraries/LibGUI/TextDocument.cpp @@ -854,7 +854,7 @@ void InsertTextCommand::perform_formatting(TextDocument::Client const& client) ++column; } } - m_text = builder.build(); + m_text = builder.to_deprecated_string(); } void InsertTextCommand::redo() diff --git a/Userland/Libraries/LibGemini/Document.cpp b/Userland/Libraries/LibGemini/Document.cpp index 8c162ede1a..41794cf7d3 100644 --- a/Userland/Libraries/LibGemini/Document.cpp +++ b/Userland/Libraries/LibGemini/Document.cpp @@ -25,7 +25,7 @@ DeprecatedString Document::render_to_html() const } html_builder.append("</body>"sv); html_builder.append("</html>"sv); - return html_builder.build(); + return html_builder.to_deprecated_string(); } NonnullRefPtr<Document> Document::parse(StringView lines, const URL& url) diff --git a/Userland/Libraries/LibGemini/Line.cpp b/Userland/Libraries/LibGemini/Line.cpp index 8db3ef4156..96ddbb51f1 100644 --- a/Userland/Libraries/LibGemini/Line.cpp +++ b/Userland/Libraries/LibGemini/Line.cpp @@ -14,7 +14,7 @@ DeprecatedString Text::render_to_html() const StringBuilder builder; builder.append(escape_html_entities(m_text)); builder.append("<br>\n"sv); - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString Heading::render_to_html() const @@ -31,7 +31,7 @@ DeprecatedString UnorderedList::render_to_html() const builder.append("<li>"sv); builder.append(escape_html_entities(m_text.substring_view(1, m_text.length() - 1))); builder.append("</li>"sv); - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString Control::render_to_html() const @@ -81,7 +81,7 @@ DeprecatedString Link::render_to_html() const builder.append("\">"sv); builder.append(escape_html_entities(m_name)); builder.append("</a><br>\n"sv); - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString Preformatted::render_to_html() const @@ -90,7 +90,7 @@ DeprecatedString Preformatted::render_to_html() const builder.append(escape_html_entities(m_text)); builder.append('\n'); - return builder.build(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp index 920d9ccf2b..37f5a96953 100644 --- a/Userland/Libraries/LibHTTP/Job.cpp +++ b/Userland/Libraries/LibHTTP/Job.cpp @@ -371,7 +371,7 @@ void Job::on_socket_connected() builder.append(existing_value.value()); builder.append(','); builder.append(value); - m_headers.set(name, builder.build()); + m_headers.set(name, builder.to_deprecated_string()); } else { m_headers.set(name, value); } diff --git a/Userland/Libraries/LibIDL/IDLParser.cpp b/Userland/Libraries/LibIDL/IDLParser.cpp index dba2a2d870..3fac6549e7 100644 --- a/Userland/Libraries/LibIDL/IDLParser.cpp +++ b/Userland/Libraries/LibIDL/IDLParser.cpp @@ -73,7 +73,7 @@ static DeprecatedString convert_enumeration_value_to_cpp_enum_member(DeprecatedS builder.append('_'); names_already_seen.set(builder.string_view()); - return builder.build(); + return builder.to_deprecated_string(); } namespace IDL { diff --git a/Userland/Libraries/LibIMAP/Client.cpp b/Userland/Libraries/LibIMAP/Client.cpp index 56b4dc822b..f57696564c 100644 --- a/Userland/Libraries/LibIMAP/Client.cpp +++ b/Userland/Libraries/LibIMAP/Client.cpp @@ -306,7 +306,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::store(StoreMethod method, Seque flags_builder.join(' ', flags); flags_builder.append(')'); - auto command = Command { uid ? CommandType::UIDStore : CommandType::Store, m_current_command, { sequence_set.serialize(), data_item_name.build(), flags_builder.build() } }; + auto command = Command { uid ? CommandType::UIDStore : CommandType::Store, m_current_command, { sequence_set.serialize(), data_item_name.to_deprecated_string(), flags_builder.to_deprecated_string() } }; return cast_promise<SolidResponse>(send_command(move(command))); } RefPtr<Promise<Optional<SolidResponse>>> Client::search(Optional<DeprecatedString> charset, Vector<SearchKey>&& keys, bool uid) @@ -363,7 +363,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::status(StringView mailbox, Vect types_list.append('('); types_list.join(' ', args); types_list.append(')'); - auto command = Command { CommandType::Status, m_current_command, { mailbox, types_list.build() } }; + auto command = Command { CommandType::Status, m_current_command, { mailbox, types_list.to_deprecated_string() } }; return cast_promise<SolidResponse>(send_command(move(command))); } @@ -375,7 +375,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::append(StringView mailbox, Mess flags_sb.append('('); flags_sb.join(' ', flags.value()); flags_sb.append(')'); - args.append(flags_sb.build()); + args.append(flags_sb.to_deprecated_string()); } if (date_time.has_value()) args.append(date_time.value().to_deprecated_string("\"%d-%b-%Y %H:%M:%S +0000\""sv)); diff --git a/Userland/Libraries/LibIMAP/Objects.cpp b/Userland/Libraries/LibIMAP/Objects.cpp index ed5dc56578..e3c16821e6 100644 --- a/Userland/Libraries/LibIMAP/Objects.cpp +++ b/Userland/Libraries/LibIMAP/Objects.cpp @@ -41,7 +41,7 @@ DeprecatedString FetchCommand::DataItem::Section::serialize() const first = false; } headers_builder.append(')'); - return headers_builder.build(); + return headers_builder.to_deprecated_string(); } case SectionType::Text: return "TEXT"; @@ -57,7 +57,7 @@ DeprecatedString FetchCommand::DataItem::Section::serialize() const if (ends_with_mime) { sb.append(".MIME"sv); } - return sb.build(); + return sb.to_deprecated_string(); } } VERIFY_NOT_REACHED(); @@ -82,7 +82,7 @@ DeprecatedString FetchCommand::DataItem::serialize() const sb.appendff("<{}.{}>", start, octets); } - return sb.build(); + return sb.to_deprecated_string(); } case DataItemType::BodyStructure: return "BODYSTRUCTURE"; @@ -111,7 +111,7 @@ DeprecatedString FetchCommand::serialize() first = false; } - return AK::DeprecatedString::formatted("{} ({})", sequence_builder.build(), data_items_builder.build()); + return AK::DeprecatedString::formatted("{} ({})", sequence_builder.to_deprecated_string(), data_items_builder.to_deprecated_string()); } DeprecatedString serialize_astring(StringView string) { @@ -164,7 +164,7 @@ DeprecatedString SearchKey::serialize() const sb.append(item->serialize()); first = false; } - return sb.build(); + return sb.to_deprecated_string(); }, [&](Seen const&) { return DeprecatedString("SEEN"); }, [&](SentBefore const& x) { return DeprecatedString::formatted("SENTBEFORE {}", x.date.to_deprecated_string("%d-%b-%Y"sv)); }, diff --git a/Userland/Libraries/LibIMAP/Parser.cpp b/Userland/Libraries/LibIMAP/Parser.cpp index 489ab0e233..d41e3c53d1 100644 --- a/Userland/Libraries/LibIMAP/Parser.cpp +++ b/Userland/Libraries/LibIMAP/Parser.cpp @@ -83,7 +83,7 @@ void Parser::parse_response_done() } consume("\r\n"sv); - m_response.m_response_text = response_data.build(); + m_response.m_response_text = response_data.to_deprecated_string(); } void Parser::consume(StringView x) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 370b675bcf..941e76b043 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -3762,7 +3762,7 @@ Completion TemplateLiteral::execute(Interpreter& interpreter) const } // 7. Return the string-concatenation of head, middle, and tail. - return Value { PrimitiveString::create(vm, string_builder.build()) }; + return Value { PrimitiveString::create(vm, string_builder.to_deprecated_string()) }; } void TaggedTemplateLiteral::dump(int indent) const diff --git a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp index 0b25b313f6..fd3a19531c 100644 --- a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp @@ -142,7 +142,7 @@ void MergeBlocks::perform(PassPipelineExecutable& executable) builder.append(entry->name()); } - auto new_block = BasicBlock::create(builder.build(), size); + auto new_block = BasicBlock::create(builder.to_deprecated_string(), size); auto& block = *new_block; auto first_successor_position = replace_blocks(successors, *new_block); VERIFY(first_successor_position.has_value()); diff --git a/Userland/Libraries/LibJS/ParserError.cpp b/Userland/Libraries/LibJS/ParserError.cpp index ae12e82d56..c790ca5d44 100644 --- a/Userland/Libraries/LibJS/ParserError.cpp +++ b/Userland/Libraries/LibJS/ParserError.cpp @@ -32,7 +32,7 @@ DeprecatedString ParserError::source_location_hint(StringView source, char const for (size_t i = 0; i < position.value().column - 1; ++i) builder.append(spacer); builder.append(indicator); - return builder.build(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibJS/Runtime/Date.cpp b/Userland/Libraries/LibJS/Runtime/Date.cpp index 2f38a3aaaa..7a77a8f499 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.cpp +++ b/Userland/Libraries/LibJS/Runtime/Date.cpp @@ -57,7 +57,7 @@ DeprecatedString Date::iso_date_string() const builder.appendff("{:03}", ms_from_time(m_date_value)); builder.append('Z'); - return builder.build(); + return builder.to_deprecated_string(); } // DayWithinYear(t), https://tc39.es/ecma262/#eqn-DayWithinYear diff --git a/Userland/Libraries/LibJS/Runtime/Error.cpp b/Userland/Libraries/LibJS/Runtime/Error.cpp index ffde022808..69551c1130 100644 --- a/Userland/Libraries/LibJS/Runtime/Error.cpp +++ b/Userland/Libraries/LibJS/Runtime/Error.cpp @@ -95,7 +95,7 @@ DeprecatedString Error::stack_string() const } } - return stack_string_builder.build(); + return stack_string_builder.to_deprecated_string(); } #define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index 42b47836f7..d9bc029d2f 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -413,7 +413,7 @@ static ThrowCompletionOr<DeprecatedString> encode(VM& vm, DeprecatedString const VERIFY(nwritten > 0); } } - return encoded_builder.build(); + return encoded_builder.to_deprecated_string(); } // 19.2.6.1.2 Decode ( string, reservedSet ), https://tc39.es/ecma262/#sec-decode @@ -471,7 +471,7 @@ static ThrowCompletionOr<DeprecatedString> decode(VM& vm, DeprecatedString const } if (expected_continuation_bytes > 0) return vm.throw_completion<URIError>(ErrorType::URIMalformed); - return decoded_builder.build(); + return decoded_builder.to_deprecated_string(); } // 19.2.6.4 encodeURI ( uri ), https://tc39.es/ecma262/#sec-encodeuri-uri @@ -521,7 +521,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::escape) } escaped.appendff("%u{:04X}", code_point); } - return PrimitiveString::create(vm, escaped.build()); + return PrimitiveString::create(vm, escaped.to_deprecated_string()); } // B.2.1.2 unescape ( string ), https://tc39.es/ecma262/#sec-unescape-string @@ -543,7 +543,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::unescape) } unescaped.append_code_point(code_point); } - return PrimitiveString::create(vm, unescaped.build()); + return PrimitiveString::create(vm, unescaped.to_deprecated_string()); } } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp index a8600a8f5b..d9d47c11fd 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp @@ -55,7 +55,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationFormatPrototype::format) } // 7. Return result. - return PrimitiveString::create(vm, result.build()); + return PrimitiveString::create(vm, result.to_deprecated_string()); } // 1.4.4 Intl.DurationFormat.prototype.formatToParts ( duration ), https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat.prototype.formatToParts diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp index 95f772606e..49e65b20e3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp @@ -237,7 +237,7 @@ ThrowCompletionOr<DeprecatedString> format_relative_time(VM& vm, RelativeTimeFor } // 4. Return result. - return result.build(); + return result.to_deprecated_string(); } // 17.5.5 FormatRelativeTimeToParts ( relativeTimeFormat, value, unit ), https://tc39.es/ecma402/#sec-FormatRelativeTimeToParts diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index d612c0e48e..8a407c9d6a 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -116,7 +116,7 @@ ErrorOr<DeprecatedString, ParseRegexPatternError> parse_regex_pattern(StringView builder.append_code_point(code_unit); } - return builder.build(); + return builder.to_deprecated_string(); } ThrowCompletionOr<DeprecatedString> parse_regex_pattern(VM& vm, StringView pattern, bool unicode, bool unicode_sets) diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 2aa8ea588a..b52cfe7019 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -820,13 +820,13 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace) // 15. If nextSourcePosition ≥ lengthS, return accumulatedResult. if (next_source_position >= string.length_in_code_units()) - return PrimitiveString::create(vm, accumulated_result.build()); + return PrimitiveString::create(vm, accumulated_result.to_deprecated_string()); // 16. Return the string-concatenation of accumulatedResult and the substring of S from nextSourcePosition. auto substring = string.substring_view(next_source_position); accumulated_result.append(substring); - return PrimitiveString::create(vm, accumulated_result.build()); + return PrimitiveString::create(vm, accumulated_result.to_deprecated_string()); } // 22.2.5.12 RegExp.prototype [ @@search ] ( string ), https://tc39.es/ecma262/#sec-regexp.prototype-@@search diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index a2eb479bc9..13d5bd9f73 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -94,7 +94,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw) builder.append(next_sub); } } - return PrimitiveString::create(vm, builder.build()); + return PrimitiveString::create(vm, builder.to_deprecated_string()); } // 22.1.2.1 String.fromCharCode ( ...codeUnits ), https://tc39.es/ecma262/#sec-string.fromcharcode diff --git a/Userland/Libraries/LibJS/Token.cpp b/Userland/Libraries/LibJS/Token.cpp index 74b22461da..c438ee5428 100644 --- a/Userland/Libraries/LibJS/Token.cpp +++ b/Userland/Libraries/LibJS/Token.cpp @@ -63,7 +63,7 @@ double Token::double_value() const builder.append(ch); } - DeprecatedString value_string = builder.to_deprecated_string(); + auto value_string = builder.to_deprecated_string(); if (value_string[0] == '0' && value_string.length() >= 2) { if (value_string[1] == 'x' || value_string[1] == 'X') { // hexadecimal diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index c108f170de..4ee1726c6c 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -372,7 +372,7 @@ void Editor::insert(const u32 cp) { StringBuilder builder; builder.append(Utf32View(&cp, 1)); - auto str = builder.build(); + auto str = builder.to_deprecated_string(); if (m_pending_chars.try_append(str.characters(), str.length()).is_error()) return; @@ -1750,7 +1750,7 @@ DeprecatedString Style::to_deprecated_string() const builder.append('}'); - return builder.build(); + return builder.to_deprecated_string(); } ErrorOr<void> VT::apply_style(Style const& style, Core::Stream::Stream& stream, bool is_starting) @@ -2182,7 +2182,7 @@ DeprecatedString Editor::line(size_t up_to_index) const { StringBuilder builder; builder.append(Utf32View { m_buffer.data(), min(m_buffer.size(), up_to_index) }); - return builder.build(); + return builder.to_deprecated_string(); } void Editor::remove_at_index(size_t index) diff --git a/Userland/Libraries/LibLine/InternalFunctions.cpp b/Userland/Libraries/LibLine/InternalFunctions.cpp index f562542843..32e520baf5 100644 --- a/Userland/Libraries/LibLine/InternalFunctions.cpp +++ b/Userland/Libraries/LibLine/InternalFunctions.cpp @@ -36,7 +36,7 @@ void Editor::search_forwards() ScopedValueRollback inline_search_cursor_rollback { m_inline_search_cursor }; StringBuilder builder; builder.append(Utf32View { m_buffer.data(), m_inline_search_cursor }); - DeprecatedString search_phrase = builder.to_deprecated_string(); + auto search_phrase = builder.to_deprecated_string(); if (m_search_offset_state == SearchOffsetState::Backwards) --m_search_offset; if (m_search_offset > 0) { @@ -63,7 +63,7 @@ void Editor::search_backwards() ScopedValueRollback inline_search_cursor_rollback { m_inline_search_cursor }; StringBuilder builder; builder.append(Utf32View { m_buffer.data(), m_inline_search_cursor }); - DeprecatedString search_phrase = builder.to_deprecated_string(); + auto search_phrase = builder.to_deprecated_string(); if (m_search_offset_state == SearchOffsetState::Forwards) ++m_search_offset; if (search(search_phrase, true)) { @@ -237,7 +237,7 @@ void Editor::enter_search() StringBuilder builder; builder.append(Utf32View { search_editor.buffer().data(), search_editor.buffer().size() }); - if (!search(builder.build(), false, false)) { + if (!search(builder.to_deprecated_string(), false, false)) { m_chars_touched_in_the_middle = m_buffer.size(); m_refresh_needed = true; m_buffer.clear(); diff --git a/Userland/Libraries/LibLocale/DateTimeFormat.cpp b/Userland/Libraries/LibLocale/DateTimeFormat.cpp index c0310140f1..3e0739b5be 100644 --- a/Userland/Libraries/LibLocale/DateTimeFormat.cpp +++ b/Userland/Libraries/LibLocale/DateTimeFormat.cpp @@ -290,7 +290,7 @@ static ErrorOr<Optional<String>> format_time_zone_offset(StringView locale, Cale } // The digits used for hours, minutes and seconds fields in this format are the locale's default decimal digits. - auto result = TRY(replace_digits_for_number_system(*number_system, builder.build())); + auto result = TRY(replace_digits_for_number_system(*number_system, builder.to_deprecated_string())); return TRY(String::from_utf8(formats->gmt_format)).replace("{0}"sv, result, ReplaceMode::FirstOnly); } diff --git a/Userland/Libraries/LibMarkdown/BlockQuote.cpp b/Userland/Libraries/LibMarkdown/BlockQuote.cpp index 191f7a96a6..ac40a2650b 100644 --- a/Userland/Libraries/LibMarkdown/BlockQuote.cpp +++ b/Userland/Libraries/LibMarkdown/BlockQuote.cpp @@ -17,7 +17,7 @@ DeprecatedString BlockQuote::render_to_html(bool) const builder.append("<blockquote>\n"sv); builder.append(m_contents->render_to_html()); builder.append("</blockquote>\n"sv); - return builder.build(); + return builder.to_deprecated_string(); } Vector<DeprecatedString> BlockQuote::render_lines_for_terminal(size_t view_width) const diff --git a/Userland/Libraries/LibMarkdown/CodeBlock.cpp b/Userland/Libraries/LibMarkdown/CodeBlock.cpp index 1a2f1e753d..1d388fabca 100644 --- a/Userland/Libraries/LibMarkdown/CodeBlock.cpp +++ b/Userland/Libraries/LibMarkdown/CodeBlock.cpp @@ -51,7 +51,7 @@ DeprecatedString CodeBlock::render_to_html(bool) const builder.append("</pre>\n"sv); - return builder.build(); + return builder.to_deprecated_string(); } Vector<DeprecatedString> CodeBlock::render_lines_for_terminal(size_t) const @@ -174,7 +174,7 @@ OwnPtr<CodeBlock> CodeBlock::parse_backticks(LineIterator& lines, Heading* curre builder.append('\n'); } - return make<CodeBlock>(language, style, builder.build(), current_section); + return make<CodeBlock>(language, style, builder.to_deprecated_string(), current_section); } OwnPtr<CodeBlock> CodeBlock::parse_indent(LineIterator& lines) @@ -197,6 +197,6 @@ OwnPtr<CodeBlock> CodeBlock::parse_indent(LineIterator& lines) builder.append('\n'); } - return make<CodeBlock>("", "", builder.build(), nullptr); + return make<CodeBlock>("", "", builder.to_deprecated_string(), nullptr); } } diff --git a/Userland/Libraries/LibMarkdown/CommentBlock.cpp b/Userland/Libraries/LibMarkdown/CommentBlock.cpp index 0b07ba7459..b885b32e94 100644 --- a/Userland/Libraries/LibMarkdown/CommentBlock.cpp +++ b/Userland/Libraries/LibMarkdown/CommentBlock.cpp @@ -20,7 +20,7 @@ DeprecatedString CommentBlock::render_to_html(bool) const // TODO: This is probably incorrect, because we technically need to escape "--" in some form. However, Browser does not care about this. builder.append("-->\n"sv); - return builder.build(); + return builder.to_deprecated_string(); } Vector<DeprecatedString> CommentBlock::render_lines_for_terminal(size_t) const @@ -69,7 +69,7 @@ OwnPtr<CommentBlock> CommentBlock::parse(LineIterator& lines) line = *lines; } - return make<CommentBlock>(builder.build()); + return make<CommentBlock>(builder.to_deprecated_string()); } } diff --git a/Userland/Libraries/LibMarkdown/ContainerBlock.cpp b/Userland/Libraries/LibMarkdown/ContainerBlock.cpp index 5810b8276b..d18fab6b4b 100644 --- a/Userland/Libraries/LibMarkdown/ContainerBlock.cpp +++ b/Userland/Libraries/LibMarkdown/ContainerBlock.cpp @@ -37,7 +37,7 @@ DeprecatedString ContainerBlock::render_to_html(bool tight) const } } - return builder.build(); + return builder.to_deprecated_string(); } Vector<DeprecatedString> ContainerBlock::render_lines_for_terminal(size_t view_width) const @@ -97,7 +97,7 @@ OwnPtr<ContainerBlock> ContainerBlock::parse(LineIterator& lines) auto flush_paragraph = [&] { if (paragraph_text.is_empty()) return; - auto paragraph = make<Paragraph>(Text::parse(paragraph_text.build())); + auto paragraph = make<Paragraph>(Text::parse(paragraph_text.to_deprecated_string())); blocks.append(move(paragraph)); paragraph_text.clear(); }; diff --git a/Userland/Libraries/LibMarkdown/Document.cpp b/Userland/Libraries/LibMarkdown/Document.cpp index df088e326e..6e6ff08041 100644 --- a/Userland/Libraries/LibMarkdown/Document.cpp +++ b/Userland/Libraries/LibMarkdown/Document.cpp @@ -35,7 +35,7 @@ DeprecatedString Document::render_to_html(StringView extra_head_contents) const </body> </html>)~~~"sv); - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString Document::render_to_inline_html() const @@ -51,7 +51,7 @@ DeprecatedString Document::render_for_terminal(size_t view_width) const builder.append("\n"sv); } - return builder.build(); + return builder.to_deprecated_string(); } RecursionDecision Document::walk(Visitor& visitor) const diff --git a/Userland/Libraries/LibMarkdown/Heading.cpp b/Userland/Libraries/LibMarkdown/Heading.cpp index e31db29959..1e2b0c3121 100644 --- a/Userland/Libraries/LibMarkdown/Heading.cpp +++ b/Userland/Libraries/LibMarkdown/Heading.cpp @@ -32,7 +32,7 @@ Vector<DeprecatedString> Heading::render_lines_for_terminal(size_t) const break; } - return Vector<DeprecatedString> { builder.build() }; + return Vector<DeprecatedString> { builder.to_deprecated_string() }; } RecursionDecision Heading::walk(Visitor& visitor) const diff --git a/Userland/Libraries/LibMarkdown/List.cpp b/Userland/Libraries/LibMarkdown/List.cpp index ac5a48e221..75f46d2119 100644 --- a/Userland/Libraries/LibMarkdown/List.cpp +++ b/Userland/Libraries/LibMarkdown/List.cpp @@ -35,7 +35,7 @@ DeprecatedString List::render_to_html(bool) const builder.appendff("</{}>\n", tag); - return builder.build(); + return builder.to_deprecated_string(); } Vector<DeprecatedString> List::render_lines_for_terminal(size_t view_width) const @@ -57,13 +57,13 @@ Vector<DeprecatedString> List::render_lines_for_terminal(size_t view_width) cons builder.append(first_line); - lines.append(builder.build()); + lines.append(builder.to_deprecated_string()); for (auto& line : item_lines) { builder.clear(); builder.append(DeprecatedString::repeated(' ', item_indentation)); builder.append(line); - lines.append(builder.build()); + lines.append(builder.to_deprecated_string()); } } diff --git a/Userland/Libraries/LibMarkdown/Paragraph.cpp b/Userland/Libraries/LibMarkdown/Paragraph.cpp index afb0d2860d..3ad5e50967 100644 --- a/Userland/Libraries/LibMarkdown/Paragraph.cpp +++ b/Userland/Libraries/LibMarkdown/Paragraph.cpp @@ -25,7 +25,7 @@ DeprecatedString Paragraph::render_to_html(bool tight) const builder.append('\n'); - return builder.build(); + return builder.to_deprecated_string(); } Vector<DeprecatedString> Paragraph::render_lines_for_terminal(size_t) const diff --git a/Userland/Libraries/LibMarkdown/Table.cpp b/Userland/Libraries/LibMarkdown/Table.cpp index d1f8b37aab..d526e7acff 100644 --- a/Userland/Libraries/LibMarkdown/Table.cpp +++ b/Userland/Libraries/LibMarkdown/Table.cpp @@ -44,12 +44,12 @@ Vector<DeprecatedString> Table::render_lines_for_terminal(size_t view_width) con write_aligned(col.header, width, col.alignment); } - lines.append(builder.build()); + lines.append(builder.to_deprecated_string()); builder.clear(); for (size_t i = 0; i < view_width; ++i) builder.append('-'); - lines.append(builder.build()); + lines.append(builder.to_deprecated_string()); builder.clear(); for (size_t i = 0; i < m_row_count; ++i) { @@ -65,7 +65,7 @@ Vector<DeprecatedString> Table::render_lines_for_terminal(size_t view_width) con size_t width = col.relative_width * unit_width_length; write_aligned(cell, width, col.alignment); } - lines.append(builder.build()); + lines.append(builder.to_deprecated_string()); builder.clear(); } diff --git a/Userland/Libraries/LibMarkdown/Text.cpp b/Userland/Libraries/LibMarkdown/Text.cpp index 2a410f1976..c5296ebfaa 100644 --- a/Userland/Libraries/LibMarkdown/Text.cpp +++ b/Userland/Libraries/LibMarkdown/Text.cpp @@ -266,14 +266,14 @@ DeprecatedString Text::render_to_html() const { StringBuilder builder; m_node->render_to_html(builder); - return builder.build().trim(" \n\t"sv); + return builder.to_deprecated_string().trim(" \n\t"sv); } DeprecatedString Text::render_for_terminal() const { StringBuilder builder; m_node->render_for_terminal(builder); - return builder.build().trim(" \n\t"sv); + return builder.to_deprecated_string().trim(" \n\t"sv); } RecursionDecision Text::walk(Visitor& visitor) const @@ -323,7 +323,7 @@ Vector<Text::Token> Text::tokenize(StringView str) return; tokens.append({ - current_token.build(), + current_token.to_deprecated_string(), left_flanking, right_flanking, punct_before, @@ -627,7 +627,7 @@ NonnullOwnPtr<Text::Node> Text::parse_link(Vector<Token>::ConstIterator& tokens) if (*iterator == ")"sv) { tokens = iterator; - return make<LinkNode>(is_image, move(link_text), address.build().trim_whitespace(), image_width, image_height); + return make<LinkNode>(is_image, move(link_text), address.to_deprecated_string().trim_whitespace(), image_width, image_height); } address.append(iterator->data); diff --git a/Userland/Libraries/LibRegex/RegexMatch.h b/Userland/Libraries/LibRegex/RegexMatch.h index 670e06e80d..923d550300 100644 --- a/Userland/Libraries/LibRegex/RegexMatch.h +++ b/Userland/Libraries/LibRegex/RegexMatch.h @@ -273,7 +273,7 @@ public: StringBuilder builder; for (auto ch : data) builder.append(ch); // Note: The type conversion is intentional. - optional_string_storage = builder.build(); + optional_string_storage = builder.to_deprecated_string(); return RegexStringView { T { *optional_string_storage } }; }, [&](Utf32View) { diff --git a/Userland/Libraries/LibRegex/RegexMatcher.cpp b/Userland/Libraries/LibRegex/RegexMatcher.cpp index bf6571680a..4afe01fa03 100644 --- a/Userland/Libraries/LibRegex/RegexMatcher.cpp +++ b/Userland/Libraries/LibRegex/RegexMatcher.cpp @@ -96,7 +96,7 @@ DeprecatedString Regex<Parser>::error_string(Optional<DeprecatedString> message) eb.append(' '); eb.appendff("^---- {}", message.value_or(get_error_string(parser_result.error))); - return eb.build(); + return eb.to_deprecated_string(); } template<typename Parser> diff --git a/Userland/Libraries/LibRegex/RegexParser.cpp b/Userland/Libraries/LibRegex/RegexParser.cpp index bc6c2fc7d0..136b7a97f2 100644 --- a/Userland/Libraries/LibRegex/RegexParser.cpp +++ b/Userland/Libraries/LibRegex/RegexParser.cpp @@ -598,7 +598,7 @@ ALWAYS_INLINE bool PosixExtendedParser::parse_repetition_symbol(ByteCode& byteco number_builder.append(consume().value()); } - auto maybe_minimum = number_builder.build().to_uint(); + auto maybe_minimum = number_builder.to_deprecated_string().to_uint(); if (!maybe_minimum.has_value()) return set_error(Error::InvalidBraceContent); @@ -627,7 +627,7 @@ ALWAYS_INLINE bool PosixExtendedParser::parse_repetition_symbol(ByteCode& byteco number_builder.append(consume().value()); } if (!number_builder.is_empty()) { - auto value = number_builder.build().to_uint(); + auto value = number_builder.to_deprecated_string().to_uint(); if (!value.has_value() || minimum > value.value() || *value > s_maximum_repetition_count) return set_error(Error::InvalidBraceContent); @@ -2530,7 +2530,7 @@ DeprecatedFlyString ECMA262Parser::read_capture_group_specifier(bool take_starti builder.append_code_point(code_point); } - DeprecatedFlyString name = builder.build(); + DeprecatedFlyString name = builder.to_deprecated_string(); if (!hit_end || name.is_empty()) set_error(Error::InvalidNameForCaptureGroup); diff --git a/Userland/Libraries/LibSQL/AST/Expression.cpp b/Userland/Libraries/LibSQL/AST/Expression.cpp index cd2270577d..e4457e4868 100644 --- a/Userland/Libraries/LibSQL/AST/Expression.cpp +++ b/Userland/Libraries/LibSQL/AST/Expression.cpp @@ -211,7 +211,7 @@ ResultOr<Value> MatchExpression::evaluate(ExecutionContext& context) const builder.append('$'); // FIXME: We should probably cache this regex. - auto regex = Regex<PosixBasic>(builder.build()); + auto regex = Regex<PosixBasic>(builder.to_deprecated_string()); auto result = regex.match(lhs_value.to_deprecated_string(), PosixFlags::Insensitive | PosixFlags::Unicode); return Value(invert_expression() ? !result.success : result.success); } @@ -226,7 +226,7 @@ ResultOr<Value> MatchExpression::evaluate(ExecutionContext& context) const builder.append("Regular expression: "sv); builder.append(get_error_string(err)); - return Result { SQLCommand::Unknown, SQLErrorCode::SyntaxError, builder.build() }; + return Result { SQLCommand::Unknown, SQLErrorCode::SyntaxError, builder.to_deprecated_string() }; } auto result = regex.match(lhs_value.to_deprecated_string(), PosixFlags::Insensitive | PosixFlags::Unicode); diff --git a/Userland/Libraries/LibSQL/AST/Lexer.cpp b/Userland/Libraries/LibSQL/AST/Lexer.cpp index 5ca6b8fe3f..dfc857ef25 100644 --- a/Userland/Libraries/LibSQL/AST/Lexer.cpp +++ b/Userland/Libraries/LibSQL/AST/Lexer.cpp @@ -109,7 +109,7 @@ Token Lexer::next() } } - Token token(token_type, current_token.build(), + Token token(token_type, current_token.to_deprecated_string(), { value_start_line_number, value_start_column_number }, { m_line_number, m_line_column }); diff --git a/Userland/Libraries/LibSQL/Result.cpp b/Userland/Libraries/LibSQL/Result.cpp index fefa28192a..2a902da869 100644 --- a/Userland/Libraries/LibSQL/Result.cpp +++ b/Userland/Libraries/LibSQL/Result.cpp @@ -41,7 +41,7 @@ DeprecatedString Result::error_string() const builder.append(error_description); } - return builder.build(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibSQL/TreeNode.cpp b/Userland/Libraries/LibSQL/TreeNode.cpp index 9f2f74d5b9..b17da4902c 100644 --- a/Userland/Libraries/LibSQL/TreeNode.cpp +++ b/Userland/Libraries/LibSQL/TreeNode.cpp @@ -364,7 +364,7 @@ void TreeNode::dump_if(int flag, DeprecatedString&& msg) builder.append(", leaf"sv); } builder.append(')'); - dbgln(builder.build()); + dbgln(builder.to_deprecated_string()); } void TreeNode::list_node(int indent) diff --git a/Userland/Libraries/LibSQL/Tuple.cpp b/Userland/Libraries/LibSQL/Tuple.cpp index 5fcc5fbdfb..3c92103ac8 100644 --- a/Userland/Libraries/LibSQL/Tuple.cpp +++ b/Userland/Libraries/LibSQL/Tuple.cpp @@ -173,7 +173,7 @@ DeprecatedString Tuple::to_deprecated_string() const if (pointer() != 0) { builder.appendff(":{}", pointer()); } - return builder.build(); + return builder.to_deprecated_string(); } void Tuple::copy_from(Tuple const& other) diff --git a/Userland/Libraries/LibSQL/Value.cpp b/Userland/Libraries/LibSQL/Value.cpp index 789e14623a..1cbb2be685 100644 --- a/Userland/Libraries/LibSQL/Value.cpp +++ b/Userland/Libraries/LibSQL/Value.cpp @@ -221,7 +221,7 @@ DeprecatedString Value::to_deprecated_string() const builder.join(',', value.values); builder.append(')'); - return builder.build(); + return builder.to_deprecated_string(); }); } diff --git a/Userland/Libraries/LibTLS/Certificate.h b/Userland/Libraries/LibTLS/Certificate.h index fdab883c27..d56e5abb20 100644 --- a/Userland/Libraries/LibTLS/Certificate.h +++ b/Userland/Libraries/LibTLS/Certificate.h @@ -92,7 +92,7 @@ public: cert_name.append("/CN="sv); cert_name.append(subject.subject); } - return cert_name.build(); + return cert_name.to_deprecated_string(); } DeprecatedString issuer_identifier_string() const @@ -122,7 +122,7 @@ public: cert_name.append("/CN="sv); cert_name.append(issuer.subject); } - return cert_name.build(); + return cert_name.to_deprecated_string(); } }; diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp index 43241d34dd..56ba3e5b6e 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -229,7 +229,7 @@ DeprecatedString DOMTokenList::value() const { StringBuilder builder; builder.join(' ', m_token_set); - return builder.build(); + return builder.to_deprecated_string(); } // https://dom.spec.whatwg.org/#ref-for-concept-element-attributes-set-value%E2%91%A2 diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 3c62d54765..d575117498 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -386,7 +386,7 @@ WebIDL::ExceptionOr<void> Document::write(Vector<DeprecatedString> const& string StringBuilder builder; builder.join(""sv, strings); - return run_the_document_write_steps(builder.build()); + return run_the_document_write_steps(builder.to_deprecated_string()); } // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-writeln @@ -396,7 +396,7 @@ WebIDL::ExceptionOr<void> Document::writeln(Vector<DeprecatedString> const& stri builder.join(""sv, strings); builder.append("\n"sv); - return run_the_document_write_steps(builder.build()); + return run_the_document_write_steps(builder.to_deprecated_string()); } // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-write-steps diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 5da4574a65..5c3f757812 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -270,7 +270,7 @@ DeprecatedString Node::child_text_content() const if (is<Text>(child)) builder.append(verify_cast<Text>(child).text_content()); }); - return builder.build(); + return builder.to_deprecated_string(); } // https://dom.spec.whatwg.org/#concept-tree-root diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp index b6862eb63e..9dd59d8996 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp @@ -147,7 +147,7 @@ ErrorOr<Optional<Vector<DeprecatedString>>> get_decode_and_split_header_value(Re } // 3. Remove all HTTP tab or space from the start and end of temporaryValue. - auto temporary_value = temporary_value_builder.build().trim(HTTP_TAB_OR_SPACE, TrimMode::Both); + auto temporary_value = temporary_value_builder.to_deprecated_string().trim(HTTP_TAB_OR_SPACE, TrimMode::Both); // 4. Append temporaryValue to values. values.append(move(temporary_value)); diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index 1b41e9d448..662df94c8b 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -420,7 +420,7 @@ CanvasRenderingContext2D::PreparedText CanvasRenderingContext2D::prepare_text(De for (auto c : text) { builder.append(Infra::is_ascii_whitespace(c) ? ' ' : c); } - DeprecatedString replaced_text = builder.build(); + auto replaced_text = builder.to_deprecated_string(); // 3. Let font be the current font of target, as given by that object's font attribute. // FIXME: Once we have CanvasTextDrawingStyles, implement font selection. diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp index aa4c066193..50864bb915 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp @@ -2816,7 +2816,7 @@ void HTMLTokenizer::insert_input_at_insertion_point(DeprecatedString const& inpu builder.append(m_decoded_input.substring(0, m_insertion_point.position)); builder.append(input); builder.append(m_decoded_input.substring(m_insertion_point.position)); - m_decoded_input = builder.build(); + m_decoded_input = builder.to_deprecated_string(); m_utf8_view = Utf8View(m_decoded_input); m_utf8_iterator = m_utf8_view.iterator_at_byte_offset(utf8_iterator_byte_offset); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index e7557025c1..6e3858fddd 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -284,7 +284,7 @@ JS::ThrowCompletionOr<size_t> WebAssemblyObject::instantiate_module(JS::VM& vm, StringBuilder builder; builder.append("LinkError: Missing "sv); builder.join(' ', link_result.error().missing_imports); - return vm.throw_completion<JS::TypeError>(builder.build()); + return vm.throw_completion<JS::TypeError>(builder.to_deprecated_string()); } auto instance_result = s_abstract_machine.instantiate(module, link_result.release_value()); diff --git a/Userland/Services/DHCPClient/DHCPv4.h b/Userland/Services/DHCPClient/DHCPv4.h index 239468f7a4..87b6d28abd 100644 --- a/Userland/Services/DHCPClient/DHCPv4.h +++ b/Userland/Services/DHCPClient/DHCPv4.h @@ -163,7 +163,7 @@ struct ParsedDHCPv4Options { builder.appendff(" {} ", ((u8 const*)opt.value.value)[i]); builder.append('\n'); } - return builder.build(); + return builder.to_deprecated_string(); } struct DHCPOptionValue { diff --git a/Userland/Services/LaunchServer/Launcher.cpp b/Userland/Services/LaunchServer/Launcher.cpp index e59c271186..1c0be751c0 100644 --- a/Userland/Services/LaunchServer/Launcher.cpp +++ b/Userland/Services/LaunchServer/Launcher.cpp @@ -64,7 +64,7 @@ DeprecatedString Handler::to_details_str() const break; } MUST(obj.finish()); - return builder.build(); + return builder.to_deprecated_string(); } Launcher::Launcher() diff --git a/Userland/Shell/AST.cpp b/Userland/Shell/AST.cpp index 6f7704fdff..55522038b6 100644 --- a/Userland/Shell/AST.cpp +++ b/Userland/Shell/AST.cpp @@ -198,7 +198,7 @@ static DeprecatedString resolve_slices(RefPtr<Shell> shell, DeprecatedString&& i for (auto& index : indices) builder.append(input_value[index]); - input_value = builder.build(); + input_value = builder.to_deprecated_string(); } return move(input_value); diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp index 770da10c41..ec45f90711 100644 --- a/Userland/Shell/Builtin.cpp +++ b/Userland/Shell/Builtin.cpp @@ -317,9 +317,9 @@ int Shell::builtin_type(int argc, char const** argv) if (fn.body) { auto formatter = Formatter(*fn.body); builder.append(formatter.format()); - printf("%s\n}\n", builder.build().characters()); + printf("%s\n}\n", builder.to_deprecated_string().characters()); } else { - printf("%s\n}\n", builder.build().characters()); + printf("%s\n}\n", builder.to_deprecated_string().characters()); } } continue; diff --git a/Userland/Shell/ImmediateFunctions.cpp b/Userland/Shell/ImmediateFunctions.cpp index 93e89186e2..1ec7d5cf2e 100644 --- a/Userland/Shell/ImmediateFunctions.cpp +++ b/Userland/Shell/ImmediateFunctions.cpp @@ -345,7 +345,7 @@ RefPtr<AST::Node> Shell::immediate_split(AST::ImmediateExpression& invoking_node StringBuilder builder; for (auto code_point : Utf8View { value }) { builder.append_code_point(code_point); - split_strings.append(builder.build()); + split_strings.append(builder.to_deprecated_string()); builder.clear(); } } else { diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index f299260c1f..43ec26b497 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -217,7 +217,7 @@ Parser::SequenceParseResult Parser::parse_sequence() error_builder.appendff(", {} (at {}:{})", entry.end, entry.node->position().start_line.line_column, entry.node->position().start_line.line_number); first = false; } - left.append(create<AST::SyntaxError>(error_builder.build(), true)); + left.append(create<AST::SyntaxError>(error_builder.to_deprecated_string(), true)); // Just read the rest of the newlines goto discard_terminators; } diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 3a74789ec0..fa349cb68f 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -846,7 +846,7 @@ ErrorOr<RefPtr<Job>> Shell::run_command(const AST::Command& command) // as the child will run this chain. if (command.should_immediately_execute_next) command_copy.next_chain.clear(); - auto job = Job::create(child, pgid, cmd.build(), find_last_job_id() + 1, move(command_copy)); + auto job = Job::create(child, pgid, cmd.to_deprecated_string(), find_last_job_id() + 1, move(command_copy)); jobs.set((u64)child, job); job->on_exit = [this](auto job) { @@ -1159,7 +1159,7 @@ DeprecatedString Shell::escape_token_for_single_quotes(StringView token) if (started_single_quote) builder.append("'"sv); - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString Shell::escape_token_for_double_quotes(StringView token) @@ -1185,7 +1185,7 @@ DeprecatedString Shell::escape_token_for_double_quotes(StringView token) builder.append('"'); - return builder.build(); + return builder.to_deprecated_string(); } Shell::SpecialCharacterEscapeMode Shell::special_character_escape_mode(u32 code_point, EscapeMode mode) @@ -1290,7 +1290,7 @@ static DeprecatedString do_escape(Shell::EscapeMode escape_mode, auto& token) } } - return builder.build(); + return builder.to_deprecated_string(); } DeprecatedString Shell::escape_token(Utf32View token, EscapeMode escape_mode) @@ -1333,7 +1333,7 @@ DeprecatedString Shell::unescape_token(StringView token) if (state == Escaped) builder.append('\\'); - return builder.build(); + return builder.to_deprecated_string(); } void Shell::cache_path() @@ -1477,7 +1477,7 @@ Vector<Line::CompletionSuggestion> Shell::complete_path(StringView base, StringV path_builder.append('/'); path_builder.append(init_slash_part); } - path = path_builder.build(); + path = path_builder.to_deprecated_string(); token = last_slash_part; // the invariant part of the token is actually just the last segment @@ -1745,7 +1745,7 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s auto list = pop_list(); StringBuilder builder; builder.join(""sv, list); - this->list().append(builder.build()); + this->list().append(builder.to_deprecated_string()); } virtual void visit(AST::Glob const* node) override @@ -1764,7 +1764,7 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s auto list = pop_list(); StringBuilder builder; builder.join(""sv, list); - this->list().append(builder.build()); + this->list().append(builder.to_deprecated_string()); } virtual void visit(AST::ImmediateExpression const* node) override @@ -1813,7 +1813,7 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s for (auto& right_entry : right) { builder.append(left_entry); builder.append(right_entry); - list().append(builder.build()); + list().append(builder.to_deprecated_string()); builder.clear(); } } diff --git a/Userland/Utilities/diff.cpp b/Userland/Utilities/diff.cpp index b15a2f9bb4..9ec39cabe1 100644 --- a/Userland/Utilities/diff.cpp +++ b/Userland/Utilities/diff.cpp @@ -54,7 +54,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) if (num_added > 1) sb.appendff(",{}", target_start + num_added - 1); - outln("Hunk: {}", sb.build()); + outln("Hunk: {}", sb.to_deprecated_string()); for (auto const& line : hunk.removed_lines) { if (color_output) outln("\033[31;1m< {}\033[0m", line); diff --git a/Userland/Utilities/echo.cpp b/Userland/Utilities/echo.cpp index a368d13e0d..5eb71c9f29 100644 --- a/Userland/Utilities/echo.cpp +++ b/Userland/Utilities/echo.cpp @@ -94,7 +94,7 @@ static DeprecatedString interpret_backslash_escapes(StringView string, bool& no_ } } - return builder.build(); + return builder.to_deprecated_string(); } ErrorOr<int> serenity_main(Main::Arguments arguments) diff --git a/Userland/Utilities/expr.cpp b/Userland/Utilities/expr.cpp index a49f90ade0..2af361b66c 100644 --- a/Userland/Utilities/expr.cpp +++ b/Userland/Utilities/expr.cpp @@ -421,7 +421,7 @@ private: for (auto& e : match.capture_group_matches[0]) result.append(e.view.string_view()); - return result.build(); + return result.to_deprecated_string(); } } diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index e253dd3faf..1a358fcad1 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -110,7 +110,7 @@ static DeprecatedString prompt_for_level(int level) for (auto i = 0; i < level; ++i) prompt_builder.append(" "sv); - return prompt_builder.build(); + return prompt_builder.to_deprecated_string(); } static DeprecatedString read_next_piece() diff --git a/Userland/Utilities/less.cpp b/Userland/Utilities/less.cpp index 358b933d00..eb594cef82 100644 --- a/Userland/Utilities/less.cpp +++ b/Userland/Utilities/less.cpp @@ -565,28 +565,28 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } else if (sequence == "j" || sequence == "\e[B" || sequence == "\n") { if (!emulate_more) { if (!modifier_buffer.is_empty()) - pager.down_n(modifier_buffer.build().to_uint().value_or(1)); + pager.down_n(modifier_buffer.to_deprecated_string().to_uint().value_or(1)); else pager.down(); } } else if (sequence == "k" || sequence == "\e[A") { if (!emulate_more) { if (!modifier_buffer.is_empty()) - pager.up_n(modifier_buffer.build().to_uint().value_or(1)); + pager.up_n(modifier_buffer.to_deprecated_string().to_uint().value_or(1)); else pager.up(); } } else if (sequence == "g") { if (!emulate_more) { if (!modifier_buffer.is_empty()) - pager.go_to_line(modifier_buffer.build().to_uint().value()); + pager.go_to_line(modifier_buffer.to_deprecated_string().to_uint().value()); else pager.top(); } } else if (sequence == "G") { if (!emulate_more) { if (!modifier_buffer.is_empty()) - pager.go_to_line(modifier_buffer.build().to_uint().value()); + pager.go_to_line(modifier_buffer.to_deprecated_string().to_uint().value()); else pager.bottom(); } diff --git a/Userland/Utilities/markdown-check.cpp b/Userland/Utilities/markdown-check.cpp index 4896a108e5..2259e20db4 100644 --- a/Userland/Utilities/markdown-check.cpp +++ b/Userland/Utilities/markdown-check.cpp @@ -112,7 +112,7 @@ public: StringCollector() = default; virtual ~StringCollector() = default; - DeprecatedString build() { return m_builder.build(); } + DeprecatedString build() { return m_builder.to_deprecated_string(); } static DeprecatedString from(Markdown::Heading const& heading) { diff --git a/Userland/Utilities/mkdir.cpp b/Userland/Utilities/mkdir.cpp index 30a3c1eb92..d464aa2a36 100644 --- a/Userland/Utilities/mkdir.cpp +++ b/Userland/Utilities/mkdir.cpp @@ -63,7 +63,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto& part = parts[idx]; path_builder.append(part); - auto path = path_builder.build(); + auto path = path_builder.to_deprecated_string(); struct stat st; if (stat(path.characters(), &st) < 0) { diff --git a/Userland/Utilities/printf.cpp b/Userland/Utilities/printf.cpp index c20aef7429..8051465e12 100644 --- a/Userland/Utilities/printf.cpp +++ b/Userland/Utilities/printf.cpp @@ -252,7 +252,7 @@ static DeprecatedString handle_escapes(char const* string) builder.append('\b'); break; case 'c': - return builder.build(); + return builder.to_deprecated_string(); case 'e': builder.append('\e'); break; @@ -288,7 +288,7 @@ static DeprecatedString handle_escapes(char const* string) } } - return builder.build(); + return builder.to_deprecated_string(); } ErrorOr<int> serenity_main(Main::Arguments arguments) diff --git a/Userland/Utilities/sql.cpp b/Userland/Utilities/sql.cpp index 574118c1b6..cb5c599e22 100644 --- a/Userland/Utilities/sql.cpp +++ b/Userland/Utilities/sql.cpp @@ -87,7 +87,7 @@ public: m_sql_client->on_next_result = [](auto, auto, auto row) { StringBuilder builder; builder.join(", "sv, row); - outln("{}", builder.build()); + outln("{}", builder.to_deprecated_string()); }; m_sql_client->on_results_exhausted = [this](auto, auto, auto total_rows) { @@ -299,7 +299,7 @@ private: for (auto i = 0; i < level; ++i) prompt_builder.append(" "sv); - return prompt_builder.build(); + return prompt_builder.to_deprecated_string(); } bool handle_command(StringView command) diff --git a/Userland/Utilities/tail.cpp b/Userland/Utilities/tail.cpp index 2f71f45318..382449957e 100644 --- a/Userland/Utilities/tail.cpp +++ b/Userland/Utilities/tail.cpp @@ -86,7 +86,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) line.append(ch); if (ch == '\n') { if (wanted_line_count > line_count || line_index >= line_count - wanted_line_count) - out("{}", line.build()); + out("{}", line.to_deprecated_string()); line_index++; line.clear(); } diff --git a/Userland/Utilities/tree.cpp b/Userland/Utilities/tree.cpp index 47fe53e34f..27755dfcdf 100644 --- a/Userland/Utilities/tree.cpp +++ b/Userland/Utilities/tree.cpp @@ -73,7 +73,7 @@ static void print_directory_tree(DeprecatedString const& root_path, int depth, D builder.append('/'); } builder.append(name); - DeprecatedString full_path = builder.to_deprecated_string(); + auto full_path = builder.to_deprecated_string(); struct stat st; int rc = lstat(full_path.characters(), &st); diff --git a/Userland/Utilities/useradd.cpp b/Userland/Utilities/useradd.cpp index f84e4c19ea..4767562f7c 100644 --- a/Userland/Utilities/useradd.cpp +++ b/Userland/Utilities/useradd.cpp @@ -142,7 +142,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) builder.append("$5$"sv); builder.append(TRY(encode_base64({ random_data, sizeof(random_data) }))); - return builder.build(); + return builder.to_deprecated_string(); }; char* hash = crypt(password.characters(), TRY(get_salt()).characters()); diff --git a/Userland/Utilities/watch.cpp b/Userland/Utilities/watch.cpp index af36a8e982..9adfbe68c0 100644 --- a/Userland/Utilities/watch.cpp +++ b/Userland/Utilities/watch.cpp @@ -34,7 +34,7 @@ static DeprecatedString build_header_string(Vector<char const*> const& command, builder.appendff("Every {}.{}s: \x1b[1m", interval.tv_sec, interval.tv_usec / 100000); builder.join(' ', command); builder.append("\x1b[0m"sv); - return builder.build(); + return builder.to_deprecated_string(); } static DeprecatedString build_header_string(Vector<char const*> const& command, Vector<DeprecatedString> const& filenames) @@ -43,7 +43,7 @@ static DeprecatedString build_header_string(Vector<char const*> const& command, builder.appendff("Every time any of {} changes: \x1b[1m", filenames); builder.join(' ', command); builder.append("\x1b[0m"sv); - return builder.build(); + return builder.to_deprecated_string(); } static struct timeval get_current_time() |