diff options
Diffstat (limited to 'Userland/Libraries')
263 files changed, 4239 insertions, 4239 deletions
diff --git a/Userland/Libraries/LibArchive/Tar.h b/Userland/Libraries/LibArchive/Tar.h index dcfb38f9ec..6c677d79c8 100644 --- a/Userland/Libraries/LibArchive/Tar.h +++ b/Userland/Libraries/LibArchive/Tar.h @@ -43,12 +43,12 @@ enum class TarFileType : char { }; constexpr size_t block_size = 512; -constexpr StringView gnu_magic = "ustar "; // gnu format magic -constexpr StringView gnu_version = " "; // gnu format version -constexpr StringView ustar_magic = "ustar"; // ustar format magic -constexpr StringView ustar_version = "00"; // ustar format version -constexpr StringView posix1_tar_magic = ""; // POSIX.1-1988 format magic -constexpr StringView posix1_tar_version = ""; // POSIX.1-1988 format version +constexpr StringView gnu_magic = "ustar "sv; // gnu format magic +constexpr StringView gnu_version = " "sv; // gnu format version +constexpr StringView ustar_magic = "ustar"sv; // ustar format magic +constexpr StringView ustar_version = "00"sv; // ustar format version +constexpr StringView posix1_tar_magic = ""sv; // POSIX.1-1988 format magic +constexpr StringView posix1_tar_version = ""sv; // POSIX.1-1988 format version template<size_t N> static size_t get_field_as_integral(char const (&field)[N]) diff --git a/Userland/Libraries/LibAudio/Loader.h b/Userland/Libraries/LibAudio/Loader.h index 4f08aa9120..beacfc31c6 100644 --- a/Userland/Libraries/LibAudio/Loader.h +++ b/Userland/Libraries/LibAudio/Loader.h @@ -22,7 +22,7 @@ namespace Audio { -static constexpr StringView no_plugin_error = "No loader plugin available"; +static constexpr StringView no_plugin_error = "No loader plugin available"sv; using LoaderSamples = Result<FixedArray<Sample>, LoaderError>; using MaybeLoaderError = Result<void, LoaderError>; diff --git a/Userland/Libraries/LibAudio/Sample.h b/Userland/Libraries/LibAudio/Sample.h index 91ff28f909..2c55336dc6 100644 --- a/Userland/Libraries/LibAudio/Sample.h +++ b/Userland/Libraries/LibAudio/Sample.h @@ -154,7 +154,7 @@ template<> struct Formatter<Audio::Sample> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, Audio::Sample const& value) { - return Formatter<FormatString>::format(builder, "[{}, {}]", value.left, value.right); + return Formatter<FormatString>::format(builder, "[{}, {}]"sv, value.left, value.right); } }; diff --git a/Userland/Libraries/LibC/getopt.cpp b/Userland/Libraries/LibC/getopt.cpp index 1f46fede94..3c6b346e6c 100644 --- a/Userland/Libraries/LibC/getopt.cpp +++ b/Userland/Libraries/LibC/getopt.cpp @@ -116,7 +116,7 @@ int OptionParser::getopt() m_consumed_args = 0; } else { // Alright, so we have an option on our hands! - bool is_long_option = arg.starts_with("--"); + bool is_long_option = arg.starts_with("--"sv); if (is_long_option) res = handle_long_option(); else @@ -146,7 +146,7 @@ bool OptionParser::lookup_short_option(char option, int& needs_value) const return false; } - if (parts[1].starts_with("::")) { + if (parts[1].starts_with("::"sv)) { // If an option is followed by two colons, it optionally accepts an // argument. needs_value = optional_argument; diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp index 6288d46841..cbee348cde 100644 --- a/Userland/Libraries/LibC/netdb.cpp +++ b/Userland/Libraries/LibC/netdb.cpp @@ -451,7 +451,7 @@ void endservent() static bool fill_getserv_buffers(char const* line, ssize_t read) { // Splitting the line by tab delimiter and filling the servent buffers name, port, and protocol members. - auto split_line = StringView(line, read).replace(" ", "\t", ReplaceMode::All).split('\t'); + auto split_line = StringView(line, read).replace(" "sv, "\t"sv, ReplaceMode::All).split('\t'); // This indicates an incorrect file format. // Services file entries should always at least contain @@ -474,7 +474,7 @@ static bool fill_getserv_buffers(char const* line, ssize_t read) __getserv_port_buffer = number.value(); // Remove any annoying whitespace at the end of the protocol. - __getserv_protocol_buffer = port_protocol_split[1].replace(" ", "", ReplaceMode::All).replace("\t", "", ReplaceMode::All).replace("\n", "", ReplaceMode::All); + __getserv_protocol_buffer = port_protocol_split[1].replace(" "sv, ""sv, ReplaceMode::All).replace("\t"sv, ""sv, ReplaceMode::All).replace("\n"sv, ""sv, ReplaceMode::All); __getserv_alias_list_buffer.clear(); // If there are aliases for the service, we will fill the alias list buffer. @@ -630,7 +630,7 @@ void endprotoent() static bool fill_getproto_buffers(char const* line, ssize_t read) { String string_line = String(line, read); - auto split_line = string_line.replace(" ", "\t", ReplaceMode::All).split('\t'); + auto split_line = string_line.replace(" "sv, "\t"sv, ReplaceMode::All).split('\t'); // This indicates an incorrect file format. Protocols file entries should // always have at least a name and a protocol. diff --git a/Userland/Libraries/LibC/scanf.cpp b/Userland/Libraries/LibC/scanf.cpp index d82c5d6b94..fa2e21fb30 100644 --- a/Userland/Libraries/LibC/scanf.cpp +++ b/Userland/Libraries/LibC/scanf.cpp @@ -297,7 +297,7 @@ struct ReadElement { template<> struct ReadElement<char*, ReadKind::Normal> { ReadElement(StringView scan_set = {}, bool invert = false) - : scan_set(scan_set.is_null() ? " \t\n\f\r" : scan_set) + : scan_set(scan_set.is_null() ? " \t\n\f\r"sv : scan_set) , invert(scan_set.is_null() ? true : invert) , was_null(scan_set.is_null()) { diff --git a/Userland/Libraries/LibC/shadow.cpp b/Userland/Libraries/LibC/shadow.cpp index a7504ec3d9..099fca4cae 100644 --- a/Userland/Libraries/LibC/shadow.cpp +++ b/Userland/Libraries/LibC/shadow.cpp @@ -87,7 +87,7 @@ static bool parse_shadow_entry(String const& line) } if (min_string.is_empty()) - min_string = "-1"; + min_string = "-1"sv; auto min_value = min_string.to_int(); if (!min_value.has_value()) { dbgln("getspent(): Malformed min value on line {}", s_line_number); @@ -95,7 +95,7 @@ static bool parse_shadow_entry(String const& line) } if (max_string.is_empty()) - max_string = "-1"; + max_string = "-1"sv; auto max_value = max_string.to_int(); if (!max_value.has_value()) { dbgln("getspent(): Malformed max value on line {}", s_line_number); @@ -103,7 +103,7 @@ static bool parse_shadow_entry(String const& line) } if (warn_string.is_empty()) - warn_string = "-1"; + warn_string = "-1"sv; auto warn = warn_string.to_int(); if (!warn.has_value()) { dbgln("getspent(): Malformed warn on line {}", s_line_number); @@ -111,7 +111,7 @@ static bool parse_shadow_entry(String const& line) } if (inact_string.is_empty()) - inact_string = "-1"; + inact_string = "-1"sv; auto inact = inact_string.to_int(); if (!inact.has_value()) { dbgln("getspent(): Malformed inact on line {}", s_line_number); @@ -119,7 +119,7 @@ static bool parse_shadow_entry(String const& line) } if (expire_string.is_empty()) - expire_string = "-1"; + expire_string = "-1"sv; auto expire = expire_string.to_int(); if (!expire.has_value()) { dbgln("getspent(): Malformed expire on line {}", s_line_number); @@ -127,7 +127,7 @@ static bool parse_shadow_entry(String const& line) } if (flag_string.is_empty()) - flag_string = "0"; + flag_string = "0"sv; auto flag = flag_string.to_int(); if (!flag.has_value()) { dbgln("getspent(): Malformed flag on line {}", s_line_number); diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp index 8cbc57220a..163c75fa4c 100644 --- a/Userland/Libraries/LibC/time.cpp +++ b/Userland/Libraries/LibC/time.cpp @@ -283,7 +283,7 @@ size_t strftime(char* destination, size_t max_size, char const* format, const st builder.append('\n'); break; case 'p': - builder.append(tm->tm_hour < 12 ? "AM" : "PM"); + builder.append(tm->tm_hour < 12 ? "AM"sv : "PM"sv); break; case 'r': { int display_hour = tm->tm_hour % 12; diff --git a/Userland/Libraries/LibCards/Card.cpp b/Userland/Libraries/LibCards/Card.cpp index aa4ae10d1b..25c0ff3556 100644 --- a/Userland/Libraries/LibCards/Card.cpp +++ b/Userland/Libraries/LibCards/Card.cpp @@ -21,7 +21,7 @@ static constexpr Gfx::CharacterBitmap s_diamond { " ####### " " ##### " " ### " - " # ", + " # "sv, 9, 9 }; @@ -34,7 +34,7 @@ static constexpr Gfx::CharacterBitmap s_heart { " ####### " " ##### " " ### " - " # ", + " # "sv, 9, 9 }; @@ -47,7 +47,7 @@ static constexpr Gfx::CharacterBitmap s_spade { "#########" " ## # ## " " ### " - " ### ", + " ### "sv, 9, 9 }; @@ -60,7 +60,7 @@ static constexpr Gfx::CharacterBitmap s_club { "###########" "#### # ####" " ## ### ## " - " ### ", + " ### "sv, 11, 9 }; @@ -80,7 +80,7 @@ Card::Card(Suit suit, uint8_t value) s_background = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { width, height }).release_value_but_fixme_should_propagate_errors(); Gfx::Painter bg_painter(*s_background); - auto image = Gfx::Bitmap::try_load_from_file("/res/icons/cards/buggie-deck.png").release_value_but_fixme_should_propagate_errors(); + auto image = Gfx::Bitmap::try_load_from_file("/res/icons/cards/buggie-deck.png"sv).release_value_but_fixme_should_propagate_errors(); float aspect_ratio = image->width() / static_cast<float>(image->height()); auto target_size = Gfx::IntSize(static_cast<int>(aspect_ratio * (height - 5)), height - 5); @@ -107,7 +107,7 @@ Card::Card(Suit suit, uint8_t value) paint_rect.set_height(paint_rect.height() / 2); paint_rect.shrink(10, 6); - auto text_rect = Gfx::IntRect { 4, 6, font.width("10"), font.glyph_height() }; + auto text_rect = Gfx::IntRect { 4, 6, font.width("10"sv), font.glyph_height() }; painter.draw_text(text_rect, label, font, Gfx::TextAlignment::Center, color()); auto const& symbol = [&]() -> Gfx::CharacterBitmap const& { diff --git a/Userland/Libraries/LibCards/Card.h b/Userland/Libraries/LibCards/Card.h index 257751f057..6577ed3c1e 100644 --- a/Userland/Libraries/LibCards/Card.h +++ b/Userland/Libraries/LibCards/Card.h @@ -26,7 +26,7 @@ public: static constexpr int card_count = 13; static constexpr int card_radius = 5; static constexpr Array<StringView, card_count> labels = { - "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" + "A"sv, "2"sv, "3"sv, "4"sv, "5"sv, "6"sv, "7"sv, "8"sv, "9"sv, "10"sv, "J"sv, "Q"sv, "K"sv }; enum class Suit { @@ -104,6 +104,6 @@ struct AK::Formatter<Cards::Card> : Formatter<FormatString> { VERIFY_NOT_REACHED(); } - return Formatter<FormatString>::format(builder, "{:>2}{}", Cards::Card::labels[card.value()], suit); + return Formatter<FormatString>::format(builder, "{:>2}{}"sv, Cards::Card::labels[card.value()], suit); } }; diff --git a/Userland/Libraries/LibCards/CardStack.h b/Userland/Libraries/LibCards/CardStack.h index 7c763daae3..52356fe40d 100644 --- a/Userland/Libraries/LibCards/CardStack.h +++ b/Userland/Libraries/LibCards/CardStack.h @@ -130,6 +130,6 @@ struct AK::Formatter<Cards::CardStack> : Formatter<FormatString> { first_card = false; } - return Formatter<FormatString>::format(builder, "{:<10} {:>16}: {}", type, stack.bounding_box(), cards.build()); + return Formatter<FormatString>::format(builder, "{:<10} {:>16}: {}"sv, type, stack.bounding_box(), cards.build()); } }; diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp index 60c1ff4d88..c58c69301c 100644 --- a/Userland/Libraries/LibChess/Chess.cpp +++ b/Userland/Libraries/LibChess/Chess.cpp @@ -88,7 +88,7 @@ String Square::to_algebraic() const Move::Move(StringView long_algebraic) : from(long_algebraic.substring_view(0, 2)) , to(long_algebraic.substring_view(2, 2)) - , promote_to(piece_for_char_promotion((long_algebraic.length() >= 5) ? long_algebraic.substring_view(4, 1) : "")) + , promote_to(piece_for_char_promotion((long_algebraic.length() >= 5) ? long_algebraic.substring_view(4, 1) : ""sv)) { } @@ -292,13 +292,13 @@ String Board::to_fen() const // 2. Active color VERIFY(m_turn != Color::None); - builder.append(m_turn == Color::White ? " w " : " b "); + builder.append(m_turn == Color::White ? " w "sv : " b "sv); // 3. Castling availability - builder.append(m_white_can_castle_kingside ? "K" : ""); - builder.append(m_white_can_castle_queenside ? "Q" : ""); - builder.append(m_black_can_castle_kingside ? "k" : ""); - builder.append(m_black_can_castle_queenside ? "q" : ""); + builder.append(m_white_can_castle_kingside ? "K"sv : ""sv); + builder.append(m_white_can_castle_queenside ? "Q"sv : ""sv); + builder.append(m_black_can_castle_kingside ? "k"sv : ""sv); + builder.append(m_black_can_castle_queenside ? "q"sv : ""sv); builder.append(" "); // 4. En passant target square diff --git a/Userland/Libraries/LibChess/UCICommand.cpp b/Userland/Libraries/LibChess/UCICommand.cpp index 91e0a531d6..23c022a7ed 100644 --- a/Userland/Libraries/LibChess/UCICommand.cpp +++ b/Userland/Libraries/LibChess/UCICommand.cpp @@ -98,10 +98,10 @@ SetOptionCommand SetOptionCommand::from_string(StringView command) String SetOptionCommand::to_string() const { StringBuilder builder; - builder.append("setoption name "); + builder.append("setoption name "sv); builder.append(name()); if (value().has_value()) { - builder.append(" value "); + builder.append(" value "sv); builder.append(value().value()); } builder.append('\n'); @@ -129,13 +129,13 @@ PositionCommand PositionCommand::from_string(StringView command) String PositionCommand::to_string() const { StringBuilder builder; - builder.append("position "); + builder.append("position "sv); if (fen().has_value()) { builder.append(fen().value()); } else { - builder.append("startpos "); + builder.append("startpos "sv); } - builder.append("moves"); + builder.append("moves"sv); for (auto& move : moves()) { builder.append(' '); builder.append(move.to_long_algebraic()); @@ -193,10 +193,10 @@ GoCommand GoCommand::from_string(StringView command) String GoCommand::to_string() const { StringBuilder builder; - builder.append("go"); + builder.append("go"sv); if (searchmoves.has_value()) { - builder.append(" searchmoves"); + builder.append(" searchmoves"sv); for (auto& move : searchmoves.value()) { builder.append(' '); builder.append(move.to_long_algebraic()); @@ -204,7 +204,7 @@ String GoCommand::to_string() const } if (ponder) - builder.append(" ponder"); + builder.append(" ponder"sv); if (wtime.has_value()) builder.appendff(" wtime {}", wtime.value()); if (btime.has_value()) @@ -224,7 +224,7 @@ String GoCommand::to_string() const if (movetime.has_value()) builder.appendff(" movetime {}", movetime.value()); if (infinite) - builder.append(" infinite"); + builder.append(" infinite"sv); builder.append('\n'); return builder.build(); @@ -266,11 +266,11 @@ IdCommand IdCommand::from_string(StringView command) String IdCommand::to_string() const { StringBuilder builder; - builder.append("id "); + builder.append("id "sv); if (field_type() == Type::Name) { - builder.append("name "); + builder.append("name "sv); } else { - builder.append("author "); + builder.append("author "sv); } builder.append(value()); builder.append('\n'); @@ -314,7 +314,7 @@ BestMoveCommand BestMoveCommand::from_string(StringView command) String BestMoveCommand::to_string() const { StringBuilder builder; - builder.append("bestmove "); + builder.append("bestmove "sv); builder.append(move().to_long_algebraic()); builder.append('\n'); return builder.build(); diff --git a/Userland/Libraries/LibChess/UCIEndpoint.cpp b/Userland/Libraries/LibChess/UCIEndpoint.cpp index 6c107a101c..be23d6bc7c 100644 --- a/Userland/Libraries/LibChess/UCIEndpoint.cpp +++ b/Userland/Libraries/LibChess/UCIEndpoint.cpp @@ -76,27 +76,27 @@ NonnullOwnPtr<Command> Endpoint::read_command() if (line == "uci") { return make<UCICommand>(UCICommand::from_string(line)); - } else if (line.starts_with("debug")) { + } else if (line.starts_with("debug"sv)) { return make<DebugCommand>(DebugCommand::from_string(line)); - } else if (line.starts_with("isready")) { + } else if (line.starts_with("isready"sv)) { return make<IsReadyCommand>(IsReadyCommand::from_string(line)); - } else if (line.starts_with("setoption")) { + } else if (line.starts_with("setoption"sv)) { return make<SetOptionCommand>(SetOptionCommand::from_string(line)); - } else if (line.starts_with("position")) { + } else if (line.starts_with("position"sv)) { return make<PositionCommand>(PositionCommand::from_string(line)); - } else if (line.starts_with("go")) { + } else if (line.starts_with("go"sv)) { return make<GoCommand>(GoCommand::from_string(line)); - } else if (line.starts_with("stop")) { + } else if (line.starts_with("stop"sv)) { return make<StopCommand>(StopCommand::from_string(line)); - } else if (line.starts_with("id")) { + } else if (line.starts_with("id"sv)) { return make<IdCommand>(IdCommand::from_string(line)); - } else if (line.starts_with("uciok")) { + } else if (line.starts_with("uciok"sv)) { return make<UCIOkCommand>(UCIOkCommand::from_string(line)); - } else if (line.starts_with("readyok")) { + } else if (line.starts_with("readyok"sv)) { return make<ReadyOkCommand>(ReadyOkCommand::from_string(line)); - } else if (line.starts_with("bestmove")) { + } else if (line.starts_with("bestmove"sv)) { return make<BestMoveCommand>(BestMoveCommand::from_string(line)); - } else if (line.starts_with("info")) { + } else if (line.starts_with("info"sv)) { return make<InfoCommand>(InfoCommand::from_string(line)); } diff --git a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp index 7cfed25df1..c32aa6345b 100644 --- a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp +++ b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp @@ -740,7 +740,7 @@ Optional<Vector<CodeComprehension::AutocompleteResultEntry>> CppComprehensionEng // FIXME: Don't dismiss the autocomplete when filling these suggestions. auto completion = String::formatted("{}{}{}/", prefix, include_dir, path); options.empend(completion, include_dir.length() + partial_basename.length() + 1, CodeComprehension::Language::Cpp, path, CodeComprehension::AutocompleteResultEntry::HideAutocompleteAfterApplying::No); - } else if (path.ends_with(".h")) { + } else if (path.ends_with(".h"sv)) { // FIXME: Place the cursor after the trailing > or ", even if it was // already typed. auto completion = String::formatted("{}{}{}{}", prefix, include_dir, path, already_has_suffix ? "" : suffix); @@ -784,7 +784,7 @@ CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(St CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(StringView qualified_name) { - auto parts = qualified_name.split_view("::"); + auto parts = qualified_name.split_view("::"sv); VERIFY(!parts.is_empty()); auto name = parts.take_last(); return SymbolName::create(name, move(parts)); diff --git a/Userland/Libraries/LibCodeComprehension/Cpp/Tests.cpp b/Userland/Libraries/LibCodeComprehension/Cpp/Tests.cpp index 890a0c532e..ad0fe9809d 100644 --- a/Userland/Libraries/LibCodeComprehension/Cpp/Tests.cpp +++ b/Userland/Libraries/LibCodeComprehension/Cpp/Tests.cpp @@ -33,7 +33,7 @@ static bool s_some_test_failed = false; return; \ } while (0) -constexpr char TESTS_ROOT_DIR[] = "/home/anon/Tests/cpp-tests/comprehension"; +constexpr auto TESTS_ROOT_DIR = "/home/anon/Tests/cpp-tests/comprehension"sv; class FileDB : public CodeComprehension::FileDB { public: diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index 77ce8e6efd..98cbd41bdd 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -32,7 +32,7 @@ static String get_salt() fill_with_random(random_data, sizeof(random_data)); StringBuilder builder; - builder.append("$5$"); + builder.append("$5$"sv); builder.append(encode_base64(ReadonlyBytes(random_data, sizeof(random_data)))); return builder.build(); diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp index 798a89fa2b..570a314314 100644 --- a/Userland/Libraries/LibCore/ArgsParser.cpp +++ b/Userland/Libraries/LibCore/ArgsParser.cpp @@ -743,7 +743,7 @@ void ArgsParser::autocomplete(FILE* file, StringView program_name, Span<char con continue; } - if (argument.starts_with("--")) { + if (argument.starts_with("--"sv)) { option_to_complete = argument; completing_option = true; @@ -799,7 +799,7 @@ void ArgsParser::autocomplete(FILE* file, StringView program_name, Span<char con outln(file, "{}", object.to_string()); }; - if (option_to_complete.starts_with("--")) { + if (option_to_complete.starts_with("--"sv)) { // Complete a long option. auto option_pattern = option_to_complete.substring_view(2); for (auto& option : m_options) { diff --git a/Userland/Libraries/LibCore/DateTime.cpp b/Userland/Libraries/LibCore/DateTime.cpp index 9da50d5c46..4a5dc66c04 100644 --- a/Userland/Libraries/LibCore/DateTime.cpp +++ b/Userland/Libraries/LibCore/DateTime.cpp @@ -173,7 +173,7 @@ String DateTime::to_string(StringView format) const builder.append('\n'); break; case 'p': - builder.append(tm.tm_hour < 12 ? "AM" : "PM"); + builder.append(tm.tm_hour < 12 ? "AM"sv : "PM"sv); break; case 'r': { int display_hour = tm.tm_hour % 12; @@ -240,11 +240,11 @@ String DateTime::to_string(StringView format) const break; case ':': if (++i == format_len) { - builder.append("%:"); + builder.append("%:"sv); break; } if (format[i] != 'z') { - builder.append("%:"); + builder.append("%:"sv); builder.append(format[i]); break; } diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index a255fa287b..8916e9c2e7 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -217,7 +217,7 @@ public: void handle_request(JsonObject const& request) { - auto type = request.get("type").as_string_or({}); + auto type = request.get("type"sv).as_string_or({}); if (type.is_null()) { dbgln("RPC client sent request without type field"); @@ -255,7 +255,7 @@ public: } if (type == "SetInspectedObject") { - auto address = request.get("address").to_number<FlatPtr>(); + auto address = request.get("address"sv).to_number<FlatPtr>(); for (auto& object : Object::all_objects()) { if ((FlatPtr)&object == address) { if (auto inspected_object = m_inspected_object.strong_ref()) @@ -269,10 +269,10 @@ public: } if (type == "SetProperty") { - auto address = request.get("address").to_number<FlatPtr>(); + auto address = request.get("address"sv).to_number<FlatPtr>(); for (auto& object : Object::all_objects()) { if ((FlatPtr)&object == address) { - bool success = object.set_property(request.get("name").to_string(), request.get("value")); + bool success = object.set_property(request.get("name"sv).to_string(), request.get("value"sv)); JsonObject response; response.set("type", "SetProperty"); response.set("success", success); diff --git a/Userland/Libraries/LibCore/FileWatcher.h b/Userland/Libraries/LibCore/FileWatcher.h index c8d70011dd..b19f844fca 100644 --- a/Userland/Libraries/LibCore/FileWatcher.h +++ b/Userland/Libraries/LibCore/FileWatcher.h @@ -87,7 +87,7 @@ template<> struct Formatter<Core::FileWatcherEvent> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, Core::FileWatcherEvent const& value) { - return Formatter<FormatString>::format(builder, "FileWatcherEvent(\"{}\", {})", value.event_path, value.type); + return Formatter<FormatString>::format(builder, "FileWatcherEvent(\"{}\", {})"sv, value.event_path, value.type); } }; @@ -95,22 +95,22 @@ template<> struct Formatter<Core::FileWatcherEvent::Type> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, Core::FileWatcherEvent::Type const& value) { - char const* type; + StringView type; switch (value) { case Core::FileWatcherEvent::Type::ChildCreated: - type = "ChildCreated"; + type = "ChildCreated"sv; break; case Core::FileWatcherEvent::Type::ChildDeleted: - type = "ChildDeleted"; + type = "ChildDeleted"sv; break; case Core::FileWatcherEvent::Type::Deleted: - type = "Deleted"; + type = "Deleted"sv; break; case Core::FileWatcherEvent::Type::ContentModified: - type = "ContentModified"; + type = "ContentModified"sv; break; case Core::FileWatcherEvent::Type::MetadataModified: - type = "MetadataModified"; + type = "MetadataModified"sv; break; default: VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibCore/LocalServer.cpp b/Userland/Libraries/LibCore/LocalServer.cpp index fcbd687278..6430fd6d21 100644 --- a/Userland/Libraries/LibCore/LocalServer.cpp +++ b/Userland/Libraries/LibCore/LocalServer.cpp @@ -120,7 +120,7 @@ ErrorOr<NonnullOwnPtr<Stream::LocalSocket>> LocalServer::accept() int accepted_fd = ::accept(m_fd, (sockaddr*)&un, &un_size); #endif if (accepted_fd < 0) { - return Error::from_syscall("accept", -errno); + return Error::from_syscall("accept"sv, -errno); } #ifdef AK_OS_MACOS diff --git a/Userland/Libraries/LibCore/MimeData.cpp b/Userland/Libraries/LibCore/MimeData.cpp index 4ee2a3d955..23aac4c320 100644 --- a/Userland/Libraries/LibCore/MimeData.cpp +++ b/Userland/Libraries/LibCore/MimeData.cpp @@ -53,54 +53,54 @@ void MimeData::set_text(String const& text) String guess_mime_type_based_on_filename(StringView path) { - if (path.ends_with(".pbm", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".pbm"sv, CaseSensitivity::CaseInsensitive)) return "image/x‑portable‑bitmap"; - if (path.ends_with(".pgm", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".pgm"sv, CaseSensitivity::CaseInsensitive)) return "image/x‑portable‑graymap"; - if (path.ends_with(".png", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".png"sv, CaseSensitivity::CaseInsensitive)) return "image/png"; - if (path.ends_with(".ppm", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".ppm"sv, CaseSensitivity::CaseInsensitive)) return "image/x‑portable‑pixmap"; - if (path.ends_with(".gif", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".gif"sv, CaseSensitivity::CaseInsensitive)) return "image/gif"; - if (path.ends_with(".bmp", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".bmp"sv, CaseSensitivity::CaseInsensitive)) return "image/bmp"; - if (path.ends_with(".jpg", CaseSensitivity::CaseInsensitive) || path.ends_with(".jpeg", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".jpg"sv, CaseSensitivity::CaseInsensitive) || path.ends_with(".jpeg"sv, CaseSensitivity::CaseInsensitive)) return "image/jpeg"; - if (path.ends_with(".qoi", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".qoi"sv, CaseSensitivity::CaseInsensitive)) return "image/x-qoi"; - if (path.ends_with(".svg", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".svg"sv, CaseSensitivity::CaseInsensitive)) return "image/svg+xml"; - if (path.ends_with(".md", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".md"sv, CaseSensitivity::CaseInsensitive)) return "text/markdown"; - if (path.ends_with(".html", CaseSensitivity::CaseInsensitive) || path.ends_with(".htm", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".html"sv, CaseSensitivity::CaseInsensitive) || path.ends_with(".htm"sv, CaseSensitivity::CaseInsensitive)) return "text/html"; - if (path.ends_with(".css", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".css"sv, CaseSensitivity::CaseInsensitive)) return "text/css"; - if (path.ends_with(".js", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".js"sv, CaseSensitivity::CaseInsensitive)) return "application/javascript"; - if (path.ends_with(".json", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".json"sv, CaseSensitivity::CaseInsensitive)) return "application/json"; - if (path.ends_with(".zip", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".zip"sv, CaseSensitivity::CaseInsensitive)) return "application/zip"; - if (path.ends_with(".md", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".md"sv, CaseSensitivity::CaseInsensitive)) return "text/markdown"; - if (path.ends_with("/", CaseSensitivity::CaseInsensitive)) + if (path.ends_with("/"sv, CaseSensitivity::CaseInsensitive)) return "text/html"; - if (path.ends_with(".csv", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".csv"sv, CaseSensitivity::CaseInsensitive)) return "text/csv"; - if (path.ends_with(".sheets", CaseSensitivity::CaseInsensitive)) + if (path.ends_with(".sheets"sv, CaseSensitivity::CaseInsensitive)) return "application/x-sheets+json"; // FIXME: Share this, TextEditor and HackStudio language detection somehow. auto basename = LexicalPath::basename(path); - if (path.ends_with(".cpp", CaseSensitivity::CaseInsensitive) - || path.ends_with(".c", CaseSensitivity::CaseInsensitive) - || path.ends_with(".hpp", CaseSensitivity::CaseInsensitive) - || path.ends_with(".h", CaseSensitivity::CaseInsensitive) - || path.ends_with(".gml", CaseSensitivity::CaseInsensitive) - || path.ends_with(".ini", CaseSensitivity::CaseInsensitive) - || path.ends_with(".ipc", CaseSensitivity::CaseInsensitive) - || path.ends_with(".txt", CaseSensitivity::CaseInsensitive) + if (path.ends_with(".cpp"sv, CaseSensitivity::CaseInsensitive) + || path.ends_with(".c"sv, CaseSensitivity::CaseInsensitive) + || path.ends_with(".hpp"sv, CaseSensitivity::CaseInsensitive) + || path.ends_with(".h"sv, CaseSensitivity::CaseInsensitive) + || path.ends_with(".gml"sv, CaseSensitivity::CaseInsensitive) + || path.ends_with(".ini"sv, CaseSensitivity::CaseInsensitive) + || path.ends_with(".ipc"sv, CaseSensitivity::CaseInsensitive) + || path.ends_with(".txt"sv, CaseSensitivity::CaseInsensitive) || basename == "CMakeLists.txt" || basename == ".history" || basename == ".shellrc") diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h index 7e361b4fd7..33a1fbf443 100644 --- a/Userland/Libraries/LibCore/Object.h +++ b/Userland/Libraries/LibCore/Object.h @@ -22,18 +22,18 @@ namespace Core { -#define REGISTER_ABSTRACT_CORE_OBJECT(namespace_, class_name) \ - namespace Core { \ - namespace Registration { \ - Core::ObjectClassRegistration registration_##class_name(#namespace_ "::" #class_name, []() { return RefPtr<Object>(); }); \ - } \ +#define REGISTER_ABSTRACT_CORE_OBJECT(namespace_, class_name) \ + namespace Core { \ + namespace Registration { \ + Core::ObjectClassRegistration registration_##class_name(#namespace_ "::" #class_name##sv, []() { return RefPtr<Object>(); }); \ + } \ } -#define REGISTER_CORE_OBJECT(namespace_, class_name) \ - namespace Core { \ - namespace Registration { \ - Core::ObjectClassRegistration registration_##class_name(#namespace_ "::" #class_name, []() { return namespace_::class_name::construct(); }); \ - } \ +#define REGISTER_CORE_OBJECT(namespace_, class_name) \ + namespace Core { \ + namespace Registration { \ + Core::ObjectClassRegistration registration_##class_name(#namespace_ "::" #class_name##sv, []() { return namespace_::class_name::construct(); }); \ + } \ } class ObjectClassRegistration { @@ -67,7 +67,7 @@ enum class TimerShouldFireWhenNotVisible { #define C_OBJECT(klass) \ public: \ - virtual StringView class_name() const override { return #klass; } \ + virtual StringView class_name() const override { return #klass##sv; } \ template<typename Klass = klass, class... Args> \ static NonnullRefPtr<klass> construct(Args&&... args) \ { \ @@ -81,7 +81,7 @@ public: #define C_OBJECT_ABSTRACT(klass) \ public: \ - virtual StringView class_name() const override { return #klass; } + virtual StringView class_name() const override { return #klass##sv; } class Object : public RefCounted<Object> @@ -215,7 +215,7 @@ template<> struct AK::Formatter<Core::Object> : AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, Core::Object const& value) { - return AK::Formatter<FormatString>::format(builder, "{}({})", value.class_name(), &value); + return AK::Formatter<FormatString>::format(builder, "{}({})"sv, value.class_name(), &value); } }; @@ -306,28 +306,28 @@ T* Object::find_descendant_of_type_named(String const& name) requires IsBaseOf<O }, \ {}); -#define REGISTER_RECT_PROPERTY(property_name, getter, setter) \ - register_property( \ - property_name, \ - [this] { \ - auto rect = this->getter(); \ - JsonObject rect_object; \ - rect_object.set("x", rect.x()); \ - rect_object.set("y", rect.y()); \ - rect_object.set("width", rect.width()); \ - rect_object.set("height", rect.height()); \ - return rect_object; \ - }, \ - [this](auto& value) { \ - if (!value.is_object()) \ - return false; \ - Gfx::IntRect rect; \ - rect.set_x(value.as_object().get("x").to_i32()); \ - rect.set_y(value.as_object().get("y").to_i32()); \ - rect.set_width(value.as_object().get("width").to_i32()); \ - rect.set_height(value.as_object().get("height").to_i32()); \ - setter(rect); \ - return true; \ +#define REGISTER_RECT_PROPERTY(property_name, getter, setter) \ + register_property( \ + property_name, \ + [this] { \ + auto rect = this->getter(); \ + JsonObject rect_object; \ + rect_object.set("x"sv, rect.x()); \ + rect_object.set("y"sv, rect.y()); \ + rect_object.set("width"sv, rect.width()); \ + rect_object.set("height"sv, rect.height()); \ + return rect_object; \ + }, \ + [this](auto& value) { \ + if (!value.is_object()) \ + return false; \ + Gfx::IntRect rect; \ + rect.set_x(value.as_object().get("x"sv).to_i32()); \ + rect.set_y(value.as_object().get("y"sv).to_i32()); \ + rect.set_width(value.as_object().get("width"sv).to_i32()); \ + rect.set_height(value.as_object().get("height"sv).to_i32()); \ + setter(rect); \ + return true; \ }); #define REGISTER_SIZE_PROPERTY(property_name, getter, setter) \ diff --git a/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp b/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp index 9a9176d4a7..979c1bc3f9 100644 --- a/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp +++ b/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp @@ -39,56 +39,56 @@ Optional<AllProcessesStatistics> ProcessStatisticsReader::get_all(RefPtr<Core::F return {}; auto& json_obj = json.value().as_object(); - json_obj.get("processes").as_array().for_each([&](auto& value) { + json_obj.get("processes"sv).as_array().for_each([&](auto& value) { const JsonObject& process_object = value.as_object(); Core::ProcessStatistics process; // kernel data first - process.pid = process_object.get("pid").to_u32(); - process.pgid = process_object.get("pgid").to_u32(); - process.pgp = process_object.get("pgp").to_u32(); - process.sid = process_object.get("sid").to_u32(); - process.uid = process_object.get("uid").to_u32(); - process.gid = process_object.get("gid").to_u32(); - process.ppid = process_object.get("ppid").to_u32(); - process.nfds = process_object.get("nfds").to_u32(); - process.kernel = process_object.get("kernel").to_bool(); - process.name = process_object.get("name").to_string(); - process.executable = process_object.get("executable").to_string(); - process.tty = process_object.get("tty").to_string(); - process.pledge = process_object.get("pledge").to_string(); - process.veil = process_object.get("veil").to_string(); - process.amount_virtual = process_object.get("amount_virtual").to_u32(); - process.amount_resident = process_object.get("amount_resident").to_u32(); - process.amount_shared = process_object.get("amount_shared").to_u32(); - process.amount_dirty_private = process_object.get("amount_dirty_private").to_u32(); - process.amount_clean_inode = process_object.get("amount_clean_inode").to_u32(); - process.amount_purgeable_volatile = process_object.get("amount_purgeable_volatile").to_u32(); - process.amount_purgeable_nonvolatile = process_object.get("amount_purgeable_nonvolatile").to_u32(); + process.pid = process_object.get("pid"sv).to_u32(); + process.pgid = process_object.get("pgid"sv).to_u32(); + process.pgp = process_object.get("pgp"sv).to_u32(); + process.sid = process_object.get("sid"sv).to_u32(); + process.uid = process_object.get("uid"sv).to_u32(); + process.gid = process_object.get("gid"sv).to_u32(); + process.ppid = process_object.get("ppid"sv).to_u32(); + process.nfds = process_object.get("nfds"sv).to_u32(); + process.kernel = process_object.get("kernel"sv).to_bool(); + process.name = process_object.get("name"sv).to_string(); + process.executable = process_object.get("executable"sv).to_string(); + process.tty = process_object.get("tty"sv).to_string(); + process.pledge = process_object.get("pledge"sv).to_string(); + process.veil = process_object.get("veil"sv).to_string(); + process.amount_virtual = process_object.get("amount_virtual"sv).to_u32(); + process.amount_resident = process_object.get("amount_resident"sv).to_u32(); + process.amount_shared = process_object.get("amount_shared"sv).to_u32(); + process.amount_dirty_private = process_object.get("amount_dirty_private"sv).to_u32(); + process.amount_clean_inode = process_object.get("amount_clean_inode"sv).to_u32(); + process.amount_purgeable_volatile = process_object.get("amount_purgeable_volatile"sv).to_u32(); + process.amount_purgeable_nonvolatile = process_object.get("amount_purgeable_nonvolatile"sv).to_u32(); - auto& thread_array = process_object.get_ptr("threads")->as_array(); + auto& thread_array = process_object.get_ptr("threads"sv)->as_array(); process.threads.ensure_capacity(thread_array.size()); thread_array.for_each([&](auto& value) { auto& thread_object = value.as_object(); Core::ThreadStatistics thread; - thread.tid = thread_object.get("tid").to_u32(); - thread.times_scheduled = thread_object.get("times_scheduled").to_u32(); - thread.name = thread_object.get("name").to_string(); - thread.state = thread_object.get("state").to_string(); - thread.time_user = thread_object.get("time_user").to_u64(); - thread.time_kernel = thread_object.get("time_kernel").to_u64(); - thread.cpu = thread_object.get("cpu").to_u32(); - thread.priority = thread_object.get("priority").to_u32(); - thread.syscall_count = thread_object.get("syscall_count").to_u32(); - thread.inode_faults = thread_object.get("inode_faults").to_u32(); - thread.zero_faults = thread_object.get("zero_faults").to_u32(); - thread.cow_faults = thread_object.get("cow_faults").to_u32(); - thread.unix_socket_read_bytes = thread_object.get("unix_socket_read_bytes").to_u32(); - thread.unix_socket_write_bytes = thread_object.get("unix_socket_write_bytes").to_u32(); - thread.ipv4_socket_read_bytes = thread_object.get("ipv4_socket_read_bytes").to_u32(); - thread.ipv4_socket_write_bytes = thread_object.get("ipv4_socket_write_bytes").to_u32(); - thread.file_read_bytes = thread_object.get("file_read_bytes").to_u32(); - thread.file_write_bytes = thread_object.get("file_write_bytes").to_u32(); + thread.tid = thread_object.get("tid"sv).to_u32(); + thread.times_scheduled = thread_object.get("times_scheduled"sv).to_u32(); + thread.name = thread_object.get("name"sv).to_string(); + thread.state = thread_object.get("state"sv).to_string(); + thread.time_user = thread_object.get("time_user"sv).to_u64(); + thread.time_kernel = thread_object.get("time_kernel"sv).to_u64(); + thread.cpu = thread_object.get("cpu"sv).to_u32(); + thread.priority = thread_object.get("priority"sv).to_u32(); + thread.syscall_count = thread_object.get("syscall_count"sv).to_u32(); + thread.inode_faults = thread_object.get("inode_faults"sv).to_u32(); + thread.zero_faults = thread_object.get("zero_faults"sv).to_u32(); + thread.cow_faults = thread_object.get("cow_faults"sv).to_u32(); + thread.unix_socket_read_bytes = thread_object.get("unix_socket_read_bytes"sv).to_u32(); + thread.unix_socket_write_bytes = thread_object.get("unix_socket_write_bytes"sv).to_u32(); + thread.ipv4_socket_read_bytes = thread_object.get("ipv4_socket_read_bytes"sv).to_u32(); + thread.ipv4_socket_write_bytes = thread_object.get("ipv4_socket_write_bytes"sv).to_u32(); + thread.file_read_bytes = thread_object.get("file_read_bytes"sv).to_u32(); + thread.file_write_bytes = thread_object.get("file_write_bytes"sv).to_u32(); process.threads.append(move(thread)); }); @@ -97,8 +97,8 @@ Optional<AllProcessesStatistics> ProcessStatisticsReader::get_all(RefPtr<Core::F all_processes_statistics.processes.append(move(process)); }); - all_processes_statistics.total_time_scheduled = json_obj.get("total_time").to_u64(); - all_processes_statistics.total_time_scheduled_kernel = json_obj.get("total_time_kernel").to_u64(); + all_processes_statistics.total_time_scheduled = json_obj.get("total_time"sv).to_u64(); + all_processes_statistics.total_time_scheduled_kernel = json_obj.get("total_time_kernel"sv).to_u64(); return all_processes_statistics; } diff --git a/Userland/Libraries/LibCore/SOCKSProxyClient.cpp b/Userland/Libraries/LibCore/SOCKSProxyClient.cpp index c71535b16c..1acd206fb3 100644 --- a/Userland/Libraries/LibCore/SOCKSProxyClient.cpp +++ b/Userland/Libraries/LibCore/SOCKSProxyClient.cpp @@ -74,23 +74,23 @@ StringView reply_response_name(Reply reply) { switch (reply) { case Reply::Succeeded: - return "Succeeded"; + return "Succeeded"sv; case Reply::GeneralSocksServerFailure: - return "GeneralSocksServerFailure"; + return "GeneralSocksServerFailure"sv; case Reply::ConnectionNotAllowedByRuleset: - return "ConnectionNotAllowedByRuleset"; + return "ConnectionNotAllowedByRuleset"sv; case Reply::NetworkUnreachable: - return "NetworkUnreachable"; + return "NetworkUnreachable"sv; case Reply::HostUnreachable: - return "HostUnreachable"; + return "HostUnreachable"sv; case Reply::ConnectionRefused: - return "ConnectionRefused"; + return "ConnectionRefused"sv; case Reply::TTLExpired: - return "TTLExpired"; + return "TTLExpired"sv; case Reply::CommandNotSupported: - return "CommandNotSupported"; + return "CommandNotSupported"sv; case Reply::AddressTypeNotSupported: - return "AddressTypeNotSupported"; + return "AddressTypeNotSupported"sv; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibCore/StandardPaths.cpp b/Userland/Libraries/LibCore/StandardPaths.cpp index 1c286e01a1..2398b6f925 100644 --- a/Userland/Libraries/LibCore/StandardPaths.cpp +++ b/Userland/Libraries/LibCore/StandardPaths.cpp @@ -29,7 +29,7 @@ String StandardPaths::desktop_directory() { StringBuilder builder; builder.append(home_directory()); - builder.append("/Desktop"); + builder.append("/Desktop"sv); return LexicalPath::canonicalized_path(builder.to_string()); } @@ -37,7 +37,7 @@ String StandardPaths::downloads_directory() { StringBuilder builder; builder.append(home_directory()); - builder.append("/Downloads"); + builder.append("/Downloads"sv); return LexicalPath::canonicalized_path(builder.to_string()); } @@ -45,7 +45,7 @@ String StandardPaths::config_directory() { StringBuilder builder; builder.append(home_directory()); - builder.append("/.config"); + builder.append("/.config"sv); return LexicalPath::canonicalized_path(builder.to_string()); } diff --git a/Userland/Libraries/LibCore/Stream.cpp b/Userland/Libraries/LibCore/Stream.cpp index c1d25ae29f..5debcb987a 100644 --- a/Userland/Libraries/LibCore/Stream.cpp +++ b/Userland/Libraries/LibCore/Stream.cpp @@ -333,7 +333,7 @@ ErrorOr<IPv4Address> Socket::resolve_host(String const& host, SocketType type) int rc = getaddrinfo(host.characters(), nullptr, &hints, &results); if (rc != 0) { if (rc == EAI_SYSTEM) { - return Error::from_syscall("getaddrinfo", -errno); + return Error::from_syscall("getaddrinfo"sv, -errno); } auto const* error_string = gai_strerror(rc); @@ -423,7 +423,7 @@ ErrorOr<bool> PosixSocketHelper::can_read_without_blocking(int timeout) const } while (rc < 0 && errno == EINTR); if (rc < 0) { - return Error::from_syscall("poll", -errno); + return Error::from_syscall("poll"sv, -errno); } return (the_fd.revents & POLLIN) > 0; diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index e518320614..a3b1972bdf 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -44,7 +44,7 @@ static int memfd_create(char const* name, unsigned int flags) #define HANDLE_SYSCALL_RETURN_VALUE(syscall_name, rc, success_value) \ if ((rc) < 0) { \ - return Error::from_syscall(syscall_name, rc); \ + return Error::from_syscall(syscall_name##sv, rc); \ } \ return success_value; @@ -75,7 +75,7 @@ ErrorOr<void> pledge(StringView promises, StringView execpromises) { execpromises.characters_without_null_termination(), execpromises.length() }, }; int rc = syscall(SC_pledge, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("pledge"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("pledge", rc, {}); } ErrorOr<void> unveil(StringView path, StringView permissions) @@ -85,7 +85,7 @@ ErrorOr<void> unveil(StringView path, StringView permissions) { permissions.characters_without_null_termination(), permissions.length() }, }; int rc = syscall(SC_unveil, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("unveil"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("unveil", rc, {}); } ErrorOr<void> sendfd(int sockfd, int fd) @@ -342,7 +342,7 @@ ErrorOr<int> openat(int fd, StringView path, int options, mode_t mode) #ifdef __serenity__ Syscall::SC_open_params params { fd, { path.characters_without_null_termination(), path.length() }, options, mode }; int rc = syscall(SC_open, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("open"sv, rc, rc); + HANDLE_SYSCALL_RETURN_VALUE("open", rc, rc); #else // NOTE: We have to ensure that the path is null-terminated. String path_string = path; @@ -376,7 +376,7 @@ ErrorOr<struct stat> stat(StringView path) #ifdef __serenity__ Syscall::SC_stat_params params { { path.characters_without_null_termination(), path.length() }, &st, AT_FDCWD, true }; int rc = syscall(SC_stat, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("stat"sv, rc, st); + HANDLE_SYSCALL_RETURN_VALUE("stat", rc, st); #else String path_string = path; if (::stat(path_string.characters(), &st) < 0) @@ -394,7 +394,7 @@ ErrorOr<struct stat> lstat(StringView path) #ifdef __serenity__ Syscall::SC_stat_params params { { path.characters_without_null_termination(), path.length() }, &st, AT_FDCWD, false }; int rc = syscall(SC_stat, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("lstat"sv, rc, st); + HANDLE_SYSCALL_RETURN_VALUE("lstat", rc, st); #else String path_string = path; if (::stat(path_string.characters(), &st) < 0) @@ -532,7 +532,7 @@ ErrorOr<void> chmod(StringView pathname, mode_t mode) true }; int rc = syscall(SC_chmod, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("chmod"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("chmod", rc, {}); #else String path = pathname; if (::chmod(path.characters(), mode) < 0) @@ -563,7 +563,7 @@ ErrorOr<void> lchown(StringView pathname, uid_t uid, gid_t gid) #ifdef __serenity__ Syscall::SC_chown_params params = { { pathname.characters_without_null_termination(), pathname.length() }, uid, gid, AT_FDCWD, false }; int rc = syscall(SC_chown, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("chown"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("chown", rc, {}); #else String path = pathname; if (::chown(path.characters(), uid, gid) < 0) @@ -580,7 +580,7 @@ ErrorOr<void> chown(StringView pathname, uid_t uid, gid_t gid) #ifdef __serenity__ Syscall::SC_chown_params params = { { pathname.characters_without_null_termination(), pathname.length() }, uid, gid, AT_FDCWD, true }; int rc = syscall(SC_chown, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("chown"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("chown", rc, {}); #else String path = pathname; if (::lchown(path.characters(), uid, gid) < 0) @@ -653,7 +653,7 @@ ErrorOr<void> clock_settime(clockid_t clock_id, struct timespec* ts) { #ifdef __serenity__ int rc = syscall(SC_clock_settime, clock_id, ts); - HANDLE_SYSCALL_RETURN_VALUE("clocksettime"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("clocksettime", rc, {}); #else if (::clock_settime(clock_id, ts) < 0) return Error::from_syscall("clocksettime"sv, -errno); @@ -683,7 +683,7 @@ ErrorOr<off_t> lseek(int fd, off_t offset, int whence) { off_t rc = ::lseek(fd, offset, whence); if (rc < 0) - return Error::from_syscall("lseek", -errno); + return Error::from_syscall("lseek"sv, -errno); return rc; } @@ -693,7 +693,7 @@ ErrorOr<void> endgrent() swap(old_errno, errno); ::endgrent(); if (errno != 0) - return Error::from_syscall("endgrent", -errno); + return Error::from_syscall("endgrent"sv, -errno); errno = old_errno; return {}; } @@ -777,7 +777,7 @@ ErrorOr<void> symlink(StringView target, StringView link_path) .linkpath = { link_path.characters_without_null_termination(), link_path.length() }, }; int rc = syscall(SC_symlink, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("symlink"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("symlink", rc, {}); #else String target_string = target; String link_path_string = link_path; @@ -793,7 +793,7 @@ ErrorOr<void> mkdir(StringView path, mode_t mode) return Error::from_errno(EFAULT); #ifdef __serenity__ int rc = syscall(SC_mkdir, path.characters_without_null_termination(), path.length(), mode); - HANDLE_SYSCALL_RETURN_VALUE("mkdir"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("mkdir", rc, {}); #else String path_string = path; if (::mkdir(path_string.characters(), mode) < 0) @@ -808,7 +808,7 @@ ErrorOr<void> chdir(StringView path) return Error::from_errno(EFAULT); #ifdef __serenity__ int rc = syscall(SC_chdir, path.characters_without_null_termination(), path.length()); - HANDLE_SYSCALL_RETURN_VALUE("chdir"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("chdir", rc, {}); #else String path_string = path; if (::chdir(path_string.characters()) < 0) @@ -823,7 +823,7 @@ ErrorOr<void> rmdir(StringView path) return Error::from_errno(EFAULT); #ifdef __serenity__ int rc = syscall(SC_rmdir, path.characters_without_null_termination(), path.length()); - HANDLE_SYSCALL_RETURN_VALUE("rmdir"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("rmdir", rc, {}); #else String path_string = path; if (::rmdir(path_string.characters()) < 0) @@ -859,7 +859,7 @@ ErrorOr<void> rename(StringView old_path, StringView new_path) .new_path = { new_path.characters_without_null_termination(), new_path.length() }, }; int rc = syscall(SC_rename, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("rename"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("rename", rc, {}); #else String old_path_string = old_path; String new_path_string = new_path; @@ -876,7 +876,7 @@ ErrorOr<void> unlink(StringView path) #ifdef __serenity__ int rc = syscall(SC_unlink, AT_FDCWD, path.characters_without_null_termination(), path.length(), 0); - HANDLE_SYSCALL_RETURN_VALUE("unlink"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("unlink", rc, {}); #else String path_string = path; if (::unlink(path_string.characters()) < 0) @@ -895,7 +895,7 @@ ErrorOr<void> utime(StringView path, Optional<struct utimbuf> maybe_buf) buf = &maybe_buf.value(); #ifdef __serenity__ int rc = syscall(SC_utime, path.characters_without_null_termination(), path.length(), buf); - HANDLE_SYSCALL_RETURN_VALUE("utime"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("utime", rc, {}); #else String path_string = path; if (::utime(path_string.characters(), buf) < 0) @@ -909,7 +909,7 @@ ErrorOr<struct utsname> uname() utsname uts; #ifdef __serenity__ int rc = syscall(SC_uname, &uts); - HANDLE_SYSCALL_RETURN_VALUE("uname"sv, rc, uts); + HANDLE_SYSCALL_RETURN_VALUE("uname", rc, uts); #else if (::uname(&uts) < 0) return Error::from_syscall("uname"sv, -errno); @@ -921,7 +921,7 @@ ErrorOr<void> adjtime(const struct timeval* delta, struct timeval* old_delta) { #ifdef __serenity__ int rc = syscall(SC_adjtime, delta, old_delta); - HANDLE_SYSCALL_RETURN_VALUE("adjtime"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("adjtime", rc, {}); #else if (::adjtime(delta, old_delta) < 0) return Error::from_syscall("adjtime"sv, -errno); @@ -973,7 +973,7 @@ ErrorOr<void> exec(StringView filename, Span<StringView> arguments, SearchInPath auto const* path_ptr = getenv("PATH"); StringView path { path_ptr, strlen(path_ptr) }; if (path.is_empty()) - path = "/bin:/usr/bin"; + path = "/bin:/usr/bin"sv; auto parts = path.split_view(':'); for (auto& part : parts) { auto candidate = String::formatted("{}/{}", part, filename); @@ -1214,7 +1214,7 @@ ErrorOr<void> mknod(StringView pathname, mode_t mode, dev_t dev) #ifdef __serenity__ Syscall::SC_mknod_params params { { pathname.characters_without_null_termination(), pathname.length() }, mode, dev }; int rc = syscall(SC_mknod, ¶ms); - HANDLE_SYSCALL_RETURN_VALUE("mknod"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("mknod", rc, {}); #else String path_string = pathname; if (::mknod(path_string.characters(), mode, dev) < 0) @@ -1238,7 +1238,7 @@ ErrorOr<void> setenv(StringView name, StringView value, bool overwrite) auto const rc = ::setenv(name_string.characters(), value_string.characters(), overwrite); #endif if (rc < 0) - return Error::from_syscall("setenv", -errno); + return Error::from_syscall("setenv"sv, -errno); return {}; } @@ -1246,7 +1246,7 @@ ErrorOr<int> posix_openpt(int flags) { int const rc = ::posix_openpt(flags); if (rc < 0) - return Error::from_syscall("posix_openpt", -errno); + return Error::from_syscall("posix_openpt"sv, -errno); return rc; } @@ -1254,7 +1254,7 @@ ErrorOr<void> grantpt(int fildes) { auto const rc = ::grantpt(fildes); if (rc < 0) - return Error::from_syscall("grantpt", -errno); + return Error::from_syscall("grantpt"sv, -errno); return {}; } @@ -1262,7 +1262,7 @@ ErrorOr<void> unlockpt(int fildes) { auto const rc = ::unlockpt(fildes); if (rc < 0) - return Error::from_syscall("unlockpt", -errno); + return Error::from_syscall("unlockpt"sv, -errno); return {}; } @@ -1273,7 +1273,7 @@ ErrorOr<void> access(StringView pathname, int mode) #ifdef __serenity__ int rc = ::syscall(Syscall::SC_access, pathname.characters_without_null_termination(), pathname.length(), mode); - HANDLE_SYSCALL_RETURN_VALUE("access"sv, rc, {}); + HANDLE_SYSCALL_RETURN_VALUE("access", rc, {}); #else String path_string = pathname; if (::access(path_string.characters(), mode) < 0) diff --git a/Userland/Libraries/LibCoredump/Backtrace.cpp b/Userland/Libraries/LibCoredump/Backtrace.cpp index f063e30c80..5dae26eef6 100644 --- a/Userland/Libraries/LibCoredump/Backtrace.cpp +++ b/Userland/Libraries/LibCoredump/Backtrace.cpp @@ -127,11 +127,11 @@ String Backtrace::Entry::to_string(bool color) const StringBuilder builder; builder.appendff("{:p}: ", eip); if (object_name.is_empty()) { - builder.append("???"); + builder.append("???"sv); return builder.build(); } builder.appendff("[{}] {}", object_name, function_name.is_empty() ? "???" : function_name); - builder.append(" ("); + builder.append(" ("sv); Vector<Debug::DebugInfo::SourcePosition> source_positions; @@ -146,10 +146,10 @@ String Backtrace::Entry::to_string(bool color) const for (size_t i = 0; i < source_positions.size(); ++i) { auto& position = source_positions[i]; - auto fmt = color ? "\033[34;1m{}\033[0m:{}" : "{}:{}"; + auto fmt = color ? "\033[34;1m{}\033[0m:{}"sv : "{}:{}"sv; builder.appendff(fmt, LexicalPath::basename(position.file_path), position.line_number); if (i != source_positions.size() - 1) { - builder.append(" => "); + builder.append(" => "sv); } } diff --git a/Userland/Libraries/LibCoredump/Reader.cpp b/Userland/Libraries/LibCoredump/Reader.cpp index 05c77f8584..ed38e8b41f 100644 --- a/Userland/Libraries/LibCoredump/Reader.cpp +++ b/Userland/Libraries/LibCoredump/Reader.cpp @@ -196,14 +196,14 @@ Optional<MemoryRegionInfo> Reader::region_containing(FlatPtr address) const int Reader::process_pid() const { auto process_info = this->process_info(); - auto pid = process_info.get("pid"); + auto pid = process_info.get("pid"sv); return pid.to_number<int>(); } u8 Reader::process_termination_signal() const { auto process_info = this->process_info(); - auto termination_signal = process_info.get("termination_signal"); + auto termination_signal = process_info.get("termination_signal"sv); auto signal_number = termination_signal.to_number<u8>(); if (signal_number <= SIGINVAL || signal_number >= NSIG) return SIGINVAL; @@ -213,14 +213,14 @@ u8 Reader::process_termination_signal() const String Reader::process_executable_path() const { auto process_info = this->process_info(); - auto executable_path = process_info.get("executable_path"); + auto executable_path = process_info.get("executable_path"sv); return executable_path.as_string_or({}); } Vector<String> Reader::process_arguments() const { auto process_info = this->process_info(); - auto arguments = process_info.get("arguments"); + auto arguments = process_info.get("arguments"sv); if (!arguments.is_array()) return {}; Vector<String> vector; @@ -234,7 +234,7 @@ Vector<String> Reader::process_arguments() const Vector<String> Reader::process_environment() const { auto process_info = this->process_info(); - auto environment = process_info.get("environment"); + auto environment = process_info.get("environment"sv); if (!environment.is_array()) return {}; Vector<String> vector; diff --git a/Userland/Libraries/LibCoredump/Reader.h b/Userland/Libraries/LibCoredump/Reader.h index 48a5fca355..3e99ec88fa 100644 --- a/Userland/Libraries/LibCoredump/Reader.h +++ b/Userland/Libraries/LibCoredump/Reader.h @@ -26,7 +26,7 @@ struct MemoryRegionInfo { StringView object_name() const { - if (region_name.contains("Loader.so")) + if (region_name.contains("Loader.so"sv)) return "Loader.so"sv; auto maybe_colon_index = region_name.find(':'); if (!maybe_colon_index.has_value()) diff --git a/Userland/Libraries/LibCpp/AST.cpp b/Userland/Libraries/LibCpp/AST.cpp index 65483a5426..19f2b60cca 100644 --- a/Userland/Libraries/LibCpp/AST.cpp +++ b/Userland/Libraries/LibCpp/AST.cpp @@ -85,7 +85,7 @@ String NamedType::to_string() const if (is_auto()) name = "auto"; else - name = m_name.is_null() ? "" : m_name->full_name(); + name = m_name.is_null() ? ""sv : m_name->full_name(); return String::formatted("{}{}", qualifiers_string, name); } @@ -109,7 +109,7 @@ String Reference::to_string() const if (m_kind == Kind::Lvalue) builder.append("&"); else - builder.append("&&"); + builder.append("&&"sv); return builder.to_string(); } @@ -123,7 +123,7 @@ String FunctionType::to_string() const if (first) first = false; else - builder.append(", "); + builder.append(", "sv); if (parameter.type()) builder.append(parameter.type()->to_string()); if (parameter.name() && !parameter.full_name().is_empty()) { @@ -552,7 +552,7 @@ StringView Name::full_name() const builder.appendff("{}::", scope.name()); } } - m_full_name = String::formatted("{}{}", builder.to_string(), m_name.is_null() ? "" : m_name->name()); + m_full_name = String::formatted("{}{}", builder.to_string(), m_name.is_null() ? ""sv : m_name->name()); return *m_full_name; } diff --git a/Userland/Libraries/LibCpp/Lexer.cpp b/Userland/Libraries/LibCpp/Lexer.cpp index 5696fcad1c..db5fc33cfa 100644 --- a/Userland/Libraries/LibCpp/Lexer.cpp +++ b/Userland/Libraries/LibCpp/Lexer.cpp @@ -52,155 +52,155 @@ constexpr bool is_valid_nonfirst_character_of_identifier(char ch) } constexpr StringView s_known_keywords[] = { - "alignas", - "alignof", - "and", - "and_eq", - "asm", - "bitand", - "bitor", - "break", - "case", - "catch", - "class", - "compl", - "const", - "const_cast", - "constexpr", - "continue", - "decltype", - "default", - "delete", - "do", - "dynamic_cast", - "else", - "enum", - "explicit", - "export", - "extern", - "false", - "final", - "for", - "friend", - "goto", - "if", - "inline", - "mutable", - "namespace", - "new", - "noexcept", - "not", - "not_eq", - "nullptr", - "operator", - "or", - "or_eq", - "override", - "private", - "protected", - "public", - "register", - "reinterpret_cast", - "return", - "signed", - "sizeof", - "static", - "static_assert", - "static_cast", - "struct", - "switch", - "template", - "this", - "thread_local", - "throw", - "true", - "try", - "typedef", - "typeid", - "typename", - "union", - "using", - "virtual", - "volatile", - "while", - "xor", - "xor_eq" + "alignas"sv, + "alignof"sv, + "and"sv, + "and_eq"sv, + "asm"sv, + "bitand"sv, + "bitor"sv, + "break"sv, + "case"sv, + "catch"sv, + "class"sv, + "compl"sv, + "const"sv, + "const_cast"sv, + "constexpr"sv, + "continue"sv, + "decltype"sv, + "default"sv, + "delete"sv, + "do"sv, + "dynamic_cast"sv, + "else"sv, + "enum"sv, + "explicit"sv, + "export"sv, + "extern"sv, + "false"sv, + "final"sv, + "for"sv, + "friend"sv, + "goto"sv, + "if"sv, + "inline"sv, + "mutable"sv, + "namespace"sv, + "new"sv, + "noexcept"sv, + "not"sv, + "not_eq"sv, + "nullptr"sv, + "operator"sv, + "or"sv, + "or_eq"sv, + "override"sv, + "private"sv, + "protected"sv, + "public"sv, + "register"sv, + "reinterpret_cast"sv, + "return"sv, + "signed"sv, + "sizeof"sv, + "static"sv, + "static_assert"sv, + "static_cast"sv, + "struct"sv, + "switch"sv, + "template"sv, + "this"sv, + "thread_local"sv, + "throw"sv, + "true"sv, + "try"sv, + "typedef"sv, + "typeid"sv, + "typename"sv, + "union"sv, + "using"sv, + "virtual"sv, + "volatile"sv, + "while"sv, + "xor"sv, + "xor_eq"sv }; constexpr StringView s_known_types[] = { - "Array", - "Array", - "Badge", - "Bitmap", - "ByteBuffer", - "Bytes", - "Checked", - "CircularDeque", - "CircularQueue", - "Deque", - "DoublyLinkedList", - "Error", - "ErrorOr", - "FlyString", - "Function", - "HashMap", - "HashTable", - "IPv4Address", - "IntrusiveList", - "IntrusiveList", - "JsonArray", - "JsonObject", - "JsonValue", - "LexicalPath", - "MappedFile", - "NetworkOrdered", - "NeverDestroyed", - "NonnullOwnPtr", - "NonnullOwnPtrVector", - "NonnullRefPtr", - "NonnullRefPtrVector", - "Optional", - "OwnPtr", - "ReadonlyBytes", - "RedBlackTree", - "RefPtr", - "Result", - "ScopeGuard", - "Singleton", - "SinglyLinkedList", - "Span", - "String", - "StringBuilder", - "StringImpl", - "StringView", - "Utf8View", - "Variant", - "Vector", - "WeakPtr", - "auto", - "bool", - "char", - "char16_t", - "char32_t", - "char8_t", - "double", - "float", - "i16", - "i32", - "i64", - "i8", - "int", - "int", - "long", - "short", - "signed", - "u16", - "u32", - "u64", - "u8", - "unsigned", - "void", - "wchar_t", + "Array"sv, + "Array"sv, + "Badge"sv, + "Bitmap"sv, + "ByteBuffer"sv, + "Bytes"sv, + "Checked"sv, + "CircularDeque"sv, + "CircularQueue"sv, + "Deque"sv, + "DoublyLinkedList"sv, + "Error"sv, + "ErrorOr"sv, + "FlyString"sv, + "Function"sv, + "HashMap"sv, + "HashTable"sv, + "IPv4Address"sv, + "IntrusiveList"sv, + "IntrusiveList"sv, + "JsonArray"sv, + "JsonObject"sv, + "JsonValue"sv, + "LexicalPath"sv, + "MappedFile"sv, + "NetworkOrdered"sv, + "NeverDestroyed"sv, + "NonnullOwnPtr"sv, + "NonnullOwnPtrVector"sv, + "NonnullRefPtr"sv, + "NonnullRefPtrVector"sv, + "Optional"sv, + "OwnPtr"sv, + "ReadonlyBytes"sv, + "RedBlackTree"sv, + "RefPtr"sv, + "Result"sv, + "ScopeGuard"sv, + "Singleton"sv, + "SinglyLinkedList"sv, + "Span"sv, + "String"sv, + "StringBuilder"sv, + "StringImpl"sv, + "StringView"sv, + "Utf8View"sv, + "Variant"sv, + "Vector"sv, + "WeakPtr"sv, + "auto"sv, + "bool"sv, + "char"sv, + "char16_t"sv, + "char32_t"sv, + "char8_t"sv, + "double"sv, + "float"sv, + "i16"sv, + "i32"sv, + "i64"sv, + "i8"sv, + "int"sv, + "int"sv, + "long"sv, + "short"sv, + "signed"sv, + "u16"sv, + "u32"sv, + "u64"sv, + "u8"sv, + "unsigned"sv, + "void"sv, + "wchar_t"sv, }; static bool is_keyword(StringView string) diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp index d44a91ce12..0ccb9afb4b 100644 --- a/Userland/Libraries/LibCpp/Parser.cpp +++ b/Userland/Libraries/LibCpp/Parser.cpp @@ -45,7 +45,7 @@ NonnullRefPtrVector<Declaration> Parser::parse_declarations_in_translation_unit( if (declaration) { declarations.append(declaration.release_nonnull()); } else { - error("unexpected token"); + error("unexpected token"sv); consume(); } } @@ -92,7 +92,7 @@ NonnullRefPtr<Declaration> Parser::parse_declaration(ASTNode& parent, Declaratio case DeclarationType::Destructor: return parse_destructor(parent); default: - error("unexpected declaration type"); + error("unexpected declaration type"sv); return create_ast_node<InvalidDeclaration>(parent, position(), position()); } } @@ -181,7 +181,7 @@ NonnullRefPtr<Statement> Parser::parse_statement(ASTNode& parent) consume_semicolon.disarm(); return parse_if_statement(parent); } else { - error("unexpected statement type"); + error("unexpected statement type"sv); consume_semicolon.disarm(); consume(); return create_ast_node<InvalidStatement>(parent, position(), position()); @@ -295,7 +295,7 @@ bool Parser::match_variable_declaration() if (match(Token::Type::Equals)) { consume(Token::Type::Equals); if (!match_expression()) { - error("initial value of variable is not an expression"); + error("initial value of variable is not an expression"sv); return false; } return true; @@ -312,7 +312,7 @@ NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration(ASTNode& p LOG_SCOPE(); auto var = create_ast_node<VariableDeclaration>(parent, position(), {}); if (!match_variable_declaration()) { - error("unexpected token for variable type"); + error("unexpected token for variable type"sv); var->set_end(position()); return var; } @@ -432,7 +432,7 @@ NonnullRefPtr<Expression> Parser::parse_primary_expression(ASTNode& parent) return parse_name(parent); } - error("could not parse primary expression"); + error("could not parse primary expression"sv); auto token = consume(); return create_ast_node<InvalidExpression>(parent, token.start(), token.end()); } @@ -523,7 +523,7 @@ NonnullRefPtr<Expression> Parser::parse_literal(ASTNode& parent) [[fallthrough]]; } default: { - error("could not parse literal"); + error("could not parse literal"sv); auto token = consume(); return create_ast_node<InvalidExpression>(parent, token.start(), token.end()); } @@ -805,7 +805,7 @@ void Parser::consume_preprocessor() consume(Token::Type::IncludePath); break; default: - error("unexpected token while parsing preprocessor statement"); + error("unexpected token while parsing preprocessor statement"sv); consume(); } } @@ -832,7 +832,7 @@ bool Parser::match(Token::Type type) Token Parser::consume() { if (eof()) { - error("C++ Parser: out of tokens"); + error("C++ Parser: out of tokens"sv); return { Token::Type::EOF_TOKEN, position(), position(), {} }; } return m_tokens[m_state.token_index++]; @@ -905,14 +905,14 @@ void Parser::error(StringView message) return; if (message.is_null() || message.is_empty()) - message = "<empty>"; + message = "<empty>"sv; String formatted_message; if (m_state.token_index >= m_tokens.size()) { formatted_message = String::formatted("C++ Parsed error on EOF.{}", message); } else { formatted_message = String::formatted("C++ Parser error: {}. token: {} ({}:{})", message, - m_state.token_index < m_tokens.size() ? text_of_token(m_tokens[m_state.token_index]) : "EOF", + m_state.token_index < m_tokens.size() ? text_of_token(m_tokens[m_state.token_index]) : "EOF"sv, m_tokens[m_state.token_index].start().line, m_tokens[m_state.token_index].start().column); } @@ -1017,7 +1017,7 @@ Vector<CodeComprehension::TodoEntry> Parser::get_todo_entries() const Vector<CodeComprehension::TodoEntry> ret; for (auto& token : m_tokens) { if (token.type() == Token::Type::Comment) { - if (token.text().contains("TODO") || token.text().contains("FIXME")) { + if (token.text().contains("TODO"sv) || token.text().contains("FIXME"sv)) { ret.append({ token.text(), m_filename, token.start().line, token.start().column }); } } @@ -1206,7 +1206,7 @@ NonnullRefPtr<Type> Parser::parse_type(ASTNode& parent) LOG_SCOPE(); if (!match_named_type()) { - error("expected named named_type"); + error("expected named named_type"sv); auto token = consume(); return create_ast_node<NamedType>(parent, token.start(), token.end()); } @@ -1412,7 +1412,7 @@ NonnullRefPtr<NamespaceDeclaration> Parser::parse_namespace_declaration(ASTNode& if (declaration) { namespace_decl->add_declaration(declaration.release_nonnull()); } else { - error("unexpected token"); + error("unexpected token"sv); consume(); } } @@ -1577,7 +1577,7 @@ NonnullRefPtrVector<Declaration> Parser::parse_class_members(StructOrClassDeclar if (member_type.has_value()) { members.append(parse_declaration(parent, member_type.value())); } else { - error("Expected class member"); + error("Expected class member"sv); consume(); } } @@ -1661,7 +1661,7 @@ void Parser::parse_constructor_or_destructor_impl(FunctionDeclaration& func, Cto auto parameters = parse_parameter_list(func); if (parameters.has_value()) { if (type == CtorOrDtor::Dtor && !parameters->is_empty()) - error("Destructor declaration that takes parameters"); + error("Destructor declaration that takes parameters"sv); else func.set_parameters(parameters.value()); } diff --git a/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp b/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp index a87e5b4f54..bdc23e33c5 100644 --- a/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp +++ b/Userland/Libraries/LibCrypto/ASN1/ASN1.cpp @@ -85,14 +85,14 @@ Optional<Core::DateTime> parse_utc_time(StringView time) Optional<unsigned> seconds, offset_hours, offset_minutes; [[maybe_unused]] bool negative_offset = false; if (!lexer.next_is('Z')) { - if (!lexer.next_is(is_any_of("+-"))) { + if (!lexer.next_is(is_any_of("+-"sv))) { seconds = lexer.consume(2).to_uint(); if (!seconds.has_value()) { return {}; } } - if (lexer.next_is(is_any_of("+-"))) { + if (lexer.next_is(is_any_of("+-"sv))) { negative_offset = lexer.consume() == '-'; offset_hours = lexer.consume(2).to_uint(); offset_minutes = lexer.consume(2).to_uint(); @@ -136,7 +136,7 @@ Optional<Core::DateTime> parse_generalized_time(StringView time) if (lexer.consume_specific('Z')) goto done_parsing; - if (!lexer.next_is(is_any_of("+-"))) { + if (!lexer.next_is(is_any_of("+-"sv))) { minute = lexer.consume(2).to_uint(); if (!minute.has_value()) { return {}; @@ -145,7 +145,7 @@ Optional<Core::DateTime> parse_generalized_time(StringView time) goto done_parsing; } - if (!lexer.next_is(is_any_of("+-"))) { + if (!lexer.next_is(is_any_of("+-"sv))) { seconds = lexer.consume(2).to_uint(); if (!seconds.has_value()) { return {}; @@ -163,7 +163,7 @@ Optional<Core::DateTime> parse_generalized_time(StringView time) goto done_parsing; } - if (lexer.next_is(is_any_of("+-"))) { + if (lexer.next_is(is_any_of("+-"sv))) { negative_offset = lexer.consume() == '-'; offset_hours = lexer.consume(2).to_uint(); offset_minutes = lexer.consume(2).to_uint(); diff --git a/Userland/Libraries/LibCrypto/ASN1/DER.cpp b/Userland/Libraries/LibCrypto/ASN1/DER.cpp index 49e0b90ba8..f86ab6b2c8 100644 --- a/Userland/Libraries/LibCrypto/ASN1/DER.cpp +++ b/Userland/Libraries/LibCrypto/ASN1/DER.cpp @@ -312,7 +312,7 @@ void pretty_print(Decoder& decoder, OutputStream& stream, int indent) dbgln("Integer PrettyPrint error: {}", value.error()); return; } - builder.append(" 0x"); + builder.append(" 0x"sv); for (auto ch : value.value()) builder.appendff("{:0>2x}", ch); break; @@ -323,7 +323,7 @@ void pretty_print(Decoder& decoder, OutputStream& stream, int indent) dbgln("BitString PrettyPrint error: {}", value.error()); return; } - builder.append(" 0b"); + builder.append(" 0b"sv); for (size_t i = 0; i < value.value().size(); ++i) builder.append(value.value().get(i) ? '1' : '0'); break; @@ -334,7 +334,7 @@ void pretty_print(Decoder& decoder, OutputStream& stream, int indent) dbgln("OctetString PrettyPrint error: {}", value.error()); return; } - builder.append(" 0x"); + builder.append(" 0x"sv); for (auto ch : value.value()) builder.appendff("{:0>2x}", ch); break; diff --git a/Userland/Libraries/LibCrypto/Authentication/HMAC.h b/Userland/Libraries/LibCrypto/Authentication/HMAC.h index 29c9ce1300..cb601c0622 100644 --- a/Userland/Libraries/LibCrypto/Authentication/HMAC.h +++ b/Userland/Libraries/LibCrypto/Authentication/HMAC.h @@ -77,7 +77,7 @@ public: String class_name() const { StringBuilder builder; - builder.append("HMAC-"); + builder.append("HMAC-"sv); builder.append(m_inner_hasher.class_name()); return builder.build(); } diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp index da24f95b31..382939947a 100644 --- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp +++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp @@ -339,6 +339,6 @@ bool SignedBigInteger::operator>=(SignedBigInteger const& other) const ErrorOr<void> AK::Formatter<Crypto::SignedBigInteger>::format(FormatBuilder& fmtbuilder, Crypto::SignedBigInteger const& value) { if (value.is_negative()) - TRY(fmtbuilder.put_string("-")); + TRY(fmtbuilder.put_string("-"sv)); return Formatter<Crypto::UnsignedBigInteger>::format(fmtbuilder, value.unsigned_value()); } diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h b/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h index 9cc3210a7e..04e7bf30ae 100644 --- a/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h +++ b/Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h @@ -34,7 +34,7 @@ public: { StringBuilder builder; builder.append(this->cipher().class_name()); - builder.append("_CBC"); + builder.append("_CBC"sv); return builder.build(); } #endif diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h b/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h index 3639282bf8..009fd3b07e 100644 --- a/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h +++ b/Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h @@ -109,7 +109,7 @@ public: { StringBuilder builder; builder.append(this->cipher().class_name()); - builder.append("_CTR"); + builder.append("_CTR"sv); return builder.build(); } #endif diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h b/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h index 77478ba4c9..ade13a1ce3 100644 --- a/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h +++ b/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h @@ -49,7 +49,7 @@ public: { StringBuilder builder; builder.append(this->cipher().class_name()); - builder.append("_GCM"); + builder.append("_GCM"sv); return builder.build(); } #endif diff --git a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp index b44e6cac0c..0805130398 100644 --- a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp +++ b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp @@ -218,7 +218,7 @@ bool is_probably_prime(UnsignedBigInteger const& p) UnsignedBigInteger random_big_prime(size_t bits) { VERIFY(bits >= 33); - UnsignedBigInteger min = UnsignedBigInteger::from_base(10, "6074001000").shift_left(bits - 33); + UnsignedBigInteger min = UnsignedBigInteger::from_base(10, "6074001000"sv).shift_left(bits - 33); UnsignedBigInteger max = UnsignedBigInteger { 1 }.shift_left(bits).minus(1); for (;;) { auto p = random_number(min, max); diff --git a/Userland/Libraries/LibDNS/Answer.cpp b/Userland/Libraries/LibDNS/Answer.cpp index 4927eb7fa7..e494d3bd8c 100644 --- a/Userland/Libraries/LibDNS/Answer.cpp +++ b/Userland/Libraries/LibDNS/Answer.cpp @@ -62,26 +62,26 @@ ErrorOr<void> AK::Formatter<DNS::RecordType>::format(AK::FormatBuilder& builder, { switch (value) { case DNS::RecordType::A: - return builder.put_string("A"); + return builder.put_string("A"sv); case DNS::RecordType::NS: - return builder.put_string("NS"); + return builder.put_string("NS"sv); case DNS::RecordType::CNAME: - return builder.put_string("CNAME"); + return builder.put_string("CNAME"sv); case DNS::RecordType::SOA: - return builder.put_string("SOA"); + return builder.put_string("SOA"sv); case DNS::RecordType::PTR: - return builder.put_string("PTR"); + return builder.put_string("PTR"sv); case DNS::RecordType::MX: - return builder.put_string("MX"); + return builder.put_string("MX"sv); case DNS::RecordType::TXT: - return builder.put_string("TXT"); + return builder.put_string("TXT"sv); case DNS::RecordType::AAAA: - return builder.put_string("AAAA"); + return builder.put_string("AAAA"sv); case DNS::RecordType::SRV: - return builder.put_string("SRV"); + return builder.put_string("SRV"sv); } - TRY(builder.put_string("DNS record type ")); + TRY(builder.put_string("DNS record type "sv)); TRY(builder.put_u64((u16)value)); return {}; } @@ -90,10 +90,10 @@ ErrorOr<void> AK::Formatter<DNS::RecordClass>::format(AK::FormatBuilder& builder { switch (value) { case DNS::RecordClass::IN: - return builder.put_string("IN"); + return builder.put_string("IN"sv); } - TRY(builder.put_string("DNS record class ")); + TRY(builder.put_string("DNS record class "sv)); TRY(builder.put_u64((u16)value)); return {}; } diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp index 6cf6a90cf1..b4c73751ac 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.cpp +++ b/Userland/Libraries/LibDebug/DebugInfo.cpp @@ -135,9 +135,10 @@ Optional<DebugInfo::SourcePositionAndAddress> DebugInfo::get_address_from_source if (!file_path.starts_with("/")) file_path = String::formatted("/{}", file_path); - constexpr char SERENITY_LIBS_PREFIX[] = "/usr/src/serenity"; + constexpr auto SERENITY_LIBS_PREFIX = "/usr/src/serenity"sv; if (file.starts_with(SERENITY_LIBS_PREFIX)) { - file_path = file.substring(sizeof(SERENITY_LIBS_PREFIX), file.length() - sizeof(SERENITY_LIBS_PREFIX)); + size_t file_prefix_offset = SERENITY_LIBS_PREFIX.length() + 1; + file_path = file.substring(file_prefix_offset, file.length() - file_prefix_offset); file_path = String::formatted("../{}", file_path); } diff --git a/Userland/Libraries/LibDebug/DebugSession.cpp b/Userland/Libraries/LibDebug/DebugSession.cpp index de990e6220..9d3bd88e5a 100644 --- a/Userland/Libraries/LibDebug/DebugSession.cpp +++ b/Userland/Libraries/LibDebug/DebugSession.cpp @@ -445,7 +445,7 @@ void DebugSession::update_loaded_libs() vm_entries.for_each([&](auto& entry) { // TODO: check that region is executable - auto vm_name = entry.as_object().get("name").as_string(); + auto vm_name = entry.as_object().get("name"sv).as_string(); auto object_path = get_path_to_object(vm_name); if (!object_path.has_value()) @@ -455,7 +455,7 @@ void DebugSession::update_loaded_libs() if (Core::File::looks_like_shared_library(lib_name)) lib_name = LexicalPath::basename(object_path.value()); - FlatPtr base_address = entry.as_object().get("address").to_addr(); + FlatPtr base_address = entry.as_object().get("address"sv).to_addr(); if (auto it = m_loaded_libraries.find(lib_name); it != m_loaded_libraries.end()) { // We expect the VM regions to be sorted by address. VERIFY(base_address >= it->value->base_address); diff --git a/Userland/Libraries/LibDesktop/AppFile.cpp b/Userland/Libraries/LibDesktop/AppFile.cpp index 6d9ae97c46..1b7e0c9920 100644 --- a/Userland/Libraries/LibDesktop/AppFile.cpp +++ b/Userland/Libraries/LibDesktop/AppFile.cpp @@ -33,7 +33,7 @@ void AppFile::for_each(Function<void(NonnullRefPtr<AppFile>)> callback, StringVi return; while (di.has_next()) { auto name = di.next_path(); - if (!name.ends_with(".af")) + if (!name.ends_with(".af"sv)) continue; auto path = String::formatted("{}/{}", directory, name); auto af = AppFile::open(path); diff --git a/Userland/Libraries/LibDesktop/AppFile.h b/Userland/Libraries/LibDesktop/AppFile.h index a9f10da6fa..cb393db6e2 100644 --- a/Userland/Libraries/LibDesktop/AppFile.h +++ b/Userland/Libraries/LibDesktop/AppFile.h @@ -15,7 +15,8 @@ namespace Desktop { class AppFile : public RefCounted<AppFile> { public: - static constexpr char const* APP_FILES_DIRECTORY = "/res/apps"; + static constexpr auto APP_FILES_DIRECTORY = "/res/apps"sv; + static NonnullRefPtr<AppFile> get_for_app(StringView app_name); static NonnullRefPtr<AppFile> open(StringView path); static void for_each(Function<void(NonnullRefPtr<AppFile>)>, StringView directory = APP_FILES_DIRECTORY); diff --git a/Userland/Libraries/LibDesktop/Launcher.cpp b/Userland/Libraries/LibDesktop/Launcher.cpp index 4cfd16beb4..e4add1ac9b 100644 --- a/Userland/Libraries/LibDesktop/Launcher.cpp +++ b/Userland/Libraries/LibDesktop/Launcher.cpp @@ -19,9 +19,9 @@ auto Launcher::Details::from_details_str(String const& details_str) -> NonnullRe auto details = adopt_ref(*new Details); auto json = JsonValue::from_string(details_str).release_value_but_fixme_should_propagate_errors(); auto const& obj = json.as_object(); - details->executable = obj.get("executable").to_string(); - details->name = obj.get("name").to_string(); - if (auto type_value = obj.get_ptr("type")) { + details->executable = obj.get("executable"sv).to_string(); + details->name = obj.get("name"sv).to_string(); + if (auto type_value = obj.get_ptr("type"sv)) { auto type_str = type_value->to_string(); if (type_str == "app") details->launcher_type = LauncherType::Application; diff --git a/Userland/Libraries/LibELF/Core.h b/Userland/Libraries/LibELF/Core.h index eb29e56866..1f19ea688c 100644 --- a/Userland/Libraries/LibELF/Core.h +++ b/Userland/Libraries/LibELF/Core.h @@ -61,9 +61,9 @@ struct [[gnu::packed]] MemoryRegionInfo { #ifndef KERNEL String object_name() const { - StringView memory_region_name { region_name }; - if (memory_region_name.contains("Loader.so")) - return "Loader.so"; + StringView memory_region_name { region_name, strlen(region_name) }; + if (memory_region_name.contains("Loader.so"sv)) + return "Loader.so"sv; auto maybe_colon_index = memory_region_name.find(':'); if (!maybe_colon_index.has_value()) return {}; diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp index 6ea9ab82db..956d5f9f58 100644 --- a/Userland/Libraries/LibELF/DynamicLoader.cpp +++ b/Userland/Libraries/LibELF/DynamicLoader.cpp @@ -397,9 +397,9 @@ void DynamicLoader::load_program_headers() StringBuilder builder; builder.append(m_filepath); if (region.is_executable()) - builder.append(": .text"); + builder.append(": .text"sv); else - builder.append(": .rodata"); + builder.append(": .rodata"sv); // Now we can map the text segment at the reserved address. auto* segment_base = (u8*)mmap_with_name( diff --git a/Userland/Libraries/LibELF/DynamicObject.cpp b/Userland/Libraries/LibELF/DynamicObject.cpp index 29471f6560..193c9c4230 100644 --- a/Userland/Libraries/LibELF/DynamicObject.cpp +++ b/Userland/Libraries/LibELF/DynamicObject.cpp @@ -41,7 +41,7 @@ void DynamicObject::dump() const { if constexpr (DYNAMIC_LOAD_DEBUG) { StringBuilder builder; - builder.append("\nd_tag tag_name value\n"); + builder.append("\nd_tag tag_name value\n"sv); size_t num_dynamic_sections = 0; for_each_dynamic_entry([&](DynamicObject::DynamicEntry const& entry) { diff --git a/Userland/Libraries/LibELF/Image.cpp b/Userland/Libraries/LibELF/Image.cpp index da79f41f65..d5d81b23e4 100644 --- a/Userland/Libraries/LibELF/Image.cpp +++ b/Userland/Libraries/LibELF/Image.cpp @@ -60,7 +60,7 @@ void Image::dump() const return; } - dbgln(" type: {}", ELF::Image::object_file_type_to_string(header().e_type).value_or("(?)")); + dbgln(" type: {}", ELF::Image::object_file_type_to_string(header().e_type).value_or("(?)"sv)); dbgln(" machine: {}", header().e_machine); dbgln(" entry: {:x}", header().e_entry); dbgln(" shoff: {}", header().e_shoff); diff --git a/Userland/Libraries/LibGL/GLContext.cpp b/Userland/Libraries/LibGL/GLContext.cpp index 8fa80a2ecf..3e87e7c584 100644 --- a/Userland/Libraries/LibGL/GLContext.cpp +++ b/Userland/Libraries/LibGL/GLContext.cpp @@ -1216,10 +1216,10 @@ void GLContext::build_extension_string() // Ideally we would verify if the selected device adheres to the requested OpenGL context version before context creation // and refuse to create a context if it doesn't. if (m_device_info.supports_npot_textures) - extensions.append("GL_ARB_texture_non_power_of_two"); + extensions.append("GL_ARB_texture_non_power_of_two"sv); if (m_device_info.num_texture_units > 1) - extensions.append("GL_ARB_multitexture"); + extensions.append("GL_ARB_multitexture"sv); m_extensions = String::join(" ", extensions); } @@ -1227,7 +1227,7 @@ void GLContext::build_extension_string() NonnullOwnPtr<GLContext> create_context(Gfx::Bitmap& bitmap) { // FIXME: Make driver selectable. This is currently hardcoded to LibSoftGPU - auto driver = MUST(GPU::Driver::try_create("softgpu")); + auto driver = MUST(GPU::Driver::try_create("softgpu"sv)); auto device = MUST(driver->try_create_device(bitmap.size())); auto context = make<GLContext>(driver, move(device), bitmap); dbgln_if(GL_DEBUG, "GL::create_context({}) -> {:p}", bitmap.size(), context.ptr()); diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp index 1d86433364..9bbbdfa83c 100644 --- a/Userland/Libraries/LibGUI/AboutDialog.cpp +++ b/Userland/Libraries/LibGUI/AboutDialog.cpp @@ -36,7 +36,7 @@ AboutDialog::AboutDialog(StringView name, Gfx::Bitmap const* icon, Window* paren widget.layout()->set_spacing(0); auto& banner_image = widget.add<GUI::ImageWidget>(); - banner_image.load_from_file("/res/graphics/brand-banner.png"); + banner_image.load_from_file("/res/graphics/brand-banner.png"sv); auto& content_container = widget.add<Widget>(); content_container.set_layout<HorizontalBoxLayout>(); @@ -69,9 +69,9 @@ AboutDialog::AboutDialog(StringView name, Gfx::Bitmap const* icon, Window* paren make_label(m_name, true); // If we are displaying a dialog for an application, insert 'SerenityOS' below the application name if (m_name != "SerenityOS") - make_label("SerenityOS"); + make_label("SerenityOS"sv); make_label(m_version_string); - make_label("Copyright \xC2\xA9 the SerenityOS developers, 2018-2022"); + make_label("Copyright \xC2\xA9 the SerenityOS developers, 2018-2022"sv); right_container.layout()->add_spacer(); diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp index ba9ff35060..eba13fdbeb 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.cpp +++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp @@ -60,7 +60,7 @@ void AbstractTableView::auto_resize_column(int column) int header_width = m_column_header->font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); + header_width += font().width(" \xE2\xAC\x86"sv); int column_width = header_width; bool is_empty = true; @@ -99,7 +99,7 @@ void AbstractTableView::update_column_sizes() continue; int header_width = m_column_header->font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); // UPWARDS BLACK ARROW + header_width += font().width(" \xE2\xAC\x86"sv); // UPWARDS BLACK ARROW int column_width = header_width; for (int row = 0; row < row_count; ++row) { auto cell_data = model.index(row, column).data(); diff --git a/Userland/Libraries/LibGUI/AbstractThemePreview.cpp b/Userland/Libraries/LibGUI/AbstractThemePreview.cpp index 743ce60a0e..e1cea74089 100644 --- a/Userland/Libraries/LibGUI/AbstractThemePreview.cpp +++ b/Userland/Libraries/LibGUI/AbstractThemePreview.cpp @@ -21,12 +21,12 @@ namespace GUI { AbstractThemePreview::AbstractThemePreview(Gfx::Palette const& preview_palette) : m_preview_palette(preview_palette) { - m_active_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png").release_value_but_fixme_should_propagate_errors(); - m_inactive_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png").release_value_but_fixme_should_propagate_errors(); + m_active_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors(); + m_inactive_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors(); - m_default_close_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window-close.png").release_value_but_fixme_should_propagate_errors(); - m_default_maximize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png").release_value_but_fixme_should_propagate_errors(); - m_default_minimize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png").release_value_but_fixme_should_propagate_errors(); + m_default_close_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window-close.png"sv).release_value_but_fixme_should_propagate_errors(); + m_default_maximize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png"sv).release_value_but_fixme_should_propagate_errors(); + m_default_minimize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv).release_value_but_fixme_should_propagate_errors(); VERIFY(m_active_window_icon); VERIFY(m_inactive_window_icon); diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index b9574e7f09..073cceab35 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -28,7 +28,7 @@ public: { m_label->set_text(Gfx::parse_ampersand_string(tooltip)); int tooltip_width = m_label->effective_min_size().width().as_int() + 10; - int line_count = m_label->text().count("\n"); + int line_count = m_label->text().count("\n"sv); int glyph_height = m_label->font().glyph_height(); int tooltip_height = glyph_height * (1 + line_count) + ((glyph_height + 1) / 2) * line_count + 8; diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp index f2b82ac6f6..0d208f1598 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp @@ -52,13 +52,13 @@ public: if (index.column() == Column::Icon) { if (suggestion.language == CodeComprehension::Language::Cpp) { if (!s_cpp_identifier_icon) { - s_cpp_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/cpp-identifier.png").release_value_but_fixme_should_propagate_errors(); + s_cpp_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/cpp-identifier.png"sv).release_value_but_fixme_should_propagate_errors(); } return *s_cpp_identifier_icon; } if (suggestion.language == CodeComprehension::Language::Unspecified) { if (!s_unspecified_identifier_icon) { - s_unspecified_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/unspecified-identifier.png").release_value_but_fixme_should_propagate_errors(); + s_unspecified_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/unspecified-identifier.png"sv).release_value_but_fixme_should_propagate_errors(); } return *s_unspecified_identifier_icon; } diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index 2af591fde5..79aaa6ffbb 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -186,7 +186,7 @@ ColorPicker::ColorPicker(Color color, Window* parent_window, String title) : Dialog(parent_window) , m_color(color) { - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/color-chooser.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/color-chooser.png"sv).release_value_but_fixme_should_propagate_errors()); set_title(title); set_resizable(false); resize(458, 326); diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp index ce1cbef995..afd04ca201 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.cpp +++ b/Userland/Libraries/LibGUI/ColumnsView.cpp @@ -23,7 +23,7 @@ static constexpr Gfx::CharacterBitmap s_arrow_bitmap { " ### " " ## " " # " - " ", + " "sv, 9, 9 }; diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp index 4ec805d20b..90b4f7f37b 100644 --- a/Userland/Libraries/LibGUI/ComboBox.cpp +++ b/Userland/Libraries/LibGUI/ComboBox.cpp @@ -98,7 +98,7 @@ ComboBox::ComboBox() m_open_button = add<Button>(); m_open_button->set_button_style(Gfx::ButtonStyle::ThickCap); - m_open_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png").release_value_but_fixme_should_propagate_errors()); + m_open_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv).release_value_but_fixme_should_propagate_errors()); m_open_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_open_button->on_click = [this](auto) { if (m_list_window->is_visible()) diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp index d28ba7e74c..91616ff784 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.cpp +++ b/Userland/Libraries/LibGUI/CommandPalette.cpp @@ -193,7 +193,7 @@ CommandPalette::CommandPalette(GUI::Window& parent_window, ScreenPosition screen m_table_view->set_column_headers_visible(false); m_filter_model = MUST(GUI::FilteringProxyModel::create(*m_model)); - m_filter_model->set_filter_term(""); + m_filter_model->set_filter_term(""sv); m_table_view->set_column_painting_delegate(0, make<ActionIconDelegate>()); m_table_view->set_model(*m_filter_model); diff --git a/Userland/Libraries/LibGUI/CommonActions.cpp b/Userland/Libraries/LibGUI/CommonActions.cpp index 3e23795ee4..883a74d5d7 100644 --- a/Userland/Libraries/LibGUI/CommonActions.cpp +++ b/Userland/Libraries/LibGUI/CommonActions.cpp @@ -27,71 +27,71 @@ NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_ NonnullRefPtr<Action> make_open_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Open...", { Mod_Ctrl, Key_O }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Open...", { Mod_Ctrl, Key_O }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Open an existing file"); return action; } NonnullRefPtr<Action> make_save_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Save", { Mod_Ctrl, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Save", { Mod_Ctrl, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Save the current file"); return action; } NonnullRefPtr<Action> make_save_as_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Save &As...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Save &As...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Save the current file with a new name"); return action; } NonnullRefPtr<Action> make_move_to_front_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Move to &Front", { Mod_Ctrl | Mod_Shift, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-front.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Move to &Front", { Mod_Ctrl | Mod_Shift, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-front.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move to the top of the stack"); return action; } NonnullRefPtr<Action> make_move_to_back_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Move to &Back", { Mod_Ctrl | Mod_Shift, Key_Down }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-back.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Move to &Back", { Mod_Ctrl | Mod_Shift, Key_Down }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-back.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move to the bottom of the stack"); return action; } NonnullRefPtr<Action> make_undo_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Undo", { Mod_Ctrl, Key_Z }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/undo.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Undo", { Mod_Ctrl, Key_Z }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/undo.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_redo_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Redo", { Mod_Ctrl | Mod_Shift, Key_Z }, { Mod_Ctrl, Key_Y }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/redo.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Redo", { Mod_Ctrl | Mod_Shift, Key_Z }, { Mod_Ctrl, Key_Y }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/redo.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_delete_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Delete", { Mod_None, Key_Delete }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Delete", { Mod_None, Key_Delete }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_cut_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Cu&t", { Mod_Ctrl, Key_X }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-cut.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Cu&t", { Mod_Ctrl, Key_X }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-cut.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Cut to clipboard"); return action; } NonnullRefPtr<Action> make_copy_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Copy", { Mod_Ctrl, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Copy", { Mod_Ctrl, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Copy to clipboard"); return action; } NonnullRefPtr<Action> make_paste_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Paste", { Mod_Ctrl, Key_V }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/paste.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Paste", { Mod_Ctrl, Key_V }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/paste.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Paste from clipboard"); return action; } @@ -100,7 +100,7 @@ NonnullRefPtr<Action> make_fullscreen_action(Function<void(Action&)> callback, C { auto action = Action::create("&Fullscreen", { Mod_None, Key_F11 }, move(callback), parent); action->set_status_tip("Enter fullscreen mode"); - action->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/fullscreen.png").release_value_but_fixme_should_propagate_errors()); + action->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/fullscreen.png"sv).release_value_but_fixme_should_propagate_errors()); return action; } @@ -113,80 +113,80 @@ NonnullRefPtr<Action> make_quit_action(Function<void(Action&)> callback) NonnullRefPtr<Action> make_help_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Manual", { Mod_None, Key_F1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Manual", { Mod_None, Key_F1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Show help contents"); return action; } NonnullRefPtr<Action> make_go_back_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, { MouseButton::Backward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, { MouseButton::Backward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move one step backward in history"); return action; } NonnullRefPtr<Action> make_go_forward_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, { MouseButton::Forward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, { MouseButton::Forward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move one step forward in history"); return action; } NonnullRefPtr<Action> make_go_home_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("Go &Home", { Mod_Alt, Key_Home }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-home.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("Go &Home", { Mod_Alt, Key_Home }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-home.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_close_tab_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Close Tab", { Mod_Ctrl, Key_W }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/close-tab.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Close Tab", { Mod_Ctrl, Key_W }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/close-tab.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Close current tab"); return action; } NonnullRefPtr<Action> make_reload_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Reload", { Mod_Ctrl, Key_R }, Key_F5, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/reload.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Reload", { Mod_Ctrl, Key_R }, Key_F5, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/reload.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_select_all_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("Select &All", { Mod_Ctrl, Key_A }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/select-all.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("Select &All", { Mod_Ctrl, Key_A }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/select-all.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_rename_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("Re&name", Key_F2, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/rename.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("Re&name", Key_F2, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/rename.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_properties_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("P&roperties", { Mod_Alt, Key_Return }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/properties.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("P&roperties", { Mod_Alt, Key_Return }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/properties.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_zoom_in_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Zoom &In", { Mod_Ctrl, Key_Equal }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-in.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Zoom &In", { Mod_Ctrl, Key_Equal }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-in.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_reset_zoom_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("&Reset Zoom", { Mod_Ctrl, Key_0 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-reset.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("&Reset Zoom", { Mod_Ctrl, Key_0 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-reset.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_zoom_out_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Zoom &Out", { Mod_Ctrl, Key_Minus }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-out.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Zoom &Out", { Mod_Ctrl, Key_Minus }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-out.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_rotate_clockwise_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Rotate Clock&wise", { Mod_Ctrl | Mod_Shift, Key_GreaterThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-cw.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Rotate Clock&wise", { Mod_Ctrl | Mod_Shift, Key_GreaterThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-cw.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_rotate_counterclockwise_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Rotate &Counterclockwise", { Mod_Ctrl | Mod_Shift, Key_LessThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-ccw.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Rotate &Counterclockwise", { Mod_Ctrl | Mod_Shift, Key_LessThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-ccw.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } } diff --git a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp index a06a32f7b4..3e54777ad9 100644 --- a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp +++ b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp @@ -61,8 +61,8 @@ void CommonLocationsProvider::load_from_json(String const& json_path) if (!entry_value.is_object()) continue; auto entry = entry_value.as_object(); - auto name = entry.get("name").to_string(); - auto path = entry.get("path").to_string(); + auto name = entry.get("name"sv).to_string(); + auto path = entry.get("path"sv).to_string(); s_common_locations.append({ name, path }); } diff --git a/Userland/Libraries/LibGUI/Desktop.cpp b/Userland/Libraries/LibGUI/Desktop.cpp index 74e443557c..cb99deaf5b 100644 --- a/Userland/Libraries/LibGUI/Desktop.cpp +++ b/Userland/Libraries/LibGUI/Desktop.cpp @@ -53,7 +53,7 @@ void Desktop::set_wallpaper_mode(StringView mode) String Desktop::wallpaper_path() const { - return Config::read_string("WindowManager", "Background", "Wallpaper"); + return Config::read_string("WindowManager"sv, "Background"sv, "Wallpaper"sv); } RefPtr<Gfx::Bitmap> Desktop::wallpaper_bitmap() const @@ -72,7 +72,7 @@ bool Desktop::set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<Strin if (ret_val && path.has_value()) { dbgln("Saving wallpaper path '{}' to ConfigServer", *path); - Config::write_string("WindowManager", "Background", "Wallpaper", *path); + Config::write_string("WindowManager"sv, "Background"sv, "Wallpaper"sv, *path); } return ret_val; diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index bb441808e5..caa60b9b98 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -28,7 +28,7 @@ static Vector<u32> supported_emoji_code_points() if (lexical_path.extension() != "png") continue; auto basename = lexical_path.basename(); - if (!basename.starts_with("U+")) + if (!basename.starts_with("U+"sv)) continue; // FIXME: Handle multi code point emojis. if (basename.contains('_')) diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index 8a1afddfd6..a4d801edfb 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -559,17 +559,17 @@ inline StringView mouse_button_to_string(MouseButton key) { switch (key) { case MouseButton::None: - return "None"; + return "None"sv; case MouseButton::Primary: - return "Primary"; + return "Primary"sv; case MouseButton::Secondary: - return "Secondary"; + return "Secondary"sv; case MouseButton::Middle: - return "Middle"; + return "Middle"sv; case MouseButton::Backward: - return "Backward"; + return "Backward"sv; case MouseButton::Forward: - return "Forward"; + return "Forward"sv; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibGUI/FileIconProvider.cpp b/Userland/Libraries/LibGUI/FileIconProvider.cpp index 495cae5b3f..7684d52fe2 100644 --- a/Userland/Libraries/LibGUI/FileIconProvider.cpp +++ b/Userland/Libraries/LibGUI/FileIconProvider.cpp @@ -48,7 +48,7 @@ static void initialize_executable_icon_if_needed() if (initialized) return; initialized = true; - s_executable_icon = Icon::default_icon("filetype-executable"); + s_executable_icon = Icon::default_icon("filetype-executable"sv); } static void initialize_filetype_image_icon_if_needed() @@ -57,7 +57,7 @@ static void initialize_filetype_image_icon_if_needed() if (initialized) return; initialized = true; - s_filetype_image_icon = Icon::default_icon("filetype-image"); + s_filetype_image_icon = Icon::default_icon("filetype-image"sv); } static void initialize_if_needed() @@ -68,19 +68,19 @@ static void initialize_if_needed() auto config = Core::ConfigFile::open("/etc/FileIconProvider.ini").release_value_but_fixme_should_propagate_errors(); - s_symlink_emblem = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem.png").release_value_but_fixme_should_propagate_errors(); - s_symlink_emblem_small = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem-small.png").release_value_but_fixme_should_propagate_errors(); + s_symlink_emblem = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem.png"sv).release_value_but_fixme_should_propagate_errors(); + s_symlink_emblem_small = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem-small.png"sv).release_value_but_fixme_should_propagate_errors(); - s_hard_disk_icon = Icon::default_icon("hard-disk"); - s_directory_icon = Icon::default_icon("filetype-folder"); - s_directory_open_icon = Icon::default_icon("filetype-folder-open"); - s_inaccessible_directory_icon = Icon::default_icon("filetype-folder-inaccessible"); - s_home_directory_icon = Icon::default_icon("home-directory"); - s_home_directory_open_icon = Icon::default_icon("home-directory-open"); - s_desktop_directory_icon = Icon::default_icon("desktop"); - s_file_icon = Icon::default_icon("filetype-unknown"); - s_symlink_icon = Icon::default_icon("filetype-symlink"); - s_socket_icon = Icon::default_icon("filetype-socket"); + s_hard_disk_icon = Icon::default_icon("hard-disk"sv); + s_directory_icon = Icon::default_icon("filetype-folder"sv); + s_directory_open_icon = Icon::default_icon("filetype-folder-open"sv); + s_inaccessible_directory_icon = Icon::default_icon("filetype-folder-inaccessible"sv); + s_home_directory_icon = Icon::default_icon("home-directory"sv); + s_home_directory_open_icon = Icon::default_icon("home-directory-open"sv); + s_desktop_directory_icon = Icon::default_icon("desktop"sv); + s_file_icon = Icon::default_icon("filetype-unknown"sv); + s_symlink_icon = Icon::default_icon("filetype-symlink"sv); + s_socket_icon = Icon::default_icon("filetype-socket"sv); initialize_filetype_image_icon_if_needed(); initialize_executable_icon_if_needed(); @@ -176,13 +176,13 @@ Icon FileIconProvider::icon_for_executable(String const& path) // If any of the required sections are missing then use the defaults Icon icon; struct IconSection { - char const* section_name; + StringView section_name; int image_size; }; static constexpr Array<IconSection, 2> icon_sections = { - IconSection { .section_name = "serenity_icon_s", .image_size = 16 }, - IconSection { .section_name = "serenity_icon_m", .image_size = 32 } + IconSection { .section_name = "serenity_icon_s"sv, .image_size = 16 }, + IconSection { .section_name = "serenity_icon_m"sv, .image_size = 32 } }; bool had_error = false; diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp index f91c1c04cd..4be64268e7 100644 --- a/Userland/Libraries/LibGUI/FilePicker.cpp +++ b/Userland/Libraries/LibGUI/FilePicker.cpp @@ -34,7 +34,7 @@ namespace GUI { Optional<String> FilePicker::get_open_filepath(Window* parent_window, String const& window_title, StringView path, bool folder, ScreenPosition screen_position) { - auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, "", path, screen_position); + auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, ""sv, path, screen_position); if (!window_title.is_null()) picker->set_title(window_title); @@ -75,11 +75,11 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St case Mode::OpenMultiple: case Mode::OpenFolder: set_title("Open"); - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors()); break; case Mode::Save: set_title("Save as"); - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors()); break; } resize(560, 320); @@ -115,7 +115,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St }; auto open_parent_directory_action = Action::create( - "Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png").release_value_but_fixme_should_propagate_errors(), [this](Action const&) { + "Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) { set_path(String::formatted("{}/..", m_model->root_path())); }, this); @@ -129,13 +129,13 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St toolbar.add_separator(); auto mkdir_action = Action::create( - "New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png").release_value_but_fixme_should_propagate_errors(), [this](Action const&) { + "New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) { String value; - if (InputBox::show(this, value, "Enter name:", "New directory") == InputBox::ExecResult::OK && !value.is_empty()) { + if (InputBox::show(this, value, "Enter name:"sv, "New directory"sv) == InputBox::ExecResult::OK && !value.is_empty()) { auto new_dir_path = LexicalPath::canonicalized_path(String::formatted("{}/{}", m_model->root_path(), value)); int rc = mkdir(new_dir_path.characters(), 0777); if (rc < 0) { - MessageBox::show(this, String::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error", MessageBox::Type::Error); + MessageBox::show(this, String::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error"sv, MessageBox::Type::Error); } else { m_model->invalidate(); } @@ -272,12 +272,12 @@ void FilePicker::on_file_return() bool file_exists = Core::File::exists(path); if (!file_exists && (m_mode == Mode::Open || m_mode == Mode::OpenFolder)) { - MessageBox::show(this, String::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found", MessageBox::Type::Error, MessageBox::InputType::OK); + MessageBox::show(this, String::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found"sv, MessageBox::Type::Error, MessageBox::InputType::OK); return; } if (file_exists && m_mode == Mode::Save) { - auto result = MessageBox::show(this, "File already exists. Overwrite?", "Existing File", MessageBox::Type::Warning, MessageBox::InputType::OKCancel); + auto result = MessageBox::show(this, "File already exists. Overwrite?"sv, "Existing File"sv, MessageBox::Type::Warning, MessageBox::InputType::OKCancel); if (result == MessageBox::ExecResult::Cancel) return; } @@ -289,7 +289,7 @@ void FilePicker::on_file_return() void FilePicker::set_path(String const& path) { if (access(path.characters(), R_OK | X_OK) == -1) { - GUI::MessageBox::show(this, String::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error", GUI::MessageBox::Type::Error); + GUI::MessageBox::show(this, String::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error); auto& common_locations_tray = *find_descendant_of_type_named<GUI::Tray>("common_locations_tray"); for (auto& location_button : m_common_location_buttons) common_locations_tray.set_item_checked(location_button.tray_item_index, m_model->root_path() == location_button.path); diff --git a/Userland/Libraries/LibGUI/FilePicker.h b/Userland/Libraries/LibGUI/FilePicker.h index 441cfeaefa..163082f537 100644 --- a/Userland/Libraries/LibGUI/FilePicker.h +++ b/Userland/Libraries/LibGUI/FilePicker.h @@ -43,7 +43,7 @@ private: // ^GUI::ModelClient virtual void model_did_update(unsigned) override; - FilePicker(Window* parent_window, Mode type = Mode::Open, StringView filename = "Untitled", StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent); + FilePicker(Window* parent_window, Mode type = Mode::Open, StringView filename = "Untitled"sv, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent); static String ok_button_name(Mode mode) { diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h index 7f7a4289a2..5d87f5c4f6 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.h +++ b/Userland/Libraries/LibGUI/FileSystemModel.h @@ -128,7 +128,7 @@ public: virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override; virtual ModelIndex parent_index(ModelIndex const&) const override; virtual ModelIndex index(int row, int column = 0, ModelIndex const& parent = ModelIndex()) const override; - virtual StringView drag_data_type() const override { return "text/uri-list"; } + virtual StringView drag_data_type() const override { return "text/uri-list"sv; } virtual bool accepts_drag(ModelIndex const&, Vector<String> const& mime_types) const override; virtual bool is_column_sortable(int column_index) const override { return column_index != Column::Icon; } virtual bool is_editable(ModelIndex const&) const override; diff --git a/Userland/Libraries/LibGUI/FontPicker.cpp b/Userland/Libraries/LibGUI/FontPicker.cpp index bcb80fcdb5..665f4d6964 100644 --- a/Userland/Libraries/LibGUI/FontPicker.cpp +++ b/Userland/Libraries/LibGUI/FontPicker.cpp @@ -24,7 +24,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo { set_title("Font picker"); resize(430, 280); - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors()); auto& widget = set_main_widget<GUI::Widget>(); if (!widget.load_from_gml(font_picker_dialog_gml)) diff --git a/Userland/Libraries/LibGUI/GML/AST.h b/Userland/Libraries/LibGUI/GML/AST.h index f670ade835..ebcfc5a875 100644 --- a/Userland/Libraries/LibGUI/GML/AST.h +++ b/Userland/Libraries/LibGUI/GML/AST.h @@ -52,7 +52,7 @@ public: static void indent(StringBuilder& builder, size_t indentation) { for (size_t i = 0; i < indentation; ++i) - builder.append(" "); + builder.append(" "sv); } }; @@ -136,7 +136,7 @@ public: auto first = true; as_array().for_each([&](auto& value) { if (!first) - builder.append(", "); + builder.append(", "sv); first = false; value.serialize(builder); }); @@ -248,7 +248,7 @@ public: indent(builder, indentation); builder.append('@'); builder.append(m_name); - builder.append(" {"); + builder.append(" {"sv); if (!m_properties.is_empty() || !m_sub_objects.is_empty()) { builder.append('\n'); diff --git a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp index c22ea26a53..38b0b14d7c 100644 --- a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp @@ -107,8 +107,8 @@ void AutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehe state = previous_states.take_last(); } - auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"); - auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"); + auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"sv); + auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"sv); // FIXME: Can this be done without a StringBuilder? auto make_fuzzy = [](StringView str) { diff --git a/Userland/Libraries/LibGUI/HeaderView.cpp b/Userland/Libraries/LibGUI/HeaderView.cpp index 814206d12a..e596387906 100644 --- a/Userland/Libraries/LibGUI/HeaderView.cpp +++ b/Userland/Libraries/LibGUI/HeaderView.cpp @@ -269,9 +269,9 @@ void HeaderView::paint_horizontal(Painter& painter) StringBuilder builder; builder.append(model()->column_name(section)); if (m_table_view.sort_order() == SortOrder::Ascending) - builder.append(" \xE2\xAC\x86"); // UPWARDS BLACK ARROW + builder.append(" \xE2\xAC\x86"sv); // UPWARDS BLACK ARROW else if (m_table_view.sort_order() == SortOrder::Descending) - builder.append(" \xE2\xAC\x87"); // DOWNWARDS BLACK ARROW + builder.append(" \xE2\xAC\x87"sv); // DOWNWARDS BLACK ARROW text = builder.to_string(); } else { text = model()->column_name(section); diff --git a/Userland/Libraries/LibGUI/Layout.h b/Userland/Libraries/LibGUI/Layout.h index 0c61fe6271..b194e9dfa9 100644 --- a/Userland/Libraries/LibGUI/Layout.h +++ b/Userland/Libraries/LibGUI/Layout.h @@ -21,12 +21,12 @@ extern Core::ObjectClassRegistration registration_Layout; } } -#define REGISTER_LAYOUT(namespace_, class_name) \ - namespace Core { \ - namespace Registration { \ - Core::ObjectClassRegistration registration_##class_name( \ - #namespace_ "::" #class_name, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Layout); \ - } \ +#define REGISTER_LAYOUT(namespace_, class_name) \ + namespace Core { \ + namespace Registration { \ + Core::ObjectClassRegistration registration_##class_name( \ + #namespace_ "::" #class_name##sv, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Layout); \ + } \ } namespace GUI { diff --git a/Userland/Libraries/LibGUI/LinkLabel.cpp b/Userland/Libraries/LibGUI/LinkLabel.cpp index 14d6a54dd0..f7f8b1af43 100644 --- a/Userland/Libraries/LibGUI/LinkLabel.cpp +++ b/Userland/Libraries/LibGUI/LinkLabel.cpp @@ -29,7 +29,7 @@ LinkLabel::LinkLabel(String text) void LinkLabel::setup_actions() { - m_open_action = GUI::Action::create("Show in File Manager", {}, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png").release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { + m_open_action = GUI::Action::create("Show in File Manager", {}, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { if (on_click) on_click(); }); diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp index 362b07ef39..178012e806 100644 --- a/Userland/Libraries/LibGUI/MessageBox.cpp +++ b/Userland/Libraries/LibGUI/MessageBox.cpp @@ -26,18 +26,18 @@ Dialog::ExecResult MessageBox::show(Window* parent_window, StringView text, Stri Dialog::ExecResult MessageBox::show_error(Window* parent_window, StringView text) { - return show(parent_window, text, "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK); + return show(parent_window, text, "Error"sv, GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK); } Dialog::ExecResult MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path, Optional<Time> last_unmodified_timestamp) { StringBuilder builder; - builder.append("Save changes to "); + builder.append("Save changes to "sv); if (path.is_empty()) - builder.append("untitled document"); + builder.append("untitled document"sv); else builder.appendff("\"{}\"", LexicalPath::basename(path)); - builder.append(" before closing?"); + builder.append(" before closing?"sv); if (!path.is_empty() && last_unmodified_timestamp.has_value()) { auto age = (Time::now_monotonic() - *last_unmodified_timestamp).to_seconds(); @@ -45,7 +45,7 @@ Dialog::ExecResult MessageBox::ask_about_unsaved_changes(Window* parent_window, builder.appendff("\nLast saved {} ago.", readable_time); } - auto box = MessageBox::construct(parent_window, builder.string_view(), "Unsaved changes", Type::Warning, InputType::YesNoCancel); + auto box = MessageBox::construct(parent_window, builder.string_view(), "Unsaved changes"sv, Type::Warning, InputType::YesNoCancel); if (parent_window) box->set_icon(parent_window->icon()); @@ -76,13 +76,13 @@ RefPtr<Gfx::Bitmap> MessageBox::icon() const { switch (m_type) { case Type::Information: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-information.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-information.png"sv).release_value_but_fixme_should_propagate_errors(); case Type::Warning: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-warning.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-warning.png"sv).release_value_but_fixme_should_propagate_errors(); case Type::Error: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-error.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-error.png"sv).release_value_but_fixme_should_propagate_errors(); case Type::Question: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-question.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-question.png"sv).release_value_but_fixme_should_propagate_errors(); default: return nullptr; } diff --git a/Userland/Libraries/LibGUI/Model.cpp b/Userland/Libraries/LibGUI/Model.cpp index 7ffa5c1fc4..b15f452cee 100644 --- a/Userland/Libraries/LibGUI/Model.cpp +++ b/Userland/Libraries/LibGUI/Model.cpp @@ -108,7 +108,7 @@ RefPtr<Core::MimeData> Model::mime_data(ModelSelection const& selection) const selection.for_each_index([&](auto& index) { auto text_data = index.data(); if (!first) - text_builder.append(", "); + text_builder.append(", "sv); text_builder.append(text_data.to_string()); if (!first) diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h index c143f49ac1..d24122d0fc 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -69,8 +69,8 @@ struct Formatter<GUI::ModelIndex> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::ModelIndex const& value) { if (value.internal_data()) - return Formatter<FormatString>::format(builder, "ModelIndex({},{},{})", value.row(), value.column(), value.internal_data()); - return Formatter<FormatString>::format(builder, "ModelIndex({},{})", value.row(), value.column()); + return Formatter<FormatString>::format(builder, "ModelIndex({},{},{})"sv, value.row(), value.column(), value.internal_data()); + return Formatter<FormatString>::format(builder, "ModelIndex({},{})"sv, value.row(), value.column()); } }; diff --git a/Userland/Libraries/LibGUI/MultiView.cpp b/Userland/Libraries/LibGUI/MultiView.cpp index fff6f0e135..095510a3d0 100644 --- a/Userland/Libraries/LibGUI/MultiView.cpp +++ b/Userland/Libraries/LibGUI/MultiView.cpp @@ -101,19 +101,19 @@ void MultiView::set_column_visible(int column_index, bool visible) void MultiView::build_actions() { m_view_as_icons_action = Action::create_checkable( - "Icon view", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/icon-view.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Icon view", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { set_view_mode(ViewMode::Icon); }, this); m_view_as_table_action = Action::create_checkable( - "Table view", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/table-view.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Table view", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { set_view_mode(ViewMode::Table); }, this); m_view_as_columns_action = Action::create_checkable( - "Columns view", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/columns-view.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Columns view", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { set_view_mode(ViewMode::Columns); }, this); diff --git a/Userland/Libraries/LibGUI/PasswordInputDialog.cpp b/Userland/Libraries/LibGUI/PasswordInputDialog.cpp index a961fe4108..3a8773fede 100644 --- a/Userland/Libraries/LibGUI/PasswordInputDialog.cpp +++ b/Userland/Libraries/LibGUI/PasswordInputDialog.cpp @@ -28,7 +28,7 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, String title, St auto& key_icon_label = *widget.find_descendant_of_type_named<GUI::Label>("key_icon_label"); - key_icon_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/key.png").release_value_but_fixme_should_propagate_errors()); + key_icon_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/key.png"sv).release_value_but_fixme_should_propagate_errors()); auto& server_label = *widget.find_descendant_of_type_named<GUI::Label>("server_label"); server_label.set_text(move(server)); diff --git a/Userland/Libraries/LibGUI/PersistentModelIndex.h b/Userland/Libraries/LibGUI/PersistentModelIndex.h index 5840010e49..0690ebd0de 100644 --- a/Userland/Libraries/LibGUI/PersistentModelIndex.h +++ b/Userland/Libraries/LibGUI/PersistentModelIndex.h @@ -76,7 +76,7 @@ template<> struct Formatter<GUI::PersistentModelIndex> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::PersistentModelIndex const& value) { - return Formatter<FormatString>::format(builder, "PersistentModelIndex({},{},{})", value.row(), value.column(), value.internal_data()); + return Formatter<FormatString>::format(builder, "PersistentModelIndex({},{},{})"sv, value.row(), value.column(), value.internal_data()); } }; diff --git a/Userland/Libraries/LibGUI/ProcessChooser.cpp b/Userland/Libraries/LibGUI/ProcessChooser.cpp index 6c5be287f0..246f507eca 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.cpp +++ b/Userland/Libraries/LibGUI/ProcessChooser.cpp @@ -56,7 +56,7 @@ ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, select_button.set_fixed_width(80); select_button.on_click = [this](auto) { if (m_table_view->selection().is_empty()) { - GUI::MessageBox::show(this, "No process selected!", m_window_title, GUI::MessageBox::Type::Error); + GUI::MessageBox::show(this, "No process selected!"sv, m_window_title, GUI::MessageBox::Type::Error); return; } auto index = m_table_view->selection().first(); diff --git a/Userland/Libraries/LibGUI/ProcessChooser.h b/Userland/Libraries/LibGUI/ProcessChooser.h index e9467e5e1f..ac4b30dc80 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.h +++ b/Userland/Libraries/LibGUI/ProcessChooser.h @@ -22,7 +22,7 @@ public: pid_t pid() const { return m_pid; } private: - ProcessChooser(StringView window_title = "Process Chooser", StringView button_label = "Select", Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr); + ProcessChooser(StringView window_title = "Process Chooser"sv, StringView button_label = "Select"sv, Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr); void set_pid_from_index_and_close(ModelIndex const&); diff --git a/Userland/Libraries/LibGUI/ResizeCorner.cpp b/Userland/Libraries/LibGUI/ResizeCorner.cpp index 072b486cae..2b37546363 100644 --- a/Userland/Libraries/LibGUI/ResizeCorner.cpp +++ b/Userland/Libraries/LibGUI/ResizeCorner.cpp @@ -30,7 +30,7 @@ static constexpr Gfx::CharacterBitmap s_resize_corner_shadows_bitmap { " " " ## ## ## ## ## " " # # # # # " - " ", + " "sv, 16, 16 }; @@ -50,7 +50,7 @@ static constexpr Gfx::CharacterBitmap s_resize_corner_highlights_bitmap { " " " " " # # # # # " - " ", + " "sv, 16, 16 }; diff --git a/Userland/Libraries/LibGUI/SettingsWindow.cpp b/Userland/Libraries/LibGUI/SettingsWindow.cpp index efb4599bd6..17b5541756 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.cpp +++ b/Userland/Libraries/LibGUI/SettingsWindow.cpp @@ -75,7 +75,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(String title, Show if (!window->is_modified()) return Window::CloseRequestDecision::Close; - auto result = MessageBox::show(window, "Apply these settings before closing?", "Unsaved changes", MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel); + auto result = MessageBox::show(window, "Apply these settings before closing?"sv, "Unsaved changes"sv, MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel); switch (result) { case MessageBox::ExecResult::Yes: window->apply_settings(); diff --git a/Userland/Libraries/LibGUI/SpinBox.cpp b/Userland/Libraries/LibGUI/SpinBox.cpp index ab98c62030..470a165f0e 100644 --- a/Userland/Libraries/LibGUI/SpinBox.cpp +++ b/Userland/Libraries/LibGUI/SpinBox.cpp @@ -18,7 +18,7 @@ SpinBox::SpinBox() set_min_size({ 40, 22 }); set_preferred_size({ SpecialDimension::OpportunisticGrow, 22 }); m_editor = add<TextBox>(); - m_editor->set_text("0"); + m_editor->set_text("0"sv); m_editor->on_change = [this, weak_this = make_weak_ptr()] { if (!weak_this) return; @@ -42,13 +42,13 @@ SpinBox::SpinBox() m_increment_button = add<Button>(); m_increment_button->set_button_style(Gfx::ButtonStyle::ThickCap); - m_increment_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png").release_value_but_fixme_should_propagate_errors()); + m_increment_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png"sv).release_value_but_fixme_should_propagate_errors()); m_increment_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_increment_button->on_click = [this](auto) { set_value(m_value + 1); }; m_increment_button->set_auto_repeat_interval(150); m_decrement_button = add<Button>(); m_decrement_button->set_button_style(Gfx::ButtonStyle::ThickCap); - m_decrement_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png").release_value_but_fixme_should_propagate_errors()); + m_decrement_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv).release_value_but_fixme_should_propagate_errors()); m_decrement_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_decrement_button->on_click = [this](auto) { set_value(m_value - 1); }; m_decrement_button->set_auto_repeat_interval(150); diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 0bc89b95c7..2a0d5d76e1 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -89,12 +89,12 @@ void TextEditor::create_actions() m_cut_action->set_enabled(false); m_copy_action->set_enabled(false); m_paste_action = CommonActions::make_paste_action([&](auto&) { paste(); }, this); - m_paste_action->set_enabled(is_editable() && Clipboard::the().fetch_mime_type().starts_with("text/")); + m_paste_action->set_enabled(is_editable() && Clipboard::the().fetch_mime_type().starts_with("text/"sv)); if (is_multi_line()) { m_go_to_line_action = Action::create( - "Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { String value; - if (InputBox::show(window(), value, "Line:", "Go to line") == InputBox::ExecResult::OK) { + if (InputBox::show(window(), value, "Line:"sv, "Go to line"sv) == InputBox::ExecResult::OK) { auto line_target = value.to_uint(); if (line_target.has_value()) { set_cursor_and_focus_line(line_target.value() - 1, 0); @@ -1560,7 +1560,7 @@ void TextEditor::paste() return; auto [data, mime_type, _] = GUI::Clipboard::the().fetch_data_and_type(); - if (!mime_type.starts_with("text/")) + if (!mime_type.starts_with("text/"sv)) return; if (data.is_empty()) @@ -1953,8 +1953,8 @@ void TextEditor::document_did_update_undo_stack() m_undo_action->set_enabled(can_undo() && !text_is_secret()); m_redo_action->set_enabled(can_redo() && !text_is_secret()); - m_undo_action->set_text(make_action_text("&Undo", document().undo_stack().undo_action_text())); - m_redo_action->set_text(make_action_text("&Redo", document().undo_stack().redo_action_text())); + m_undo_action->set_text(make_action_text("&Undo"sv, document().undo_stack().undo_action_text())); + m_redo_action->set_text(make_action_text("&Redo"sv, document().undo_stack().redo_action_text())); // FIXME: This is currently firing more often than it should. // Ideally we'd only send this out when the undo stack modified state actually changes. @@ -1982,7 +1982,7 @@ void TextEditor::cursor_did_change() void TextEditor::clipboard_content_did_change(String const& mime_type) { - m_paste_action->set_enabled(is_editable() && mime_type.starts_with("text/")); + m_paste_action->set_enabled(is_editable() && mime_type.starts_with("text/"sv)); } void TextEditor::set_document(TextDocument& document) diff --git a/Userland/Libraries/LibGUI/TextPosition.h b/Userland/Libraries/LibGUI/TextPosition.h index c6b0bf0225..991adaf68f 100644 --- a/Userland/Libraries/LibGUI/TextPosition.h +++ b/Userland/Libraries/LibGUI/TextPosition.h @@ -45,8 +45,8 @@ struct AK::Formatter<GUI::TextPosition> : AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::TextPosition const& value) { if (value.is_valid()) - return Formatter<FormatString>::format(builder, "({},{})", value.line(), value.column()); + return Formatter<FormatString>::format(builder, "({},{})"sv, value.line(), value.column()); - return Formatter<FormatString>::format(builder, "GUI::TextPosition(Invalid)"); + return builder.put_string("GUI::TextPosition(Invalid)"sv); } }; diff --git a/Userland/Libraries/LibGUI/TextRange.h b/Userland/Libraries/LibGUI/TextRange.h index 2e0b7332ab..ab25148880 100644 --- a/Userland/Libraries/LibGUI/TextRange.h +++ b/Userland/Libraries/LibGUI/TextRange.h @@ -72,7 +72,7 @@ struct AK::Formatter<GUI::TextRange> : AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::TextRange const& value) { if (value.is_valid()) - return Formatter<FormatString>::format(builder, "{}-{}", value.start(), value.end()); - return Formatter<FormatString>::format(builder, "GUI::TextRange(Invalid)"); + return Formatter<FormatString>::format(builder, "{}-{}"sv, value.start(), value.end()); + return builder.put_string("GUI::TextRange(Invalid)"sv); } }; diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp index 9ee2e6da09..2ad9215da0 100644 --- a/Userland/Libraries/LibGUI/TreeView.cpp +++ b/Userland/Libraries/LibGUI/TreeView.cpp @@ -42,8 +42,8 @@ TreeView::TreeView() set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); set_column_headers_visible(false); - m_expand_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-expand.png").release_value_but_fixme_should_propagate_errors(); - m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png").release_value_but_fixme_should_propagate_errors(); + m_expand_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-expand.png"sv).release_value_but_fixme_should_propagate_errors(); + m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png"sv).release_value_but_fixme_should_propagate_errors(); } ModelIndex TreeView::index_at_event_position(Gfx::IntPoint const& a_position, bool& is_toggle) const @@ -644,7 +644,7 @@ void TreeView::auto_resize_column(int column) int header_width = column_header().font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); + header_width += font().width(" \xE2\xAC\x86"sv); int column_width = header_width; bool is_empty = true; @@ -689,7 +689,7 @@ void TreeView::update_column_sizes() continue; int header_width = column_header().font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); + header_width += font().width(" \xE2\xAC\x86"sv); int column_width = header_width; traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int) { auto cell_data = model.index(index.row(), column, index.parent()).data(); @@ -710,7 +710,7 @@ void TreeView::update_column_sizes() int tree_column_header_width = column_header().font().width(model.column_name(tree_column)); if (tree_column == m_key_column && model.is_column_sortable(tree_column)) - tree_column_header_width += font().width(" \xE2\xAC\x86"); + tree_column_header_width += font().width(" \xE2\xAC\x86"sv); int tree_column_width = tree_column_header_width; traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int indent_level) { auto cell_data = model.index(index.row(), tree_column, index.parent()).data(); diff --git a/Userland/Libraries/LibGUI/UIDimensions.h b/Userland/Libraries/LibGUI/UIDimensions.h index f1beab0991..082dcf8032 100644 --- a/Userland/Libraries/LibGUI/UIDimensions.h +++ b/Userland/Libraries/LibGUI/UIDimensions.h @@ -298,17 +298,17 @@ inline auto clamp<GUI::UIDimension>(GUI::UIDimension const& input, GUI::UIDimens [this] { \ auto size = this->getter(); \ JsonObject size_object; \ - size_object.set("width", size.width().as_json_value()); \ - size_object.set("height", size.height().as_json_value()); \ + size_object.set("width"sv, size.width().as_json_value()); \ + size_object.set("height"sv, size.height().as_json_value()); \ return size_object; \ }, \ [this](auto& value) { \ if (!value.is_object()) \ return false; \ auto result_width = GUI::UIDimension::construct_from_json_value( \ - value.as_object().get("width")); \ + value.as_object().get("width"sv)); \ auto result_height = GUI::UIDimension::construct_from_json_value( \ - value.as_object().get("height")); \ + value.as_object().get("height"sv)); \ if (result_width.has_value() && result_height.has_value()) { \ GUI::UISize size(result_width.value(), result_height.value()); \ setter(size); \ diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index c3fd5e39d7..8486f0fa6d 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -1150,7 +1150,7 @@ bool Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::O return false; } - auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"); + auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"sv); if (auto* registration = Core::ObjectClassRegistration::find(class_name)) { auto layout = registration->construct(); if (!layout || !registration->is_derived_from(layout_class)) { @@ -1168,7 +1168,7 @@ bool Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::O }); } - auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"); + auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"sv); bool is_tab_widget = is<TabWidget>(*this); object->for_each_child_object_interruptible([&](auto child_data) { auto class_name = child_data->name(); diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index 0f8c8b8e80..82bfcc0c63 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -32,12 +32,12 @@ extern Core::ObjectClassRegistration registration_Widget; } } -#define REGISTER_WIDGET(namespace_, class_name) \ - namespace Core { \ - namespace Registration { \ - Core::ObjectClassRegistration registration_##class_name( \ - #namespace_ "::" #class_name, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Widget); \ - } \ +#define REGISTER_WIDGET(namespace_, class_name) \ + namespace Core { \ + namespace Registration { \ + Core::ObjectClassRegistration registration_##class_name( \ + #namespace_ "::" #class_name##sv, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Widget); \ + } \ } namespace GUI { diff --git a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp index c7d639c177..fff99f1f97 100644 --- a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp +++ b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp @@ -21,7 +21,7 @@ CoverWizardPage::CoverWizardPage() set_layout<HorizontalBoxLayout>(); m_banner_image_widget = add<ImageWidget>(); m_banner_image_widget->set_fixed_size(160, 315); - m_banner_image_widget->load_from_file("/res/graphics/wizard-banner-simple.png"); + m_banner_image_widget->load_from_file("/res/graphics/wizard-banner-simple.png"sv); m_content_widget = add<Widget>(); m_content_widget->set_layout<VerticalBoxLayout>(); diff --git a/Userland/Libraries/LibGemini/Document.cpp b/Userland/Libraries/LibGemini/Document.cpp index 623a6b22f7..cea128e7a6 100644 --- a/Userland/Libraries/LibGemini/Document.cpp +++ b/Userland/Libraries/LibGemini/Document.cpp @@ -15,16 +15,16 @@ namespace Gemini { String Document::render_to_html() const { StringBuilder html_builder; - html_builder.append("<!DOCTYPE html>\n<html>\n"); - html_builder.append("<head>\n<title>"); + html_builder.append("<!DOCTYPE html>\n<html>\n"sv); + html_builder.append("<head>\n<title>"sv); html_builder.append(m_url.path()); - html_builder.append("</title>\n</head>\n"); - html_builder.append("<body>\n"); + html_builder.append("</title>\n</head>\n"sv); + html_builder.append("<body>\n"sv); for (auto& line : m_lines) { html_builder.append(line.render_to_html()); } - html_builder.append("</body>"); - html_builder.append("</html>"); + html_builder.append("</body>"sv); + html_builder.append("</html>"sv); return html_builder.build(); } @@ -45,7 +45,7 @@ void Document::read_lines(StringView source) }; for (auto& line : source.lines()) { - if (line.starts_with("```")) { + if (line.starts_with("```"sv)) { close_list_if_needed(); m_inside_preformatted_block = !m_inside_preformatted_block; diff --git a/Userland/Libraries/LibGemini/GeminiRequest.cpp b/Userland/Libraries/LibGemini/GeminiRequest.cpp index eda8439b1d..37c5798ab4 100644 --- a/Userland/Libraries/LibGemini/GeminiRequest.cpp +++ b/Userland/Libraries/LibGemini/GeminiRequest.cpp @@ -14,7 +14,7 @@ ByteBuffer GeminiRequest::to_raw_request() const { StringBuilder builder; builder.append(m_url.to_string()); - builder.append("\r\n"); + builder.append("\r\n"sv); return builder.to_byte_buffer(); } diff --git a/Userland/Libraries/LibGemini/Line.cpp b/Userland/Libraries/LibGemini/Line.cpp index 5e5b2dd810..a4816c5ab9 100644 --- a/Userland/Libraries/LibGemini/Line.cpp +++ b/Userland/Libraries/LibGemini/Line.cpp @@ -13,7 +13,7 @@ String Text::render_to_html() const { StringBuilder builder; builder.append(escape_html_entities(m_text)); - builder.append("<br>\n"); + builder.append("<br>\n"sv); return builder.build(); } @@ -28,9 +28,9 @@ String UnorderedList::render_to_html() const // FIXME: The spec is unclear about what the space means, or where it goes // somehow figure this out StringBuilder builder; - builder.append("<li>"); + builder.append("<li>"sv); builder.append(escape_html_entities(m_text.substring_view(1, m_text.length() - 1))); - builder.append("</li>"); + builder.append("</li>"sv); return builder.build(); } @@ -59,7 +59,7 @@ Link::Link(String text, Document const& document) while (index < m_text.length() && (m_text[index] == ' ' || m_text[index] == '\t')) ++index; auto url_string = m_text.substring_view(index, m_text.length() - index); - auto space_offset = url_string.find_any_of(" \t"); + auto space_offset = url_string.find_any_of(" \t"sv); String url = url_string; if (space_offset.has_value()) { url = url_string.substring_view(0, space_offset.value()); @@ -76,11 +76,11 @@ Link::Link(String text, Document const& document) String Link::render_to_html() const { StringBuilder builder; - builder.append("<a href=\""); + builder.append("<a href=\""sv); builder.append(escape_html_entities(m_url.to_string())); - builder.append("\">"); + builder.append("\">"sv); builder.append(escape_html_entities(m_name)); - builder.append("</a><br>\n"); + builder.append("</a><br>\n"sv); return builder.build(); } @@ -88,7 +88,7 @@ String Preformatted::render_to_html() const { StringBuilder builder; builder.append(escape_html_entities(m_text)); - builder.append("\n"); + builder.append('\n'); return builder.build(); } diff --git a/Userland/Libraries/LibGfx/AffineTransform.h b/Userland/Libraries/LibGfx/AffineTransform.h index 2dd8e9de29..f6abcec665 100644 --- a/Userland/Libraries/LibGfx/AffineTransform.h +++ b/Userland/Libraries/LibGfx/AffineTransform.h @@ -77,6 +77,6 @@ template<> struct AK::Formatter<Gfx::AffineTransform> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, Gfx::AffineTransform const& value) { - return Formatter<FormatString>::format(builder, "[{} {} {} {} {} {}]", value.a(), value.b(), value.c(), value.d(), value.e(), value.f()); + return Formatter<FormatString>::format(builder, "[{} {} {} {} {} {}]"sv, value.a(), value.b(), value.c(), value.d(), value.e(), value.f()); } }; diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp index 9f55da796d..a6ca112f93 100644 --- a/Userland/Libraries/LibGfx/Bitmap.cpp +++ b/Userland/Libraries/LibGfx/Bitmap.cpp @@ -104,7 +104,7 @@ ErrorOr<NonnullRefPtr<Bitmap>> Bitmap::try_create_wrapper(BitmapFormat format, I ErrorOr<NonnullRefPtr<Bitmap>> Bitmap::try_load_from_file(StringView path, int scale_factor) { - if (scale_factor > 1 && path.starts_with("/res/")) { + if (scale_factor > 1 && path.starts_with("/res/"sv)) { LexicalPath lexical_path { path }; StringBuilder highdpi_icon_path; TRY(highdpi_icon_path.try_appendff("{}/{}-{}x.{}", lexical_path.dirname(), lexical_path.title(), scale_factor, lexical_path.extension())); diff --git a/Userland/Libraries/LibGfx/Bitmap.h b/Userland/Libraries/LibGfx/Bitmap.h index a3ded47679..62d5f362ec 100644 --- a/Userland/Libraries/LibGfx/Bitmap.h +++ b/Userland/Libraries/LibGfx/Bitmap.h @@ -100,8 +100,8 @@ public: static bool is_path_a_supported_image_format(StringView path) { -#define __ENUMERATE_IMAGE_FORMAT(Name, Ext) \ - if (path.ends_with(Ext, CaseSensitivity::CaseInsensitive)) \ +#define __ENUMERATE_IMAGE_FORMAT(Name, Ext) \ + if (path.ends_with(Ext##sv, CaseSensitivity::CaseInsensitive)) \ return true; ENUMERATE_IMAGE_FORMATS #undef __ENUMERATE_IMAGE_FORMAT diff --git a/Userland/Libraries/LibGfx/ClassicStylePainter.cpp b/Userland/Libraries/LibGfx/ClassicStylePainter.cpp index be863de0f8..206b34bd26 100644 --- a/Userland/Libraries/LibGfx/ClassicStylePainter.cpp +++ b/Userland/Libraries/LibGfx/ClassicStylePainter.cpp @@ -409,10 +409,10 @@ static Gfx::Bitmap const& circle_bitmap(bool checked, bool changing) void ClassicStylePainter::paint_radio_button(Painter& painter, IntRect const& rect, Palette const&, bool is_checked, bool is_being_pressed) { if (!s_unfilled_circle_bitmap) { - s_unfilled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/unfilled-radio-circle.png").release_value_but_fixme_should_propagate_errors(); - s_filled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/filled-radio-circle.png").release_value_but_fixme_should_propagate_errors(); - s_changing_filled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/changing-filled-radio-circle.png").release_value_but_fixme_should_propagate_errors(); - s_changing_unfilled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/changing-unfilled-radio-circle.png").release_value_but_fixme_should_propagate_errors(); + s_unfilled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/unfilled-radio-circle.png"sv).release_value_but_fixme_should_propagate_errors(); + s_filled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/filled-radio-circle.png"sv).release_value_but_fixme_should_propagate_errors(); + s_changing_filled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/changing-filled-radio-circle.png"sv).release_value_but_fixme_should_propagate_errors(); + s_changing_unfilled_circle_bitmap = Bitmap::try_load_from_file("/res/icons/serenity/changing-unfilled-radio-circle.png"sv).release_value_but_fixme_should_propagate_errors(); } auto& bitmap = circle_bitmap(is_checked, is_being_pressed); @@ -428,7 +428,7 @@ static constexpr Gfx::CharacterBitmap s_checked_bitmap { " ##### " " ### " " # " - " ", + " "sv, 9, 9 }; diff --git a/Userland/Libraries/LibGfx/Color.cpp b/Userland/Libraries/LibGfx/Color.cpp index b5abcb8844..d870d5c2e1 100644 --- a/Userland/Libraries/LibGfx/Color.cpp +++ b/Userland/Libraries/LibGfx/Color.cpp @@ -29,7 +29,7 @@ String Color::to_string_without_alpha() const static Optional<Color> parse_rgb_color(StringView string) { - VERIFY(string.starts_with("rgb(", CaseSensitivity::CaseInsensitive)); + VERIFY(string.starts_with("rgb("sv, CaseSensitivity::CaseInsensitive)); VERIFY(string.ends_with(")")); auto substring = string.substring_view(4, string.length() - 5); @@ -50,7 +50,7 @@ static Optional<Color> parse_rgb_color(StringView string) static Optional<Color> parse_rgba_color(StringView string) { - VERIFY(string.starts_with("rgba(", CaseSensitivity::CaseInsensitive)); + VERIFY(string.starts_with("rgba("sv, CaseSensitivity::CaseInsensitive)); VERIFY(string.ends_with(")")); auto substring = string.substring_view(5, string.length() - 6); @@ -244,7 +244,7 @@ Optional<Color> Color::from_string(StringView string) { 0x000000, nullptr } }; - if (string.equals_ignoring_case("transparent")) + if (string.equals_ignoring_case("transparent"sv)) return Color::from_argb(0x00000000); for (size_t i = 0; !web_colors[i].name.is_null(); ++i) { @@ -252,10 +252,10 @@ Optional<Color> Color::from_string(StringView string) return Color::from_rgb(web_colors[i].color); } - if (string.starts_with("rgb(", CaseSensitivity::CaseInsensitive) && string.ends_with(")")) + if (string.starts_with("rgb("sv, CaseSensitivity::CaseInsensitive) && string.ends_with(")")) return parse_rgb_color(string); - if (string.starts_with("rgba(", CaseSensitivity::CaseInsensitive) && string.ends_with(")")) + if (string.starts_with("rgba("sv, CaseSensitivity::CaseInsensitive) && string.ends_with(")")) return parse_rgba_color(string); if (string[0] != '#') diff --git a/Userland/Libraries/LibGfx/DDSLoader.cpp b/Userland/Libraries/LibGfx/DDSLoader.cpp index 3902d141e3..3adaaf4117 100644 --- a/Userland/Libraries/LibGfx/DDSLoader.cpp +++ b/Userland/Libraries/LibGfx/DDSLoader.cpp @@ -806,27 +806,27 @@ void DDSLoadingContext::dump_debug() { StringBuilder builder; - builder.append("\nDDS:\n"); + builder.append("\nDDS:\n"sv); builder.appendff("\tHeader Size: {}\n", header.size); - builder.append("\tFlags:"); + builder.append("\tFlags:"sv); if ((header.flags & DDSFlags::DDSD_CAPS) == DDSFlags::DDSD_CAPS) - builder.append(" DDSD_CAPS"); + builder.append(" DDSD_CAPS"sv); if ((header.flags & DDSFlags::DDSD_HEIGHT) == DDSFlags::DDSD_HEIGHT) - builder.append(" DDSD_HEIGHT"); + builder.append(" DDSD_HEIGHT"sv); if ((header.flags & DDSFlags::DDSD_WIDTH) == DDSFlags::DDSD_WIDTH) - builder.append(" DDSD_WIDTH"); + builder.append(" DDSD_WIDTH"sv); if ((header.flags & DDSFlags::DDSD_PITCH) == DDSFlags::DDSD_PITCH) - builder.append(" DDSD_PITCH"); + builder.append(" DDSD_PITCH"sv); if ((header.flags & DDSFlags::DDSD_PIXELFORMAT) == DDSFlags::DDSD_PIXELFORMAT) - builder.append(" DDSD_PIXELFORMAT"); + builder.append(" DDSD_PIXELFORMAT"sv); if ((header.flags & DDSFlags::DDSD_MIPMAPCOUNT) == DDSFlags::DDSD_MIPMAPCOUNT) - builder.append(" DDSD_MIPMAPCOUNT"); + builder.append(" DDSD_MIPMAPCOUNT"sv); if ((header.flags & DDSFlags::DDSD_LINEARSIZE) == DDSFlags::DDSD_LINEARSIZE) - builder.append(" DDSD_LINEARSIZE"); + builder.append(" DDSD_LINEARSIZE"sv); if ((header.flags & DDSFlags::DDSD_DEPTH) == DDSFlags::DDSD_DEPTH) - builder.append(" DDSD_DEPTH"); - builder.append("\n"); + builder.append(" DDSD_DEPTH"sv); + builder.append("\n"sv); builder.appendff("\tHeight: {}\n", header.height); builder.appendff("\tWidth: {}\n", header.width); @@ -834,105 +834,105 @@ void DDSLoadingContext::dump_debug() builder.appendff("\tDepth: {}\n", header.depth); builder.appendff("\tMipmap Count: {}\n", header.mip_map_count); - builder.append("\tCaps:"); + builder.append("\tCaps:"sv); if ((header.caps1 & Caps1Flags::DDSCAPS_COMPLEX) == Caps1Flags::DDSCAPS_COMPLEX) - builder.append(" DDSCAPS_COMPLEX"); + builder.append(" DDSCAPS_COMPLEX"sv); if ((header.caps1 & Caps1Flags::DDSCAPS_MIPMAP) == Caps1Flags::DDSCAPS_MIPMAP) - builder.append(" DDSCAPS_MIPMAP"); + builder.append(" DDSCAPS_MIPMAP"sv); if ((header.caps1 & Caps1Flags::DDSCAPS_TEXTURE) == Caps1Flags::DDSCAPS_TEXTURE) - builder.append(" DDSCAPS_TEXTURE"); - builder.append("\n"); + builder.append(" DDSCAPS_TEXTURE"sv); + builder.append("\n"sv); - builder.append("\tCaps2:"); + builder.append("\tCaps2:"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_CUBEMAP) == Caps2Flags::DDSCAPS2_CUBEMAP) - builder.append(" DDSCAPS2_CUBEMAP"); + builder.append(" DDSCAPS2_CUBEMAP"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_CUBEMAP_POSITIVEX) == Caps2Flags::DDSCAPS2_CUBEMAP_POSITIVEX) - builder.append(" DDSCAPS2_CUBEMAP_POSITIVEX"); + builder.append(" DDSCAPS2_CUBEMAP_POSITIVEX"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_CUBEMAP_NEGATIVEX) == Caps2Flags::DDSCAPS2_CUBEMAP_NEGATIVEX) - builder.append(" DDSCAPS2_CUBEMAP_NEGATIVEX"); + builder.append(" DDSCAPS2_CUBEMAP_NEGATIVEX"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_CUBEMAP_POSITIVEY) == Caps2Flags::DDSCAPS2_CUBEMAP_POSITIVEY) - builder.append(" DDSCAPS2_CUBEMAP_POSITIVEY"); + builder.append(" DDSCAPS2_CUBEMAP_POSITIVEY"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_CUBEMAP_NEGATIVEY) == Caps2Flags::DDSCAPS2_CUBEMAP_NEGATIVEY) - builder.append(" DDSCAPS2_CUBEMAP_NEGATIVEY"); + builder.append(" DDSCAPS2_CUBEMAP_NEGATIVEY"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_CUBEMAP_POSITIVEZ) == Caps2Flags::DDSCAPS2_CUBEMAP_POSITIVEZ) - builder.append(" DDSCAPS2_CUBEMAP_POSITIVEZ"); + builder.append(" DDSCAPS2_CUBEMAP_POSITIVEZ"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_CUBEMAP_NEGATIVEZ) == Caps2Flags::DDSCAPS2_CUBEMAP_NEGATIVEZ) - builder.append(" DDSCAPS2_CUBEMAP_NEGATIVEZ"); + builder.append(" DDSCAPS2_CUBEMAP_NEGATIVEZ"sv); if ((header.caps2 & Caps2Flags::DDSCAPS2_VOLUME) == Caps2Flags::DDSCAPS2_VOLUME) - builder.append(" DDSCAPS2_VOLUME"); - builder.append("\n"); + builder.append(" DDSCAPS2_VOLUME"sv); + builder.append("\n"sv); - builder.append("Pixel Format:\n"); + builder.append("Pixel Format:\n"sv); builder.appendff("\tStruct Size: {}\n", header.pixel_format.size); - builder.append("\tFlags:"); + builder.append("\tFlags:"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_ALPHAPIXELS) == PixelFormatFlags::DDPF_ALPHAPIXELS) - builder.append(" DDPF_ALPHAPIXELS"); + builder.append(" DDPF_ALPHAPIXELS"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_ALPHA) == PixelFormatFlags::DDPF_ALPHA) - builder.append(" DDPF_ALPHA"); + builder.append(" DDPF_ALPHA"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_FOURCC) == PixelFormatFlags::DDPF_FOURCC) - builder.append(" DDPF_FOURCC"); + builder.append(" DDPF_FOURCC"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_PALETTEINDEXED8) == PixelFormatFlags::DDPF_PALETTEINDEXED8) - builder.append(" DDPF_PALETTEINDEXED8"); + builder.append(" DDPF_PALETTEINDEXED8"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_RGB) == PixelFormatFlags::DDPF_RGB) - builder.append(" DDPF_RGB"); + builder.append(" DDPF_RGB"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_YUV) == PixelFormatFlags::DDPF_YUV) - builder.append(" DDPF_YUV"); + builder.append(" DDPF_YUV"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_LUMINANCE) == PixelFormatFlags::DDPF_LUMINANCE) - builder.append(" DDPF_LUMINANCE"); + builder.append(" DDPF_LUMINANCE"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_BUMPDUDV) == PixelFormatFlags::DDPF_BUMPDUDV) - builder.append(" DDPF_BUMPDUDV"); + builder.append(" DDPF_BUMPDUDV"sv); if ((header.pixel_format.flags & PixelFormatFlags::DDPF_NORMAL) == PixelFormatFlags::DDPF_NORMAL) - builder.append(" DDPF_NORMAL"); - builder.append("\n"); + builder.append(" DDPF_NORMAL"sv); + builder.append("\n"sv); - builder.append("\tFour CC: "); + builder.append("\tFour CC: "sv); builder.appendff("{:c}", (header.pixel_format.four_cc >> (8 * 0)) & 0xFF); builder.appendff("{:c}", (header.pixel_format.four_cc >> (8 * 1)) & 0xFF); builder.appendff("{:c}", (header.pixel_format.four_cc >> (8 * 2)) & 0xFF); builder.appendff("{:c}", (header.pixel_format.four_cc >> (8 * 3)) & 0xFF); - builder.append("\n"); + builder.append("\n"sv); builder.appendff("\tRGB Bit Count: {}\n", header.pixel_format.rgb_bit_count); builder.appendff("\tR Bit Mask: {}\n", header.pixel_format.r_bit_mask); builder.appendff("\tG Bit Mask: {}\n", header.pixel_format.g_bit_mask); builder.appendff("\tB Bit Mask: {}\n", header.pixel_format.b_bit_mask); builder.appendff("\tA Bit Mask: {}\n", header.pixel_format.a_bit_mask); - builder.append("DDS10:\n"); + builder.append("DDS10:\n"sv); builder.appendff("\tFormat: {}\n", static_cast<u32>(header10.format)); - builder.append("\tResource Dimension:"); + builder.append("\tResource Dimension:"sv); if ((header10.resource_dimension & ResourceDimensions::DDS_DIMENSION_UNKNOWN) == ResourceDimensions::DDS_DIMENSION_UNKNOWN) - builder.append(" DDS_DIMENSION_UNKNOWN"); + builder.append(" DDS_DIMENSION_UNKNOWN"sv); if ((header10.resource_dimension & ResourceDimensions::DDS_DIMENSION_BUFFER) == ResourceDimensions::DDS_DIMENSION_BUFFER) - builder.append(" DDS_DIMENSION_BUFFER"); + builder.append(" DDS_DIMENSION_BUFFER"sv); if ((header10.resource_dimension & ResourceDimensions::DDS_DIMENSION_TEXTURE1D) == ResourceDimensions::DDS_DIMENSION_TEXTURE1D) - builder.append(" DDS_DIMENSION_TEXTURE1D"); + builder.append(" DDS_DIMENSION_TEXTURE1D"sv); if ((header10.resource_dimension & ResourceDimensions::DDS_DIMENSION_TEXTURE2D) == ResourceDimensions::DDS_DIMENSION_TEXTURE2D) - builder.append(" DDS_DIMENSION_TEXTURE2D"); + builder.append(" DDS_DIMENSION_TEXTURE2D"sv); if ((header10.resource_dimension & ResourceDimensions::DDS_DIMENSION_TEXTURE3D) == ResourceDimensions::DDS_DIMENSION_TEXTURE3D) - builder.append(" DDS_DIMENSION_TEXTURE3D"); - builder.append("\n"); + builder.append(" DDS_DIMENSION_TEXTURE3D"sv); + builder.append("\n"sv); builder.appendff("\tArray Size: {}\n", header10.array_size); - builder.append("\tMisc Flags:"); + builder.append("\tMisc Flags:"sv); if ((header10.misc_flag & MiscFlags::DDS_RESOURCE_MISC_TEXTURECUBE) == MiscFlags::DDS_RESOURCE_MISC_TEXTURECUBE) - builder.append(" DDS_RESOURCE_MISC_TEXTURECUBE"); - builder.append("\n"); + builder.append(" DDS_RESOURCE_MISC_TEXTURECUBE"sv); + builder.append("\n"sv); - builder.append("\tMisc Flags 2:"); + builder.append("\tMisc Flags 2:"sv); if ((header10.misc_flag2 & Misc2Flags::DDS_ALPHA_MODE_UNKNOWN) == Misc2Flags::DDS_ALPHA_MODE_UNKNOWN) - builder.append(" DDS_ALPHA_MODE_UNKNOWN"); + builder.append(" DDS_ALPHA_MODE_UNKNOWN"sv); if ((header10.misc_flag2 & Misc2Flags::DDS_ALPHA_MODE_STRAIGHT) == Misc2Flags::DDS_ALPHA_MODE_STRAIGHT) - builder.append(" DDS_ALPHA_MODE_STRAIGHT"); + builder.append(" DDS_ALPHA_MODE_STRAIGHT"sv); if ((header10.misc_flag2 & Misc2Flags::DDS_ALPHA_MODE_PREMULTIPLIED) == Misc2Flags::DDS_ALPHA_MODE_PREMULTIPLIED) - builder.append(" DDS_ALPHA_MODE_PREMULTIPLIED"); + builder.append(" DDS_ALPHA_MODE_PREMULTIPLIED"sv); if ((header10.misc_flag2 & Misc2Flags::DDS_ALPHA_MODE_OPAQUE) == Misc2Flags::DDS_ALPHA_MODE_OPAQUE) - builder.append(" DDS_ALPHA_MODE_OPAQUE"); + builder.append(" DDS_ALPHA_MODE_OPAQUE"sv); if ((header10.misc_flag2 & Misc2Flags::DDS_ALPHA_MODE_CUSTOM) == Misc2Flags::DDS_ALPHA_MODE_CUSTOM) - builder.append(" DDS_ALPHA_MODE_CUSTOM"); - builder.append("\n"); + builder.append(" DDS_ALPHA_MODE_CUSTOM"sv); + builder.append("\n"sv); dbgln("{}", builder.to_string()); } diff --git a/Userland/Libraries/LibGfx/Font/Emoji.cpp b/Userland/Libraries/LibGfx/Font/Emoji.cpp index 1d2099f066..db4d6be060 100644 --- a/Userland/Libraries/LibGfx/Font/Emoji.cpp +++ b/Userland/Libraries/LibGfx/Font/Emoji.cpp @@ -31,7 +31,7 @@ Bitmap const* Emoji::emoji_for_code_points(Span<u32> const& code_points) if (it != s_emojis.end()) return (*it).value.ptr(); - auto basename = String::join('_', code_points, "U+{:X}"); + auto basename = String::join('_', code_points, "U+{:X}"sv); auto bitmap_or_error = Bitmap::try_load_from_file(String::formatted("/res/emoji/{}.png", basename)); if (bitmap_or_error.is_error()) { s_emojis.set(code_points, nullptr); diff --git a/Userland/Libraries/LibGfx/PBMLoader.h b/Userland/Libraries/LibGfx/PBMLoader.h index 8c402de31f..e37d037f20 100644 --- a/Userland/Libraries/LibGfx/PBMLoader.h +++ b/Userland/Libraries/LibGfx/PBMLoader.h @@ -16,7 +16,7 @@ namespace Gfx { struct PBM { static constexpr auto ascii_magic_number = '1'; static constexpr auto binary_magic_number = '4'; - static constexpr StringView image_type = "PBM"; + static constexpr StringView image_type = "PBM"sv; }; using PBMLoadingContext = PortableImageMapLoadingContext<PBM>; diff --git a/Userland/Libraries/LibGfx/PGMLoader.h b/Userland/Libraries/LibGfx/PGMLoader.h index 5783104dc8..f5b4778042 100644 --- a/Userland/Libraries/LibGfx/PGMLoader.h +++ b/Userland/Libraries/LibGfx/PGMLoader.h @@ -16,7 +16,7 @@ namespace Gfx { struct PGM { static constexpr auto ascii_magic_number = '2'; static constexpr auto binary_magic_number = '5'; - static constexpr StringView image_type = "PGM"; + static constexpr StringView image_type = "PGM"sv; u16 max_val { 0 }; }; diff --git a/Userland/Libraries/LibGfx/PPMLoader.h b/Userland/Libraries/LibGfx/PPMLoader.h index 2d91640005..661b2a7c69 100644 --- a/Userland/Libraries/LibGfx/PPMLoader.h +++ b/Userland/Libraries/LibGfx/PPMLoader.h @@ -16,7 +16,7 @@ namespace Gfx { struct PPM { static constexpr auto ascii_magic_number = '3'; static constexpr auto binary_magic_number = '6'; - static constexpr StringView image_type = "PPM"; + static constexpr StringView image_type = "PPM"sv; u16 max_val { 0 }; }; diff --git a/Userland/Libraries/LibGfx/Path.cpp b/Userland/Libraries/LibGfx/Path.cpp index 85500700aa..5d8380db08 100644 --- a/Userland/Libraries/LibGfx/Path.cpp +++ b/Userland/Libraries/LibGfx/Path.cpp @@ -180,39 +180,39 @@ void Path::close_all_subpaths() String Path::to_string() const { StringBuilder builder; - builder.append("Path { "); + builder.append("Path { "sv); for (auto& segment : m_segments) { switch (segment.type()) { case Segment::Type::MoveTo: - builder.append("MoveTo"); + builder.append("MoveTo"sv); break; case Segment::Type::LineTo: - builder.append("LineTo"); + builder.append("LineTo"sv); break; case Segment::Type::QuadraticBezierCurveTo: - builder.append("QuadraticBezierCurveTo"); + builder.append("QuadraticBezierCurveTo"sv); break; case Segment::Type::CubicBezierCurveTo: - builder.append("CubicBezierCurveTo"); + builder.append("CubicBezierCurveTo"sv); break; case Segment::Type::EllipticalArcTo: - builder.append("EllipticalArcTo"); + builder.append("EllipticalArcTo"sv); break; case Segment::Type::Invalid: - builder.append("Invalid"); + builder.append("Invalid"sv); break; } builder.appendff("({}", segment.point()); switch (segment.type()) { case Segment::Type::QuadraticBezierCurveTo: - builder.append(", "); + builder.append(", "sv); builder.append(static_cast<QuadraticBezierCurveSegment const&>(segment).through().to_string()); break; case Segment::Type::CubicBezierCurveTo: - builder.append(", "); + builder.append(", "sv); builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_0().to_string()); - builder.append(", "); + builder.append(", "sv); builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_1().to_string()); break; case Segment::Type::EllipticalArcTo: { @@ -229,7 +229,7 @@ String Path::to_string() const break; } - builder.append(") "); + builder.append(") "sv); } builder.append("}"); return builder.to_string(); diff --git a/Userland/Libraries/LibGfx/SystemTheme.h b/Userland/Libraries/LibGfx/SystemTheme.h index aad4a28a95..b3d16c31a7 100644 --- a/Userland/Libraries/LibGfx/SystemTheme.h +++ b/Userland/Libraries/LibGfx/SystemTheme.h @@ -245,15 +245,15 @@ enum class PathRole { __Count, }; -inline char const* to_string(PathRole role) +inline StringView to_string(PathRole role) { switch (role) { case PathRole::NoRole: - return "NoRole"; + return "NoRole"sv; #undef __ENUMERATE_PATH_ROLE #define __ENUMERATE_PATH_ROLE(role) \ case PathRole::role: \ - return #role; + return #role##sv; ENUMERATE_PATH_ROLES(__ENUMERATE_PATH_ROLE) #undef __ENUMERATE_PATH_ROLE default: diff --git a/Userland/Libraries/LibGfx/TextLayout.cpp b/Userland/Libraries/LibGfx/TextLayout.cpp index 4e5ffae0ce..453b454191 100644 --- a/Userland/Libraries/LibGfx/TextLayout.cpp +++ b/Userland/Libraries/LibGfx/TextLayout.cpp @@ -187,7 +187,7 @@ String TextLayout::elide_text_from_right(Utf8View text, bool force_elision) cons { size_t text_width = m_font->width(text); if (force_elision || text_width > static_cast<unsigned>(m_rect.width())) { - size_t ellipsis_width = m_font->width("..."); + size_t ellipsis_width = m_font->width("..."sv); size_t current_width = ellipsis_width; size_t glyph_spacing = m_font->glyph_spacing(); @@ -211,7 +211,7 @@ String TextLayout::elide_text_from_right(Utf8View text, bool force_elision) cons StringBuilder builder; builder.append(text.substring_view(0, offset).as_string()); - builder.append("..."); + builder.append("..."sv); return builder.to_string(); } } diff --git a/Userland/Libraries/LibHTTP/HttpRequest.cpp b/Userland/Libraries/LibHTTP/HttpRequest.cpp index 92c87bbbe2..61072af838 100644 --- a/Userland/Libraries/LibHTTP/HttpRequest.cpp +++ b/Userland/Libraries/LibHTTP/HttpRequest.cpp @@ -51,22 +51,22 @@ ByteBuffer HttpRequest::to_raw_request() const builder.append('?'); builder.append(m_url.query()); } - builder.append(" HTTP/1.1\r\nHost: "); + builder.append(" HTTP/1.1\r\nHost: "sv); builder.append(m_url.host()); if (m_url.port().has_value()) builder.appendff(":{}", *m_url.port()); - builder.append("\r\n"); + builder.append("\r\n"sv); for (auto& header : m_headers) { builder.append(header.name); - builder.append(": "); + builder.append(": "sv); builder.append(header.value); - builder.append("\r\n"); + builder.append("\r\n"sv); } if (!m_body.is_empty()) { builder.appendff("Content-Length: {}\r\n\r\n", m_body.size()); builder.append((char const*)m_body.data(), m_body.size()); } - builder.append("\r\n"); + builder.append("\r\n"sv); return builder.to_byte_buffer(); } @@ -204,14 +204,14 @@ Optional<HttpRequest::Header> HttpRequest::get_http_basic_authentication_header( builder.append(url.password()); auto token = encode_base64(builder.to_string().bytes()); builder.clear(); - builder.append("Basic "); + builder.append("Basic "sv); builder.append(token); return Header { "Authorization", builder.to_string() }; } Optional<HttpRequest::BasicAuthenticationCredentials> HttpRequest::parse_http_basic_authentication_header(String const& value) { - if (!value.starts_with("Basic ", AK::CaseSensitivity::CaseInsensitive)) + if (!value.starts_with("Basic "sv, AK::CaseSensitivity::CaseInsensitive)) return {}; auto token = value.substring_view(6); if (token.is_empty()) diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp index c7d2330e8b..f9f3e99453 100644 --- a/Userland/Libraries/LibHTTP/Job.cpp +++ b/Userland/Libraries/LibHTTP/Job.cpp @@ -370,7 +370,7 @@ void Job::on_socket_connected() return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); }); } auto value = line.substring(name.length() + 2, line.length() - name.length() - 2); - if (name.equals_ignoring_case("Set-Cookie")) { + if (name.equals_ignoring_case("Set-Cookie"sv)) { dbgln_if(JOB_DEBUG, "Job: Received Set-Cookie header: '{}'", value); m_set_cookie_headers.append(move(value)); @@ -388,11 +388,11 @@ void Job::on_socket_connected() } else { m_headers.set(name, value); } - if (name.equals_ignoring_case("Content-Encoding")) { + if (name.equals_ignoring_case("Content-Encoding"sv)) { // Assume that any content-encoding means that we can't decode it as a stream :( dbgln_if(JOB_DEBUG, "Content-Encoding {} detected, cannot stream output :(", value); m_can_stream_response = false; - } else if (name.equals_ignoring_case("Content-Length")) { + } else if (name.equals_ignoring_case("Content-Length"sv)) { auto length = value.to_uint(); if (length.has_value()) m_content_length = length.value(); @@ -485,7 +485,7 @@ void Job::on_socket_connected() auto encoding = transfer_encoding.value().trim_whitespace(); dbgln_if(JOB_DEBUG, "Job: This content has transfer encoding '{}'", encoding); - if (encoding.equals_ignoring_case("chunked")) { + if (encoding.equals_ignoring_case("chunked"sv)) { m_current_chunk_remaining_size = -1; goto read_chunk_size; } else { diff --git a/Userland/Libraries/LibIMAP/Client.cpp b/Userland/Libraries/LibIMAP/Client.cpp index dfb99ec918..b4bd10c580 100644 --- a/Userland/Libraries/LibIMAP/Client.cpp +++ b/Userland/Libraries/LibIMAP/Client.cpp @@ -288,17 +288,17 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::store(StoreMethod method, Seque StringBuilder data_item_name; switch (method) { case StoreMethod::Replace: - data_item_name.append("FLAGS"); + data_item_name.append("FLAGS"sv); break; case StoreMethod::Add: - data_item_name.append("+FLAGS"); + data_item_name.append("+FLAGS"sv); break; case StoreMethod::Remove: - data_item_name.append("-FLAGS"); + data_item_name.append("-FLAGS"sv); break; } if (silent) { - data_item_name.append(".SILENT"); + data_item_name.append(".SILENT"sv); } StringBuilder flags_builder; @@ -313,7 +313,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::search(Optional<String> charset { Vector<String> args; if (charset.has_value()) { - args.append("CHARSET "); + args.append("CHARSET "sv); args.append(charset.value()); } for (auto const& item : keys) { @@ -332,7 +332,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::finish_idle() { auto promise = Promise<Optional<Response>>::construct(); m_pending_promises.append(promise); - MUST(send_raw("DONE")); + MUST(send_raw("DONE"sv)); m_expecting_response = true; return cast_promise<SolidResponse>(promise); } @@ -343,19 +343,19 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::status(StringView mailbox, Vect for (auto type : types) { switch (type) { case StatusItemType::Recent: - args.append("RECENT"); + args.append("RECENT"sv); break; case StatusItemType::UIDNext: - args.append("UIDNEXT"); + args.append("UIDNEXT"sv); break; case StatusItemType::UIDValidity: - args.append("UIDVALIDITY"); + args.append("UIDVALIDITY"sv); break; case StatusItemType::Unseen: - args.append("UNSEEN"); + args.append("UNSEEN"sv); break; case StatusItemType::Messages: - args.append("MESSAGES"); + args.append("MESSAGES"sv); break; } } @@ -378,7 +378,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::append(StringView mailbox, Mess args.append(flags_sb.build()); } if (date_time.has_value()) - args.append(date_time.value().to_string("\"%d-%b-%Y %H:%M:%S +0000\"")); + args.append(date_time.value().to_string("\"%d-%b-%Y %H:%M:%S +0000\""sv)); args.append(String::formatted("{{{}}}", message.data.length())); diff --git a/Userland/Libraries/LibIMAP/Objects.cpp b/Userland/Libraries/LibIMAP/Objects.cpp index 97710a54a9..a076756290 100644 --- a/Userland/Libraries/LibIMAP/Objects.cpp +++ b/Userland/Libraries/LibIMAP/Objects.cpp @@ -29,9 +29,9 @@ String FetchCommand::DataItem::Section::serialize() const case SectionType::HeaderFields: case SectionType::HeaderFieldsNot: { if (type == SectionType::HeaderFields) - headers_builder.append("HEADER.FIELDS ("); + headers_builder.append("HEADER.FIELDS ("sv); else - headers_builder.append("HEADERS.FIELDS.NOT ("); + headers_builder.append("HEADERS.FIELDS.NOT ("sv); bool first = true; for (auto& field : headers.value()) { @@ -55,7 +55,7 @@ String FetchCommand::DataItem::Section::serialize() const first = false; } if (ends_with_mime) { - sb.append(".MIME"); + sb.append(".MIME"sv); } return sb.build(); } @@ -128,7 +128,7 @@ String serialize_astring(StringView string) // Try to quote auto can_be_quoted = !(string.contains('\n') || string.contains('\r')); if (can_be_quoted) { - auto escaped_str = string.replace("\\", "\\\\", ReplaceMode::All).replace("\"", "\\\"", ReplaceMode::All); + auto escaped_str = string.replace("\\"sv, "\\\\"sv, ReplaceMode::All).replace("\""sv, "\\\""sv, ReplaceMode::All); return String::formatted("\"{}\"", escaped_str); } @@ -151,7 +151,7 @@ String SearchKey::serialize() const [&](New const&) { return String("NEW"); }, [&](Not const& x) { return String::formatted("NOT {}", x.operand->serialize()); }, [&](Old const&) { return String("OLD"); }, - [&](On const& x) { return String::formatted("ON {}", x.date.to_string("%d-%b-%Y")); }, + [&](On const& x) { return String::formatted("ON {}", x.date.to_string("%d-%b-%Y"sv)); }, [&](Or const& x) { return String::formatted("OR {} {}", x.lhs->serialize(), x.rhs->serialize()); }, [&](Recent const&) { return String("RECENT"); }, [&](SearchKeys const& x) { @@ -160,18 +160,18 @@ String SearchKey::serialize() const bool first = true; for (const auto& item : x.keys) { if (!first) - sb.append(", "); + sb.append(", "sv); sb.append(item->serialize()); first = false; } return sb.build(); }, [&](Seen const&) { return String("SEEN"); }, - [&](SentBefore const& x) { return String::formatted("SENTBEFORE {}", x.date.to_string("%d-%b-%Y")); }, - [&](SentOn const& x) { return String::formatted("SENTON {}", x.date.to_string("%d-%b-%Y")); }, - [&](SentSince const& x) { return String::formatted("SENTSINCE {}", x.date.to_string("%d-%b-%Y")); }, + [&](SentBefore const& x) { return String::formatted("SENTBEFORE {}", x.date.to_string("%d-%b-%Y"sv)); }, + [&](SentOn const& x) { return String::formatted("SENTON {}", x.date.to_string("%d-%b-%Y"sv)); }, + [&](SentSince const& x) { return String::formatted("SENTSINCE {}", x.date.to_string("%d-%b-%Y"sv)); }, [&](SequenceSet const& x) { return x.sequence.serialize(); }, - [&](Since const& x) { return String::formatted("SINCE {}", x.date.to_string("%d-%b-%Y")); }, + [&](Since const& x) { return String::formatted("SINCE {}", x.date.to_string("%d-%b-%Y"sv)); }, [&](Smaller const& x) { return String::formatted("SMALLER {}", x.number); }, [&](Subject const& x) { return String::formatted("SUBJECT {}", serialize_astring(x.subject)); }, [&](Text const& x) { return String::formatted("TEXT {}", serialize_astring(x.text)); }, diff --git a/Userland/Libraries/LibIMAP/Parser.cpp b/Userland/Libraries/LibIMAP/Parser.cpp index 6275d75f75..acc3f92700 100644 --- a/Userland/Libraries/LibIMAP/Parser.cpp +++ b/Userland/Libraries/LibIMAP/Parser.cpp @@ -20,14 +20,14 @@ ParseStatus Parser::parse(ByteBuffer&& buffer, bool expecting_tag) m_response = SolidResponse(); } - if (try_consume("+")) { - consume(" "); + if (try_consume("+"sv)) { + consume(" "sv); auto data = consume_until_end_of_line(); - consume("\r\n"); + consume("\r\n"sv); return { true, { ContinueRequest { data } } }; } - while (try_consume("*")) { + while (try_consume("*"sv)) { parse_untagged(); } @@ -65,12 +65,12 @@ bool Parser::try_consume(StringView x) void Parser::parse_response_done() { - consume("A"); + consume("A"sv); auto tag = parse_number(); - consume(" "); + consume(" "sv); ResponseStatus status = parse_status(); - consume(" "); + consume(" "sv); m_response.m_tag = tag; m_response.m_status = status; @@ -82,7 +82,7 @@ void Parser::parse_response_done() position += 1; } - consume("\r\n"); + consume("\r\n"sv); m_response.m_response_text = response_data.build(); } @@ -123,98 +123,98 @@ unsigned Parser::parse_number() void Parser::parse_untagged() { - consume(" "); + consume(" "sv); // Certain messages begin with a number like: // * 15 EXISTS auto number = try_parse_number(); if (number.has_value()) { - consume(" "); + consume(" "sv); auto data_type = parse_atom().to_string(); if (data_type == "EXISTS"sv) { m_response.data().set_exists(number.value()); - consume("\r\n"); + consume("\r\n"sv); } else if (data_type == "RECENT"sv) { m_response.data().set_recent(number.value()); - consume("\r\n"); + consume("\r\n"sv); } else if (data_type == "FETCH"sv) { auto fetch_response = parse_fetch_response(); m_response.data().add_fetch_response(number.value(), move(fetch_response)); } else if (data_type == "EXPUNGE"sv) { m_response.data().add_expunged(number.value()); - consume("\r\n"); + consume("\r\n"sv); } return; } - if (try_consume("CAPABILITY")) { + if (try_consume("CAPABILITY"sv)) { parse_capability_response(); - } else if (try_consume("LIST")) { + } else if (try_consume("LIST"sv)) { auto item = parse_list_item(); m_response.data().add_list_item(move(item)); - } else if (try_consume("LSUB")) { + } else if (try_consume("LSUB"sv)) { auto item = parse_list_item(); m_response.data().add_lsub_item(move(item)); - } else if (try_consume("FLAGS")) { - consume(" "); + } else if (try_consume("FLAGS"sv)) { + consume(" "sv); auto flags = parse_list(+[](StringView x) { return String(x); }); m_response.data().set_flags(move(flags)); - consume("\r\n"); - } else if (try_consume("OK")) { - consume(" "); - if (try_consume("[")) { + consume("\r\n"sv); + } else if (try_consume("OK"sv)) { + consume(" "sv); + if (try_consume("["sv)) { auto actual_type = parse_atom(); if (actual_type == "CLOSED"sv) { // No-op. } else if (actual_type == "UIDNEXT"sv) { - consume(" "); + consume(" "sv); auto n = parse_number(); m_response.data().set_uid_next(n); } else if (actual_type == "UIDVALIDITY"sv) { - consume(" "); + consume(" "sv); auto n = parse_number(); m_response.data().set_uid_validity(n); } else if (actual_type == "UNSEEN"sv) { - consume(" "); + consume(" "sv); auto n = parse_number(); m_response.data().set_unseen(n); } else if (actual_type == "PERMANENTFLAGS"sv) { - consume(" "); + consume(" "sv); auto flags = parse_list(+[](StringView x) { return String(x); }); m_response.data().set_permanent_flags(move(flags)); } else if (actual_type == "HIGHESTMODSEQ"sv) { - consume(" "); + consume(" "sv); parse_number(); // No-op for now. } else { dbgln("Unknown: {}", actual_type); consume_while([](u8 x) { return x != ']'; }); } - consume("]"); + consume("]"sv); } consume_until_end_of_line(); - consume("\r\n"); - } else if (try_consume("SEARCH")) { + consume("\r\n"sv); + } else if (try_consume("SEARCH"sv)) { Vector<unsigned> ids; - while (!try_consume("\r\n")) { - consume(" "); + while (!try_consume("\r\n"sv)) { + consume(" "sv); auto id = parse_number(); ids.append(id); } m_response.data().set_search_results(move(ids)); - } else if (try_consume("BYE")) { + } else if (try_consume("BYE"sv)) { auto message = consume_until_end_of_line(); - consume("\r\n"); + consume("\r\n"sv); m_response.data().set_bye(message.is_empty() ? Optional<String>() : Optional<String>(message)); - } else if (try_consume("STATUS")) { - consume(" "); + } else if (try_consume("STATUS"sv)) { + consume(" "sv); auto mailbox = parse_astring(); - consume(" ("); + consume(" ("sv); auto status_item = StatusItem(); status_item.set_mailbox(mailbox); - while (!try_consume(")")) { + while (!try_consume(")"sv)) { auto status_att = parse_atom(); - consume(" "); + consume(" "sv); auto value = parse_number(); auto type = StatusItemType::Recent; @@ -236,14 +236,14 @@ void Parser::parse_untagged() status_item.set(type, value); if (!at_end() && m_buffer[position] != ')') - consume(" "); + consume(" "sv); } m_response.data().set_status(move(status_item)); - try_consume(" "); // Not in the spec but the Outlook server sends a space for some reason. - consume("\r\n"); + try_consume(" "sv); // Not in the spec but the Outlook server sends a space for some reason. + consume("\r\n"sv); } else { auto x = consume_until_end_of_line(); - consume("\r\n"); + consume("\r\n"sv); dbgln("ignored {}", x); } } @@ -251,13 +251,13 @@ void Parser::parse_untagged() StringView Parser::parse_quoted_string() { auto str = consume_while([](u8 x) { return x != '"'; }); - consume("\""); + consume("\""sv); return str; } StringView Parser::parse_string() { - if (try_consume("\"")) { + if (try_consume("\""sv)) { return parse_quoted_string(); } else { return parse_literal_string(); @@ -266,7 +266,7 @@ StringView Parser::parse_string() Optional<StringView> Parser::parse_nstring() { - if (try_consume("NIL")) + if (try_consume("NIL"sv)) return {}; else return { parse_string() }; @@ -274,14 +274,14 @@ Optional<StringView> Parser::parse_nstring() FetchResponseData Parser::parse_fetch_response() { - consume(" ("); + consume(" ("sv); auto fetch_response = FetchResponseData(); - while (!try_consume(")")) { + while (!try_consume(")"sv)) { auto data_item = parse_fetch_data_item(); switch (data_item.type) { case FetchCommand::DataItemType::BodyStructure: { - consume(" ("); + consume(" ("sv); auto structure = parse_body_structure(); fetch_response.set_body_structure(move(structure)); break; @@ -291,21 +291,21 @@ FetchResponseData Parser::parse_fetch_response() break; } case FetchCommand::DataItemType::Flags: { - consume(" "); + consume(" "sv); auto flags = parse_list(+[](StringView x) { return String(x); }); fetch_response.set_flags(move(flags)); break; } case FetchCommand::DataItemType::InternalDate: { - consume(" \""); + consume(" \""sv); auto date_view = consume_while([](u8 x) { return x != '"'; }); - consume("\""); - auto date = Core::DateTime::parse("%d-%b-%Y %H:%M:%S %z", date_view).value(); + consume("\""sv); + auto date = Core::DateTime::parse("%d-%b-%Y %H:%M:%S %z"sv, date_view).value(); fetch_response.set_internal_date(date); break; } case FetchCommand::DataItemType::UID: { - consume(" "); + consume(" "sv); fetch_response.set_uid(parse_number()); break; } @@ -320,34 +320,34 @@ FetchResponseData Parser::parse_fetch_response() } } if (!at_end() && m_buffer[position] != ')') - consume(" "); + consume(" "sv); } - consume("\r\n"); + consume("\r\n"sv); return fetch_response; } Envelope Parser::parse_envelope() { - consume(" ("); + consume(" ("sv); auto date = parse_nstring(); - consume(" "); + consume(" "sv); auto subject = parse_nstring(); - consume(" "); + consume(" "sv); auto from = parse_address_list(); - consume(" "); + consume(" "sv); auto sender = parse_address_list(); - consume(" "); + consume(" "sv); auto reply_to = parse_address_list(); - consume(" "); + consume(" "sv); auto to = parse_address_list(); - consume(" "); + consume(" "sv); auto cc = parse_address_list(); - consume(" "); + consume(" "sv); auto bcc = parse_address_list(); - consume(" "); + consume(" "sv); auto in_reply_to = parse_nstring(); - consume(" "); + consume(" "sv); auto message_id = parse_nstring(); - consume(")"); + consume(")"sv); Envelope envelope = { date.has_value() ? AK::Optional<String>(date.value()) : AK::Optional<String>(), subject.has_value() ? AK::Optional<String>(subject.value()) : AK::Optional<String>(), @@ -366,38 +366,38 @@ BodyStructure Parser::parse_body_structure() { if (!at_end() && m_buffer[position] == '(') { auto data = MultiPartBodyStructureData(); - while (try_consume("(")) { + while (try_consume("("sv)) { auto child = parse_body_structure(); data.bodies.append(make<BodyStructure>(move(child))); } - consume(" "); + consume(" "sv); data.media_type = parse_string(); - if (!try_consume(")")) { - consume(" "); - data.params = try_consume("NIL") ? Optional<HashMap<String, String>>() : parse_body_fields_params(); - if (!try_consume(")")) { - consume(" "); - if (!try_consume("NIL")) { + if (!try_consume(")"sv)) { + consume(" "sv); + data.params = try_consume("NIL"sv) ? Optional<HashMap<String, String>>() : parse_body_fields_params(); + if (!try_consume(")"sv)) { + consume(" "sv); + if (!try_consume("NIL"sv)) { data.disposition = { parse_disposition() }; } - if (!try_consume(")")) { - consume(" "); - if (!try_consume("NIL")) { + if (!try_consume(")"sv)) { + consume(" "sv); + if (!try_consume("NIL"sv)) { data.langs = { parse_langs() }; } - if (!try_consume(")")) { - consume(" "); - data.location = try_consume("NIL") ? Optional<String>() : Optional<String>(parse_string()); + if (!try_consume(")"sv)) { + consume(" "sv); + data.location = try_consume("NIL"sv) ? Optional<String>() : Optional<String>(parse_string()); - if (!try_consume(")")) { - consume(" "); + if (!try_consume(")"sv)) { + consume(" "sv); Vector<BodyExtension> extensions; - while (!try_consume(")")) { + while (!try_consume(")"sv)) { extensions.append(parse_body_extension()); - try_consume(" "); + try_consume(" "sv); } data.extensions = { move(extensions) }; } @@ -414,21 +414,21 @@ BodyStructure Parser::parse_body_structure() BodyStructure Parser::parse_one_part_body() { auto type = parse_string(); - consume(" "); + consume(" "sv); auto subtype = parse_string(); - consume(" "); - if (type.equals_ignoring_case("TEXT")) { + consume(" "sv); + if (type.equals_ignoring_case("TEXT"sv)) { // body-type-text auto params = parse_body_fields_params(); - consume(" "); + consume(" "sv); auto id = parse_nstring(); - consume(" "); + consume(" "sv); auto description = parse_nstring(); - consume(" "); + consume(" "sv); auto encoding = parse_string(); - consume(" "); + consume(" "sv); auto num_octets = parse_number(); - consume(" "); + consume(" "sv); auto num_lines = parse_number(); auto data = BodyStructureData { @@ -443,34 +443,34 @@ BodyStructure Parser::parse_one_part_body() {} }; - if (!try_consume(")")) { - consume(" "); + if (!try_consume(")"sv)) { + consume(" "sv); auto md5 = parse_nstring(); if (md5.has_value()) data.md5 = { md5.value() }; - if (!try_consume(")")) { - consume(" "); - if (!try_consume("NIL")) { + if (!try_consume(")"sv)) { + consume(" "sv); + if (!try_consume("NIL"sv)) { auto disposition = parse_disposition(); data.disposition = { disposition }; } - if (!try_consume(")")) { - consume(" "); - if (!try_consume("NIL")) { + if (!try_consume(")"sv)) { + consume(" "sv); + if (!try_consume("NIL"sv)) { data.langs = { parse_langs() }; } - if (!try_consume(")")) { - consume(" "); + if (!try_consume(")"sv)) { + consume(" "sv); auto location = parse_nstring(); if (location.has_value()) data.location = { location.value() }; Vector<BodyExtension> extensions; - while (!try_consume(")")) { + while (!try_consume(")"sv)) { extensions.append(parse_body_extension()); - try_consume(" "); + try_consume(" "sv); } data.extensions = { move(extensions) }; } @@ -479,18 +479,18 @@ BodyStructure Parser::parse_one_part_body() } return BodyStructure(move(data)); - } else if (type.equals_ignoring_case("MESSAGE") && subtype.equals_ignoring_case("RFC822")) { + } else if (type.equals_ignoring_case("MESSAGE"sv) && subtype.equals_ignoring_case("RFC822"sv)) { // body-type-message auto params = parse_body_fields_params(); - consume(" "); + consume(" "sv); auto id = parse_nstring(); - consume(" "); + consume(" "sv); auto description = parse_nstring(); - consume(" "); + consume(" "sv); auto encoding = parse_string(); - consume(" "); + consume(" "sv); auto num_octets = parse_number(); - consume(" "); + consume(" "sv); auto envelope = parse_envelope(); BodyStructureData data { @@ -509,15 +509,15 @@ BodyStructure Parser::parse_one_part_body() } else { // body-type-basic auto params = parse_body_fields_params(); - consume(" "); + consume(" "sv); auto id = parse_nstring(); - consume(" "); + consume(" "sv); auto description = parse_nstring(); - consume(" "); + consume(" "sv); auto encoding = parse_string(); - consume(" "); + consume(" "sv); auto num_octets = parse_number(); - consume(" "); + consume(" "sv); BodyStructureData data { type, @@ -537,12 +537,12 @@ BodyStructure Parser::parse_one_part_body() Vector<String> Parser::parse_langs() { AK::Vector<String> langs; - if (!try_consume("(")) { + if (!try_consume("("sv)) { langs.append(parse_string()); } else { - while (!try_consume(")")) { + while (!try_consume(")"sv)) { langs.append(parse_string()); - try_consume(" "); + try_consume(" "sv); } } return langs; @@ -550,21 +550,21 @@ Vector<String> Parser::parse_langs() Tuple<String, HashMap<String, String>> Parser::parse_disposition() { auto disposition_type = parse_string(); - consume(" "); + consume(" "sv); auto disposition_vals = parse_body_fields_params(); - consume(")"); + consume(")"sv); return { move(disposition_type), move(disposition_vals) }; } StringView Parser::parse_literal_string() { - consume("{"); + consume("{"sv); auto num_bytes = parse_number(); - consume("}\r\n"); + consume("}\r\n"sv); if (m_buffer.size() < position + num_bytes) { m_parsing_failed = true; - return ""; + return ""sv; } position += num_bytes; @@ -573,25 +573,25 @@ StringView Parser::parse_literal_string() ListItem Parser::parse_list_item() { - consume(" "); + consume(" "sv); auto flags_vec = parse_list(parse_mailbox_flag); unsigned flags = 0; for (auto flag : flags_vec) { flags |= static_cast<unsigned>(flag); } - consume(" \""); + consume(" \""sv); auto reference = consume_while([](u8 x) { return x != '"'; }); - consume("\" "); + consume("\" "sv); auto mailbox = parse_astring(); - consume("\r\n"); + consume("\r\n"sv); return ListItem { flags, String(reference), String(mailbox) }; } void Parser::parse_capability_response() { auto capability = AK::Vector<String>(); - while (!try_consume("\r\n")) { - consume(" "); + while (!try_consume("\r\n"sv)) { + consume(" "sv); auto x = String(parse_atom()); capability.append(x); } @@ -634,12 +634,12 @@ ResponseStatus Parser::parse_status() template<typename T> Vector<T> Parser::parse_list(T converter(StringView)) { - consume("("); + consume("("sv); Vector<T> x; bool first = true; - while (!try_consume(")")) { + while (!try_consume(")"sv)) { if (!first) - consume(" "); + consume(" "sv); auto item = consume_while([](u8 x) { return x != ' ' && x != ')'; }); @@ -701,79 +701,79 @@ StringView Parser::consume_until_end_of_line() FetchCommand::DataItem Parser::parse_fetch_data_item() { auto msg_attr = consume_while([](u8 x) { return is_ascii_alpha(x) != 0; }); - if (msg_attr.equals_ignoring_case("BODY") && try_consume("[")) { + if (msg_attr.equals_ignoring_case("BODY"sv) && try_consume("["sv)) { auto data_item = FetchCommand::DataItem { .type = FetchCommand::DataItemType::BodySection, .section = { {} } }; auto section_type = consume_while([](u8 x) { return x != ']' && x != ' '; }); - if (section_type.equals_ignoring_case("HEADER.FIELDS")) { + if (section_type.equals_ignoring_case("HEADER.FIELDS"sv)) { data_item.section->type = FetchCommand::DataItem::SectionType::HeaderFields; data_item.section->headers = Vector<String>(); - consume(" "); + consume(" "sv); auto headers = parse_list(+[](StringView x) { return x; }); for (auto& header : headers) { data_item.section->headers->append(header); } - consume("]"); - } else if (section_type.equals_ignoring_case("HEADER.FIELDS.NOT")) { + consume("]"sv); + } else if (section_type.equals_ignoring_case("HEADER.FIELDS.NOT"sv)) { data_item.section->type = FetchCommand::DataItem::SectionType::HeaderFieldsNot; data_item.section->headers = Vector<String>(); - consume(" ("); + consume(" ("sv); auto headers = parse_list(+[](StringView x) { return x; }); for (auto& header : headers) { data_item.section->headers->append(header); } - consume("]"); + consume("]"sv); } else if (is_ascii_digit(section_type[0])) { data_item.section->type = FetchCommand::DataItem::SectionType::Parts; data_item.section->parts = Vector<unsigned>(); - while (!try_consume("]")) { + while (!try_consume("]"sv)) { auto num = try_parse_number(); if (num.has_value()) { data_item.section->parts->append(num.value()); continue; } auto atom = parse_atom(); - if (atom.equals_ignoring_case("MIME")) { + if (atom.equals_ignoring_case("MIME"sv)) { data_item.section->ends_with_mime = true; continue; } } - } else if (section_type.equals_ignoring_case("TEXT")) { + } else if (section_type.equals_ignoring_case("TEXT"sv)) { data_item.section->type = FetchCommand::DataItem::SectionType::Text; - } else if (section_type.equals_ignoring_case("HEADER")) { + } else if (section_type.equals_ignoring_case("HEADER"sv)) { data_item.section->type = FetchCommand::DataItem::SectionType::Header; } else { dbgln("Unmatched section type {}", section_type); m_parsing_failed = true; } - if (try_consume("<")) { + if (try_consume("<"sv)) { auto start = parse_number(); data_item.partial_fetch = true; data_item.start = (int)start; - consume(">"); + consume(">"sv); } - try_consume(" "); + try_consume(" "sv); return data_item; - } else if (msg_attr.equals_ignoring_case("FLAGS")) { + } else if (msg_attr.equals_ignoring_case("FLAGS"sv)) { return FetchCommand::DataItem { .type = FetchCommand::DataItemType::Flags }; - } else if (msg_attr.equals_ignoring_case("UID")) { + } else if (msg_attr.equals_ignoring_case("UID"sv)) { return FetchCommand::DataItem { .type = FetchCommand::DataItemType::UID }; - } else if (msg_attr.equals_ignoring_case("INTERNALDATE")) { + } else if (msg_attr.equals_ignoring_case("INTERNALDATE"sv)) { return FetchCommand::DataItem { .type = FetchCommand::DataItemType::InternalDate }; - } else if (msg_attr.equals_ignoring_case("ENVELOPE")) { + } else if (msg_attr.equals_ignoring_case("ENVELOPE"sv)) { return FetchCommand::DataItem { .type = FetchCommand::DataItemType::Envelope }; - } else if (msg_attr.equals_ignoring_case("BODY") || msg_attr.equals_ignoring_case("BODYSTRUCTURE")) { + } else if (msg_attr.equals_ignoring_case("BODY"sv) || msg_attr.equals_ignoring_case("BODYSTRUCTURE"sv)) { return FetchCommand::DataItem { .type = FetchCommand::DataItemType::BodyStructure }; @@ -785,35 +785,35 @@ FetchCommand::DataItem Parser::parse_fetch_data_item() } Optional<Vector<Address>> Parser::parse_address_list() { - if (try_consume("NIL")) + if (try_consume("NIL"sv)) return {}; auto addresses = Vector<Address>(); - consume("("); - while (!try_consume(")")) { + consume("("sv); + while (!try_consume(")"sv)) { addresses.append(parse_address()); if (!at_end() && m_buffer[position] != ')') - consume(" "); + consume(" "sv); } return { addresses }; } Address Parser::parse_address() { - consume("("); + consume("("sv); auto address = Address(); auto name = parse_nstring(); address.name = Optional<String>(move(name)); - consume(" "); + consume(" "sv); auto source_route = parse_nstring(); address.source_route = Optional<String>(move(source_route)); - consume(" "); + consume(" "sv); auto mailbox = parse_nstring(); address.mailbox = Optional<String>(move(mailbox)); - consume(" "); + consume(" "sv); auto host = parse_nstring(); address.host = Optional<String>(move(host)); - consume(")"); + consume(")"sv); return address; } StringView Parser::parse_astring() @@ -825,30 +825,30 @@ StringView Parser::parse_astring() } HashMap<String, String> Parser::parse_body_fields_params() { - if (try_consume("NIL")) + if (try_consume("NIL"sv)) return {}; HashMap<String, String> fields; - consume("("); - while (!try_consume(")")) { + consume("("sv); + while (!try_consume(")"sv)) { auto key = parse_string(); - consume(" "); + consume(" "sv); auto value = parse_string(); fields.set(key, value); - try_consume(" "); + try_consume(" "sv); } return fields; } BodyExtension Parser::parse_body_extension() { - if (try_consume("NIL")) { + if (try_consume("NIL"sv)) { return BodyExtension { Optional<String> {} }; - } else if (try_consume("(")) { + } else if (try_consume("("sv)) { Vector<OwnPtr<BodyExtension>> extensions; - while (!try_consume(")")) { + while (!try_consume(")"sv)) { extensions.append(make<BodyExtension>(parse_body_extension())); - try_consume(" "); + try_consume(" "sv); } return BodyExtension { move(extensions) }; } else if (!at_end() && (m_buffer[position] == '"' || m_buffer[position] == '{')) { diff --git a/Userland/Libraries/LibJS/Bytecode/Label.h b/Userland/Libraries/LibJS/Bytecode/Label.h index a858ef0fc0..44698f6704 100644 --- a/Userland/Libraries/LibJS/Bytecode/Label.h +++ b/Userland/Libraries/LibJS/Bytecode/Label.h @@ -30,6 +30,6 @@ template<> struct AK::Formatter<JS::Bytecode::Label> : AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, JS::Bytecode::Label const& value) { - return AK::Formatter<FormatString>::format(builder, "@{}", value.block().name()); + return AK::Formatter<FormatString>::format(builder, "@{}"sv, value.block().name()); } }; diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp index 6b12f737a5..62a9c2cd0b 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp @@ -759,7 +759,7 @@ ThrowCompletionOr<void> NewClass::execute_impl(Bytecode::Interpreter& interprete auto name = m_class_expression.name(); auto scope = interpreter.ast_interpreter_scope(); auto& ast_interpreter = scope.interpreter(); - auto class_object = TRY(m_class_expression.class_definition_evaluation(ast_interpreter, interpreter.global_object(), name, name.is_null() ? "" : name)); + auto class_object = TRY(m_class_expression.class_definition_evaluation(ast_interpreter, interpreter.global_object(), name, name.is_null() ? ""sv : name)); interpreter.accumulator() = class_object; return {}; } @@ -810,7 +810,7 @@ String NewBigInt::to_string_impl(Bytecode::Executable const&) const String NewArray::to_string_impl(Bytecode::Executable const&) const { StringBuilder builder; - builder.append("NewArray"); + builder.append("NewArray"sv); if (m_element_count != 0) { builder.appendff(" [{}-{}]", m_elements[0], m_elements[1]); } @@ -842,7 +842,7 @@ String CopyObjectExcludingProperties::to_string_impl(Bytecode::Executable const& StringBuilder builder; builder.appendff("CopyObjectExcludingProperties from:{}", m_from_object); if (m_excluded_names_count != 0) { - builder.append(" excluding:["); + builder.append(" excluding:["sv); for (size_t i = 0; i < m_excluded_names_count; ++i) { builder.appendff("{}", m_excluded_names[i]); if (i != m_excluded_names_count - 1) @@ -950,7 +950,7 @@ String Call::to_string_impl(Bytecode::Executable const&) const StringBuilder builder; builder.appendff("Call callee:{}, this:{}", m_callee, m_this_value); if (m_argument_count != 0) { - builder.append(", arguments:["); + builder.append(", arguments:["sv); for (size_t i = 0; i < m_argument_count; ++i) { builder.appendff("{}", m_arguments[i]); if (i != m_argument_count - 1) @@ -1024,14 +1024,14 @@ String ContinuePendingUnwind::to_string_impl(Bytecode::Executable const&) const String PushDeclarativeEnvironment::to_string_impl(Bytecode::Executable const& executable) const { StringBuilder builder; - builder.append("PushDeclarativeEnvironment"); + builder.append("PushDeclarativeEnvironment"sv); if (!m_variables.is_empty()) { - builder.append(" {"); + builder.append(" {"sv); Vector<String> names; for (auto& it : m_variables) names.append(executable.get_string(it.key)); - builder.join(", ", names); builder.append("}"); + builder.join(", "sv, names); } return builder.to_string(); } diff --git a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp index e80d7f7029..f9e3ac55bd 100644 --- a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp @@ -126,7 +126,7 @@ void MergeBlocks::perform(PassPipelineExecutable& executable) size_t size = 0; StringBuilder builder; - builder.append("merge"); + builder.append("merge"sv); for (auto& entry : successors) { size += entry->size(); builder.append('.'); diff --git a/Userland/Libraries/LibJS/Bytecode/Register.h b/Userland/Libraries/LibJS/Bytecode/Register.h index aeae630f3d..1bdab0eeb7 100644 --- a/Userland/Libraries/LibJS/Bytecode/Register.h +++ b/Userland/Libraries/LibJS/Bytecode/Register.h @@ -45,7 +45,7 @@ struct AK::Formatter<JS::Bytecode::Register> : AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, JS::Bytecode::Register const& value) { if (value.index() == JS::Bytecode::Register::accumulator_index) - return AK::Formatter<FormatString>::format(builder, "acc"); - return AK::Formatter<FormatString>::format(builder, "${}", value.index()); + return builder.put_string("acc"sv); + return AK::Formatter<FormatString>::format(builder, "${}"sv, value.index()); } }; diff --git a/Userland/Libraries/LibJS/Console.cpp b/Userland/Libraries/LibJS/Console.cpp index 956dc0c5c0..2d2bfadf79 100644 --- a/Userland/Libraries/LibJS/Console.cpp +++ b/Userland/Libraries/LibJS/Console.cpp @@ -464,14 +464,14 @@ ThrowCompletionOr<String> Console::format_time_since(Core::ElapsedTimer timer) }; StringBuilder builder; if (duration.days > 0) - append(builder, "{:.0} day(s)", duration.days); + append(builder, "{:.0} day(s)"sv, duration.days); if (duration.hours > 0) - append(builder, "{:.0} hour(s)", duration.hours); + append(builder, "{:.0} hour(s)"sv, duration.hours); if (duration.minutes > 0) - append(builder, "{:.0} minute(s)", duration.minutes); + append(builder, "{:.0} minute(s)"sv, duration.minutes); if (duration.seconds > 0 || duration.milliseconds > 0) { double combined_seconds = duration.seconds + (0.001 * duration.milliseconds); - append(builder, "{:.3} seconds", combined_seconds); + append(builder, "{:.3} seconds"sv, combined_seconds); } return builder.to_string(); diff --git a/Userland/Libraries/LibJS/CyclicModule.cpp b/Userland/Libraries/LibJS/CyclicModule.cpp index 7320477782..55515c16e0 100644 --- a/Userland/Libraries/LibJS/CyclicModule.cpp +++ b/Userland/Libraries/LibJS/CyclicModule.cpp @@ -66,7 +66,7 @@ ThrowCompletionOr<u32> CyclicModule::inner_module_linking(VM& vm, Vector<Module* // b. Return index. // Note: Step 1, 1.a and 1.b are handled in Module.cpp - dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] inner_module_linking[{}](vm, {}, {})", this, String::join(",", stack), index); + dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] inner_module_linking[{}](vm, {}, {})", this, String::join(',', stack), index); // 2. If module.[[Status]] is linking, linked, evaluating-async, or evaluated, then if (m_status == ModuleStatus::Linking || m_status == ModuleStatus::Linked || m_status == ModuleStatus::EvaluatingAsync || m_status == ModuleStatus::Evaluated) { @@ -96,7 +96,7 @@ ThrowCompletionOr<u32> CyclicModule::inner_module_linking(VM& vm, Vector<Module* StringBuilder request_module_names; for (auto& module_request : m_requested_modules) { request_module_names.append(module_request.module_specifier); - request_module_names.append(", "); + request_module_names.append(", "sv); } dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] module: {} has requested modules: [{}]", filename(), request_module_names.string_view()); #endif @@ -263,7 +263,7 @@ ThrowCompletionOr<Promise*> CyclicModule::evaluate(VM& vm) // 16.2.1.5.2.1 InnerModuleEvaluation ( module, stack, index ), https://tc39.es/ecma262/#sec-innermoduleevaluation ThrowCompletionOr<u32> CyclicModule::inner_module_evaluation(VM& vm, Vector<Module*>& stack, u32 index) { - dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] inner_module_evaluation[{}](vm, {}, {})", this, String::join(", ", stack), index); + dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] inner_module_evaluation[{}](vm, {}, {})", this, String::join(", "sv, stack), index); // Note: Step 1 is performed in Module.cpp // 2. If module.[[Status]] is evaluating-async or evaluated, then diff --git a/Userland/Libraries/LibJS/Lexer.cpp b/Userland/Libraries/LibJS/Lexer.cpp index 23a8e2de64..d7b24d9bfb 100644 --- a/Userland/Libraries/LibJS/Lexer.cpp +++ b/Userland/Libraries/LibJS/Lexer.cpp @@ -830,7 +830,7 @@ Token Lexer::next() if (m_hit_invalid_unicode.has_value()) { value_start = m_hit_invalid_unicode.value() - 1; m_current_token = Token(TokenType::Invalid, "Invalid unicode codepoint in source", - "", // Since the invalid unicode can occur anywhere in the current token the trivia is not correct + ""sv, // Since the invalid unicode can occur anywhere in the current token the trivia is not correct m_source.substring_view(value_start + 1, min(4u, m_source.length() - value_start - 2)), m_filename, m_line_number, diff --git a/Userland/Libraries/LibJS/Lexer.h b/Userland/Libraries/LibJS/Lexer.h index 326f5aa45b..3cb25f68db 100644 --- a/Userland/Libraries/LibJS/Lexer.h +++ b/Userland/Libraries/LibJS/Lexer.h @@ -16,7 +16,7 @@ namespace JS { class Lexer { public: - explicit Lexer(StringView source, StringView filename = "(unknown)", size_t line_number = 1, size_t line_column = 0); + explicit Lexer(StringView source, StringView filename = "(unknown)"sv, size_t line_number = 1, size_t line_column = 0); Token next(); diff --git a/Userland/Libraries/LibJS/MarkupGenerator.cpp b/Userland/Libraries/LibJS/MarkupGenerator.cpp index eae5ad4c80..995d72ce10 100644 --- a/Userland/Libraries/LibJS/MarkupGenerator.cpp +++ b/Userland/Libraries/LibJS/MarkupGenerator.cpp @@ -47,7 +47,7 @@ String MarkupGenerator::html_from_error(Object& object) void MarkupGenerator::value_to_html(Value value, StringBuilder& output_html, HashTable<Object*> seen_objects) { if (value.is_empty()) { - output_html.append("<empty>"); + output_html.append("<empty>"sv); return; } @@ -88,7 +88,7 @@ void MarkupGenerator::value_to_html(Value value, StringBuilder& output_html, Has if (value.is_string()) output_html.append('"'); - output_html.append("</span>"); + output_html.append("</span>"sv); } void MarkupGenerator::array_to_html(Array const& array, StringBuilder& html_output, HashTable<Object*>& seen_objects) diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index 867cc79c3f..48dc4c4c85 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -682,7 +682,7 @@ bool Parser::match_invalid_escaped_keyword() const return token_value != "let"sv; } -static constexpr AK::Array<StringView, 9> strict_reserved_words = { "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield" }; +static constexpr AK::Array<StringView, 9> strict_reserved_words = { "implements"sv, "interface"sv, "let"sv, "package"sv, "private"sv, "protected"sv, "public"sv, "static"sv, "yield"sv }; static bool is_strict_reserved_word(StringView str) { @@ -755,7 +755,7 @@ RefPtr<FunctionExpression> Parser::try_parse_arrow_function_expression(bool expe TemporaryChange in_async_context(m_state.await_expression_is_valid, is_async || m_state.await_expression_is_valid); parameters = parse_formal_parameters(function_length, FunctionNodeParseOptions::IsArrowFunction | (is_async ? FunctionNodeParseOptions::IsAsyncFunction : 0)); - if (m_state.errors.size() > previous_syntax_errors && m_state.errors[previous_syntax_errors].message.starts_with("Unexpected token")) + if (m_state.errors.size() > previous_syntax_errors && m_state.errors[previous_syntax_errors].message.starts_with("Unexpected token"sv)) return nullptr; if (!match(TokenType::ParenClose)) return nullptr; @@ -1199,20 +1199,20 @@ NonnullRefPtr<ClassExpression> Parser::parse_class_expression(bool expect_class_ switch (method_kind) { case ClassMethod::Kind::Method: if (is_async) { - name = "async"; + name = "async"sv; is_async = false; } else { VERIFY(is_static); - name = "static"; + name = "static"sv; is_static = false; } break; case ClassMethod::Kind::Getter: - name = "get"; + name = "get"sv; method_kind = ClassMethod::Kind::Method; break; case ClassMethod::Kind::Setter: - name = "set"; + name = "set"sv; method_kind = ClassMethod::Kind::Method; break; } diff --git a/Userland/Libraries/LibJS/Parser.h b/Userland/Libraries/LibJS/Parser.h index d1f0ba0235..ffbe199e9c 100644 --- a/Userland/Libraries/LibJS/Parser.h +++ b/Userland/Libraries/LibJS/Parser.h @@ -182,7 +182,7 @@ public: return {}; // We need to modify the source to match what the lexer considers one line - normalizing // line terminators to \n is easier than splitting using all different LT characters. - String source_string = source.replace("\r\n", "\n", ReplaceMode::All).replace("\r", "\n", ReplaceMode::All).replace(LINE_SEPARATOR_STRING, "\n", ReplaceMode::All).replace(PARAGRAPH_SEPARATOR_STRING, "\n", ReplaceMode::All); + String source_string = source.replace("\r\n"sv, "\n"sv, ReplaceMode::All).replace("\r"sv, "\n"sv, ReplaceMode::All).replace(LINE_SEPARATOR_STRING, "\n"sv, ReplaceMode::All).replace(PARAGRAPH_SEPARATOR_STRING, "\n"sv, ReplaceMode::All); StringBuilder builder; builder.append(source_string.split_view('\n', true)[position.value().line - 1]); builder.append('\n'); diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index f375e7b975..2527cd74f2 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -155,7 +155,7 @@ static double parse_date_string(String const& date_string) // Date.parse() is allowed to accept an arbitrary number of implementation-defined formats. // Parse formats of this type: "Wed Apr 17 23:08:53 +0000 2019" - auto maybe_datetime = Core::DateTime::parse("%a %b %e %T %z %Y", date_string); + auto maybe_datetime = Core::DateTime::parse("%a %b %e %T %z %Y"sv, date_string); if (maybe_datetime.has_value()) return 1000.0 * maybe_datetime->timestamp(); diff --git a/Userland/Libraries/LibJS/Runtime/Environment.h b/Userland/Libraries/LibJS/Runtime/Environment.h index 62b0618a76..3fbc9643c3 100644 --- a/Userland/Libraries/LibJS/Runtime/Environment.h +++ b/Userland/Libraries/LibJS/Runtime/Environment.h @@ -20,7 +20,7 @@ struct Variable { #define JS_ENVIRONMENT(class_, base_class) \ public: \ using Base = base_class; \ - virtual StringView class_name() const override { return #class_; } + virtual StringView class_name() const override { return #class_##sv; } class Environment : public Cell { public: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index bb676f29f9..1989731a62 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -299,7 +299,7 @@ ThrowCompletionOr<DurationUnitOptions> get_duration_unit_options(GlobalObject& g // here, but at some point we should split the the NumberFormat exporter to export both formats of the data. static String convert_number_format_pattern_to_duration_format_template(Unicode::NumberFormat const& number_format) { - auto result = number_format.zero_format.replace("{number}", "{0}", ReplaceMode::FirstOnly); + auto result = number_format.zero_format.replace("{number}"sv, "{0}"sv, ReplaceMode::FirstOnly); for (size_t i = 0; i < number_format.identifiers.size(); ++i) result = result.replace(String::formatted("{{unitIdentifier:{}}}", i), number_format.identifiers[i], ReplaceMode::FirstOnly); @@ -428,7 +428,7 @@ ThrowCompletionOr<Vector<PatternPartition>> partition_duration_format_pattern(Gl auto separator = Unicode::get_number_system_symbol(data_locale, duration_format.numbering_system(), Unicode::NumericSymbol::TimeSeparator).value_or(":"sv); // 2. Append the new Record { [[Type]]: "literal", [[Value]]: separator} to the end of result. - result.append({ "literal", separator }); + result.append({ "literal"sv, separator }); } } diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index 36a30160aa..3eb4d9f21f 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -254,7 +254,7 @@ ThrowCompletionOr<String> JSONObject::serialize_json_object(GlobalObject& global } StringBuilder builder; if (property_strings.is_empty()) { - builder.append("{}"); + builder.append("{}"sv); } else { bool first = true; builder.append('{'); @@ -306,7 +306,7 @@ ThrowCompletionOr<String> JSONObject::serialize_json_array(GlobalObject& global_ for (size_t i = 0; i < length; ++i) { auto serialized_property_string = TRY(serialize_json_property(global_object, state, i, &object)); if (serialized_property_string.is_null()) { - property_strings.append("null"); + property_strings.append("null"sv); } else { property_strings.append(serialized_property_string); } @@ -314,7 +314,7 @@ ThrowCompletionOr<String> JSONObject::serialize_json_array(GlobalObject& global_ StringBuilder builder; if (property_strings.is_empty()) { - builder.append("[]"); + builder.append("[]"sv); } else { if (state.gap.is_empty()) { builder.append('['); @@ -327,7 +327,7 @@ ThrowCompletionOr<String> JSONObject::serialize_json_array(GlobalObject& global_ } builder.append(']'); } else { - builder.append("[\n"); + builder.append("[\n"sv); builder.append(state.indent); auto separator = String::formatted(",\n{}", state.indent); bool first = true; @@ -357,25 +357,25 @@ String JSONObject::quote_json_string(String string) for (auto code_point : utf_view) { switch (code_point) { case '\b': - builder.append("\\b"); + builder.append("\\b"sv); break; case '\t': - builder.append("\\t"); + builder.append("\\t"sv); break; case '\n': - builder.append("\\n"); + builder.append("\\n"sv); break; case '\f': - builder.append("\\f"); + builder.append("\\f"sv); break; case '\r': - builder.append("\\r"); + builder.append("\\r"sv); break; case '"': - builder.append("\\\""); + builder.append("\\\""sv); break; case '\\': - builder.append("\\\\"); + builder.append("\\\\"sv); break; default: if (code_point < 0x20 || Utf16View::is_high_surrogate(code_point) || Utf16View::is_low_surrogate(code_point)) { diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 6876bd8d1a..e77fda9c17 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -30,7 +30,7 @@ public: \ using Base = base_class; \ virtual StringView class_name() const override \ { \ - return #class_; \ + return #class_##sv; \ } struct PrivateElement { diff --git a/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h b/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h index 1c558e67ff..6713ab079d 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyAttributes.h @@ -81,7 +81,7 @@ struct Formatter<JS::PropertyAttributes> : Formatter<StringView> { parts.append(String::formatted("[[Writable]]: {}", property_attributes.is_writable())); parts.append(String::formatted("[[Enumerable]]: {}", property_attributes.is_enumerable())); parts.append(String::formatted("[[Configurable]]: {}", property_attributes.is_configurable())); - return Formatter<StringView>::format(builder, String::formatted("PropertyAttributes {{ {} }}", String::join(", ", parts))); + return Formatter<StringView>::format(builder, String::formatted("PropertyAttributes {{ {} }}", String::join(", "sv, parts))); } }; diff --git a/Userland/Libraries/LibJS/Runtime/PropertyDescriptor.h b/Userland/Libraries/LibJS/Runtime/PropertyDescriptor.h index 2fd209147d..048ef7cd99 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyDescriptor.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyDescriptor.h @@ -62,7 +62,7 @@ struct Formatter<JS::PropertyDescriptor> : Formatter<StringView> { parts.append(String::formatted("[[Enumerable]]: {}", *property_descriptor.enumerable)); if (property_descriptor.configurable.has_value()) parts.append(String::formatted("[[Configurable]]: {}", *property_descriptor.configurable)); - return Formatter<StringView>::format(builder, String::formatted("PropertyDescriptor {{ {} }}", String::join(", ", parts))); + return Formatter<StringView>::format(builder, String::formatted("PropertyDescriptor {{ {} }}", String::join(", "sv, parts))); } }; diff --git a/Userland/Libraries/LibJS/Runtime/Reference.cpp b/Userland/Libraries/LibJS/Runtime/Reference.cpp index 1c31fd5cd6..c433c51c93 100644 --- a/Userland/Libraries/LibJS/Runtime/Reference.cpp +++ b/Userland/Libraries/LibJS/Runtime/Reference.cpp @@ -199,24 +199,24 @@ ThrowCompletionOr<bool> Reference::delete_(GlobalObject& global_object) String Reference::to_string() const { StringBuilder builder; - builder.append("Reference { Base="); + builder.append("Reference { Base="sv); switch (m_base_type) { case BaseType::Unresolvable: - builder.append("Unresolvable"); + builder.append("Unresolvable"sv); break; case BaseType::Environment: builder.appendff("{}", base_environment().class_name()); break; case BaseType::Value: if (m_base_value.is_empty()) - builder.append("<empty>"); + builder.append("<empty>"sv); else builder.appendff("{}", m_base_value.to_string_without_side_effects()); break; } - builder.append(", ReferencedName="); + builder.append(", ReferencedName="sv); if (!m_name.is_valid()) - builder.append("<invalid>"); + builder.append("<invalid>"sv); else if (m_name.is_symbol()) builder.appendff("{}", m_name.as_symbol()->to_string()); else @@ -224,11 +224,11 @@ String Reference::to_string() const builder.appendff(", Strict={}", m_strict); builder.appendff(", ThisValue="); if (m_this_value.is_empty()) - builder.append("<empty>"); + builder.append("<empty>"sv); else builder.appendff("{}", m_this_value.to_string_without_side_effects()); - builder.append(" }"); + builder.append(" }"sv); return builder.to_string(); } diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index cfbfbc3063..7a011a09c1 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -182,7 +182,7 @@ String RegExpObject::escape_regexp_pattern() const if (m_pattern.is_empty()) return "(?:)"; // FIXME: Check u flag and escape accordingly - return m_pattern.replace("\n", "\\n", ReplaceMode::All).replace("\r", "\\r", ReplaceMode::All).replace(LINE_SEPARATOR_STRING, "\\u2028", ReplaceMode::All).replace(PARAGRAPH_SEPARATOR_STRING, "\\u2029", ReplaceMode::All).replace("/", "\\/", ReplaceMode::All); + return m_pattern.replace("\n"sv, "\\n"sv, ReplaceMode::All).replace("\r"sv, "\\r"sv, ReplaceMode::All).replace(LINE_SEPARATOR_STRING, "\\u2028"sv, ReplaceMode::All).replace(PARAGRAPH_SEPARATOR_STRING, "\\u2029"sv, ReplaceMode::All).replace("/"sv, "\\/"sv, ReplaceMode::All); } // 22.2.3.2.4 RegExpCreate ( P, F ), https://tc39.es/ecma262/#sec-regexpcreate diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 9b898ed46c..608e318cdd 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -474,7 +474,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::flags) #define __JS_ENUMERATE(flagName, flag_name, flag_char) \ auto flag_##flag_name = TRY(regexp_object->get(vm.names.flagName)); \ if (flag_##flag_name.to_boolean()) \ - builder.append(#flag_char); + builder.append(#flag_char##sv); JS_ENUMERATE_REGEXP_FLAGS #undef __JS_ENUMERATE diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index 7484610a63..8ffc5403f6 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -969,13 +969,13 @@ static ThrowCompletionOr<Value> create_html(GlobalObject& global_object, Value s auto value_string = TRY(value.to_string(global_object)); builder.append(' '); builder.append(attribute); - builder.append("=\""); - builder.append(value_string.replace("\"", """, ReplaceMode::All)); + builder.append("=\""sv); + builder.append(value_string.replace("\""sv, """sv, ReplaceMode::All)); builder.append('"'); } builder.append('>'); builder.append(str); - builder.append("</"); + builder.append("</"sv); builder.append(tag); builder.append('>'); return js_string(vm, builder.build()); diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp index 22e22da0db..96a33aef50 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp @@ -449,7 +449,7 @@ void TypedArrayBase::visit_edges(Visitor& visitor) : TypedArray(prototype, \ reinterpret_cast<TypedArrayBase::IntrinsicConstructor>(&GlobalObject::snake_name##_constructor), length, array_buffer) \ { \ - if constexpr (StringView { #ClassName }.is_one_of("BigInt64Array", "BigUint64Array")) \ + if constexpr (#ClassName##sv.is_one_of("BigInt64Array", "BigUint64Array")) \ m_content_type = ContentType::BigInt; \ else \ m_content_type = ContentType::Number; \ diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 193c01d25f..a7a12df189 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -599,7 +599,7 @@ String VM::join_arguments(size_t start_index) const { StringBuilder joined_arguments; for (size_t i = start_index; i < argument_count(); ++i) { - joined_arguments.append(argument(i).to_string_without_side_effects().characters()); + joined_arguments.append(argument(i).to_string_without_side_effects().view()); if (i != argument_count() - 1) joined_arguments.append(' '); } diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 66838574e5..c560763156 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -156,7 +156,7 @@ static String double_to_string(double d) return builder.to_string(); } if (-6 < exponent && exponent <= 0) { - builder.append("0."); + builder.append("0."sv); builder.append(String::repeated('0', -exponent)); builder.append(digits); return builder.to_string(); diff --git a/Userland/Libraries/LibJS/Token.cpp b/Userland/Libraries/LibJS/Token.cpp index cca3375778..496761937f 100644 --- a/Userland/Libraries/LibJS/Token.cpp +++ b/Userland/Libraries/LibJS/Token.cpp @@ -205,7 +205,7 @@ String Token::string_value(StringValueStatus& status) const } lexer.retreat(); - builder.append(lexer.consume_escaped_character('\\', "b\bf\fn\nr\rt\tv\v")); + builder.append(lexer.consume_escaped_character('\\', "b\bf\fn\nr\rt\tv\v"sv)); } return builder.to_string(); } @@ -213,7 +213,7 @@ String Token::string_value(StringValueStatus& status) const // 12.8.6.2 Static Semantics: TRV, https://tc39.es/ecma262/#sec-static-semantics-trv String Token::raw_template_value() const { - return value().replace("\r\n", "\n", ReplaceMode::All).replace("\r", "\n", ReplaceMode::All); + return value().replace("\r\n"sv, "\n"sv, ReplaceMode::All).replace("\r"sv, "\n"sv, ReplaceMode::All); } bool Token::bool_value() const diff --git a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp index 838de4e35c..0e70ff77d2 100644 --- a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp +++ b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp @@ -14,11 +14,11 @@ namespace Keyboard { ErrorOr<CharacterMapData> CharacterMapFile::load_from_file(String const& filename) { auto path = filename; - if (!path.ends_with(".json")) { + if (!path.ends_with(".json"sv)) { StringBuilder full_path; - full_path.append("/res/keymaps/"); + full_path.append("/res/keymaps/"sv); full_path.append(filename); - full_path.append(".json"); + full_path.append(".json"sv); path = full_path.to_string(); } diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index 711328e5a6..211827a5b1 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -55,16 +55,16 @@ Configuration Configuration::from_config(StringView libname) configuration.set(flags); - if (refresh.equals_ignoring_case("lazy")) + if (refresh.equals_ignoring_case("lazy"sv)) configuration.set(Configuration::Lazy); - else if (refresh.equals_ignoring_case("eager")) + else if (refresh.equals_ignoring_case("eager"sv)) configuration.set(Configuration::Eager); - if (operation.equals_ignoring_case("full")) + if (operation.equals_ignoring_case("full"sv)) configuration.set(Configuration::OperationMode::Full); - else if (operation.equals_ignoring_case("noescapesequences")) + else if (operation.equals_ignoring_case("noescapesequences"sv)) configuration.set(Configuration::OperationMode::NoEscapeSequences); - else if (operation.equals_ignoring_case("noninteractive")) + else if (operation.equals_ignoring_case("noninteractive"sv)) configuration.set(Configuration::OperationMode::NonInteractive); else configuration.set(Configuration::OperationMode::Unset); @@ -125,7 +125,7 @@ Configuration Configuration::from_config(StringView libname) while (!value_lexer.is_eof()) value_builder.append(value_lexer.consume_escaped_character()); auto value = value_builder.string_view(); - if (value.starts_with("internal:")) { + if (value.starts_with("internal:"sv)) { configuration.set(KeyBinding { keys, KeyBinding::Kind::InternalFunction, @@ -258,8 +258,8 @@ bool Editor::load_history(String const& path) return false; auto data = history_file->read_all(); auto hist = StringView { data.data(), data.size() }; - for (auto& str : hist.split_view("\n\n")) { - auto it = str.find("::").value_or(0); + for (auto& str : hist.split_view("\n\n"sv)) { + auto it = str.find("::"sv).value_or(0); auto time = str.substring_view(0, it).to_uint<time_t>().value_or(0); auto string = str.substring_view(it == 0 ? it : it + 2); m_history.append({ string, time }); @@ -320,7 +320,7 @@ bool Editor::save_history(String const& path) merge( file->line_begin(), file->line_end(), m_history.begin(), m_history.end(), final_history, [](StringView str) { - auto it = str.find("::").value_or(0); + auto it = str.find("::"sv).value_or(0); auto time = str.substring_view(0, it).to_uint<time_t>().value_or(0); auto string = str.substring_view(it == 0 ? it : it + 2); return HistoryEntry { string, time }; @@ -1676,36 +1676,36 @@ void Style::unify_with(Style const& other, bool prefer_other) String Style::to_string() const { StringBuilder builder; - builder.append("Style { "); + builder.append("Style { "sv); if (!m_foreground.is_default()) { - builder.append("Foreground("); + builder.append("Foreground("sv); if (m_foreground.m_is_rgb) { - builder.join(", ", m_foreground.m_rgb_color); + builder.join(", "sv, m_foreground.m_rgb_color); } else { builder.appendff("(XtermColor) {}", (int)m_foreground.m_xterm_color); } - builder.append("), "); + builder.append("), "sv); } if (!m_background.is_default()) { - builder.append("Background("); + builder.append("Background("sv); if (m_background.m_is_rgb) { builder.join(' ', m_background.m_rgb_color); } else { builder.appendff("(XtermColor) {}", (int)m_background.m_xterm_color); } - builder.append("), "); + builder.append("), "sv); } if (bold()) - builder.append("Bold, "); + builder.append("Bold, "sv); if (underline()) - builder.append("Underline, "); + builder.append("Underline, "sv); if (italic()) - builder.append("Italic, "); + builder.append("Italic, "sv); if (!m_hyperlink.is_empty()) builder.appendff("Hyperlink(\"{}\"), ", m_hyperlink.m_link); diff --git a/Userland/Libraries/LibLine/Editor.h b/Userland/Libraries/LibLine/Editor.h index 0dbe064153..063e4db9ae 100644 --- a/Userland/Libraries/LibLine/Editor.h +++ b/Userland/Libraries/LibLine/Editor.h @@ -91,7 +91,7 @@ struct Configuration { enable_bracketed_paste = flags & Flags::BracketedPaste; } - static Configuration from_config(StringView libname = "line"); + static Configuration from_config(StringView libname = "line"sv); RefreshBehavior refresh_behavior { RefreshBehavior::Lazy }; SignalHandler m_signal_mode { SignalHandler::WithSignalHandlers }; diff --git a/Userland/Libraries/LibLine/InternalFunctions.cpp b/Userland/Libraries/LibLine/InternalFunctions.cpp index 241fc7e18f..a3c0370c9a 100644 --- a/Userland/Libraries/LibLine/InternalFunctions.cpp +++ b/Userland/Libraries/LibLine/InternalFunctions.cpp @@ -314,7 +314,7 @@ void Editor::enter_search() return false; }); - auto search_prompt = "\x1b[32msearch:\x1b[0m "; + auto search_prompt = "\x1b[32msearch:\x1b[0m "sv; // While the search editor is active, we do not want editing events. m_is_editing = false; diff --git a/Userland/Libraries/LibLine/Style.h b/Userland/Libraries/LibLine/Style.h index e4352e76e4..a2b4e0bba3 100644 --- a/Userland/Libraries/LibLine/Style.h +++ b/Userland/Libraries/LibLine/Style.h @@ -145,7 +145,7 @@ public: static Style reset_style() { - return { Foreground(XtermColor::Default), Background(XtermColor::Default), Hyperlink("") }; + return { Foreground(XtermColor::Default), Background(XtermColor::Default), Hyperlink(""sv) }; } Style unified_with(Style const& other, bool prefer_other = true) const diff --git a/Userland/Libraries/LibLine/SuggestionManager.h b/Userland/Libraries/LibLine/SuggestionManager.h index 35273d3275..6938a797e8 100644 --- a/Userland/Libraries/LibLine/SuggestionManager.h +++ b/Userland/Libraries/LibLine/SuggestionManager.h @@ -27,7 +27,7 @@ public: // Intentionally not explicit. (To allow suggesting bare strings) CompletionSuggestion(String const& completion) - : CompletionSuggestion(completion, "", {}) + : CompletionSuggestion(completion, ""sv, {}) { } @@ -36,7 +36,7 @@ public: { } - CompletionSuggestion(StringView completion, StringView trailing_trivia, StringView display_trivia = "") + CompletionSuggestion(StringView completion, StringView trailing_trivia, StringView display_trivia = ""sv) : CompletionSuggestion(completion, trailing_trivia, display_trivia, {}) { } diff --git a/Userland/Libraries/LibMarkdown/BlockQuote.cpp b/Userland/Libraries/LibMarkdown/BlockQuote.cpp index df879a3c05..56f6269691 100644 --- a/Userland/Libraries/LibMarkdown/BlockQuote.cpp +++ b/Userland/Libraries/LibMarkdown/BlockQuote.cpp @@ -13,9 +13,9 @@ namespace Markdown { String BlockQuote::render_to_html(bool) const { StringBuilder builder; - builder.append("<blockquote>\n"); + builder.append("<blockquote>\n"sv); builder.append(m_contents->render_to_html()); - builder.append("</blockquote>\n"); + builder.append("</blockquote>\n"sv); return builder.build(); } diff --git a/Userland/Libraries/LibMarkdown/CodeBlock.cpp b/Userland/Libraries/LibMarkdown/CodeBlock.cpp index 7db1f88277..c22aae97b7 100644 --- a/Userland/Libraries/LibMarkdown/CodeBlock.cpp +++ b/Userland/Libraries/LibMarkdown/CodeBlock.cpp @@ -17,15 +17,15 @@ String CodeBlock::render_to_html(bool) const { StringBuilder builder; - builder.append("<pre>"); + builder.append("<pre>"sv); if (m_style.length() >= 2) - builder.append("<strong>"); + builder.append("<strong>"sv); else if (m_style.length() >= 2) - builder.append("<em>"); + builder.append("<em>"sv); if (m_language.is_empty()) - builder.append("<code>"); + builder.append("<code>"sv); else builder.appendff("<code class=\"language-{}\">", escape_html_entities(m_language)); @@ -34,14 +34,14 @@ String CodeBlock::render_to_html(bool) const else builder.append(escape_html_entities(m_code)); - builder.append("</code>"); + builder.append("</code>"sv); if (m_style.length() >= 2) - builder.append("</strong>"); + builder.append("</strong>"sv); else if (m_style.length() >= 2) - builder.append("</em>"); + builder.append("</em>"sv); - builder.append("</pre>\n"); + builder.append("</pre>\n"sv); return builder.build(); } @@ -51,9 +51,9 @@ String CodeBlock::render_for_terminal(size_t) const StringBuilder builder; for (auto line : m_code.split('\n')) { - builder.append(" "); + builder.append(" "sv); builder.append(line); - builder.append("\n"); + builder.append("\n"sv); } return builder.build(); diff --git a/Userland/Libraries/LibMarkdown/CommentBlock.cpp b/Userland/Libraries/LibMarkdown/CommentBlock.cpp index 7b4f892100..49aeabd2c9 100644 --- a/Userland/Libraries/LibMarkdown/CommentBlock.cpp +++ b/Userland/Libraries/LibMarkdown/CommentBlock.cpp @@ -14,10 +14,10 @@ String CommentBlock::render_to_html(bool) const { StringBuilder builder; - builder.append("<!--"); + builder.append("<!--"sv); builder.append(escape_html_entities(m_comment)); // TODO: This is probably incorrect, because we technically need to escape "--" in some form. However, Browser does not care about this. - builder.append("-->\n"); + builder.append("-->\n"sv); return builder.build(); } diff --git a/Userland/Libraries/LibMarkdown/ContainerBlock.cpp b/Userland/Libraries/LibMarkdown/ContainerBlock.cpp index 026d77e9be..fef3ec15c3 100644 --- a/Userland/Libraries/LibMarkdown/ContainerBlock.cpp +++ b/Userland/Libraries/LibMarkdown/ContainerBlock.cpp @@ -125,7 +125,7 @@ OwnPtr<ContainerBlock> ContainerBlock::parse(LineIterator& lines) } if (!paragraph_text.is_empty()) - paragraph_text.append("\n"); + paragraph_text.append('\n'); paragraph_text.append(*lines++); } diff --git a/Userland/Libraries/LibMarkdown/Document.cpp b/Userland/Libraries/LibMarkdown/Document.cpp index a4fa2307ae..0fbe15a293 100644 --- a/Userland/Libraries/LibMarkdown/Document.cpp +++ b/Userland/Libraries/LibMarkdown/Document.cpp @@ -16,19 +16,19 @@ String Document::render_to_html() const { StringBuilder builder; - builder.append("<!DOCTYPE html>\n"); - builder.append("<html>\n"); - builder.append("<head>\n"); - builder.append("<style>\n"); - builder.append("code { white-space: pre; }\n"); - builder.append("</style>\n"); - builder.append("</head>\n"); - builder.append("<body>\n"); + builder.append("<!DOCTYPE html>\n"sv); + builder.append("<html>\n"sv); + builder.append("<head>\n"sv); + builder.append("<style>\n"sv); + builder.append("code { white-space: pre; }\n"sv); + builder.append("</style>\n"sv); + builder.append("</head>\n"sv); + builder.append("<body>\n"sv); builder.append(render_to_inline_html()); - builder.append("</body>\n"); - builder.append("</html>\n"); + builder.append("</body>\n"sv); + builder.append("</html>\n"sv); return builder.build(); } diff --git a/Userland/Libraries/LibMarkdown/Heading.cpp b/Userland/Libraries/LibMarkdown/Heading.cpp index fe16f4d22b..0c3f2f3de8 100644 --- a/Userland/Libraries/LibMarkdown/Heading.cpp +++ b/Userland/Libraries/LibMarkdown/Heading.cpp @@ -19,16 +19,16 @@ String Heading::render_for_terminal(size_t) const { StringBuilder builder; - builder.append("\033[0;31;1m\n"); + builder.append("\033[0;31;1m\n"sv); switch (m_level) { case 1: case 2: builder.append(m_text.render_for_terminal().to_uppercase()); - builder.append("\033[0m\n"); + builder.append("\033[0m\n"sv); break; default: builder.append(m_text.render_for_terminal()); - builder.append("\033[0m\n"); + builder.append("\033[0m\n"sv); break; } diff --git a/Userland/Libraries/LibMarkdown/HorizontalRule.cpp b/Userland/Libraries/LibMarkdown/HorizontalRule.cpp index 7bb8edb42f..680c99009c 100644 --- a/Userland/Libraries/LibMarkdown/HorizontalRule.cpp +++ b/Userland/Libraries/LibMarkdown/HorizontalRule.cpp @@ -22,7 +22,7 @@ String HorizontalRule::render_for_terminal(size_t view_width) const StringBuilder builder(view_width + 1); for (size_t i = 0; i < view_width; ++i) builder.append('-'); - builder.append("\n\n"); + builder.append("\n\n"sv); return builder.to_string(); } diff --git a/Userland/Libraries/LibMarkdown/List.cpp b/Userland/Libraries/LibMarkdown/List.cpp index d98288f355..994eee226c 100644 --- a/Userland/Libraries/LibMarkdown/List.cpp +++ b/Userland/Libraries/LibMarkdown/List.cpp @@ -22,14 +22,14 @@ String List::render_to_html(bool) const if (m_start_number != 1) builder.appendff(" start=\"{}\"", m_start_number); - builder.append(">\n"); + builder.append(">\n"sv); for (auto& item : m_items) { - builder.append("<li>"); + builder.append("<li>"sv); if (!m_is_tight || (item->blocks().size() != 0 && !dynamic_cast<Paragraph const*>(&(item->blocks()[0])))) builder.append("\n"); builder.append(item->render_to_html(m_is_tight)); - builder.append("</li>\n"); + builder.append("</li>\n"sv); } builder.appendff("</{}>\n", tag); @@ -43,7 +43,7 @@ String List::render_for_terminal(size_t) const int i = 0; for (auto& item : m_items) { - builder.append(" "); + builder.append(" "sv); if (m_is_ordered) builder.appendff("{}.", ++i); else diff --git a/Userland/Libraries/LibMarkdown/Paragraph.cpp b/Userland/Libraries/LibMarkdown/Paragraph.cpp index d1d2ebec65..0b804a86b9 100644 --- a/Userland/Libraries/LibMarkdown/Paragraph.cpp +++ b/Userland/Libraries/LibMarkdown/Paragraph.cpp @@ -15,12 +15,12 @@ String Paragraph::render_to_html(bool tight) const StringBuilder builder; if (!tight) - builder.append("<p>"); + builder.append("<p>"sv); builder.append(m_text.render_to_html()); if (!tight) - builder.append("</p>"); + builder.append("</p>"sv); builder.append('\n'); @@ -30,9 +30,9 @@ String Paragraph::render_to_html(bool tight) const String Paragraph::render_for_terminal(size_t) const { StringBuilder builder; - builder.append(" "); + builder.append(" "sv); builder.append(m_text.render_for_terminal()); - builder.append("\n\n"); + builder.append("\n\n"sv); return builder.build(); } diff --git a/Userland/Libraries/LibMarkdown/Table.cpp b/Userland/Libraries/LibMarkdown/Table.cpp index 5cf26bd48e..c67409aa61 100644 --- a/Userland/Libraries/LibMarkdown/Table.cpp +++ b/Userland/Libraries/LibMarkdown/Table.cpp @@ -84,29 +84,29 @@ String Table::render_to_html(bool) const StringBuilder builder; - builder.append("<table>"); - builder.append("<thead>"); - builder.append("<tr>"); + builder.append("<table>"sv); + builder.append("<thead>"sv); + builder.append("<tr>"sv); for (auto& column : m_columns) { builder.appendff("<th style='text-align: {}'>", alignment_string(column.alignment)); builder.append(column.header.render_to_html()); - builder.append("</th>"); + builder.append("</th>"sv); } - builder.append("</tr>"); - builder.append("</thead>"); - builder.append("<tbody>"); + builder.append("</tr>"sv); + builder.append("</thead>"sv); + builder.append("<tbody>"sv); for (size_t i = 0; i < m_row_count; ++i) { - builder.append("<tr>"); + builder.append("<tr>"sv); for (auto& column : m_columns) { VERIFY(i < column.rows.size()); builder.appendff("<td style='text-align: {}'>", alignment_string(column.alignment)); builder.append(column.rows[i].render_to_html()); - builder.append("</td>"); + builder.append("</td>"sv); } - builder.append("</tr>"); + builder.append("</tr>"sv); } - builder.append("</tbody>"); - builder.append("</table>"); + builder.append("</tbody>"sv); + builder.append("</table>"sv); return builder.to_string(); } @@ -224,7 +224,7 @@ OwnPtr<Table> Table::parse(LineIterator& lines) if (i >= segments.size()) { // Ran out of segments, but still have headers. // Just make an empty cell. - table->m_columns[i].rows.append(Text::parse("")); + table->m_columns[i].rows.append(Text::parse(""sv)); } else { auto text = Text::parse(segments[i]); table->m_columns[i].rows.append(move(text)); diff --git a/Userland/Libraries/LibMarkdown/Text.cpp b/Userland/Libraries/LibMarkdown/Text.cpp index b4088ebb60..1a5f55717b 100644 --- a/Userland/Libraries/LibMarkdown/Text.cpp +++ b/Userland/Libraries/LibMarkdown/Text.cpp @@ -17,21 +17,21 @@ namespace Markdown { void Text::EmphasisNode::render_to_html(StringBuilder& builder) const { - builder.append((strong) ? "<strong>" : "<em>"); + builder.append((strong) ? "<strong>"sv : "<em>"sv); child->render_to_html(builder); - builder.append((strong) ? "</strong>" : "</em>"); + builder.append((strong) ? "</strong>"sv : "</em>"sv); } void Text::EmphasisNode::render_for_terminal(StringBuilder& builder) const { if (strong) { - builder.append("\e[1m"); + builder.append("\e[1m"sv); child->render_for_terminal(builder); - builder.append("\e[22m"); + builder.append("\e[22m"sv); } else { - builder.append("\e[3m"); + builder.append("\e[3m"sv); child->render_for_terminal(builder); - builder.append("\e[23m"); + builder.append("\e[23m"sv); } } @@ -51,16 +51,16 @@ RecursionDecision Text::EmphasisNode::walk(Visitor& visitor) const void Text::CodeNode::render_to_html(StringBuilder& builder) const { - builder.append("<code>"); + builder.append("<code>"sv); code->render_to_html(builder); - builder.append("</code>"); + builder.append("</code>"sv); } void Text::CodeNode::render_for_terminal(StringBuilder& builder) const { - builder.append("\e[1m"); + builder.append("\e[1m"sv); code->render_for_terminal(builder); - builder.append("\e[22m"); + builder.append("\e[22m"sv); } size_t Text::CodeNode::terminal_length() const @@ -79,7 +79,7 @@ RecursionDecision Text::CodeNode::walk(Visitor& visitor) const void Text::BreakNode::render_to_html(StringBuilder& builder) const { - builder.append("<br />"); + builder.append("<br />"sv); } void Text::BreakNode::render_for_terminal(StringBuilder&) const @@ -138,34 +138,34 @@ RecursionDecision Text::TextNode::walk(Visitor& visitor) const void Text::LinkNode::render_to_html(StringBuilder& builder) const { if (is_image) { - builder.append("<img src=\""); + builder.append("<img src=\""sv); builder.append(escape_html_entities(href)); - builder.append("\" alt=\""); + builder.append("\" alt=\""sv); text->render_to_html(builder); - builder.append("\" >"); + builder.append("\" >"sv); } else { - builder.append("<a href=\""); + builder.append("<a href=\""sv); builder.append(escape_html_entities(href)); - builder.append("\">"); + builder.append("\">"sv); text->render_to_html(builder); - builder.append("</a>"); + builder.append("</a>"sv); } } void Text::LinkNode::render_for_terminal(StringBuilder& builder) const { - bool is_linked = href.contains("://"); + bool is_linked = href.contains("://"sv); if (is_linked) { - builder.append("\033[0;34m\e]8;;"); + builder.append("\033[0;34m\e]8;;"sv); builder.append(href); - builder.append("\e\\"); + builder.append("\e\\"sv); } text->render_for_terminal(builder); if (is_linked) { builder.appendff(" <{}>", href); - builder.append("\033]8;;\033\\\033[0m"); + builder.append("\033]8;;\033\\\033[0m"sv); } } @@ -225,16 +225,16 @@ RecursionDecision Text::MultiNode::walk(Visitor& visitor) const void Text::StrikeThroughNode::render_to_html(StringBuilder& builder) const { - builder.append("<del>"); + builder.append("<del>"sv); striked_text->render_to_html(builder); - builder.append("</del>"); + builder.append("</del>"sv); } void Text::StrikeThroughNode::render_for_terminal(StringBuilder& builder) const { - builder.append("\e[9m"); + builder.append("\e[9m"sv); striked_text->render_for_terminal(builder); - builder.append("\e[29m"); + builder.append("\e[29m"sv); } size_t Text::StrikeThroughNode::terminal_length() const @@ -260,14 +260,14 @@ String Text::render_to_html() const { StringBuilder builder; m_node->render_to_html(builder); - return builder.build().trim(" \n\t"); + return builder.build().trim(" \n\t"sv); } String Text::render_for_terminal() const { StringBuilder builder; m_node->render_for_terminal(builder); - return builder.build().trim(" \n\t"); + return builder.build().trim(" \n\t"sv); } RecursionDecision Text::walk(Visitor& visitor) const @@ -380,16 +380,16 @@ Vector<Text::Token> Text::tokenize(StringView str) in_space = true; } current_token.append(ch); - } else if (has("\n")) { - expect("\n"); - } else if (has("[")) { - expect("["); - } else if (has("![")) { - expect("!["); - } else if (has("](")) { - expect("]("); - } else if (has(")")) { - expect(")"); + } else if (has("\n"sv)) { + expect("\n"sv); + } else if (has("["sv)) { + expect("["sv); + } else if (has("!["sv)) { + expect("!["sv); + } else if (has("]("sv)) { + expect("]("sv); + } else if (has(")"sv)) { + expect(")"sv); } else { current_token.append(ch); } @@ -405,7 +405,7 @@ NonnullOwnPtr<Text::MultiNode> Text::parse_sequence(Vector<Token>::ConstIterator for (; !tokens.is_end(); ++tokens) { if (tokens->is_space()) { node->children.append(parse_break(tokens)); - } else if (*tokens == "\n") { + } else if (*tokens == "\n"sv) { node->children.append(parse_newline(tokens)); } else if (tokens->is_run) { switch (tokens->run_char()) { @@ -420,15 +420,15 @@ NonnullOwnPtr<Text::MultiNode> Text::parse_sequence(Vector<Token>::ConstIterator node->children.append(parse_strike_through(tokens)); break; } - } else if (*tokens == "[" || *tokens == "![") { + } else if (*tokens == "["sv || *tokens == "!["sv) { node->children.append(parse_link(tokens)); - } else if (in_link && *tokens == "](") { + } else if (in_link && *tokens == "]("sv) { return node; } else { node->children.append(make<TextNode>(tokens->data)); } - if (in_link && !tokens.is_end() && *tokens == "](") + if (in_link && !tokens.is_end() && *tokens == "]("sv) return node; if (tokens.is_end()) @@ -440,7 +440,7 @@ NonnullOwnPtr<Text::MultiNode> Text::parse_sequence(Vector<Token>::ConstIterator NonnullOwnPtr<Text::Node> Text::parse_break(Vector<Token>::ConstIterator& tokens) { auto next_tok = tokens + 1; - if (next_tok.is_end() || *next_tok != "\n") + if (next_tok.is_end() || *next_tok != "\n"sv) return make<TextNode>(tokens->data); if (tokens->data.length() >= 2) @@ -488,7 +488,7 @@ NonnullOwnPtr<Text::Node> Text::parse_emph(Vector<Token>::ConstIterator& tokens, for (++tokens; !tokens.is_end(); ++tokens) { if (tokens->is_space()) { child->children.append(parse_break(tokens)); - } else if (*tokens == "\n") { + } else if (*tokens == "\n"sv) { child->children.append(parse_newline(tokens)); } else if (tokens->is_run) { if (can_close_for(opening, *tokens)) { @@ -507,16 +507,16 @@ NonnullOwnPtr<Text::Node> Text::parse_emph(Vector<Token>::ConstIterator& tokens, child->children.append(parse_strike_through(tokens)); break; } - } else if (*tokens == "[" || *tokens == "![") { + } else if (*tokens == "["sv || *tokens == "!["sv) { child->children.append(parse_link(tokens)); - } else if (in_link && *tokens == "](") { + } else if (in_link && *tokens == "]("sv) { child->children.prepend(make<TextNode>(opening.data)); return child; } else { child->children.append(make<TextNode>(tokens->data)); } - if (in_link && !tokens.is_end() && *tokens == "](") { + if (in_link && !tokens.is_end() && *tokens == "]("sv) { child->children.prepend(make<TextNode>(opening.data)); return child; } @@ -556,7 +556,7 @@ NonnullOwnPtr<Text::Node> Text::parse_code(Vector<Token>::ConstIterator& tokens) } is_all_whitespace = is_all_whitespace && iterator->data.is_whitespace(); - code->children.append(make<TextNode>((*iterator == "\n") ? " " : iterator->data, false)); + code->children.append(make<TextNode>((*iterator == "\n"sv) ? " " : iterator->data, false)); } return make<TextNode>(opening.data); @@ -565,20 +565,20 @@ NonnullOwnPtr<Text::Node> Text::parse_code(Vector<Token>::ConstIterator& tokens) NonnullOwnPtr<Text::Node> Text::parse_link(Vector<Token>::ConstIterator& tokens) { auto opening = *tokens++; - bool is_image = opening == "!["; + bool is_image = opening == "!["sv; auto link_text = parse_sequence(tokens, true); - if (tokens.is_end() || *tokens != "](") { + if (tokens.is_end() || *tokens != "]("sv) { link_text->children.prepend(make<TextNode>(opening.data)); return link_text; } auto separator = *tokens; - VERIFY(separator == "]("); + VERIFY(separator == "]("sv); StringBuilder address; for (auto iterator = tokens + 1; !iterator.is_end(); ++iterator) { - if (*iterator == ")") { + if (*iterator == ")"sv) { tokens = iterator; return make<LinkNode>(is_image, move(link_text), address.build()); } @@ -618,7 +618,7 @@ NonnullOwnPtr<Text::Node> Text::parse_strike_through(Vector<Token>::ConstIterato } is_all_whitespace = is_all_whitespace && iterator->data.is_whitespace(); - striked_text->children.append(make<TextNode>((*iterator == "\n") ? " " : iterator->data, false)); + striked_text->children.append(make<TextNode>((*iterator == "\n"sv) ? " " : iterator->data, false)); } return make<TextNode>(opening.data); diff --git a/Userland/Libraries/LibPCIDB/Database.cpp b/Userland/Libraries/LibPCIDB/Database.cpp index bffd5b7d07..7ff48f7420 100644 --- a/Userland/Libraries/LibPCIDB/Database.cpp +++ b/Userland/Libraries/LibPCIDB/Database.cpp @@ -27,7 +27,7 @@ const StringView Database::get_vendor(u16 vendor_id) const { auto const& vendor = m_vendors.get(vendor_id); if (!vendor.has_value()) - return ""; + return ""sv; return vendor.value()->name; } @@ -35,10 +35,10 @@ const StringView Database::get_device(u16 vendor_id, u16 device_id) const { auto const& vendor = m_vendors.get(vendor_id); if (!vendor.has_value()) - return ""; + return ""sv; auto const& device = vendor.value()->devices.get(device_id); if (!device.has_value()) - return ""; + return ""sv; return device.value()->name; } @@ -46,13 +46,13 @@ const StringView Database::get_subsystem(u16 vendor_id, u16 device_id, u16 subve { auto const& vendor = m_vendors.get(vendor_id); if (!vendor.has_value()) - return ""; + return ""sv; auto const& device = vendor.value()->devices.get(device_id); if (!device.has_value()) - return ""; + return ""sv; auto const& subsystem = device.value()->subsystems.get((subvendor_id << 16) + subdevice_id); if (!subsystem.has_value()) - return ""; + return ""sv; return subsystem.value()->name; } @@ -60,7 +60,7 @@ const StringView Database::get_class(u8 class_id) const { auto const& xclass = m_classes.get(class_id); if (!xclass.has_value()) - return ""; + return ""sv; return xclass.value()->name; } @@ -68,10 +68,10 @@ const StringView Database::get_subclass(u8 class_id, u8 subclass_id) const { auto const& xclass = m_classes.get(class_id); if (!xclass.has_value()) - return ""; + return ""sv; auto const& subclass = xclass.value()->subclasses.get(subclass_id); if (!subclass.has_value()) - return ""; + return ""sv; return subclass.value()->name; } @@ -79,13 +79,13 @@ const StringView Database::get_programming_interface(u8 class_id, u8 subclass_id { auto const& xclass = m_classes.get(class_id); if (!xclass.has_value()) - return ""; + return ""sv; auto const& subclass = xclass.value()->subclasses.get(subclass_id); if (!subclass.has_value()) - return ""; + return ""sv; auto const& programming_interface = subclass.value()->programming_interfaces.get(programming_interface_id); if (!programming_interface.has_value()) - return ""; + return ""sv; return programming_interface.value()->name; } diff --git a/Userland/Libraries/LibPDF/Document.cpp b/Userland/Libraries/LibPDF/Document.cpp index 2a3aefce9e..ebe95e1541 100644 --- a/Userland/Libraries/LibPDF/Document.cpp +++ b/Userland/Libraries/LibPDF/Document.cpp @@ -12,7 +12,7 @@ namespace PDF { String OutlineItem::to_string(int indent) const { - auto indent_str = String::repeated(" ", indent + 1); + auto indent_str = String::repeated(" "sv, indent + 1); StringBuilder child_builder; child_builder.append('['); @@ -21,7 +21,7 @@ String OutlineItem::to_string(int indent) const child_builder.appendff("{}]", indent_str); StringBuilder builder; - builder.append("OutlineItem {{\n"); + builder.append("OutlineItem {{\n"sv); builder.appendff("{}title={}\n", indent_str, title); builder.appendff("{}count={}\n", indent_str, count); builder.appendff("{}dest={}\n", indent_str, dest); @@ -29,7 +29,7 @@ String OutlineItem::to_string(int indent) const builder.appendff("{}italic={}\n", indent_str, italic); builder.appendff("{}bold={}\n", indent_str, bold); builder.appendff("{}children={}\n", indent_str, child_builder.to_string()); - builder.appendff("{}}}", String::repeated(" ", indent)); + builder.appendff("{}}}", String::repeated(" "sv, indent)); return builder.to_string(); } @@ -51,7 +51,7 @@ PDFErrorOr<NonnullRefPtr<Document>> Document::create(ReadonlyBytes bytes) // Automatically attempt to unencrypt the document with the empty string. The // result is not important; it is the caller's responsibility to ensure the // document is unencrypted before calling initialize(). - document->m_security_handler->try_provide_user_password(""); + document->m_security_handler->try_provide_user_password(""sv); } return document; diff --git a/Userland/Libraries/LibPDF/Document.h b/Userland/Libraries/LibPDF/Document.h index fd3401f905..fee4b14ccc 100644 --- a/Userland/Libraries/LibPDF/Document.h +++ b/Userland/Libraries/LibPDF/Document.h @@ -248,7 +248,7 @@ struct Formatter<PDF::OutlineDict> : Formatter<FormatString> { child_builder.append('['); for (auto& child : dict.children) child_builder.appendff("{}\n", child.to_string(2)); - child_builder.append(" ]"); + child_builder.append(" ]"sv); return Formatter<FormatString>::format(builder, "OutlineDict {{\n count={}\n children={}\n}}"sv, dict.count, child_builder.to_string()); diff --git a/Userland/Libraries/LibPDF/Encoding.cpp b/Userland/Libraries/LibPDF/Encoding.cpp index a9c4e1366a..a7f2ce7a23 100644 --- a/Userland/Libraries/LibPDF/Encoding.cpp +++ b/Userland/Libraries/LibPDF/Encoding.cpp @@ -79,7 +79,7 @@ NonnullRefPtr<Encoding> Encoding::standard_encoding() static NonnullRefPtr<Encoding> encoding = adopt_ref(*new Encoding()); if (encoding->m_descriptors.is_empty()) { #define ENUMERATE(string, name, standard_code, mac_code, win_code, pdf_code) \ - auto name##_code_point = *Utf8View(StringView(string)).begin(); \ + auto name##_code_point = *Utf8View(string##sv).begin(); \ encoding->m_descriptors.set(standard_code, { string, name##_code_point }); ENUMERATE_LATIN_CHARACTER_SET(ENUMERATE) #undef ENUMERATE @@ -93,7 +93,7 @@ NonnullRefPtr<Encoding> Encoding::mac_encoding() static NonnullRefPtr<Encoding> encoding = adopt_ref(*new Encoding()); if (encoding->m_descriptors.is_empty()) { #define ENUMERATE(string, name, standard_code, mac_code, win_code, pdf_code) \ - auto name##_code_point = *Utf8View(StringView(string)).begin(); \ + auto name##_code_point = *Utf8View(string##sv).begin(); \ encoding->m_descriptors.set(mac_code, { string, name##_code_point }); ENUMERATE_LATIN_CHARACTER_SET(ENUMERATE) #undef ENUMERATE @@ -107,7 +107,7 @@ NonnullRefPtr<Encoding> Encoding::windows_encoding() static NonnullRefPtr<Encoding> encoding = adopt_ref(*new Encoding()); if (encoding->m_descriptors.is_empty()) { #define ENUMERATE(string, name, standard_code, mac_code, win_code, pdf_code) \ - auto name##_code_point = *Utf8View(StringView(string)).begin(); \ + auto name##_code_point = *Utf8View(string##sv).begin(); \ encoding->m_descriptors.set(win_code, { string, name##_code_point }); ENUMERATE_LATIN_CHARACTER_SET(ENUMERATE) #undef ENUMERATE @@ -121,7 +121,7 @@ NonnullRefPtr<Encoding> Encoding::pdf_doc_encoding() static NonnullRefPtr<Encoding> encoding = adopt_ref(*new Encoding()); if (encoding->m_descriptors.is_empty()) { #define ENUMERATE(string, name, standard_code, mac_code, win_code, pdf_code) \ - auto name##_code_point = *Utf8View(StringView(string)).begin(); \ + auto name##_code_point = *Utf8View(string##sv).begin(); \ encoding->m_descriptors.set(pdf_code, { string, name##_code_point }); ENUMERATE_LATIN_CHARACTER_SET(ENUMERATE) #undef ENUMERATE @@ -134,8 +134,8 @@ NonnullRefPtr<Encoding> Encoding::symbol_encoding() { static NonnullRefPtr<Encoding> encoding = adopt_ref(*new Encoding()); if (encoding->m_descriptors.is_empty()) { -#define ENUMERATE(string, name, code) \ - auto name##_code_point = *Utf8View(StringView(string)).begin(); \ +#define ENUMERATE(string, name, code) \ + auto name##_code_point = *Utf8View(string##sv).begin(); \ encoding->m_descriptors.set(code, { string, name##_code_point }); ENUMERATE_SYMBOL_CHARACTER_SET(ENUMERATE) #undef ENUMERATE @@ -148,8 +148,8 @@ NonnullRefPtr<Encoding> Encoding::zapf_encoding() { static NonnullRefPtr<Encoding> encoding = adopt_ref(*new Encoding()); if (encoding->m_descriptors.is_empty()) { -#define ENUMERATE(string, name, code) \ - auto name##_code_point = *Utf8View(StringView(string)).begin(); \ +#define ENUMERATE(string, name, code) \ + auto name##_code_point = *Utf8View(string##sv).begin(); \ encoding->m_descriptors.set(code, { string, name##_code_point }); ENUMERATE_ZAPF_DINGBATS_CHARACTER_SET(ENUMERATE) #undef ENUMERATE diff --git a/Userland/Libraries/LibPDF/ObjectDerivatives.cpp b/Userland/Libraries/LibPDF/ObjectDerivatives.cpp index cdae2961eb..987692f33e 100644 --- a/Userland/Libraries/LibPDF/ObjectDerivatives.cpp +++ b/Userland/Libraries/LibPDF/ObjectDerivatives.cpp @@ -33,7 +33,7 @@ ENUMERATE_OBJECT_TYPES(DEFINE_ACCESSORS) static void append_indent(StringBuilder& builder, int indent) { for (int i = 0; i < indent; i++) - builder.append(" "); + builder.append(" "sv); } String StringObject::to_string(int) const @@ -53,12 +53,12 @@ String NameObject::to_string(int) const String ArrayObject::to_string(int indent) const { StringBuilder builder; - builder.append("[\n"); + builder.append("[\n"sv); bool first = true; for (auto& element : elements()) { if (!first) - builder.append(",\n"); + builder.append(",\n"sv); first = false; append_indent(builder, indent + 1); builder.appendff("{}", element.to_string(indent)); @@ -73,12 +73,12 @@ String ArrayObject::to_string(int indent) const String DictObject::to_string(int indent) const { StringBuilder builder; - builder.append("<<\n"); + builder.append("<<\n"sv); bool first = true; for (auto& [key, value] : map()) { if (!first) - builder.append(",\n"); + builder.append(",\n"sv); first = false; append_indent(builder, indent + 1); builder.appendff("/{} ", key); @@ -87,14 +87,14 @@ String DictObject::to_string(int indent) const builder.append('\n'); append_indent(builder, indent); - builder.append(">>"); + builder.append(">>"sv); return builder.to_string(); } String StreamObject::to_string(int indent) const { StringBuilder builder; - builder.append("stream\n"); + builder.append("stream\n"sv); append_indent(builder, indent); builder.appendff("{}\n", dict()->to_string(indent + 1)); append_indent(builder, indent + 1); @@ -113,7 +113,7 @@ String StreamObject::to_string(int indent) const } append_indent(builder, indent); - builder.append("endstream"); + builder.append("endstream"sv); return builder.to_string(); } @@ -125,7 +125,7 @@ String IndirectValue::to_string(int indent) const builder.append(value().to_string(indent + 1)); builder.append('\n'); append_indent(builder, indent); - builder.append("endobj"); + builder.append("endobj"sv); return builder.to_string(); } diff --git a/Userland/Libraries/LibPDF/Operator.h b/Userland/Libraries/LibPDF/Operator.h index 89e66b8690..eae89c7dc0 100644 --- a/Userland/Libraries/LibPDF/Operator.h +++ b/Userland/Libraries/LibPDF/Operator.h @@ -174,10 +174,10 @@ struct Formatter<PDF::Operator> : Formatter<StringView> { PDF::Operator::operator_symbol(op.type())); if (!op.arguments().is_empty()) { - builder.append(" ["); + builder.append(" ["sv); for (auto& argument : op.arguments()) builder.appendff(" {}", argument); - builder.append(" ]"); + builder.append(" ]"sv); } return Formatter<StringView>::format(format_builder, builder.to_string()); diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index 81988d3191..58e412f86b 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -1155,7 +1155,7 @@ struct Formatter<PDF::Parser::LinearizationDictionary> : Formatter<StringView> { ErrorOr<void> format(FormatBuilder& format_builder, PDF::Parser::LinearizationDictionary const& dict) { StringBuilder builder; - builder.append("{\n"); + builder.append("{\n"sv); builder.appendff(" length_of_file={}\n", dict.length_of_file); builder.appendff(" primary_hint_stream_offset={}\n", dict.primary_hint_stream_offset); builder.appendff(" primary_hint_stream_length={}\n", dict.primary_hint_stream_length); @@ -1176,7 +1176,7 @@ struct Formatter<PDF::Parser::PageOffsetHintTable> : Formatter<StringView> { ErrorOr<void> format(FormatBuilder& format_builder, PDF::Parser::PageOffsetHintTable const& table) { StringBuilder builder; - builder.append("{\n"); + builder.append("{\n"sv); builder.appendff(" least_number_of_objects_in_a_page={}\n", table.least_number_of_objects_in_a_page); builder.appendff(" location_of_first_page_object={}\n", table.location_of_first_page_object); builder.appendff(" bits_required_for_object_number={}\n", table.bits_required_for_object_number); @@ -1200,18 +1200,18 @@ struct Formatter<PDF::Parser::PageOffsetHintTableEntry> : Formatter<StringView> ErrorOr<void> format(FormatBuilder& format_builder, PDF::Parser::PageOffsetHintTableEntry const& entry) { StringBuilder builder; - builder.append("{\n"); + builder.append("{\n"sv); builder.appendff(" objects_in_page_number={}\n", entry.objects_in_page_number); builder.appendff(" page_length_number={}\n", entry.page_length_number); builder.appendff(" number_of_shared_objects={}\n", entry.number_of_shared_objects); - builder.append(" shared_object_identifiers=["); + builder.append(" shared_object_identifiers=["sv); for (auto& identifier : entry.shared_object_identifiers) builder.appendff(" {}", identifier); - builder.append(" ]\n"); - builder.append(" shared_object_location_numerators=["); + builder.append(" ]\n"sv); + builder.append(" shared_object_location_numerators=["sv); for (auto& numerator : entry.shared_object_location_numerators) builder.appendff(" {}", numerator); - builder.append(" ]\n"); + builder.append(" ]\n"sv); builder.appendff(" page_content_stream_offset_number={}\n", entry.page_content_stream_offset_number); builder.appendff(" page_content_stream_length_number={}\n", entry.page_content_stream_length_number); builder.append('}'); diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp index dbeff27279..f7766c4912 100644 --- a/Userland/Libraries/LibPDF/Renderer.cpp +++ b/Userland/Libraries/LibPDF/Renderer.cpp @@ -355,8 +355,8 @@ RENDERER_HANDLER(text_set_font) auto font_name = MUST(font_dictionary->get_name(m_document, CommonNames::BaseFont))->name().to_lowercase(); auto font_view = font_name.view(); - bool is_bold = font_view.contains("bold"); - bool is_italic = font_view.contains("italic"); + bool is_bold = font_view.contains("bold"sv); + bool is_italic = font_view.contains("italic"sv); String font_variant; diff --git a/Userland/Libraries/LibPDF/Renderer.h b/Userland/Libraries/LibPDF/Renderer.h index 00e3cc978c..e5e09f29c9 100644 --- a/Userland/Libraries/LibPDF/Renderer.h +++ b/Userland/Libraries/LibPDF/Renderer.h @@ -177,7 +177,7 @@ struct Formatter<PDF::LineDashPattern> : Formatter<StringView> { for (auto& i : pattern.pattern) { if (!first) - builder.append(", "); + builder.append(", "sv); first = false; builder.appendff("{}", i); } @@ -217,7 +217,7 @@ struct Formatter<PDF::TextState> : Formatter<StringView> { ErrorOr<void> format(FormatBuilder& format_builder, PDF::TextState const& state) { StringBuilder builder; - builder.append("TextState {\n"); + builder.append("TextState {\n"sv); builder.appendff(" character_spacing={}\n", state.character_spacing); builder.appendff(" word_spacing={}\n", state.word_spacing); builder.appendff(" horizontal_scaling={}\n", state.horizontal_scaling); @@ -228,7 +228,7 @@ struct Formatter<PDF::TextState> : Formatter<StringView> { builder.appendff(" rendering_mode={}\n", state.rendering_mode); builder.appendff(" rise={}\n", state.rise); builder.appendff(" knockout={}\n", state.knockout); - builder.append(" }"); + builder.append(" }"sv); return format_builder.put_string(builder.to_string()); } }; @@ -238,7 +238,7 @@ struct Formatter<PDF::GraphicsState> : Formatter<StringView> { ErrorOr<void> format(FormatBuilder& format_builder, PDF::GraphicsState const& state) { StringBuilder builder; - builder.append("GraphicsState {\n"); + builder.append("GraphicsState {\n"sv); builder.appendff(" ctm={}\n", state.ctm); builder.appendff(" stroke_color={}\n", state.stroke_color); builder.appendff(" paint_color={}\n", state.paint_color); diff --git a/Userland/Libraries/LibPDF/XRefTable.h b/Userland/Libraries/LibPDF/XRefTable.h index 59076009ac..01c77197db 100644 --- a/Userland/Libraries/LibPDF/XRefTable.h +++ b/Userland/Libraries/LibPDF/XRefTable.h @@ -116,10 +116,10 @@ struct Formatter<PDF::XRefTable> : Formatter<StringView> { ErrorOr<void> format(FormatBuilder& format_builder, PDF::XRefTable const& table) { StringBuilder builder; - builder.append("XRefTable {"); + builder.append("XRefTable {"sv); for (auto& entry : table.m_entries) builder.appendff("\n {}", entry); - builder.append("\n}"); + builder.append("\n}"sv); return Formatter<StringView>::format(format_builder, builder.to_string()); } }; diff --git a/Userland/Libraries/LibRegex/RegexByteCode.cpp b/Userland/Libraries/LibRegex/RegexByteCode.cpp index 4212c10b89..be5f5a8533 100644 --- a/Userland/Libraries/LibRegex/RegexByteCode.cpp +++ b/Userland/Libraries/LibRegex/RegexByteCode.cpp @@ -14,94 +14,94 @@ namespace regex { -char const* OpCode::name(OpCodeId opcode_id) +StringView OpCode::name(OpCodeId opcode_id) { switch (opcode_id) { #define __ENUMERATE_OPCODE(x) \ case OpCodeId::x: \ - return #x; + return #x##sv; ENUMERATE_OPCODES #undef __ENUMERATE_OPCODE default: VERIFY_NOT_REACHED(); - return "<Unknown>"; + return "<Unknown>"sv; } } -char const* OpCode::name() const +StringView OpCode::name() const { return name(opcode_id()); } -char const* execution_result_name(ExecutionResult result) +StringView execution_result_name(ExecutionResult result) { switch (result) { #define __ENUMERATE_EXECUTION_RESULT(x) \ case ExecutionResult::x: \ - return #x; + return #x##sv; ENUMERATE_EXECUTION_RESULTS #undef __ENUMERATE_EXECUTION_RESULT default: VERIFY_NOT_REACHED(); - return "<Unknown>"; + return "<Unknown>"sv; } } -char const* opcode_id_name(OpCodeId opcode) +StringView opcode_id_name(OpCodeId opcode) { switch (opcode) { #define __ENUMERATE_OPCODE(x) \ case OpCodeId::x: \ - return #x; + return #x##sv; ENUMERATE_OPCODES #undef __ENUMERATE_OPCODE default: VERIFY_NOT_REACHED(); - return "<Unknown>"; + return "<Unknown>"sv; } } -char const* boundary_check_type_name(BoundaryCheckType ty) +StringView boundary_check_type_name(BoundaryCheckType ty) { switch (ty) { #define __ENUMERATE_BOUNDARY_CHECK_TYPE(x) \ case BoundaryCheckType::x: \ - return #x; + return #x##sv; ENUMERATE_BOUNDARY_CHECK_TYPES #undef __ENUMERATE_BOUNDARY_CHECK_TYPE default: VERIFY_NOT_REACHED(); - return "<Unknown>"; + return "<Unknown>"sv; } } -char const* character_compare_type_name(CharacterCompareType ch_compare_type) +StringView character_compare_type_name(CharacterCompareType ch_compare_type) { switch (ch_compare_type) { #define __ENUMERATE_CHARACTER_COMPARE_TYPE(x) \ case CharacterCompareType::x: \ - return #x; + return #x##sv; ENUMERATE_CHARACTER_COMPARE_TYPES #undef __ENUMERATE_CHARACTER_COMPARE_TYPE default: VERIFY_NOT_REACHED(); - return "<Unknown>"; + return "<Unknown>"sv; } } -static char const* character_class_name(CharClass ch_class) +static StringView character_class_name(CharClass ch_class) { switch (ch_class) { #define __ENUMERATE_CHARACTER_CLASS(x) \ case CharClass::x: \ - return #x; + return #x##sv; ENUMERATE_CHARACTER_CLASSES #undef __ENUMERATE_CHARACTER_CLASS default: VERIFY_NOT_REACHED(); - return "<Unknown>"; + return "<Unknown>"sv; } } diff --git a/Userland/Libraries/LibRegex/RegexByteCode.h b/Userland/Libraries/LibRegex/RegexByteCode.h index ba7d0c5b20..8b5b81ca3d 100644 --- a/Userland/Libraries/LibRegex/RegexByteCode.h +++ b/Userland/Libraries/LibRegex/RegexByteCode.h @@ -532,10 +532,10 @@ enum class ExecutionResult : u8 { #undef __ENUMERATE_EXECUTION_RESULT }; -char const* execution_result_name(ExecutionResult result); -char const* opcode_id_name(OpCodeId opcode_id); -char const* boundary_check_type_name(BoundaryCheckType); -char const* character_compare_type_name(CharacterCompareType result); +StringView execution_result_name(ExecutionResult result); +StringView opcode_id_name(OpCodeId opcode_id); +StringView boundary_check_type_name(BoundaryCheckType); +StringView character_compare_type_name(CharacterCompareType result); class OpCode { public: @@ -552,8 +552,8 @@ public: return m_bytecode->at(state().instruction_position + 1 + offset); } - ALWAYS_INLINE char const* name() const; - static char const* name(OpCodeId); + ALWAYS_INLINE StringView name() const; + static StringView name(OpCodeId); ALWAYS_INLINE void set_state(MatchState& state) { m_state = &state; } diff --git a/Userland/Libraries/LibRegex/RegexMatcher.cpp b/Userland/Libraries/LibRegex/RegexMatcher.cpp index a1df73503d..aaf2f371b0 100644 --- a/Userland/Libraries/LibRegex/RegexMatcher.cpp +++ b/Userland/Libraries/LibRegex/RegexMatcher.cpp @@ -90,7 +90,7 @@ template<class Parser> String Regex<Parser>::error_string(Optional<String> message) const { StringBuilder eb; - eb.append("Error during parsing of regular expression:\n"); + eb.append("Error during parsing of regular expression:\n"sv); eb.appendff(" {}\n ", pattern_value); for (size_t i = 0; i < parser_result.error_token.position(); ++i) eb.append(' '); diff --git a/Userland/Libraries/LibRegex/RegexParser.cpp b/Userland/Libraries/LibRegex/RegexParser.cpp index fc8a21db5a..9ffec9f0a2 100644 --- a/Userland/Libraries/LibRegex/RegexParser.cpp +++ b/Userland/Libraries/LibRegex/RegexParser.cpp @@ -405,7 +405,7 @@ bool PosixBasicParser::parse_simple_re(ByteCode& bytecode, size_t& match_length_ if (match(TokenType::Asterisk)) { consume(); ByteCode::transform_bytecode_repetition_any(simple_re_bytecode, true); - } else if (try_skip("\\{")) { + } else if (try_skip("\\{"sv)) { auto read_number = [&]() -> Optional<size_t> { if (!match(TokenType::Char)) return {}; @@ -435,7 +435,7 @@ bool PosixBasicParser::parse_simple_re(ByteCode& bytecode, size_t& match_length_ max_limit = read_number(); } - if (!try_skip("\\}")) + if (!try_skip("\\}"sv)) return set_error(Error::MismatchingBrace); if (max_limit.value_or(min_limit) < min_limit) @@ -459,7 +459,7 @@ bool PosixBasicParser::parse_simple_re(ByteCode& bytecode, size_t& match_length_ bool PosixBasicParser::parse_nonduplicating_re(ByteCode& bytecode, size_t& match_length_minimum) { // nondupl_RE : one_char_or_coll_elem_RE | Back_open_paren RE_expression Back_close_paren | BACKREF - if (try_skip("\\(")) { + if (try_skip("\\("sv)) { TemporaryChange change { m_current_capture_group_depth, m_current_capture_group_depth + 1 }; // Max number of addressable capture groups is 10, let's just be lenient // and accept 20; anything past that is probably a silly pattern anyway. @@ -472,7 +472,7 @@ bool PosixBasicParser::parse_nonduplicating_re(ByteCode& bytecode, size_t& match if (!parse_re_expression(capture_bytecode, capture_length_minimum)) return false; - if (!try_skip("\\)")) + if (!try_skip("\\)"sv)) return set_error(Error::MismatchingParen); match_length_minimum += capture_length_minimum; @@ -1035,18 +1035,18 @@ bool ECMA262Parser::parse_assertion(ByteCode& stack, [[maybe_unused]] size_t& ma return true; } - if (try_skip("\\b")) { + if (try_skip("\\b"sv)) { stack.insert_bytecode_check_boundary(BoundaryCheckType::Word); return true; } - if (try_skip("\\B")) { + if (try_skip("\\B"sv)) { stack.insert_bytecode_check_boundary(BoundaryCheckType::NonWord); return true; } if (match(TokenType::LeftParen)) { - if (!try_skip("(?")) + if (!try_skip("(?"sv)) return false; if (done()) { @@ -1058,13 +1058,13 @@ bool ECMA262Parser::parse_assertion(ByteCode& stack, [[maybe_unused]] size_t& ma size_t length_dummy = 0; bool should_parse_forward_assertion = m_should_use_browser_extended_grammar ? unicode : true; - if (should_parse_forward_assertion && try_skip("=")) { + if (should_parse_forward_assertion && try_skip("="sv)) { if (!parse_inner_disjunction(assertion_stack, length_dummy, unicode, named)) return false; stack.insert_bytecode_lookaround(move(assertion_stack), ByteCode::LookAroundType::LookAhead); return true; } - if (should_parse_forward_assertion && try_skip("!")) { + if (should_parse_forward_assertion && try_skip("!"sv)) { enter_capture_group_scope(); ScopeGuard quit_scope { [this] { @@ -1089,14 +1089,14 @@ bool ECMA262Parser::parse_assertion(ByteCode& stack, [[maybe_unused]] size_t& ma } } } - if (try_skip("<=")) { + if (try_skip("<="sv)) { if (!parse_inner_disjunction(assertion_stack, length_dummy, unicode, named)) return false; // FIXME: Somehow ensure that this assertion regexp has a fixed length. stack.insert_bytecode_lookaround(move(assertion_stack), ByteCode::LookAroundType::LookBehind, length_dummy); return true; } - if (try_skip("<!")) { + if (try_skip("<!"sv)) { enter_capture_group_scope(); ScopeGuard quit_scope { [this] { @@ -1134,14 +1134,14 @@ bool ECMA262Parser::parse_quantifiable_assertion(ByteCode& stack, size_t&, bool ByteCode assertion_stack; size_t match_length_minimum = 0; - if (try_skip("=")) { + if (try_skip("="sv)) { if (!parse_inner_disjunction(assertion_stack, match_length_minimum, false, named)) return false; stack.insert_bytecode_lookaround(move(assertion_stack), ByteCode::LookAroundType::LookAhead); return true; } - if (try_skip("!")) { + if (try_skip("!"sv)) { enter_capture_group_scope(); ScopeGuard quit_scope { [this] { @@ -1332,7 +1332,7 @@ bool ECMA262Parser::parse_atom(ByteCode& stack, size_t& match_length_minimum, bo stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (u8)token.value()[1] } }); return true; } - if (try_skip("\\")) { + if (try_skip("\\"sv)) { // AtomEscape. return parse_atom_escape(stack, match_length_minimum, unicode, named); } @@ -1453,38 +1453,38 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini } // CharacterEscape > ControlEscape - if (try_skip("f")) { + if (try_skip("f"sv)) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)'\f' } }); return true; } - if (try_skip("n")) { + if (try_skip("n"sv)) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)'\n' } }); return true; } - if (try_skip("r")) { + if (try_skip("r"sv)) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)'\r' } }); return true; } - if (try_skip("t")) { + if (try_skip("t"sv)) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)'\t' } }); return true; } - if (try_skip("v")) { + if (try_skip("v"sv)) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)'\v' } }); return true; } // CharacterEscape > ControlLetter - if (try_skip("c")) { + if (try_skip("c"sv)) { for (auto c : s_alphabetic_characters) { if (try_skip({ &c, 1 })) { match_length_minimum += 1; @@ -1512,7 +1512,7 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini } // '\0' - if (try_skip("0")) { + if (try_skip("0"sv)) { if (!lookahead_any(s_decimal_characters)) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)0 } }); @@ -1534,7 +1534,7 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini } // HexEscape - if (try_skip("x")) { + if (try_skip("x"sv)) { if (auto hex_escape = read_digits(ReadDigitsInitialZeroState::Allow, true, 2, 2); hex_escape.has_value()) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)hex_escape.value() } }); @@ -1551,7 +1551,7 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini return false; } - if (try_skip("u")) { + if (try_skip("u"sv)) { if (auto code_point = consume_escaped_code_point(unicode); code_point.has_value()) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)code_point.value() } }); @@ -1571,14 +1571,14 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini } if (unicode) { - if (try_skip("/")) { + if (try_skip("/"sv)) { match_length_minimum += 1; stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)'/' } }); return true; } } - if (named && try_skip("k")) { + if (named && try_skip("k"sv)) { auto name = read_capture_group_specifier(true); if (name.is_empty()) { set_error(Error::InvalidNameForCaptureGroup); @@ -1651,7 +1651,7 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini } Optional<u8> ECMA262Parser::parse_legacy_octal_escape() { - constexpr auto all_octal_digits = "01234567"; + constexpr auto all_octal_digits = "01234567"sv; auto read_octal_digit = [&](auto start, auto end, bool should_ensure_no_following_octal_digit) -> Optional<u8> { for (char c = '0' + start; c <= '0' + end; ++c) { if (try_skip({ &c, 1 })) { @@ -1705,24 +1705,24 @@ Optional<u8> ECMA262Parser::parse_legacy_octal_escape() Optional<CharClass> ECMA262Parser::parse_character_class_escape(bool& negate, bool expect_backslash) { - if (expect_backslash && !try_skip("\\")) + if (expect_backslash && !try_skip("\\"sv)) return {}; // CharacterClassEscape CharClass ch_class; - if (try_skip("d")) { + if (try_skip("d"sv)) { ch_class = CharClass::Digit; - } else if (try_skip("D")) { + } else if (try_skip("D"sv)) { ch_class = CharClass::Digit; negate = true; - } else if (try_skip("s")) { + } else if (try_skip("s"sv)) { ch_class = CharClass::Space; - } else if (try_skip("S")) { + } else if (try_skip("S"sv)) { ch_class = CharClass::Space; negate = true; - } else if (try_skip("w")) { + } else if (try_skip("w"sv)) { ch_class = CharClass::Word; - } else if (try_skip("W")) { + } else if (try_skip("W"sv)) { ch_class = CharClass::Word; negate = true; } else { @@ -1785,29 +1785,29 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>& return { CharClassRangeElement { .code_point = (u32)token[1], .is_character_class = false } }; } - if (try_skip("\\")) { + if (try_skip("\\"sv)) { if (done()) { set_error(Error::InvalidTrailingEscape); return {}; } - if (try_skip("f")) + if (try_skip("f"sv)) return { CharClassRangeElement { .code_point = '\f', .is_character_class = false } }; - if (try_skip("n")) + if (try_skip("n"sv)) return { CharClassRangeElement { .code_point = '\n', .is_character_class = false } }; - if (try_skip("r")) + if (try_skip("r"sv)) return { CharClassRangeElement { .code_point = '\r', .is_character_class = false } }; - if (try_skip("t")) + if (try_skip("t"sv)) return { CharClassRangeElement { .code_point = '\t', .is_character_class = false } }; - if (try_skip("v")) + if (try_skip("v"sv)) return { CharClassRangeElement { .code_point = '\v', .is_character_class = false } }; - if (try_skip("b")) + if (try_skip("b"sv)) return { CharClassRangeElement { .code_point = '\b', .is_character_class = false } }; - if (try_skip("/")) + if (try_skip("/"sv)) return { CharClassRangeElement { .code_point = '/', .is_character_class = false } }; // CharacterEscape > ControlLetter - if (try_skip("c")) { + if (try_skip("c"sv)) { for (auto c : s_alphabetic_characters) { if (try_skip({ &c, 1 })) { return { CharClassRangeElement { .code_point = (u32)(c % 32), .is_character_class = false } }; @@ -1824,7 +1824,7 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>& if (try_skip({ &c, 1 })) return { CharClassRangeElement { .code_point = (u32)(c % 32), .is_character_class = false } }; } - if (try_skip("_")) + if (try_skip("_"sv)) return { CharClassRangeElement { .code_point = (u32)('_' % 32), .is_character_class = false } }; back(1 + !done()); @@ -1833,7 +1833,7 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>& } // '\0' - if (try_skip("0")) { + if (try_skip("0"sv)) { if (!lookahead_any(s_decimal_characters)) return { CharClassRangeElement { .code_point = 0, .is_character_class = false } }; back(); @@ -1846,7 +1846,7 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>& } // HexEscape - if (try_skip("x")) { + if (try_skip("x"sv)) { if (auto hex_escape = read_digits(ReadDigitsInitialZeroState::Allow, true, 2, 2); hex_escape.has_value()) { return { CharClassRangeElement { .code_point = hex_escape.value(), .is_character_class = false } }; } else if (!unicode) { @@ -1858,7 +1858,7 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>& } } - if (try_skip("u")) { + if (try_skip("u"sv)) { if (auto code_point = consume_escaped_code_point(unicode); code_point.has_value()) { // FIXME: While code point ranges are supported, code point matches as "Char" are not! return { CharClassRangeElement { .code_point = code_point.value(), .is_character_class = false } }; @@ -1873,7 +1873,7 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>& } if (unicode) { - if (try_skip("-")) + if (try_skip("-"sv)) return { CharClassRangeElement { .code_point = '-', .is_character_class = false } }; PropertyEscape property {}; @@ -1896,17 +1896,17 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>& } } - if (try_skip("d")) + if (try_skip("d"sv)) return { CharClassRangeElement { .character_class = CharClass::Digit, .is_character_class = true } }; - if (try_skip("s")) + if (try_skip("s"sv)) return { CharClassRangeElement { .character_class = CharClass::Space, .is_character_class = true } }; - if (try_skip("w")) + if (try_skip("w"sv)) return { CharClassRangeElement { .character_class = CharClass::Word, .is_character_class = true } }; - if (try_skip("D")) + if (try_skip("D"sv)) return { CharClassRangeElement { .character_class = CharClass::Digit, .is_negated = true, .is_character_class = true } }; - if (try_skip("S")) + if (try_skip("S"sv)) return { CharClassRangeElement { .character_class = CharClass::Space, .is_negated = true, .is_character_class = true } }; - if (try_skip("W")) + if (try_skip("W"sv)) return { CharClassRangeElement { .character_class = CharClass::Word, .is_negated = true, .is_character_class = true } }; if (!unicode) { @@ -2021,9 +2021,9 @@ bool ECMA262Parser::parse_unicode_property_escape(PropertyEscape& property, bool { negated = false; - if (try_skip("p")) + if (try_skip("p"sv)) negated = false; - else if (try_skip("P")) + else if (try_skip("P"sv)) negated = true; else return false; @@ -2125,7 +2125,7 @@ FlyString ECMA262Parser::read_capture_group_specifier(bool take_starting_angle_b } if (code_point == '\\') { - if (!try_skip("u")) { + if (!try_skip("u"sv)) { set_error(Error::InvalidNameForCaptureGroup); return {}; } @@ -2338,7 +2338,7 @@ size_t ECMA262Parser::ensure_total_number_of_capturing_parenthesis() if (!lexer.consume_specific('<')) break; - if (lexer.next_is(is_any_of("=!"))) + if (lexer.next_is(is_any_of("=!"sv))) break; ++count; diff --git a/Userland/Libraries/LibSQL/AST/Expression.cpp b/Userland/Libraries/LibSQL/AST/Expression.cpp index b8706915f4..839b2cf235 100644 --- a/Userland/Libraries/LibSQL/AST/Expression.cpp +++ b/Userland/Libraries/LibSQL/AST/Expression.cpp @@ -12,7 +12,7 @@ namespace SQL::AST { -static constexpr StringView s_posix_basic_metacharacters = ".^$*[]+\\"; +static constexpr auto s_posix_basic_metacharacters = ".^$*[]+\\"sv; ResultOr<Value> NumericLiteral::evaluate(ExecutionContext&) const { @@ -205,7 +205,7 @@ ResultOr<Value> MatchExpression::evaluate(ExecutionContext& context) const } else if (c == '_' && !escaped) { builder.append('.'); } else if (c == '%' && !escaped) { - builder.append(".*"); + builder.append(".*"sv); } else { escaped = false; builder.append(c); @@ -226,7 +226,7 @@ ResultOr<Value> MatchExpression::evaluate(ExecutionContext& context) const auto err = regex.parser_result.error; if (err != regex::Error::NoError) { StringBuilder builder; - builder.append("Regular expression: "); + builder.append("Regular expression: "sv); builder.append(get_error_string(err)); return Result { SQLCommand::Unknown, SQLErrorCode::SyntaxError, builder.build() }; diff --git a/Userland/Libraries/LibSQL/AST/Lexer.cpp b/Userland/Libraries/LibSQL/AST/Lexer.cpp index 7a78028cb6..304d991c0e 100644 --- a/Userland/Libraries/LibSQL/AST/Lexer.cpp +++ b/Userland/Libraries/LibSQL/AST/Lexer.cpp @@ -27,16 +27,16 @@ Lexer::Lexer(StringView source) } if (s_one_char_tokens.is_empty()) { -#define __ENUMERATE_SQL_TOKEN(value, type, category) \ - if (TokenCategory::category != TokenCategory::Keyword && StringView(value).length() == 1) \ +#define __ENUMERATE_SQL_TOKEN(value, type, category) \ + if (TokenCategory::category != TokenCategory::Keyword && value##sv.length() == 1) \ s_one_char_tokens.set(value[0], TokenType::type); ENUMERATE_SQL_TOKENS #undef __ENUMERATE_SQL_TOKEN } if (s_two_char_tokens.is_empty()) { -#define __ENUMERATE_SQL_TOKEN(value, type, category) \ - if (TokenCategory::category != TokenCategory::Keyword && StringView(value).length() == 2) \ +#define __ENUMERATE_SQL_TOKEN(value, type, category) \ + if (TokenCategory::category != TokenCategory::Keyword && value##sv.length() == 2) \ s_two_char_tokens.set(value, TokenType::type); ENUMERATE_SQL_TOKENS #undef __ENUMERATE_SQL_TOKEN diff --git a/Userland/Libraries/LibSQL/AST/Parser.cpp b/Userland/Libraries/LibSQL/AST/Parser.cpp index 94ed6f55e3..3f18b34fe4 100644 --- a/Userland/Libraries/LibSQL/AST/Parser.cpp +++ b/Userland/Libraries/LibSQL/AST/Parser.cpp @@ -58,7 +58,7 @@ NonnullRefPtr<Statement> Parser::parse_statement() case TokenType::Select: return parse_select_statement({}); default: - expected("CREATE, ALTER, DROP, DESCRIBE, INSERT, UPDATE, DELETE, or SELECT"); + expected("CREATE, ALTER, DROP, DESCRIBE, INSERT, UPDATE, DELETE, or SELECT"sv); return create_ast_node<ErrorStatement>(); } } @@ -75,7 +75,7 @@ NonnullRefPtr<Statement> Parser::parse_statement_with_expression_list(RefPtr<Com case TokenType::Select: return parse_select_statement(move(common_table_expression_list)); default: - expected("INSERT, UPDATE, DELETE, or SELECT"); + expected("INSERT, UPDATE, DELETE, or SELECT"sv); return create_ast_node<ErrorStatement>(); } } @@ -226,7 +226,7 @@ NonnullRefPtr<Insert> Parser::parse_insert_statement(RefPtr<CommonTableExpressio chained_expressions.append(static_ptr_cast<ChainedExpression>(chained_expression.release_nonnull())); } } else { - expected("Chained expression"); + expected("Chained expression"sv); } }); } else if (match(TokenType::Select)) { @@ -381,7 +381,7 @@ RefPtr<CommonTableExpressionList> Parser::parse_common_table_expression_list() parse_comma_separated_list(false, [&]() { common_table_expression.append(parse_common_table_expression()); }); if (common_table_expression.is_empty()) { - expected("Common table expression list"); + expected("Common table expression list"sv); return {}; } @@ -432,7 +432,7 @@ NonnullRefPtr<Expression> Parser::parse_primary_expression() if (auto expression = parse_exists_expression(false)) return expression.release_nonnull(); - expected("Primary Expression"); + expected("Primary Expression"sv); consume(); return create_ast_node<ErrorExpression>(); @@ -465,7 +465,7 @@ NonnullRefPtr<Expression> Parser::parse_secondary_expression(NonnullRefPtr<Expre if (auto expression = parse_in_expression(primary, invert_expression)) return expression.release_nonnull(); - expected("Secondary Expression"); + expected("Secondary Expression"sv); consume(); return create_ast_node<ErrorExpression>(); @@ -805,13 +805,13 @@ RefPtr<Expression> Parser::parse_between_expression(NonnullRefPtr<Expression> ex auto nested = parse_expression(); if (!is<BinaryOperatorExpression>(*nested)) { - expected("Binary Expression"); + expected("Binary Expression"sv); return create_ast_node<ErrorExpression>(); } auto const& binary_expression = static_cast<BinaryOperatorExpression const&>(*nested); if (binary_expression.type() != BinaryOperator::And) { - expected("AND Expression"); + expected("AND Expression"sv); return create_ast_node<ErrorExpression>(); } @@ -903,7 +903,7 @@ NonnullRefPtr<SignedNumber> Parser::parse_signed_number() return create_ast_node<SignedNumber>(is_positive ? number : (number * -1)); } - expected("NumericLiteral"); + expected("NumericLiteral"sv); return create_ast_node<SignedNumber>(0); } @@ -1047,7 +1047,7 @@ NonnullRefPtr<OrderingTerm> Parser::parse_ordering_term() else if (consume_if(TokenType::Last)) nulls = Nulls::Last; else - expected("FIRST or LAST"); + expected("FIRST or LAST"sv); } return create_ast_node<OrderingTerm>(move(expression), move(collation_name), order, nulls); @@ -1080,7 +1080,7 @@ ConflictResolution Parser::parse_conflict_resolution() if (consume_if(TokenType::Rollback)) return ConflictResolution::Rollback; - expected("ABORT, FAIL, IGNORE, REPLACE, or ROLLBACK"); + expected("ABORT, FAIL, IGNORE, REPLACE, or ROLLBACK"sv); } return ConflictResolution::Abort; diff --git a/Userland/Libraries/LibSQL/AST/Token.cpp b/Userland/Libraries/LibSQL/AST/Token.cpp index 9acd3370de..0e33bd5dd0 100644 --- a/Userland/Libraries/LibSQL/AST/Token.cpp +++ b/Userland/Libraries/LibSQL/AST/Token.cpp @@ -16,7 +16,7 @@ StringView Token::name(TokenType type) switch (type) { #define __ENUMERATE_SQL_TOKEN(value, type, category) \ case TokenType::type: \ - return #type; + return #type##sv; ENUMERATE_SQL_TOKENS #undef __ENUMERATE_SQL_TOKEN default: diff --git a/Userland/Libraries/LibSQL/TreeNode.cpp b/Userland/Libraries/LibSQL/TreeNode.cpp index 6ae7a1f5fb..8c5f8704a7 100644 --- a/Userland/Libraries/LibSQL/TreeNode.cpp +++ b/Userland/Libraries/LibSQL/TreeNode.cpp @@ -359,11 +359,11 @@ void TreeNode::dump_if(int flag, String&& msg) builder.appendff("[#{}] ", pointer()); if (!msg.is_empty()) builder.appendff("{}", msg); - builder.append(": "); + builder.append(": "sv); if (m_up) builder.appendff("[^{}] -> ", m_up->pointer()); else - builder.append("* -> "); + builder.append("* -> "sv); for (size_t ix = 0; ix < m_entries.size(); ix++) { if (!is_leaf()) builder.appendff("[v{}] ", m_down[ix].pointer()); @@ -378,7 +378,7 @@ void TreeNode::dump_if(int flag, String&& msg) } builder.appendff(" (size {}", (int)size()); if (is_leaf()) { - builder.append(", leaf"); + builder.append(", leaf"sv); } builder.append(")"); dbgln(builder.build()); diff --git a/Userland/Libraries/LibSQL/Value.cpp b/Userland/Libraries/LibSQL/Value.cpp index a90bcda850..88ca5ffd3b 100644 --- a/Userland/Libraries/LibSQL/Value.cpp +++ b/Userland/Libraries/LibSQL/Value.cpp @@ -569,9 +569,9 @@ Optional<bool> TextImpl::to_bool() const { if (!m_value.has_value()) return {}; - if (value().equals_ignoring_case("true") || value().equals_ignoring_case("t")) + if (value().equals_ignoring_case("true"sv) || value().equals_ignoring_case("t"sv)) return true; - if (value().equals_ignoring_case("false") || value().equals_ignoring_case("f")) + if (value().equals_ignoring_case("false"sv) || value().equals_ignoring_case("f"sv)) return false; return {}; } @@ -876,7 +876,7 @@ String ContainerValueImpl::to_string() const StringBuilder builder; builder.append("("); StringBuilder joined; - joined.join(", ", to_string_vector()); + joined.join(", "sv, to_string_vector()); builder.append(joined.string_view()); builder.append(")"); return builder.build(); diff --git a/Userland/Libraries/LibSanitizer/UBSanitizer.cpp b/Userland/Libraries/LibSanitizer/UBSanitizer.cpp index ae1c7ae21f..8434cd49a9 100644 --- a/Userland/Libraries/LibSanitizer/UBSanitizer.cpp +++ b/Userland/Libraries/LibSanitizer/UBSanitizer.cpp @@ -35,9 +35,9 @@ static void print_location(SourceLocation const& location) auto options = options_ptr != NULL ? StringView { options_ptr, strlen(options_ptr) } : StringView {}; // FIXME: Parse more options and complain about invalid options if (!options.is_null()) { - if (options.contains("halt_on_error=1")) + if (options.contains("halt_on_error=1"sv)) g_ubsan_is_deadly = true; - else if (options.contains("halt_on_error=0")) + else if (options.contains("halt_on_error=0"sv)) g_ubsan_is_deadly = false; } } @@ -181,18 +181,18 @@ void __ubsan_handle_type_mismatch_v1(TypeMismatchData&, ValueHandle) __attribute void __ubsan_handle_type_mismatch_v1(TypeMismatchData& data, ValueHandle ptr) { constexpr StringView kinds[] = { - "load of", - "store to", - "reference binding to", - "member access within", - "member call on", - "constructor call on", - "downcast of", - "downcast of", - "upcast of", - "cast to virtual base of", - "_Nonnull binding to", - "dynamic operation on" + "load of"sv, + "store to"sv, + "reference binding to"sv, + "member access within"sv, + "member call on"sv, + "constructor call on"sv, + "downcast of"sv, + "downcast of"sv, + "upcast of"sv, + "cast to virtual base of"sv, + "_Nonnull binding to"sv, + "dynamic operation on"sv }; auto location = data.location.permanently_clear(); diff --git a/Userland/Libraries/LibSymbolication/Symbolication.cpp b/Userland/Libraries/LibSymbolication/Symbolication.cpp index bef6ca0b2c..19a7ffb2a8 100644 --- a/Userland/Libraries/LibSymbolication/Symbolication.cpp +++ b/Userland/Libraries/LibSymbolication/Symbolication.cpp @@ -185,14 +185,14 @@ Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid, IncludeSourcePosition in for (auto& region_value : json.value().as_array().values()) { auto& region = region_value.as_object(); - auto name = region.get("name").to_string(); - auto address = region.get("address").to_addr(); - auto size = region.get("size").to_addr(); + auto name = region.get("name"sv).to_string(); + auto address = region.get("address"sv).to_addr(); + auto size = region.get("size"sv).to_addr(); String path; if (name == "/usr/lib/Loader.so") { path = name; - } else if (name.ends_with(": .text") || name.ends_with(": .rodata")) { + } else if (name.ends_with(": .text"sv) || name.ends_with(": .rodata"sv)) { auto parts = name.split_view(':'); path = parts[0]; } else { diff --git a/Userland/Libraries/LibTLS/Certificate.h b/Userland/Libraries/LibTLS/Certificate.h index 416da5745b..ef15456a9d 100644 --- a/Userland/Libraries/LibTLS/Certificate.h +++ b/Userland/Libraries/LibTLS/Certificate.h @@ -68,27 +68,27 @@ public: { StringBuilder cert_name; if (!subject.country.is_empty()) { - cert_name.append("/C="); + cert_name.append("/C="sv); cert_name.append(subject.country); } if (!subject.state.is_empty()) { - cert_name.append("/ST="); + cert_name.append("/ST="sv); cert_name.append(subject.state); } if (!subject.location.is_empty()) { - cert_name.append("/L="); + cert_name.append("/L="sv); cert_name.append(subject.location); } if (!subject.entity.is_empty()) { - cert_name.append("/O="); + cert_name.append("/O="sv); cert_name.append(subject.entity); } if (!subject.unit.is_empty()) { - cert_name.append("/OU="); + cert_name.append("/OU="sv); cert_name.append(subject.unit); } if (!subject.subject.is_empty()) { - cert_name.append("/CN="); + cert_name.append("/CN="sv); cert_name.append(subject.subject); } return cert_name.build(); @@ -98,27 +98,27 @@ public: { StringBuilder cert_name; if (!issuer.country.is_empty()) { - cert_name.append("/C="); + cert_name.append("/C="sv); cert_name.append(issuer.country); } if (!issuer.state.is_empty()) { - cert_name.append("/ST="); + cert_name.append("/ST="sv); cert_name.append(issuer.state); } if (!issuer.location.is_empty()) { - cert_name.append("/L="); + cert_name.append("/L="sv); cert_name.append(issuer.location); } if (!issuer.entity.is_empty()) { - cert_name.append("/O="); + cert_name.append("/O="sv); cert_name.append(issuer.entity); } if (!issuer.unit.is_empty()) { - cert_name.append("/OU="); + cert_name.append("/OU="sv); cert_name.append(issuer.unit); } if (!issuer.subject.is_empty()) { - cert_name.append("/CN="); + cert_name.append("/CN="sv); cert_name.append(issuer.subject); } return cert_name.build(); diff --git a/Userland/Libraries/LibTLS/HandshakeClient.cpp b/Userland/Libraries/LibTLS/HandshakeClient.cpp index d1a96908b8..20cfb8ac12 100644 --- a/Userland/Libraries/LibTLS/HandshakeClient.cpp +++ b/Userland/Libraries/LibTLS/HandshakeClient.cpp @@ -140,7 +140,7 @@ bool TLSv12::compute_master_secret_from_pre_master_secret(size_t length) } if constexpr (TLS_SSL_KEYLOG_DEBUG) { - auto file = MUST(Core::Stream::File::open("/home/anon/ssl_keylog", Core::Stream::OpenMode::Append | Core::Stream::OpenMode::Write)); + auto file = MUST(Core::Stream::File::open("/home/anon/ssl_keylog"sv, Core::Stream::OpenMode::Append | Core::Stream::OpenMode::Write)); VERIFY(file->write_or_error("CLIENT_RANDOM "sv.bytes())); VERIFY(file->write_or_error(encode_hex({ m_context.local_random, 32 }).bytes())); VERIFY(file->write_or_error(" "sv.bytes())); diff --git a/Userland/Libraries/LibTLS/TLSv12.cpp b/Userland/Libraries/LibTLS/TLSv12.cpp index 2f896b4045..76983103cc 100644 --- a/Userland/Libraries/LibTLS/TLSv12.cpp +++ b/Userland/Libraries/LibTLS/TLSv12.cpp @@ -197,7 +197,7 @@ static bool wildcard_matches(StringView host, StringView subject) if (host == subject) return true; - if (subject.starts_with("*.")) { + if (subject.starts_with("*."sv)) { auto maybe_first_dot_index = host.find('.'); if (maybe_first_dot_index.has_value()) { auto first_dot_index = maybe_first_dot_index.release_value(); diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunner.h b/Userland/Libraries/LibTest/JavaScriptTestRunner.h index b9ab53af2d..8c8672b990 100644 --- a/Userland/Libraries/LibTest/JavaScriptTestRunner.h +++ b/Userland/Libraries/LibTest/JavaScriptTestRunner.h @@ -275,9 +275,9 @@ inline Vector<String> TestRunner::get_test_paths() const { Vector<String> paths; iterate_directory_recursively(m_test_root, [&](String const& file_path) { - if (!file_path.ends_with(".js")) + if (!file_path.ends_with(".js"sv)) return; - if (!file_path.ends_with("test-common.js")) + if (!file_path.ends_with("test-common.js"sv)) paths.append(file_path); }); quick_sort(paths); @@ -413,9 +413,9 @@ inline JSFileResult TestRunner::run_file_test(String const& test_path) Test::Case test { test_name, Test::Result::Fail, "", 0 }; VERIFY(test_value.is_object()); - VERIFY(test_value.as_object().has("result")); + VERIFY(test_value.as_object().has("result"sv)); - auto result = test_value.as_object().get("result"); + auto result = test_value.as_object().get("result"sv); VERIFY(result.is_string()); auto result_string = result.as_string(); if (result_string == "pass") { @@ -425,8 +425,8 @@ inline JSFileResult TestRunner::run_file_test(String const& test_path) test.result = Test::Result::Fail; m_counts.tests_failed++; suite.most_severe_test_result = Test::Result::Fail; - VERIFY(test_value.as_object().has("details")); - auto details = test_value.as_object().get("details"); + VERIFY(test_value.as_object().has("details"sv)); + auto details = test_value.as_object().get("details"sv); VERIFY(result.is_string()); test.details = details.as_string(); } else { @@ -436,7 +436,7 @@ inline JSFileResult TestRunner::run_file_test(String const& test_path) m_counts.tests_skipped++; } - test.duration_us = test_value.as_object().get("duration").to_u64(0); + test.duration_us = test_value.as_object().get("duration"sv).to_u64(0); suite.tests.append(test); }); diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp b/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp index a4a6e41bd2..45cbd8bc40 100644 --- a/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp +++ b/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp @@ -141,7 +141,7 @@ int main(int argc, char** argv) test_root = String { specified_test_root }; } else { #ifdef __serenity__ - test_root = LexicalPath::join("/home/anon/Tests", String::formatted("{}-tests", program_name.split_view('-').last())).string(); + test_root = LexicalPath::join("/home/anon/Tests"sv, String::formatted("{}-tests", program_name.split_view('-').last())).string(); #else char* serenity_source_dir = getenv("SERENITY_SOURCE_DIR"); if (!serenity_source_dir) { diff --git a/Userland/Libraries/LibTest/TestRunner.h b/Userland/Libraries/LibTest/TestRunner.h index bde37c12bf..c11c63dd49 100644 --- a/Userland/Libraries/LibTest/TestRunner.h +++ b/Userland/Libraries/LibTest/TestRunner.h @@ -248,16 +248,16 @@ inline void TestRunner::print_test_results_as_json() const StringView result_name; switch (case_.result) { case Result::Pass: - result_name = "PASSED"; + result_name = "PASSED"sv; break; case Result::Fail: - result_name = "FAILED"; + result_name = "FAILED"sv; break; case Result::Skip: - result_name = "SKIPPED"; + result_name = "SKIPPED"sv; break; case Result::Crashed: - result_name = "PROCESS_ERROR"; + result_name = "PROCESS_ERROR"sv; break; } diff --git a/Userland/Libraries/LibTextCodec/Decoder.cpp b/Userland/Libraries/LibTextCodec/Decoder.cpp index e312107f9e..41058a4de1 100644 --- a/Userland/Libraries/LibTextCodec/Decoder.cpp +++ b/Userland/Libraries/LibTextCodec/Decoder.cpp @@ -30,27 +30,27 @@ Decoder* decoder_for(String const& a_encoding) { auto encoding = get_standardized_encoding(a_encoding); if (encoding.has_value()) { - if (encoding.value().equals_ignoring_case("windows-1252")) + if (encoding.value().equals_ignoring_case("windows-1252"sv)) return &s_latin1_decoder; - if (encoding.value().equals_ignoring_case("utf-8")) + if (encoding.value().equals_ignoring_case("utf-8"sv)) return &s_utf8_decoder; - if (encoding.value().equals_ignoring_case("utf-16be")) + if (encoding.value().equals_ignoring_case("utf-16be"sv)) return &s_utf16be_decoder; - if (encoding.value().equals_ignoring_case("utf-16le")) + if (encoding.value().equals_ignoring_case("utf-16le"sv)) return &s_utf16le_decoder; - if (encoding.value().equals_ignoring_case("iso-8859-2")) + if (encoding.value().equals_ignoring_case("iso-8859-2"sv)) return &s_latin2_decoder; - if (encoding.value().equals_ignoring_case("windows-1255")) + if (encoding.value().equals_ignoring_case("windows-1255"sv)) return &s_hebrew_decoder; - if (encoding.value().equals_ignoring_case("windows-1251")) + if (encoding.value().equals_ignoring_case("windows-1251"sv)) return &s_cyrillic_decoder; - if (encoding.value().equals_ignoring_case("koi8-r")) + if (encoding.value().equals_ignoring_case("koi8-r"sv)) return &s_koi8r_decoder; - if (encoding.value().equals_ignoring_case("iso-8859-15")) + if (encoding.value().equals_ignoring_case("iso-8859-15"sv)) return &s_latin9_decoder; - if (encoding.value().equals_ignoring_case("windows-1254")) + if (encoding.value().equals_ignoring_case("windows-1254"sv)) return &s_turkish_decoder; - if (encoding.value().equals_ignoring_case("x-user-defined")) + if (encoding.value().equals_ignoring_case("x-user-defined"sv)) return &s_x_user_defined_decoder; } dbgln("TextCodec: No decoder implemented for encoding '{}'", a_encoding); @@ -62,88 +62,88 @@ Optional<StringView> get_standardized_encoding(StringView encoding) { encoding = encoding.trim_whitespace(); - if (encoding.is_one_of_ignoring_case("unicode-1-1-utf-8", "unicode11utf8", "unicode20utf8", "utf-8", "utf8", "x-unicode20utf8")) - return "UTF-8"; - if (encoding.is_one_of_ignoring_case("866", "cp866", "csibm866", "ibm866")) - return "IBM866"; - if (encoding.is_one_of_ignoring_case("csisolatin2", "iso-8859-2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", "iso_8859-2:1987", "l2", "latin2")) - return "ISO-8859-2"; - if (encoding.is_one_of_ignoring_case("csisolatin3", "iso-8859-3", "iso-ir-109", "iso8859-3", "iso88593", "iso_8859-3", "iso_8859-3:1988", "l3", "latin3")) - return "ISO-8859-3"; - if (encoding.is_one_of_ignoring_case("csisolatin4", "iso-8859-4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:1989", "l4", "latin4")) - return "ISO-8859-4"; - if (encoding.is_one_of_ignoring_case("csisolatincyrillic", "cyrillic", "iso-8859-5", "iso-ir-144", "iso8859-5", "iso88595", "iso_8859-5", "iso_8859-5:1988")) - return "ISO-8859-5"; - if (encoding.is_one_of_ignoring_case("arabic", "asmo-708", "csiso88596e", "csiso88596i", "csisolatinarabic", "ecma-114", "iso-8859-6", "iso-8859-6-e", "iso-8859-6-i", "iso-ir-127", "iso8859-6", "iso88596", "iso_8859-6", "iso_8859-6:1987")) - return "ISO-8859-6"; - if (encoding.is_one_of_ignoring_case("csisolatingreek", "ecma-118", "elot_928", "greek", "greek8", "iso-8859-7", "iso-ir-126", "iso8859-7", "iso88597", "iso_8859-7", "iso_8859-7:1987", "sun_eu_greek")) - return "ISO-8859-7"; - if (encoding.is_one_of_ignoring_case("csiso88598e", "csisolatinhebrew", "hebrew", "iso-8859-8", "iso-8859-8-e", "iso-ir-138", "iso8859-8", "iso88598", "iso_8859-8", "iso_8859-8:1988", "visual")) - return "ISO-8859-8"; - if (encoding.is_one_of_ignoring_case("csiso88598i", "iso-8859-8-i", "logical")) - return "ISO-8859-8-I"; - if (encoding.is_one_of_ignoring_case("csisolatin6", "iso8859-10", "iso-ir-157", "iso8859-10", "iso885910", "l6", "latin6")) - return "ISO-8859-10"; - if (encoding.is_one_of_ignoring_case("iso-8859-13", "iso8859-13", "iso885913")) - return "ISO-8859-13"; - if (encoding.is_one_of_ignoring_case("iso-8859-14", "iso8859-14", "iso885914")) - return "ISO-8859-14"; - if (encoding.is_one_of_ignoring_case("csisolatin9", "iso-8859-15", "iso8859-15", "iso885915", "iso_8859-15", "l9")) - return "ISO-8859-15"; - if (encoding.is_one_of_ignoring_case("iso-8859-16")) - return "ISO-8859-16"; - if (encoding.is_one_of_ignoring_case("cskoi8r", "koi", "koi8", "koi8-r", "koi8_r")) - return "KOI8-R"; - if (encoding.is_one_of_ignoring_case("koi8-ru", "koi8-u")) - return "KOI8-U"; - if (encoding.is_one_of_ignoring_case("csmacintosh", "mac", "macintosh", "x-mac-roman")) - return "macintosh"; - if (encoding.is_one_of_ignoring_case("dos-874", "iso-8859-11", "iso8859-11", "iso885911", "tis-620", "windows-874")) - return "windows-874"; - if (encoding.is_one_of_ignoring_case("cp1250", "windows-1250", "x-cp1250")) - return "windows-1250"; - if (encoding.is_one_of_ignoring_case("cp1251", "windows-1251", "x-cp1251")) - return "windows-1251"; - if (encoding.is_one_of_ignoring_case("ansi_x3.4-1968", "ascii", "cp1252", "cp819", "csisolatin1", "ibm819", "iso-8859-1", "iso-ir-100", "iso8859-1", "iso88591", "iso_8859-1", "iso_8859-1:1987", "l1", "latin1", "us-ascii", "windows-1252", "x-cp1252")) - return "windows-1252"; - if (encoding.is_one_of_ignoring_case("cp1253", "windows-1253", "x-cp1253")) - return "windows-1253"; - if (encoding.is_one_of_ignoring_case("cp1254", "csisolatin5", "iso-8859-9", "iso-ir-148", "iso-8859-9", "iso-88599", "iso_8859-9", "iso_8859-9:1989", "l5", "latin5", "windows-1254", "x-cp1254")) - return "windows-1254"; - if (encoding.is_one_of_ignoring_case("cp1255", "windows-1255", "x-cp1255")) - return "windows-1255"; - if (encoding.is_one_of_ignoring_case("cp1256", "windows-1256", "x-cp1256")) - return "windows-1256"; - if (encoding.is_one_of_ignoring_case("cp1257", "windows-1257", "x-cp1257")) - return "windows-1257"; - if (encoding.is_one_of_ignoring_case("cp1258", "windows-1258", "x-cp1258")) - return "windows-1258"; - if (encoding.is_one_of_ignoring_case("x-mac-cyrillic", "x-mac-ukrainian")) - return "x-mac-cyrillic"; - if (encoding.is_one_of_ignoring_case("koi8-r", "koi8r")) - return "koi8-r"; - if (encoding.is_one_of_ignoring_case("chinese", "csgb2312", "csiso58gb231280", "gb2312", "gb_2312", "gb_2312-80", "gbk", "iso-ir-58", "x-gbk")) - return "GBK"; - if (encoding.is_one_of_ignoring_case("gb18030")) - return "gb18030"; - if (encoding.is_one_of_ignoring_case("big5", "big5-hkscs", "cn-big5", "csbig5", "x-x-big5")) - return "Big5"; - if (encoding.is_one_of_ignoring_case("cseucpkdfmtjapanese", "euc-jp", "x-euc-jp")) - return "EUC-JP"; - if (encoding.is_one_of_ignoring_case("csiso2022jp", "iso-2022-jp")) - return "ISO-2022-JP"; - if (encoding.is_one_of_ignoring_case("csshiftjis", "ms932", "ms_kanji", "shift-jis", "shift_jis", "sjis", "windows-31j", "x-sjis")) - return "Shift_JIS"; - if (encoding.is_one_of_ignoring_case("cseuckr", "csksc56011987", "euc-kr", "iso-ir-149", "korean", "ks_c_5601-1987", "ks_c_5601-1989", "ksc5601", "ksc_5601", "windows-949")) - return "EUC-KR"; - if (encoding.is_one_of_ignoring_case("csiso2022kr", "hz-gb-2312", "iso-2022-cn", "iso-2022-cn-ext", "iso-2022-kr", "replacement")) - return "replacement"; - if (encoding.is_one_of_ignoring_case("unicodefffe", "utf-16be")) - return "UTF-16BE"; - if (encoding.is_one_of_ignoring_case("csunicode", "iso-10646-ucs-2", "ucs-2", "unicode", "unicodefeff", "utf-16", "utf-16le")) - return "UTF-16LE"; - if (encoding.is_one_of_ignoring_case("x-user-defined")) - return "x-user-defined"; + if (encoding.is_one_of_ignoring_case("unicode-1-1-utf-8"sv, "unicode11utf8"sv, "unicode20utf8"sv, "utf-8"sv, "utf8"sv, "x-unicode20utf8"sv)) + return "UTF-8"sv; + if (encoding.is_one_of_ignoring_case("866"sv, "cp866"sv, "csibm866"sv, "ibm866"sv)) + return "IBM866"sv; + if (encoding.is_one_of_ignoring_case("csisolatin2"sv, "iso-8859-2"sv, "iso-ir-101"sv, "iso8859-2"sv, "iso88592"sv, "iso_8859-2"sv, "iso_8859-2:1987"sv, "l2"sv, "latin2"sv)) + return "ISO-8859-2"sv; + if (encoding.is_one_of_ignoring_case("csisolatin3"sv, "iso-8859-3"sv, "iso-ir-109"sv, "iso8859-3"sv, "iso88593"sv, "iso_8859-3"sv, "iso_8859-3:1988"sv, "l3"sv, "latin3"sv)) + return "ISO-8859-3"sv; + if (encoding.is_one_of_ignoring_case("csisolatin4"sv, "iso-8859-4"sv, "iso-ir-110"sv, "iso8859-4"sv, "iso88594"sv, "iso_8859-4"sv, "iso_8859-4:1989"sv, "l4"sv, "latin4"sv)) + return "ISO-8859-4"sv; + if (encoding.is_one_of_ignoring_case("csisolatincyrillic"sv, "cyrillic"sv, "iso-8859-5"sv, "iso-ir-144"sv, "iso8859-5"sv, "iso88595"sv, "iso_8859-5"sv, "iso_8859-5:1988"sv)) + return "ISO-8859-5"sv; + if (encoding.is_one_of_ignoring_case("arabic"sv, "asmo-708"sv, "csiso88596e"sv, "csiso88596i"sv, "csisolatinarabic"sv, "ecma-114"sv, "iso-8859-6"sv, "iso-8859-6-e"sv, "iso-8859-6-i"sv, "iso-ir-127"sv, "iso8859-6"sv, "iso88596"sv, "iso_8859-6"sv, "iso_8859-6:1987"sv)) + return "ISO-8859-6"sv; + if (encoding.is_one_of_ignoring_case("csisolatingreek"sv, "ecma-118"sv, "elot_928"sv, "greek"sv, "greek8"sv, "iso-8859-7"sv, "iso-ir-126"sv, "iso8859-7"sv, "iso88597"sv, "iso_8859-7"sv, "iso_8859-7:1987"sv, "sun_eu_greek"sv)) + return "ISO-8859-7"sv; + if (encoding.is_one_of_ignoring_case("csiso88598e"sv, "csisolatinhebrew"sv, "hebrew"sv, "iso-8859-8"sv, "iso-8859-8-e"sv, "iso-ir-138"sv, "iso8859-8"sv, "iso88598"sv, "iso_8859-8"sv, "iso_8859-8:1988"sv, "visual"sv)) + return "ISO-8859-8"sv; + if (encoding.is_one_of_ignoring_case("csiso88598i"sv, "iso-8859-8-i"sv, "logical"sv)) + return "ISO-8859-8-I"sv; + if (encoding.is_one_of_ignoring_case("csisolatin6"sv, "iso8859-10"sv, "iso-ir-157"sv, "iso8859-10"sv, "iso885910"sv, "l6"sv, "latin6"sv)) + return "ISO-8859-10"sv; + if (encoding.is_one_of_ignoring_case("iso-8859-13"sv, "iso8859-13"sv, "iso885913"sv)) + return "ISO-8859-13"sv; + if (encoding.is_one_of_ignoring_case("iso-8859-14"sv, "iso8859-14"sv, "iso885914"sv)) + return "ISO-8859-14"sv; + if (encoding.is_one_of_ignoring_case("csisolatin9"sv, "iso-8859-15"sv, "iso8859-15"sv, "iso885915"sv, "iso_8859-15"sv, "l9"sv)) + return "ISO-8859-15"sv; + if (encoding.is_one_of_ignoring_case("iso-8859-16"sv)) + return "ISO-8859-16"sv; + if (encoding.is_one_of_ignoring_case("cskoi8r"sv, "koi"sv, "koi8"sv, "koi8-r"sv, "koi8_r"sv)) + return "KOI8-R"sv; + if (encoding.is_one_of_ignoring_case("koi8-ru"sv, "koi8-u"sv)) + return "KOI8-U"sv; + if (encoding.is_one_of_ignoring_case("csmacintosh"sv, "mac"sv, "macintosh"sv, "x-mac-roman"sv)) + return "macintosh"sv; + if (encoding.is_one_of_ignoring_case("dos-874"sv, "iso-8859-11"sv, "iso8859-11"sv, "iso885911"sv, "tis-620"sv, "windows-874"sv)) + return "windows-874"sv; + if (encoding.is_one_of_ignoring_case("cp1250"sv, "windows-1250"sv, "x-cp1250"sv)) + return "windows-1250"sv; + if (encoding.is_one_of_ignoring_case("cp1251"sv, "windows-1251"sv, "x-cp1251"sv)) + return "windows-1251"sv; + if (encoding.is_one_of_ignoring_case("ansi_x3.4-1968"sv, "ascii"sv, "cp1252"sv, "cp819"sv, "csisolatin1"sv, "ibm819"sv, "iso-8859-1"sv, "iso-ir-100"sv, "iso8859-1"sv, "iso88591"sv, "iso_8859-1"sv, "iso_8859-1:1987"sv, "l1"sv, "latin1"sv, "us-ascii"sv, "windows-1252"sv, "x-cp1252"sv)) + return "windows-1252"sv; + if (encoding.is_one_of_ignoring_case("cp1253"sv, "windows-1253"sv, "x-cp1253"sv)) + return "windows-1253"sv; + if (encoding.is_one_of_ignoring_case("cp1254"sv, "csisolatin5"sv, "iso-8859-9"sv, "iso-ir-148"sv, "iso-8859-9"sv, "iso-88599"sv, "iso_8859-9"sv, "iso_8859-9:1989"sv, "l5"sv, "latin5"sv, "windows-1254"sv, "x-cp1254"sv)) + return "windows-1254"sv; + if (encoding.is_one_of_ignoring_case("cp1255"sv, "windows-1255"sv, "x-cp1255"sv)) + return "windows-1255"sv; + if (encoding.is_one_of_ignoring_case("cp1256"sv, "windows-1256"sv, "x-cp1256"sv)) + return "windows-1256"sv; + if (encoding.is_one_of_ignoring_case("cp1257"sv, "windows-1257"sv, "x-cp1257"sv)) + return "windows-1257"sv; + if (encoding.is_one_of_ignoring_case("cp1258"sv, "windows-1258"sv, "x-cp1258"sv)) + return "windows-1258"sv; + if (encoding.is_one_of_ignoring_case("x-mac-cyrillic"sv, "x-mac-ukrainian"sv)) + return "x-mac-cyrillic"sv; + if (encoding.is_one_of_ignoring_case("koi8-r"sv, "koi8r"sv)) + return "koi8-r"sv; + if (encoding.is_one_of_ignoring_case("chinese"sv, "csgb2312"sv, "csiso58gb231280"sv, "gb2312"sv, "gb_2312"sv, "gb_2312-80"sv, "gbk"sv, "iso-ir-58"sv, "x-gbk"sv)) + return "GBK"sv; + if (encoding.is_one_of_ignoring_case("gb18030"sv)) + return "gb18030"sv; + if (encoding.is_one_of_ignoring_case("big5"sv, "big5-hkscs"sv, "cn-big5"sv, "csbig5"sv, "x-x-big5"sv)) + return "Big5"sv; + if (encoding.is_one_of_ignoring_case("cseucpkdfmtjapanese"sv, "euc-jp"sv, "x-euc-jp"sv)) + return "EUC-JP"sv; + if (encoding.is_one_of_ignoring_case("csiso2022jp"sv, "iso-2022-jp"sv)) + return "ISO-2022-JP"sv; + if (encoding.is_one_of_ignoring_case("csshiftjis"sv, "ms932"sv, "ms_kanji"sv, "shift-jis"sv, "shift_jis"sv, "sjis"sv, "windows-31j"sv, "x-sjis"sv)) + return "Shift_JIS"sv; + if (encoding.is_one_of_ignoring_case("cseuckr"sv, "csksc56011987"sv, "euc-kr"sv, "iso-ir-149"sv, "korean"sv, "ks_c_5601-1987"sv, "ks_c_5601-1989"sv, "ksc5601"sv, "ksc_5601"sv, "windows-949"sv)) + return "EUC-KR"sv; + if (encoding.is_one_of_ignoring_case("csiso2022kr"sv, "hz-gb-2312"sv, "iso-2022-cn"sv, "iso-2022-cn-ext"sv, "iso-2022-kr"sv, "replacement"sv)) + return "replacement"sv; + if (encoding.is_one_of_ignoring_case("unicodefffe"sv, "utf-16be"sv)) + return "UTF-16BE"sv; + if (encoding.is_one_of_ignoring_case("csunicode"sv, "iso-10646-ucs-2"sv, "ucs-2"sv, "unicode"sv, "unicodefeff"sv, "utf-16"sv, "utf-16le"sv)) + return "UTF-16LE"sv; + if (encoding.is_one_of_ignoring_case("x-user-defined"sv)) + return "x-user-defined"sv; dbgln("TextCodec: Unrecognized encoding: {}", encoding); return {}; diff --git a/Userland/Libraries/LibThreading/Thread.cpp b/Userland/Libraries/LibThreading/Thread.cpp index 2d0da5c118..7659793c29 100644 --- a/Userland/Libraries/LibThreading/Thread.cpp +++ b/Userland/Libraries/LibThreading/Thread.cpp @@ -12,7 +12,7 @@ Threading::Thread::Thread(Function<intptr_t()> action, StringView thread_name) : Core::Object(nullptr) , m_action(move(action)) - , m_thread_name(thread_name.is_null() ? "" : thread_name) + , m_thread_name(thread_name.is_null() ? ""sv : thread_name) { register_property("thread_name", [&] { return JsonValue { m_thread_name }; }); register_property("tid", [&] { return JsonValue { m_tid }; }); diff --git a/Userland/Libraries/LibUSBDB/Database.cpp b/Userland/Libraries/LibUSBDB/Database.cpp index 2be7c04ad2..217e14b167 100644 --- a/Userland/Libraries/LibUSBDB/Database.cpp +++ b/Userland/Libraries/LibUSBDB/Database.cpp @@ -27,7 +27,7 @@ const StringView Database::get_vendor(u16 vendor_id) const { auto const& vendor = m_vendors.get(vendor_id); if (!vendor.has_value()) - return ""; + return ""sv; return vendor.value()->name; } @@ -35,11 +35,11 @@ const StringView Database::get_device(u16 vendor_id, u16 device_id) const { auto const& vendor = m_vendors.get(vendor_id); if (!vendor.has_value()) { - return ""; + return ""sv; } auto const& device = vendor.value()->devices.get(device_id); if (!device.has_value()) - return ""; + return ""sv; return device.value()->name; } @@ -47,13 +47,13 @@ const StringView Database::get_interface(u16 vendor_id, u16 device_id, u16 inter { auto const& vendor = m_vendors.get(vendor_id); if (!vendor.has_value()) - return ""; + return ""sv; auto const& device = vendor.value()->devices.get(device_id); if (!device.has_value()) - return ""; + return ""sv; auto const& interface = device.value()->interfaces.get(interface_id); if (!interface.has_value()) - return ""; + return ""sv; return interface.value()->name; } @@ -61,7 +61,7 @@ const StringView Database::get_class(u8 class_id) const { auto const& xclass = m_classes.get(class_id); if (!xclass.has_value()) - return ""; + return ""sv; return xclass.value()->name; } @@ -69,10 +69,10 @@ const StringView Database::get_subclass(u8 class_id, u8 subclass_id) const { auto const& xclass = m_classes.get(class_id); if (!xclass.has_value()) - return ""; + return ""sv; auto const& subclass = xclass.value()->subclasses.get(subclass_id); if (!subclass.has_value()) - return ""; + return ""sv; return subclass.value()->name; } @@ -80,13 +80,13 @@ const StringView Database::get_protocol(u8 class_id, u8 subclass_id, u8 protocol { auto const& xclass = m_classes.get(class_id); if (!xclass.has_value()) - return ""; + return ""sv; auto const& subclass = xclass.value()->subclasses.get(subclass_id); if (!subclass.has_value()) - return ""; + return ""sv; auto const& protocol = subclass.value()->protocols.get(protocol_id); if (!protocol.has_value()) - return ""; + return ""sv; return protocol.value()->name; } diff --git a/Userland/Libraries/LibVT/Terminal.cpp b/Userland/Libraries/LibVT/Terminal.cpp index 26381c6191..cc64527ae7 100644 --- a/Userland/Libraries/LibVT/Terminal.cpp +++ b/Userland/Libraries/LibVT/Terminal.cpp @@ -689,7 +689,7 @@ void Terminal::IL(Parameters params) void Terminal::DA(Parameters) { - emit_string("\033[?1;0c"); + emit_string("\033[?1;0c"sv); } void Terminal::DL(Parameters params) @@ -959,7 +959,7 @@ void Terminal::DSR(Parameters params) { if (params.size() == 1 && params[0] == 5) { // Device status - emit_string("\033[0n"); // Terminal status OK! + emit_string("\033[0n"sv); // Terminal status OK! } else if (params.size() == 1 && params[0] == 6) { // Cursor position query StringBuilder builder; @@ -1388,7 +1388,7 @@ void Terminal::handle_key_press(KeyCode key, u32 code_point, u8 flags) case KeyCode::Key_Return: // The standard says that CR should be generated by the return key. // The TTY will take care of translating it to CR LF for the terminal. - emit_string("\r"); + emit_string("\r"sv); return; default: break; @@ -1400,7 +1400,7 @@ void Terminal::handle_key_press(KeyCode key, u32 code_point, u8 flags) } if (shift && key == KeyCode::Key_Tab) { - emit_string("\033[Z"); + emit_string("\033[Z"sv); return; } @@ -1416,7 +1416,7 @@ void Terminal::handle_key_press(KeyCode key, u32 code_point, u8 flags) // Alt modifier sends escape prefix. if (alt) - emit_string("\033"); + emit_string("\033"sv); StringBuilder sb; sb.append_code_point(code_point); @@ -1433,7 +1433,7 @@ void Terminal::unimplemented_escape_sequence(Intermediates intermediates, u8 las StringBuilder builder; builder.appendff("Unimplemented escape sequence {:c}", last_byte); if (!intermediates.is_empty()) { - builder.append(", intermediates: "); + builder.append(", intermediates: "sv); for (size_t i = 0; i < intermediates.size(); ++i) builder.append((char)intermediates[i]); } @@ -1445,13 +1445,13 @@ void Terminal::unimplemented_csi_sequence(Parameters parameters, Intermediates i StringBuilder builder; builder.appendff("Unimplemented CSI sequence: {:c}", last_byte); if (!parameters.is_empty()) { - builder.append(", parameters: ["); + builder.append(", parameters: ["sv); for (size_t i = 0; i < parameters.size(); ++i) builder.appendff("{}{}", (i == 0) ? "" : ", ", parameters[i]); builder.append("]"); } if (!intermediates.is_empty()) { - builder.append(", intermediates:"); + builder.append(", intermediates:"sv); for (size_t i = 0; i < intermediates.size(); ++i) builder.append((char)intermediates[i]); } @@ -1465,15 +1465,15 @@ void Terminal::unimplemented_osc_sequence(OscParameters parameters, u8 last_byte bool first = true; for (auto parameter : parameters) { if (!first) - builder.append(", "); - builder.append("["); + builder.append(", "sv); + builder.append('['); for (auto character : parameter) builder.append((char)character); builder.append("]"); first = false; } - builder.append(" ]"); + builder.append(" ]"sv); dbgln("{}", builder.string_view()); } diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index 93faffd022..1fa0853b6e 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -97,9 +97,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy) update(); }; - m_cursor_blink_timer->set_interval(Config::read_i32("Terminal", "Text", - "CursorBlinkInterval", - 500)); + m_cursor_blink_timer->set_interval(Config::read_i32("Terminal"sv, "Text"sv, "CursorBlinkInterval"sv, 500)); m_cursor_blink_timer->on_timeout = [this] { m_cursor_blink_state = !m_cursor_blink_state; update_cursor(); @@ -114,7 +112,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy) }; m_auto_scroll_timer->start(); - auto font_entry = Config::read_string("Terminal", "Text", "Font", "default"); + auto font_entry = Config::read_string("Terminal"sv, "Text"sv, "Font"sv, "default"sv); if (font_entry == "default") set_font(Gfx::FontDatabase::default_fixed_width_font()); else @@ -122,14 +120,14 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy) m_line_height = font().glyph_height() + m_line_spacing; - m_terminal.set_size(Config::read_i32("Terminal", "Window", "Width", 80), Config::read_i32("Terminal", "Window", "Height", 25)); + m_terminal.set_size(Config::read_i32("Terminal"sv, "Window"sv, "Width"sv, 80), Config::read_i32("Terminal"sv, "Window"sv, "Height"sv, 25)); - m_copy_action = GUI::Action::create("&Copy", { Mod_Ctrl | Mod_Shift, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + m_copy_action = GUI::Action::create("&Copy", { Mod_Ctrl | Mod_Shift, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { copy(); }); m_copy_action->set_swallow_key_event_when_disabled(true); - m_paste_action = GUI::Action::create("&Paste", { Mod_Ctrl | Mod_Shift, Key_V }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/paste.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + m_paste_action = GUI::Action::create("&Paste", { Mod_Ctrl | Mod_Shift, Key_V }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/paste.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { paste(); }); m_paste_action->set_swallow_key_event_when_disabled(true); @@ -147,7 +145,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy) update_copy_action(); update_paste_action(); - set_color_scheme(Config::read_string("Terminal", "Window", "ColorScheme", "Default")); + set_color_scheme(Config::read_string("Terminal"sv, "Window"sv, "ColorScheme"sv, "Default"sv)); } Gfx::IntRect TerminalWidget::glyph_rect(u16 row, u16 column) @@ -757,7 +755,7 @@ void TerminalWidget::paste() return; auto [data, mime_type, _] = GUI::Clipboard::the().fetch_data_and_type(); - if (!mime_type.starts_with("text/")) + if (!mime_type.starts_with("text/"sv)) return; if (data.is_empty()) return; @@ -1170,7 +1168,7 @@ void TerminalWidget::update_copy_action() void TerminalWidget::update_paste_action() { auto [data, mime_type, _] = GUI::Clipboard::the().fetch_data_and_type(); - m_paste_action->set_enabled(mime_type.starts_with("text/") && !data.is_empty()); + m_paste_action->set_enabled(mime_type.starts_with("text/"sv) && !data.is_empty()); } void TerminalWidget::set_color_scheme(StringView name) @@ -1183,14 +1181,14 @@ void TerminalWidget::set_color_scheme(StringView name) m_color_scheme_name = name; constexpr StringView color_names[] = { - "Black", - "Red", - "Green", - "Yellow", - "Blue", - "Magenta", - "Cyan", - "White" + "Black"sv, + "Red"sv, + "Green"sv, + "Yellow"sv, + "Blue"sv, + "Magenta"sv, + "Cyan"sv, + "White"sv }; auto path = String::formatted("/res/terminal-colors/{}.ini", name); @@ -1270,8 +1268,8 @@ void TerminalWidget::set_font_and_resize_to_fit(Gfx::Font const& font) // This basically wraps the code that handles sending the escape sequence in bracketed paste mode. void TerminalWidget::send_non_user_input(ReadonlyBytes bytes) { - constexpr StringView leading_control_sequence = "\e[200~"; - constexpr StringView trailing_control_sequence = "\e[201~"; + constexpr StringView leading_control_sequence = "\e[200~"sv; + constexpr StringView trailing_control_sequence = "\e[201~"sv; int nwritten; if (m_terminal.needs_bracketed_paste()) { diff --git a/Userland/Libraries/LibVideo/MatroskaReader.cpp b/Userland/Libraries/LibVideo/MatroskaReader.cpp index ce6ab8388c..50ef45cc1a 100644 --- a/Userland/Libraries/LibVideo/MatroskaReader.cpp +++ b/Userland/Libraries/LibVideo/MatroskaReader.cpp @@ -113,7 +113,7 @@ bool MatroskaReader::parse_master_element([[maybe_unused]] StringView element_na Optional<EBMLHeader> MatroskaReader::parse_ebml_header() { EBMLHeader header; - auto success = parse_master_element("Header", [&](u64 element_id) { + auto success = parse_master_element("Header"sv, [&](u64 element_id) { if (element_id == DOCTYPE_ELEMENT_ID) { auto doc_type = read_string_element(); CHECK_HAS_VALUE(doc_type); @@ -139,7 +139,7 @@ Optional<EBMLHeader> MatroskaReader::parse_ebml_header() bool MatroskaReader::parse_segment_elements(MatroskaDocument& matroska_document) { dbgln_if(MATROSKA_DEBUG, "Parsing segment elements"); - auto success = parse_master_element("Segment", [&](u64 element_id) { + auto success = parse_master_element("Segment"sv, [&](u64 element_id) { if (element_id == SEGMENT_INFORMATION_ELEMENT_ID) { auto segment_information = parse_information(); if (!segment_information) @@ -166,7 +166,7 @@ bool MatroskaReader::parse_segment_elements(MatroskaDocument& matroska_document) OwnPtr<SegmentInformation> MatroskaReader::parse_information() { auto segment_information = make<SegmentInformation>(); - auto success = parse_master_element("Segment Information", [&](u64 element_id) { + auto success = parse_master_element("Segment Information"sv, [&](u64 element_id) { if (element_id == TIMESTAMP_SCALE_ID) { auto timestamp_scale = read_u64_element(); CHECK_HAS_VALUE(timestamp_scale); @@ -196,7 +196,7 @@ OwnPtr<SegmentInformation> MatroskaReader::parse_information() bool MatroskaReader::parse_tracks(MatroskaDocument& matroska_document) { - auto success = parse_master_element("Tracks", [&](u64 element_id) { + auto success = parse_master_element("Tracks"sv, [&](u64 element_id) { if (element_id == TRACK_ENTRY_ID) { dbgln_if(MATROSKA_DEBUG, "Parsing track"); auto track_entry = parse_track_entry(); @@ -218,7 +218,7 @@ bool MatroskaReader::parse_tracks(MatroskaDocument& matroska_document) OwnPtr<TrackEntry> MatroskaReader::parse_track_entry() { auto track_entry = make<TrackEntry>(); - auto success = parse_master_element("Track", [&](u64 element_id) { + auto success = parse_master_element("Track"sv, [&](u64 element_id) { if (element_id == TRACK_NUMBER_ID) { auto track_number = read_u64_element(); CHECK_HAS_VALUE(track_number); @@ -268,7 +268,7 @@ Optional<TrackEntry::VideoTrack> MatroskaReader::parse_video_track_information() { TrackEntry::VideoTrack video_track {}; - auto success = parse_master_element("VideoTrack", [&](u64 element_id) { + auto success = parse_master_element("VideoTrack"sv, [&](u64 element_id) { if (element_id == PIXEL_WIDTH_ID) { auto pixel_width = read_u64_element(); CHECK_HAS_VALUE(pixel_width); @@ -295,7 +295,7 @@ Optional<TrackEntry::AudioTrack> MatroskaReader::parse_audio_track_information() { TrackEntry::AudioTrack audio_track {}; - auto success = parse_master_element("AudioTrack", [&](u64 element_id) { + auto success = parse_master_element("AudioTrack"sv, [&](u64 element_id) { if (element_id == CHANNELS_ID) { auto channels = read_u64_element(); CHECK_HAS_VALUE(channels); @@ -322,7 +322,7 @@ OwnPtr<Cluster> MatroskaReader::parse_cluster() { auto cluster = make<Cluster>(); - auto success = parse_master_element("Cluster", [&](u64 element_id) { + auto success = parse_master_element("Cluster"sv, [&](u64 element_id) { if (element_id == SIMPLE_BLOCK_ID) { auto simple_block = parse_simple_block(); if (!simple_block) diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Operators.h b/Userland/Libraries/LibWasm/AbstractMachine/Operators.h index 4d8560abc9..9bf0eda19d 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/Operators.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/Operators.h @@ -21,7 +21,7 @@ namespace Operators { template<typename Lhs, typename Rhs> \ auto operator()(Lhs lhs, Rhs rhs) const { return lhs operation rhs; } \ \ - static StringView name() { return #operation; } \ + static StringView name() { return #operation##sv; } \ } DEFINE_BINARY_OPERATOR(Equals, ==); @@ -54,7 +54,7 @@ struct Divide { } } - static StringView name() { return "/"; } + static StringView name() { return "/"sv; } }; struct Modulo { template<typename Lhs, typename Rhs> @@ -69,19 +69,19 @@ struct Modulo { return AK::Result<Lhs, StringView>(lhs % rhs); } - static StringView name() { return "%"; } + static StringView name() { return "%"sv; } }; struct BitShiftLeft { template<typename Lhs, typename Rhs> auto operator()(Lhs lhs, Rhs rhs) const { return lhs << (rhs % (sizeof(lhs) * 8)); } - static StringView name() { return "<<"; } + static StringView name() { return "<<"sv; } }; struct BitShiftRight { template<typename Lhs, typename Rhs> auto operator()(Lhs lhs, Rhs rhs) const { return lhs >> (rhs % (sizeof(lhs) * 8)); } - static StringView name() { return ">>"; } + static StringView name() { return ">>"sv; } }; struct BitRotateLeft { template<typename Lhs, typename Rhs> @@ -94,7 +94,7 @@ struct BitRotateLeft { return (lhs << rhs) | (lhs >> ((-rhs) & mask)); } - static StringView name() { return "rotate_left"; } + static StringView name() { return "rotate_left"sv; } }; struct BitRotateRight { template<typename Lhs, typename Rhs> @@ -107,7 +107,7 @@ struct BitRotateRight { return (lhs >> rhs) | (lhs << ((-rhs) & mask)); } - static StringView name() { return "rotate_right"; } + static StringView name() { return "rotate_right"sv; } }; struct Minimum { template<typename Lhs, typename Rhs> @@ -126,7 +126,7 @@ struct Minimum { return min(lhs, rhs); } - static StringView name() { return "minimum"; } + static StringView name() { return "minimum"sv; } }; struct Maximum { template<typename Lhs, typename Rhs> @@ -145,7 +145,7 @@ struct Maximum { return max(lhs, rhs); } - static StringView name() { return "maximum"; } + static StringView name() { return "maximum"sv; } }; struct CopySign { template<typename Lhs, typename Rhs> @@ -159,7 +159,7 @@ struct CopySign { static_assert(DependentFalse<Lhs, Rhs>, "Invalid types to CopySign"); } - static StringView name() { return "copysign"; } + static StringView name() { return "copysign"sv; } }; // Unary @@ -168,7 +168,7 @@ struct EqualsZero { template<typename Lhs> auto operator()(Lhs lhs) const { return lhs == 0; } - static StringView name() { return "== 0"; } + static StringView name() { return "== 0"sv; } }; struct CountLeadingZeros { template<typename Lhs> @@ -183,7 +183,7 @@ struct CountLeadingZeros { VERIFY_NOT_REACHED(); } - static StringView name() { return "clz"; } + static StringView name() { return "clz"sv; } }; struct CountTrailingZeros { template<typename Lhs> @@ -198,7 +198,7 @@ struct CountTrailingZeros { VERIFY_NOT_REACHED(); } - static StringView name() { return "ctz"; } + static StringView name() { return "ctz"sv; } }; struct PopCount { template<typename Lhs> @@ -210,19 +210,19 @@ struct PopCount { VERIFY_NOT_REACHED(); } - static StringView name() { return "popcnt"; } + static StringView name() { return "popcnt"sv; } }; struct Absolute { template<typename Lhs> auto operator()(Lhs lhs) const { return AK::abs(lhs); } - static StringView name() { return "abs"; } + static StringView name() { return "abs"sv; } }; struct Negate { template<typename Lhs> auto operator()(Lhs lhs) const { return -lhs; } - static StringView name() { return "== 0"; } + static StringView name() { return "== 0"sv; } }; struct Ceil { template<typename Lhs> @@ -236,7 +236,7 @@ struct Ceil { VERIFY_NOT_REACHED(); } - static StringView name() { return "ceil"; } + static StringView name() { return "ceil"sv; } }; struct Floor { template<typename Lhs> @@ -250,7 +250,7 @@ struct Floor { VERIFY_NOT_REACHED(); } - static StringView name() { return "floor"; } + static StringView name() { return "floor"sv; } }; struct Truncate { template<typename Lhs> @@ -264,7 +264,7 @@ struct Truncate { VERIFY_NOT_REACHED(); } - static StringView name() { return "truncate"; } + static StringView name() { return "truncate"sv; } }; struct NearbyIntegral { template<typename Lhs> @@ -278,7 +278,7 @@ struct NearbyIntegral { VERIFY_NOT_REACHED(); } - static StringView name() { return "round"; } + static StringView name() { return "round"sv; } }; struct SquareRoot { template<typename Lhs> @@ -292,7 +292,7 @@ struct SquareRoot { VERIFY_NOT_REACHED(); } - static StringView name() { return "sqrt"; } + static StringView name() { return "sqrt"sv; } }; template<typename Result> @@ -303,7 +303,7 @@ struct Wrap { return static_cast<MakeUnsigned<Result>>(bit_cast<MakeUnsigned<Lhs>>(lhs)); } - static StringView name() { return "wrap"; } + static StringView name() { return "wrap"sv; } }; template<typename ResultT> @@ -331,7 +331,7 @@ struct CheckedTruncate { return static_cast<ResultT>(truncated); } - static StringView name() { return "truncate.checked"; } + static StringView name() { return "truncate.checked"sv; } }; template<typename ResultT> @@ -342,7 +342,7 @@ struct Extend { return lhs; } - static StringView name() { return "extend"; } + static StringView name() { return "extend"sv; } }; template<typename ResultT> @@ -354,7 +354,7 @@ struct Convert { return static_cast<ResultT>(signed_interpretation); } - static StringView name() { return "convert"; } + static StringView name() { return "convert"sv; } }; template<typename ResultT> @@ -365,7 +365,7 @@ struct Reinterpret { return bit_cast<ResultT>(lhs); } - static StringView name() { return "reinterpret"; } + static StringView name() { return "reinterpret"sv; } }; struct Promote { @@ -376,7 +376,7 @@ struct Promote { return static_cast<double>(lhs); } - static StringView name() { return "promote"; } + static StringView name() { return "promote"sv; } }; struct Demote { @@ -391,7 +391,7 @@ struct Demote { return static_cast<float>(lhs); } - static StringView name() { return "demote"; } + static StringView name() { return "demote"sv; } }; template<typename InitialType> @@ -405,7 +405,7 @@ struct SignExtend { return static_cast<Lhs>(initial_value); } - static StringView name() { return "extend"; } + static StringView name() { return "extend"sv; } }; template<typename ResultT> @@ -439,7 +439,7 @@ struct SaturatingTruncate { return convert(trunc(lhs)); } - static StringView name() { return "truncate.saturating"; } + static StringView name() { return "truncate.saturating"sv; } }; } diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp index a64d4958ea..fc512253db 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp @@ -73,7 +73,7 @@ ErrorOr<void, ValidationError> Validator::validate(Module& module) if (m_context.types.size() > index.value()) { m_context.functions.append(m_context.types[index.value()]); } else { - result = Errors::invalid("TypeIndex"); + result = Errors::invalid("TypeIndex"sv); break; } } @@ -171,7 +171,7 @@ ErrorOr<void, ValidationError> Validator::validate(StartSection const& section) TRY(validate(section.function().index())); FunctionType const& type = m_context.functions[section.function().index().value()]; if (!type.parameters().is_empty() || !type.results().is_empty()) - return Errors::invalid("start function signature"); + return Errors::invalid("start function signature"sv); return {}; } @@ -186,10 +186,10 @@ ErrorOr<void, ValidationError> Validator::validate(DataSection const& section) auto expression_result = TRY(validate(active.offset, { ValueType(ValueType::I32) })); if (!expression_result.is_constant) - return Errors::invalid("active data initializer"); + return Errors::invalid("active data initializer"sv); if (expression_result.result_types.size() != 1 || !expression_result.result_types.first().is_of_kind(ValueType::I32)) - return Errors::invalid("active data initializer type", ValueType(ValueType::I32), expression_result.result_types); + return Errors::invalid("active data initializer type"sv, ValueType(ValueType::I32), expression_result.result_types); return {}; })); @@ -208,9 +208,9 @@ ErrorOr<void, ValidationError> Validator::validate(ElementSection const& section TRY(validate(active.index)); auto expression_result = TRY(validate(active.expression, { ValueType(ValueType::I32) })); if (!expression_result.is_constant) - return Errors::invalid("active element initializer"); + return Errors::invalid("active element initializer"sv); if (expression_result.result_types.size() != 1 || !expression_result.result_types.first().is_of_kind(ValueType::I32)) - return Errors::invalid("active element initializer type", ValueType(ValueType::I32), expression_result.result_types); + return Errors::invalid("active element initializer type"sv, ValueType(ValueType::I32), expression_result.result_types); return {}; })); } @@ -224,9 +224,9 @@ ErrorOr<void, ValidationError> Validator::validate(GlobalSection const& section) TRY(validate(type)); auto expression_result = TRY(validate(entry.expression(), { type.type() })); if (!expression_result.is_constant) - return Errors::invalid("global variable initializer"); + return Errors::invalid("global variable initializer"sv); if (expression_result.result_types.size() != 1 || !expression_result.result_types.first().is_of_kind(type.type().kind())) - return Errors::invalid("global variable initializer type", ValueType(ValueType::I32), expression_result.result_types); + return Errors::invalid("global variable initializer type"sv, ValueType(ValueType::I32), expression_result.result_types); } return {}; @@ -1338,7 +1338,7 @@ VALIDATE_INSTRUCTION(ref_func) TRY(validate(index)); if (!m_context.references.contains(index)) - return Errors::invalid("function reference"); + return Errors::invalid("function reference"sv); is_constant = true; stack.append(ValueType(ValueType::FunctionReference)); @@ -1363,10 +1363,10 @@ VALIDATE_INSTRUCTION(select) auto arg0_type = stack.take_last(); auto& arg1_type = stack.last(); if (!index_type.is_of_kind(ValueType::I32)) - return Errors::invalid("select index type", ValueType(ValueType::I32), index_type); + return Errors::invalid("select index type"sv, ValueType(ValueType::I32), index_type); if (arg0_type != arg1_type) - return Errors::invalid("select argument types", Vector { arg0_type, arg0_type }, Vector { arg0_type, arg1_type }); + return Errors::invalid("select argument types"sv, Vector { arg0_type, arg0_type }, Vector { arg0_type, arg1_type }); return {}; } @@ -1375,7 +1375,7 @@ VALIDATE_INSTRUCTION(select_typed) { auto& required_types = instruction.arguments().get<Vector<ValueType>>(); if (required_types.size() != 1) - return Errors::invalid("select types", "exactly one type", required_types); + return Errors::invalid("select types"sv, "exactly one type"sv, required_types); if (stack.size() < 3) return Errors::invalid_stack_state(stack, Tuple { ValueType(ValueType::I32), required_types.first(), required_types.first() }); @@ -1384,10 +1384,10 @@ VALIDATE_INSTRUCTION(select_typed) auto arg0_type = stack.take_last(); auto& arg1_type = stack.last(); if (!index_type.is_of_kind(ValueType::I32)) - return Errors::invalid("select index type", ValueType(ValueType::I32), index_type); + return Errors::invalid("select index type"sv, ValueType(ValueType::I32), index_type); if (arg0_type != arg1_type || arg0_type != required_types.first()) - return Errors::invalid("select argument types", Vector { required_types.first(), required_types.first() }, Vector { arg0_type, arg1_type }); + return Errors::invalid("select argument types"sv, Vector { required_types.first(), required_types.first() }, Vector { arg0_type, arg1_type }); return {}; } @@ -1445,7 +1445,7 @@ VALIDATE_INSTRUCTION(global_set) auto& global = m_context.globals[index.value()]; if (!global.is_mutable()) - return Errors::invalid("global variable for global.set"); + return Errors::invalid("global variable for global.set"sv); TRY(stack.take(global.type())); @@ -1525,10 +1525,10 @@ VALIDATE_INSTRUCTION(table_copy) auto& rhs_table = m_context.tables[args.rhs.value()]; if (lhs_table.element_type() != rhs_table.element_type()) - return Errors::non_conforming_types("table.copy", lhs_table.element_type(), rhs_table.element_type()); + return Errors::non_conforming_types("table.copy"sv, lhs_table.element_type(), rhs_table.element_type()); if (!lhs_table.element_type().is_reference()) - return Errors::invalid("table.copy element type", "a reference type", lhs_table.element_type()); + return Errors::invalid("table.copy element type"sv, "a reference type"sv, lhs_table.element_type()); TRY((stack.take<ValueType::I32, ValueType::I32, ValueType::I32>())); @@ -1546,7 +1546,7 @@ VALIDATE_INSTRUCTION(table_init) auto& element_type = m_context.elements[args.element_index.value()]; if (table.element_type() != element_type) - return Errors::non_conforming_types("table.init", table.element_type(), element_type); + return Errors::non_conforming_types("table.init"sv, table.element_type(), element_type); TRY((stack.take<ValueType::I32, ValueType::I32, ValueType::I32>())); @@ -1568,7 +1568,7 @@ VALIDATE_INSTRUCTION(i32_load) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(i32)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(i32)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(i32)); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I32)); @@ -1581,7 +1581,7 @@ VALIDATE_INSTRUCTION(i64_load) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(i64)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(i64)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(i64)); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I64)); @@ -1594,7 +1594,7 @@ VALIDATE_INSTRUCTION(f32_load) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(float)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(float)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(float)); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::F32)); @@ -1607,7 +1607,7 @@ VALIDATE_INSTRUCTION(f64_load) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(double)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(double)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(double)); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::F64)); @@ -1620,7 +1620,7 @@ VALIDATE_INSTRUCTION(i32_load16_s) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 16 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 16 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 16 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I32)); @@ -1633,7 +1633,7 @@ VALIDATE_INSTRUCTION(i32_load16_u) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 16 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 16 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 16 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I32)); @@ -1646,7 +1646,7 @@ VALIDATE_INSTRUCTION(i32_load8_s) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 8 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 8 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 8 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I32)); @@ -1659,7 +1659,7 @@ VALIDATE_INSTRUCTION(i32_load8_u) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 8 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 8 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 8 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I32)); @@ -1672,7 +1672,7 @@ VALIDATE_INSTRUCTION(i64_load32_s) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 32 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 32 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 32 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I64)); @@ -1685,7 +1685,7 @@ VALIDATE_INSTRUCTION(i64_load32_u) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 32 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 32 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 32 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I64)); @@ -1698,7 +1698,7 @@ VALIDATE_INSTRUCTION(i64_load16_s) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 16 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 16 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 16 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I64)); @@ -1711,7 +1711,7 @@ VALIDATE_INSTRUCTION(i64_load16_u) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 16 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 16 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 16 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I64)); @@ -1724,7 +1724,7 @@ VALIDATE_INSTRUCTION(i64_load8_s) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 8 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 8 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 8 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I64)); @@ -1737,7 +1737,7 @@ VALIDATE_INSTRUCTION(i64_load8_u) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 8 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 8 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 8 / 8); TRY((stack.take<ValueType::I32>())); stack.append(ValueType(ValueType::I64)); @@ -1750,7 +1750,7 @@ VALIDATE_INSTRUCTION(i32_store) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(i32)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(i32)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(i32)); TRY((stack.take<ValueType::I32, ValueType::I32>())); @@ -1763,7 +1763,7 @@ VALIDATE_INSTRUCTION(i64_store) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(i64)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(i64)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(i64)); TRY((stack.take<ValueType::I64, ValueType::I32>())); @@ -1776,7 +1776,7 @@ VALIDATE_INSTRUCTION(f32_store) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(float)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(float)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(float)); TRY((stack.take<ValueType::F32, ValueType::I32>())); @@ -1789,7 +1789,7 @@ VALIDATE_INSTRUCTION(f64_store) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > sizeof(double)) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, sizeof(double)); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, sizeof(double)); TRY((stack.take<ValueType::F64, ValueType::I32>())); @@ -1802,7 +1802,7 @@ VALIDATE_INSTRUCTION(i32_store16) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 16 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 16 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 16 / 8); TRY((stack.take<ValueType::I32, ValueType::I32>())); @@ -1815,7 +1815,7 @@ VALIDATE_INSTRUCTION(i32_store8) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 8 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 8 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 8 / 8); TRY((stack.take<ValueType::I32, ValueType::I32>())); @@ -1828,7 +1828,7 @@ VALIDATE_INSTRUCTION(i64_store32) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 32 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 32 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 32 / 8); TRY((stack.take<ValueType::I64, ValueType::I32>())); @@ -1841,7 +1841,7 @@ VALIDATE_INSTRUCTION(i64_store16) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 16 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 16 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 16 / 8); TRY((stack.take<ValueType::I64, ValueType::I32>())); @@ -1854,7 +1854,7 @@ VALIDATE_INSTRUCTION(i64_store8) auto& arg = instruction.arguments().get<Instruction::MemoryArgument>(); if ((1ull << arg.align) > 8 / 8) - return Errors::out_of_bounds("memory op alignment", 1ull << arg.align, 0, 8 / 8); + return Errors::out_of_bounds("memory op alignment"sv, 1ull << arg.align, 0, 8 / 8); TRY((stack.take<ValueType::I64, ValueType::I32>())); @@ -1925,7 +1925,7 @@ VALIDATE_INSTRUCTION(unreachable) VALIDATE_INSTRUCTION(structured_end) { if (m_entered_scopes.is_empty()) - return Errors::invalid("usage of structured end"); + return Errors::invalid("usage of structured end"sv); auto last_scope = m_entered_scopes.take_last(); m_context = m_parent_contexts.take_last(); @@ -1938,7 +1938,7 @@ VALIDATE_INSTRUCTION(structured_end) m_block_details.take_last(); break; case ChildScopeKind::IfWithElse: - return Errors::invalid("usage of if without an else clause that appears to have one anyway"); + return Errors::invalid("usage of if without an else clause that appears to have one anyway"sv); } auto& results = last_block_type.results(); @@ -1955,10 +1955,10 @@ VALIDATE_INSTRUCTION(structured_end) VALIDATE_INSTRUCTION(structured_else) { if (m_entered_scopes.is_empty()) - return Errors::invalid("usage of structured else"); + return Errors::invalid("usage of structured else"sv); if (m_entered_scopes.last() != ChildScopeKind::IfWithElse) - return Errors::invalid("usage of structured else"); + return Errors::invalid("usage of structured else"sv); auto& block_type = m_entered_blocks.last(); auto& results = block_type.results(); @@ -2108,7 +2108,7 @@ VALIDATE_INSTRUCTION(br_table) VALIDATE_INSTRUCTION(return_) { if (!m_context.return_.has_value()) - return Errors::invalid("use of return outside function"); + return Errors::invalid("use of return outside function"sv); auto& return_types = m_context.return_->types(); for (size_t i = 0; i < return_types.size(); ++i) @@ -2142,7 +2142,7 @@ VALIDATE_INSTRUCTION(call_indirect) auto& table = m_context.tables[args.table.value()]; if (!table.element_type().is_reference()) - return Errors::invalid("table element type for call.indirect", "a reference type", table.element_type()); + return Errors::invalid("table element type for call.indirect"sv, "a reference type"sv, table.element_type()); auto& type = m_context.types[args.type.value()]; @@ -2170,7 +2170,7 @@ ErrorOr<void, ValidationError> Validator::validate(Instruction const& instructio #undef M default: is_constant = false; - return Errors::invalid("instruction opcode"); + return Errors::invalid("instruction opcode"sv); } } diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Validator.h b/Userland/Libraries/LibWasm/AbstractMachine/Validator.h index f8aa88c02e..12eb4a875d 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/Validator.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/Validator.h @@ -200,11 +200,11 @@ public: ErrorOr<void, ValidationError> take(ValueType type, SourceLocation location = SourceLocation::current()) { if (is_empty()) - return Errors::invalid("stack state", type, "<nothing>", location); + return Errors::invalid("stack state"sv, type, "<nothing>"sv, location); auto type_on_stack = take_last(); if (type_on_stack != type) - return Errors::invalid("stack state", type, type_on_stack, location); + return Errors::invalid("stack state"sv, type, type_on_stack, location); return {}; } @@ -287,13 +287,13 @@ private: else builder.appendff("Invalid stack state in <unknown>: "); - builder.append("Expected [ "); + builder.append("Expected [ "sv); expected.apply_as_args([&]<typename... Ts>(Ts const&... args) { (builder.appendff("{} ", args), ...); }); - builder.append("], but found [ "); + builder.append("], but found [ "sv); auto actual_size = stack.actual_size(); for (size_t i = 1; i <= min(count, actual_size); ++i) { diff --git a/Userland/Libraries/LibWasm/Parser/Parser.cpp b/Userland/Libraries/LibWasm/Parser/Parser.cpp index dbf4b3f345..d2e4b7bca2 100644 --- a/Userland/Libraries/LibWasm/Parser/Parser.cpp +++ b/Userland/Libraries/LibWasm/Parser/Parser.cpp @@ -117,7 +117,7 @@ static ParseResult<ParseUntilAnyOfResult<T>> parse_until_any_of(InputStream& str ParseResult<ValueType> ValueType::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("ValueType"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("ValueType"sv); u8 tag; stream >> tag; if (stream.has_any_error()) @@ -142,7 +142,7 @@ ParseResult<ValueType> ValueType::parse(InputStream& stream) ParseResult<ResultType> ResultType::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("ResultType"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("ResultType"sv); auto types = parse_vector<ValueType>(stream); if (types.is_error()) return types.error(); @@ -151,7 +151,7 @@ ParseResult<ResultType> ResultType::parse(InputStream& stream) ParseResult<FunctionType> FunctionType::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("FunctionType"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("FunctionType"sv); u8 tag; stream >> tag; if (stream.has_any_error()) @@ -174,7 +174,7 @@ ParseResult<FunctionType> FunctionType::parse(InputStream& stream) ParseResult<Limits> Limits::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Limits"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Limits"sv); u8 flag; stream >> flag; if (stream.has_any_error()) @@ -200,7 +200,7 @@ ParseResult<Limits> Limits::parse(InputStream& stream) ParseResult<MemoryType> MemoryType::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("MemoryType"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("MemoryType"sv); auto limits_result = Limits::parse(stream); if (limits_result.is_error()) return limits_result.error(); @@ -209,7 +209,7 @@ ParseResult<MemoryType> MemoryType::parse(InputStream& stream) ParseResult<TableType> TableType::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("TableType"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("TableType"sv); auto type_result = ValueType::parse(stream); if (type_result.is_error()) return type_result.error(); @@ -223,7 +223,7 @@ ParseResult<TableType> TableType::parse(InputStream& stream) ParseResult<GlobalType> GlobalType::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("GlobalType"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("GlobalType"sv); auto type_result = ValueType::parse(stream); if (type_result.is_error()) return type_result.error(); @@ -241,7 +241,7 @@ ParseResult<GlobalType> GlobalType::parse(InputStream& stream) ParseResult<BlockType> BlockType::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("BlockType"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("BlockType"sv); u8 kind; stream >> kind; if (stream.has_any_error()) @@ -277,7 +277,7 @@ ParseResult<BlockType> BlockType::parse(InputStream& stream) ParseResult<Vector<Instruction>> Instruction::parse(InputStream& stream, InstructionPointer& ip) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Instruction"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Instruction"sv); u8 byte; stream >> byte; if (stream.has_any_error()) @@ -733,7 +733,7 @@ ParseResult<Vector<Instruction>> Instruction::parse(InputStream& stream, Instruc ParseResult<CustomSection> CustomSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("CustomSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("CustomSection"sv); auto name = parse_name(stream); if (name.is_error()) return name.error(); @@ -756,7 +756,7 @@ ParseResult<CustomSection> CustomSection::parse(InputStream& stream) ParseResult<TypeSection> TypeSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("TypeSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("TypeSection"sv); auto types = parse_vector<FunctionType>(stream); if (types.is_error()) return types.error(); @@ -765,7 +765,7 @@ ParseResult<TypeSection> TypeSection::parse(InputStream& stream) ParseResult<ImportSection::Import> ImportSection::Import::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Import"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Import"sv); auto module = parse_name(stream); if (module.is_error()) return module.error(); @@ -797,7 +797,7 @@ ParseResult<ImportSection::Import> ImportSection::Import::parse(InputStream& str ParseResult<ImportSection> ImportSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("ImportSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("ImportSection"sv); auto imports = parse_vector<Import>(stream); if (imports.is_error()) return imports.error(); @@ -806,7 +806,7 @@ ParseResult<ImportSection> ImportSection::parse(InputStream& stream) ParseResult<FunctionSection> FunctionSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("FunctionSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("FunctionSection"sv); auto indices = parse_vector<size_t>(stream); if (indices.is_error()) return indices.error(); @@ -821,7 +821,7 @@ ParseResult<FunctionSection> FunctionSection::parse(InputStream& stream) ParseResult<TableSection::Table> TableSection::Table::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Table"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Table"sv); auto type = TableType::parse(stream); if (type.is_error()) return type.error(); @@ -830,7 +830,7 @@ ParseResult<TableSection::Table> TableSection::Table::parse(InputStream& stream) ParseResult<TableSection> TableSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("TableSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("TableSection"sv); auto tables = parse_vector<Table>(stream); if (tables.is_error()) return tables.error(); @@ -839,7 +839,7 @@ ParseResult<TableSection> TableSection::parse(InputStream& stream) ParseResult<MemorySection::Memory> MemorySection::Memory::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Memory"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Memory"sv); auto type = MemoryType::parse(stream); if (type.is_error()) return type.error(); @@ -848,7 +848,7 @@ ParseResult<MemorySection::Memory> MemorySection::Memory::parse(InputStream& str ParseResult<MemorySection> MemorySection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("MemorySection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("MemorySection"sv); auto memories = parse_vector<Memory>(stream); if (memories.is_error()) return memories.error(); @@ -857,7 +857,7 @@ ParseResult<MemorySection> MemorySection::parse(InputStream& stream) ParseResult<Expression> Expression::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Expression"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Expression"sv); InstructionPointer ip { 0 }; auto instructions = parse_until_any_of<Instruction, 0x0b>(stream, ip); if (instructions.is_error()) @@ -868,7 +868,7 @@ ParseResult<Expression> Expression::parse(InputStream& stream) ParseResult<GlobalSection::Global> GlobalSection::Global::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Global"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Global"sv); auto type = GlobalType::parse(stream); if (type.is_error()) return type.error(); @@ -880,7 +880,7 @@ ParseResult<GlobalSection::Global> GlobalSection::Global::parse(InputStream& str ParseResult<GlobalSection> GlobalSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("GlobalSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("GlobalSection"sv); auto result = parse_vector<Global>(stream); if (result.is_error()) return result.error(); @@ -889,7 +889,7 @@ ParseResult<GlobalSection> GlobalSection::parse(InputStream& stream) ParseResult<ExportSection::Export> ExportSection::Export::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Export"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Export"sv); auto name = parse_name(stream); if (name.is_error()) return name.error(); @@ -918,7 +918,7 @@ ParseResult<ExportSection::Export> ExportSection::Export::parse(InputStream& str ParseResult<ExportSection> ExportSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("ExportSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("ExportSection"sv); auto result = parse_vector<Export>(stream); if (result.is_error()) return result.error(); @@ -927,7 +927,7 @@ ParseResult<ExportSection> ExportSection::parse(InputStream& stream) ParseResult<StartSection::StartFunction> StartSection::StartFunction::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("StartFunction"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("StartFunction"sv); auto index = GenericIndexParser<FunctionIndex>::parse(stream); if (index.is_error()) return index.error(); @@ -936,7 +936,7 @@ ParseResult<StartSection::StartFunction> StartSection::StartFunction::parse(Inpu ParseResult<StartSection> StartSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("StartSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("StartSection"sv); auto result = StartFunction::parse(stream); if (result.is_error()) return result.error(); @@ -1014,7 +1014,7 @@ ParseResult<ElementSection::SegmentType7> ElementSection::SegmentType7::parse(In ParseResult<ElementSection::Element> ElementSection::Element::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Element"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Element"sv); u8 tag; stream >> tag; if (stream.has_any_error()) @@ -1082,7 +1082,7 @@ ParseResult<ElementSection::Element> ElementSection::Element::parse(InputStream& ParseResult<ElementSection> ElementSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("ElementSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("ElementSection"sv); auto result = parse_vector<Element>(stream); if (result.is_error()) return result.error(); @@ -1091,7 +1091,7 @@ ParseResult<ElementSection> ElementSection::parse(InputStream& stream) ParseResult<Locals> Locals::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Locals"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Locals"sv); size_t count; if (!LEB128::read_unsigned(stream, count)) return with_eof_check(stream, ParseError::InvalidSize); @@ -1108,7 +1108,7 @@ ParseResult<Locals> Locals::parse(InputStream& stream) ParseResult<CodeSection::Func> CodeSection::Func::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Func"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Func"sv); auto locals = parse_vector<Locals>(stream); if (locals.is_error()) return locals.error(); @@ -1120,7 +1120,7 @@ ParseResult<CodeSection::Func> CodeSection::Func::parse(InputStream& stream) ParseResult<CodeSection::Code> CodeSection::Code::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Code"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Code"sv); size_t size; if (!LEB128::read_unsigned(stream, size)) return with_eof_check(stream, ParseError::InvalidSize); @@ -1141,7 +1141,7 @@ ParseResult<CodeSection::Code> CodeSection::Code::parse(InputStream& stream) ParseResult<CodeSection> CodeSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("CodeSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("CodeSection"sv); auto result = parse_vector<Code>(stream); if (result.is_error()) return result.error(); @@ -1150,7 +1150,7 @@ ParseResult<CodeSection> CodeSection::parse(InputStream& stream) ParseResult<DataSection::Data> DataSection::Data::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Data"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Data"sv); u8 tag; stream >> tag; if (stream.has_any_error()) @@ -1191,7 +1191,7 @@ ParseResult<DataSection::Data> DataSection::Data::parse(InputStream& stream) ParseResult<DataSection> DataSection::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("DataSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("DataSection"sv); auto data = parse_vector<Data>(stream); if (data.is_error()) return data.error(); @@ -1201,7 +1201,7 @@ ParseResult<DataSection> DataSection::parse(InputStream& stream) ParseResult<DataCountSection> DataCountSection::parse([[maybe_unused]] InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("DataCountSection"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("DataCountSection"sv); u32 value; if (!LEB128::read_unsigned(stream, value)) { if (stream.unreliable_eof()) { @@ -1216,7 +1216,7 @@ ParseResult<DataCountSection> DataCountSection::parse([[maybe_unused]] InputStre ParseResult<Module> Module::parse(InputStream& stream) { - ScopeLogger<WASM_BINPARSER_DEBUG> logger("Module"); + ScopeLogger<WASM_BINPARSER_DEBUG> logger("Module"sv); u8 buf[4]; if (!stream.read_or_error({ buf, 4 })) return with_eof_check(stream, ParseError::InvalidInput); diff --git a/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp b/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp index 818b0fd615..d9d7fe62d9 100644 --- a/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp +++ b/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp @@ -56,7 +56,7 @@ JS_DEFINE_NATIVE_FUNCTION(CSSNamespace::supports) } // Otherwise, if property is a custom property name string, return true. // FIXME: This check is not enough to make sure this is a valid custom property name, but it's close enough. - else if (property_name.starts_with("--") && property_name.length() >= 3) { + else if (property_name.starts_with("--"sv) && property_name.length() >= 3) { return JS::Value(true); } diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp index 2e4d1378eb..39ff55157f 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp @@ -183,7 +183,7 @@ static JS::ThrowCompletionOr<HTML::Window*> impl_from(JS::VM& vm, JS::GlobalObje auto* this_object = MUST(this_value.to_object(global_object)); - if (StringView("WindowObject") != this_object->class_name()) + if ("WindowObject"sv != this_object->class_name()) return vm.throw_completion<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WindowObject"); return &static_cast<WindowObject*>(this_object)->impl(); } diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h index 7eb1b487e8..80b8866dc3 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h @@ -25,7 +25,7 @@ public: virtual ~CSSFontFaceRule() override = default; - virtual StringView class_name() const override { return "CSSFontFaceRule"; } + virtual StringView class_name() const override { return "CSSFontFaceRule"sv; } virtual Type type() const override { return Type::FontFace; } FontFace const& font_face() const { return m_font_face; } diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h index 1bed34b17b..82a558c45b 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h @@ -40,7 +40,7 @@ public: NonnullRefPtr<CSSStyleSheet> style_sheet_for_bindings() { return *m_style_sheet; } void set_style_sheet(RefPtr<CSSStyleSheet> const& style_sheet) { m_style_sheet = style_sheet; } - virtual StringView class_name() const override { return "CSSImportRule"; }; + virtual StringView class_name() const override { return "CSSImportRule"sv; }; virtual Type type() const override { return Type::Import; }; private: diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp index c59feb2a63..3e5361817e 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp @@ -31,21 +31,21 @@ String CSSMediaRule::serialized() const StringBuilder builder; // 1. The string "@media", followed by a single SPACE (U+0020). - builder.append("@media "); + builder.append("@media "sv); // 2. The result of performing serialize a media query list on rule’s media query list. builder.append(condition_text()); // 3. A single SPACE (U+0020), followed by the string "{", i.e., LEFT CURLY BRACKET (U+007B), followed by a newline. - builder.append(" {\n"); + builder.append(" {\n"sv); // 4. The result of performing serialize a CSS rule on each rule in the rule’s cssRules list, separated by a newline and indented by two spaces. for (size_t i = 0; i < css_rules().length(); i++) { auto rule = css_rules().item(i); if (i != 0) - builder.append("\n"); - builder.append(" "); + builder.append("\n"sv); + builder.append(" "sv); builder.append(rule->css_text()); } // 5. A newline, followed by the string "}", i.e., RIGHT CURLY BRACKET (U+007D) - builder.append("\n}"); + builder.append("\n}"sv); return builder.to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h index 23a3ff7b07..3bd7214243 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h @@ -27,7 +27,7 @@ public: virtual ~CSSMediaRule() = default; - virtual StringView class_name() const override { return "CSSMediaRule"; }; + virtual StringView class_name() const override { return "CSSMediaRule"sv; }; virtual Type type() const override { return Type::Media; }; virtual String condition_text() const override; diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h index 0da22ce5b5..bb40ad01cb 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h @@ -38,7 +38,7 @@ public: virtual Optional<StyleProperty> property(PropertyID) const = 0; - virtual DOM::ExceptionOr<void> set_property(PropertyID, StringView css_text, StringView priority = "") = 0; + virtual DOM::ExceptionOr<void> set_property(PropertyID, StringView css_text, StringView priority = ""sv) = 0; virtual DOM::ExceptionOr<String> remove_property(PropertyID) = 0; DOM::ExceptionOr<void> set_property(StringView property_name, StringView css_text, StringView priority); diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h index 5f61504a57..090c15db1f 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h @@ -32,7 +32,7 @@ public: NonnullRefPtrVector<Selector> const& selectors() const { return m_selectors; } CSSStyleDeclaration const& declaration() const { return m_declaration; } - virtual StringView class_name() const override { return "CSSStyleRule"; }; + virtual StringView class_name() const override { return "CSSStyleRule"sv; }; virtual Type type() const override { return Type::Style; }; String selector_text() const; diff --git a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp index f38759415f..b00611f32e 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp @@ -34,17 +34,17 @@ String CSSSupportsRule::serialized() const StringBuilder builder; - builder.append("@supports "); + builder.append("@supports "sv); builder.append(condition_text()); - builder.append(" {\n"); + builder.append(" {\n"sv); for (size_t i = 0; i < css_rules().length(); i++) { auto rule = css_rules().item(i); if (i != 0) - builder.append("\n"); - builder.append(" "); + builder.append("\n"sv); + builder.append(" "sv); builder.append(rule->css_text()); } - builder.append("\n}"); + builder.append("\n}"sv); return builder.to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h index 23d4704a43..6bc3b1ea4c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h @@ -30,7 +30,7 @@ public: virtual ~CSSSupportsRule() = default; - virtual StringView class_name() const override { return "CSSSupportsRule"; }; + virtual StringView class_name() const override { return "CSSSupportsRule"sv; }; virtual Type type() const override { return Type::Supports; }; String condition_text() const override; diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp index 417a1c388d..2e25c02d23 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp @@ -284,14 +284,14 @@ String MediaCondition::to_string() const builder.append(feature->to_string()); break; case Type::Not: - builder.append("not "); + builder.append("not "sv); builder.append(conditions.first().to_string()); break; case Type::And: - builder.join(" and ", conditions); + builder.join(" and "sv, conditions); break; case Type::Or: - builder.join(" or ", conditions); + builder.join(" or "sv, conditions); break; case Type::GeneralEnclosed: builder.append(general_enclosed->to_string()); @@ -323,12 +323,12 @@ String MediaQuery::to_string() const StringBuilder builder; if (m_negated) - builder.append("not "); + builder.append("not "sv); if (m_negated || m_media_type != MediaType::All || !m_media_condition) { builder.append(CSS::to_string(m_media_type)); if (m_media_condition) - builder.append(" and "); + builder.append(" and "sv); } if (m_media_condition) { @@ -386,7 +386,7 @@ String serialize_a_media_query_list(NonnullRefPtrVector<MediaQuery> const& media // 2. Serialize each media query in the list of media queries, in the same order as they // appear in the media query list, and then serialize the list. StringBuilder builder; - builder.join(", ", media_queries); + builder.join(", "sv, media_queries); return builder.to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp index 47778a9177..89fe5e74eb 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp @@ -24,11 +24,11 @@ String Declaration::to_string() const StringBuilder builder; serialize_an_identifier(builder, m_name); - builder.append(": "); - builder.join(" ", m_values); + builder.append(": "sv); + builder.join(' ', m_values); if (m_important == Important::Yes) - builder.append(" !important"); + builder.append(" !important"sv); return builder.to_string(); } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index ca41f9317c..2bf5e59f0b 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -409,9 +409,9 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_attribute_simple_se auto const& case_sensitivity_part = attribute_tokens.next_token(); if (case_sensitivity_part.is(Token::Type::Ident)) { auto case_sensitivity = case_sensitivity_part.token().ident(); - if (case_sensitivity.equals_ignoring_case("i")) { + if (case_sensitivity.equals_ignoring_case("i"sv)) { simple_selector.attribute().case_type = Selector::SimpleSelector::Attribute::CaseType::CaseInsensitiveMatch; - } else if (case_sensitivity.equals_ignoring_case("s")) { + } else if (case_sensitivity.equals_ignoring_case("s"sv)) { simple_selector.attribute().case_type = Selector::SimpleSelector::Attribute::CaseType::CaseSensitiveMatch; } else { dbgln_if(CSS_PARSER_DEBUG, "Expected a \"i\" or \"s\" attribute selector case sensitivity identifier, got: '{}'", case_sensitivity_part.to_debug_string()); @@ -490,39 +490,39 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_pseudo_simple_selec }; }; - if (pseudo_name.equals_ignoring_case("active")) { + if (pseudo_name.equals_ignoring_case("active"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Active); - } else if (pseudo_name.equals_ignoring_case("checked")) { + } else if (pseudo_name.equals_ignoring_case("checked"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Checked); - } else if (pseudo_name.equals_ignoring_case("disabled")) { + } else if (pseudo_name.equals_ignoring_case("disabled"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Disabled); - } else if (pseudo_name.equals_ignoring_case("empty")) { + } else if (pseudo_name.equals_ignoring_case("empty"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Empty); - } else if (pseudo_name.equals_ignoring_case("enabled")) { + } else if (pseudo_name.equals_ignoring_case("enabled"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Enabled); - } else if (pseudo_name.equals_ignoring_case("first-child")) { + } else if (pseudo_name.equals_ignoring_case("first-child"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::FirstChild); - } else if (pseudo_name.equals_ignoring_case("first-of-type")) { + } else if (pseudo_name.equals_ignoring_case("first-of-type"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::FirstOfType); - } else if (pseudo_name.equals_ignoring_case("focus")) { + } else if (pseudo_name.equals_ignoring_case("focus"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Focus); - } else if (pseudo_name.equals_ignoring_case("focus-within")) { + } else if (pseudo_name.equals_ignoring_case("focus-within"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::FocusWithin); - } else if (pseudo_name.equals_ignoring_case("hover")) { + } else if (pseudo_name.equals_ignoring_case("hover"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Hover); - } else if (pseudo_name.equals_ignoring_case("last-child")) { + } else if (pseudo_name.equals_ignoring_case("last-child"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::LastChild); - } else if (pseudo_name.equals_ignoring_case("last-of-type")) { + } else if (pseudo_name.equals_ignoring_case("last-of-type"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::LastOfType); - } else if (pseudo_name.equals_ignoring_case("link")) { + } else if (pseudo_name.equals_ignoring_case("link"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Link); - } else if (pseudo_name.equals_ignoring_case("only-child")) { + } else if (pseudo_name.equals_ignoring_case("only-child"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::OnlyChild); - } else if (pseudo_name.equals_ignoring_case("only-of-type")) { + } else if (pseudo_name.equals_ignoring_case("only-of-type"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::OnlyOfType); - } else if (pseudo_name.equals_ignoring_case("root")) { + } else if (pseudo_name.equals_ignoring_case("root"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Root); - } else if (pseudo_name.equals_ignoring_case("visited")) { + } else if (pseudo_name.equals_ignoring_case("visited"sv)) { return make_pseudo_class_selector(Selector::SimpleSelector::PseudoClass::Type::Visited); } @@ -605,7 +605,7 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_pseudo_simple_selec : Selector::SimpleSelector::PseudoClass::Type::Where, .argument_selector_list = move(argument_selector_list) } }; - } else if (pseudo_function.name().equals_ignoring_case("not")) { + } else if (pseudo_function.name().equals_ignoring_case("not"sv)) { auto function_token_stream = TokenStream(pseudo_function.values()); auto not_selector = TRY(parse_a_selector_list(function_token_stream, SelectorType::Standalone)); @@ -817,7 +817,7 @@ NonnullRefPtr<MediaQuery> Parser::parse_media_query(TokenStream<ComponentValue>& return media_query; // `[ and <media-condition-without-or> ]?` - if (auto maybe_and = tokens.next_token(); maybe_and.is(Token::Type::Ident) && maybe_and.token().ident().equals_ignoring_case("and")) { + if (auto maybe_and = tokens.next_token(); maybe_and.is(Token::Type::Ident) && maybe_and.token().ident().equals_ignoring_case("and"sv)) { if (auto media_condition = parse_media_condition(tokens, MediaCondition::AllowOr::No)) { tokens.skip_whitespace(); if (tokens.has_next_token()) @@ -964,12 +964,12 @@ Optional<MediaFeature> Parser::parse_media_feature(TokenStream<ComponentValue>& return MediaFeatureName { MediaFeatureName::Type::Normal, id.value() }; } - if (allow_min_max_prefix && (name.starts_with("min-", CaseSensitivity::CaseInsensitive) || name.starts_with("max-", CaseSensitivity::CaseInsensitive))) { + if (allow_min_max_prefix && (name.starts_with("min-"sv, CaseSensitivity::CaseInsensitive) || name.starts_with("max-"sv, CaseSensitivity::CaseInsensitive))) { auto adjusted_name = name.substring_view(4); if (auto id = media_feature_id_from_string(adjusted_name); id.has_value() && media_feature_type_is_range(id.value())) { transaction.commit(); return MediaFeatureName { - name.starts_with("min-", CaseSensitivity::CaseInsensitive) ? MediaFeatureName::Type::Min : MediaFeatureName::Type::Max, + name.starts_with("min-"sv, CaseSensitivity::CaseInsensitive) ? MediaFeatureName::Type::Min : MediaFeatureName::Type::Max, id.value() }; } @@ -1345,7 +1345,7 @@ OwnPtr<Supports::Condition> Parser::parse_supports_condition(TokenStream<Compone auto& peeked_token = tokens.peek_token(); // `not <supports-in-parens>` - if (peeked_token.is(Token::Type::Ident) && peeked_token.token().ident().equals_ignoring_case("not")) { + if (peeked_token.is(Token::Type::Ident) && peeked_token.token().ident().equals_ignoring_case("not"sv)) { tokens.next_token(); tokens.skip_whitespace(); auto child = parse_supports_in_parens(tokens); @@ -1367,9 +1367,9 @@ OwnPtr<Supports::Condition> Parser::parse_supports_condition(TokenStream<Compone if (!token.is(Token::Type::Ident)) return {}; auto ident = token.token().ident(); - if (ident.equals_ignoring_case("and")) + if (ident.equals_ignoring_case("and"sv)) return Supports::Condition::Type::And; - if (ident.equals_ignoring_case("or")) + if (ident.equals_ignoring_case("or"sv)) return Supports::Condition::Type::Or; return {}; }; @@ -1957,7 +1957,7 @@ Optional<Declaration> Parser::consume_a_declaration(TokenStream<T>& tokens) Optional<size_t> important_index; for (size_t i = declaration_values.size() - 1; i > 0; i--) { auto value = declaration_values[i]; - if (value.is(Token::Type::Ident) && value.token().ident().equals_ignoring_case("important")) { + if (value.is(Token::Type::Ident) && value.token().ident().equals_ignoring_case("important"sv)) { important_index = i; break; } @@ -2314,7 +2314,7 @@ Optional<AK::URL> Parser::parse_url_function(ComponentValue const& component_val // FIXME: Handle data: urls (RFC2397) auto convert_string_to_url = [&](StringView& url_string) -> Optional<AK::URL> { - if (url_string.starts_with("data:", CaseSensitivity::CaseInsensitive)) { + if (url_string.starts_with("data:"sv, CaseSensitivity::CaseInsensitive)) { auto data_url = AK::URL(url_string); switch (allowed_data_url_type) { @@ -2337,7 +2337,7 @@ Optional<AK::URL> Parser::parse_url_function(ComponentValue const& component_val auto url_string = component_value.token().url(); return convert_string_to_url(url_string); } - if (component_value.is_function() && component_value.function().name().equals_ignoring_case("url")) { + if (component_value.is_function() && component_value.function().name().equals_ignoring_case("url"sv)) { auto& function_values = component_value.function().values(); // FIXME: Handle url-modifiers. https://www.w3.org/TR/css-values-4/#url-modifiers for (size_t i = 0; i < function_values.size(); ++i) { @@ -2509,7 +2509,7 @@ Optional<StyleProperty> Parser::convert_to_style_property(Declaration const& dec auto property_id = property_id_from_string(property_name); if (property_id == PropertyID::Invalid) { - if (property_name.starts_with("--")) { + if (property_name.starts_with("--"sv)) { property_id = PropertyID::Custom; } else if (has_ignored_vendor_prefix(property_name)) { return {}; @@ -2542,11 +2542,11 @@ RefPtr<StyleValue> Parser::parse_builtin_value(ComponentValue const& component_v { if (component_value.is(Token::Type::Ident)) { auto ident = component_value.token().ident(); - if (ident.equals_ignoring_case("inherit")) + if (ident.equals_ignoring_case("inherit"sv)) return InheritStyleValue::the(); - if (ident.equals_ignoring_case("initial")) + if (ident.equals_ignoring_case("initial"sv)) return InitialStyleValue::the(); - if (ident.equals_ignoring_case("unset")) + if (ident.equals_ignoring_case("unset"sv)) return UnsetStyleValue::the(); // FIXME: Implement `revert` and `revert-layer` keywords, from Cascade4 and Cascade5 respectively } @@ -2595,10 +2595,10 @@ RefPtr<StyleValue> Parser::parse_dynamic_value(ComponentValue const& component_v if (component_value.is_function()) { auto& function = component_value.function(); - if (function.name().equals_ignoring_case("calc")) + if (function.name().equals_ignoring_case("calc"sv)) return parse_calculated_value(function.values()); - if (function.name().equals_ignoring_case("var")) { + if (function.name().equals_ignoring_case("var"sv)) { // Declarations using `var()` should already be parsed as an UnresolvedStyleValue before this point. VERIFY_NOT_REACHED(); } @@ -2658,7 +2658,7 @@ Optional<Length> Parser::parse_length(ComponentValue const& component_value) return dimension->length(); // FIXME: auto isn't a length! - if (component_value.is(Token::Type::Ident) && component_value.token().ident().equals_ignoring_case("auto")) + if (component_value.is(Token::Type::Ident) && component_value.token().ident().equals_ignoring_case("auto"sv)) return Length::make_auto(); return {}; @@ -2751,7 +2751,7 @@ Optional<UnicodeRange> Parser::parse_unicode_range(TokenStream<ComponentValue>& // All options start with 'u'/'U'. auto& u = tokens.next_token(); - if (!(u.is(Token::Type::Ident) && u.token().ident().equals_ignoring_case("u"))) { + if (!(u.is(Token::Type::Ident) && u.token().ident().equals_ignoring_case("u"sv))) { dbgln_if(CSS_PARSER_DEBUG, "CSSParser: <urange> does not start with 'u'"); return {}; } @@ -2883,7 +2883,7 @@ Optional<UnicodeRange> Parser::parse_unicode_range(StringView text) // 2. Interpret the consumed code points as a hexadecimal number, // with the U+003F QUESTION MARK (?) code points replaced by U+0030 DIGIT ZERO (0) code points. // This is the start value. - auto start_value_string = start_value_code_points.replace("?", "0", ReplaceMode::All); + auto start_value_string = start_value_code_points.replace("?"sv, "0"sv, ReplaceMode::All); auto maybe_start_value = AK::StringUtils::convert_to_uint_from_hex<u32>(start_value_string); if (!maybe_start_value.has_value()) { dbgln_if(CSS_PARSER_DEBUG, "CSSParser: <urange> ?-converted start value did not parse as hex number."); @@ -2894,7 +2894,7 @@ Optional<UnicodeRange> Parser::parse_unicode_range(StringView text) // 3. Interpret the consumed code points as a hexadecimal number again, // with the U+003F QUESTION MARK (?) code points replaced by U+0046 LATIN CAPITAL LETTER F (F) code points. // This is the end value. - auto end_value_string = start_value_code_points.replace("?", "F", ReplaceMode::All); + auto end_value_string = start_value_code_points.replace("?"sv, "F"sv, ReplaceMode::All); auto maybe_end_value = AK::StringUtils::convert_to_uint_from_hex<u32>(end_value_string); if (!maybe_end_value.has_value()) { dbgln_if(CSS_PARSER_DEBUG, "CSSParser: <urange> ?-converted end value did not parse as hex number."); @@ -2965,7 +2965,7 @@ RefPtr<StyleValue> Parser::parse_dimension_value(ComponentValue const& component if (component_value.is(Token::Type::Number) && !(m_context.in_quirks_mode() && property_has_quirk(m_context.current_property_id(), Quirk::UnitlessLength))) return {}; - if (component_value.is(Token::Type::Ident) && component_value.token().ident().equals_ignoring_case("auto")) + if (component_value.is(Token::Type::Ident) && component_value.token().ident().equals_ignoring_case("auto"sv)) return LengthStyleValue::create(Length::make_auto()); auto dimension = parse_dimension(component_value); @@ -4770,7 +4770,7 @@ RefPtr<StyleValue> Parser::parse_transform_value(Vector<ComponentValue> const& c tokens.skip_whitespace(); auto& part = tokens.next_token(); - if (part.is(Token::Type::Ident) && part.token().ident().equals_ignoring_case("none")) { + if (part.is(Token::Type::Ident) && part.token().ident().equals_ignoring_case("none"sv)) { if (!transformations.is_empty()) return nullptr; tokens.skip_whitespace(); @@ -5306,11 +5306,11 @@ Optional<Selector::SimpleSelector::ANPlusBPattern> Parser::parse_a_n_plus_b_patt // odd | even if (first_value.is(Token::Type::Ident)) { auto ident = first_value.token().ident(); - if (ident.equals_ignoring_case("odd")) { + if (ident.equals_ignoring_case("odd"sv)) { transaction.commit(); return Selector::SimpleSelector::ANPlusBPattern { 2, 1 }; } - if (ident.equals_ignoring_case("even")) { + if (ident.equals_ignoring_case("even"sv)) { transaction.commit(); return Selector::SimpleSelector::ANPlusBPattern { 2, 0 }; } @@ -5781,9 +5781,9 @@ bool Parser::has_ignored_vendor_prefix(StringView string) { if (!string.starts_with('-')) return false; - if (string.starts_with("--")) + if (string.starts_with("--"sv)) return false; - if (string.starts_with("-libweb-")) + if (string.starts_with("-libweb-"sv)) return false; return true; } @@ -5800,7 +5800,7 @@ RefPtr<StyleValue> Parser::parse_css_value(Badge<StyleComputer>, ParsingContext if (tokens.is_empty() || property_id == CSS::PropertyID::Invalid || property_id == CSS::PropertyID::Custom) return {}; - Parser parser(context, ""); + Parser parser(context, ""sv); TokenStream<ComponentValue> token_stream { tokens }; auto result = parser.parse_css_value(property_id, token_stream); if (result.is_error()) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp index a99c774da6..29131fcea2 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp @@ -429,7 +429,7 @@ Token Tokenizer::consume_an_ident_like_token() // If string’s value is an ASCII case-insensitive match for "url", and the next input code // point is U+0028 LEFT PARENTHESIS ((), consume it. - if (string.equals_ignoring_case("url") && is_left_paren(peek_code_point())) { + if (string.equals_ignoring_case("url"sv) && is_left_paren(peek_code_point())) { (void)next_code_point(); // While the next two input code points are whitespace, consume the next input code point. diff --git a/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp b/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp index 50e4c65da4..6a638b164c 100644 --- a/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp +++ b/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp @@ -10,9 +10,9 @@ namespace Web::CSS { PreferredColorScheme preferred_color_scheme_from_string(String const& value) { - if (value.equals_ignoring_case("light")) + if (value.equals_ignoring_case("light"sv)) return PreferredColorScheme::Light; - if (value.equals_ignoring_case("dark")) + if (value.equals_ignoring_case("dark"sv)) return PreferredColorScheme::Dark; return PreferredColorScheme::Auto; } diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index a95bc52311..5788972027 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -151,22 +151,22 @@ String Selector::SimpleSelector::serialize() const if (!attribute.value.is_null()) { switch (attribute.match_type) { case Selector::SimpleSelector::Attribute::MatchType::ExactValueMatch: - s.append("="); + s.append("="sv); break; case Selector::SimpleSelector::Attribute::MatchType::ContainsWord: - s.append("~="); + s.append("~="sv); break; case Selector::SimpleSelector::Attribute::MatchType::ContainsString: - s.append("*="); + s.append("*="sv); break; case Selector::SimpleSelector::Attribute::MatchType::StartsWithSegment: - s.append("|="); + s.append("|="sv); break; case Selector::SimpleSelector::Attribute::MatchType::StartsWithString: - s.append("^="); + s.append("^="sv); break; case Selector::SimpleSelector::Attribute::MatchType::EndsWithString: - s.append("$="); + s.append("$="sv); break; default: break; @@ -180,10 +180,10 @@ String Selector::SimpleSelector::serialize() const // (the line just above is an addition to CSS OM to match Selectors Level 4 last draft) switch (attribute.case_type) { case Selector::SimpleSelector::Attribute::CaseType::CaseInsensitiveMatch: - s.append(" i"); + s.append(" i"sv); break; case Selector::SimpleSelector::Attribute::CaseType::CaseSensitiveMatch: - s.append(" s"); + s.append(" s"sv); break; default: break; @@ -304,16 +304,16 @@ String Selector::serialize() const // so we have to check that one. switch (compound_selectors()[i + 1].combinator) { case Selector::Combinator::ImmediateChild: - s.append("> "); + s.append("> "sv); break; case Selector::Combinator::NextSibling: - s.append("+ "); + s.append("+ "sv); break; case Selector::Combinator::SubsequentSibling: - s.append("~ "); + s.append("~ "sv); break; case Selector::Combinator::Column: - s.append("|| "); + s.append("|| "sv); break; default: break; @@ -322,7 +322,7 @@ String Selector::serialize() const // 4. If this is the last part of the chain of the selector and there is a pseudo-element, // append "::" followed by the name of the pseudo-element, to s. if (compound_selector.simple_selectors.last().type == Selector::SimpleSelector::Type::PseudoElement) { - s.append("::"); + s.append("::"sv); s.append(pseudo_element_name(compound_selector.simple_selectors.last().pseudo_element())); } } @@ -336,21 +336,21 @@ String serialize_a_group_of_selectors(NonnullRefPtrVector<Selector> const& selec { // To serialize a group of selectors serialize each selector in the group of selectors and then serialize a comma-separated list of these serializations. StringBuilder builder; - builder.join(", ", selectors); + builder.join(", "sv, selectors); return builder.to_string(); } Optional<Selector::PseudoElement> pseudo_element_from_string(StringView name) { - if (name.equals_ignoring_case("after")) { + if (name.equals_ignoring_case("after"sv)) { return Selector::PseudoElement::After; - } else if (name.equals_ignoring_case("before")) { + } else if (name.equals_ignoring_case("before"sv)) { return Selector::PseudoElement::Before; - } else if (name.equals_ignoring_case("first-letter")) { + } else if (name.equals_ignoring_case("first-letter"sv)) { return Selector::PseudoElement::FirstLetter; - } else if (name.equals_ignoring_case("first-line")) { + } else if (name.equals_ignoring_case("first-line"sv)) { return Selector::PseudoElement::FirstLine; - } else if (name.equals_ignoring_case("marker")) { + } else if (name.equals_ignoring_case("marker"sv)) { return Selector::PseudoElement::Marker; } return {}; diff --git a/Userland/Libraries/LibWeb/CSS/Selector.h b/Userland/Libraries/LibWeb/CSS/Selector.h index 47e42ac9bd..4d42a58f8c 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.h +++ b/Userland/Libraries/LibWeb/CSS/Selector.h @@ -61,7 +61,7 @@ public: result.append("n"); // - A is -1: Append "-n" to result. else if (step_size == -1) - result.append("-n"); + result.append("-n"sv); // - A is non-zero: Serialize A and append it to result, then append "n" to result. else if (step_size != 0) result.appendff("{}n", step_size); diff --git a/Userland/Libraries/LibWeb/CSS/Serialize.cpp b/Userland/Libraries/LibWeb/CSS/Serialize.cpp index e43a5e03c3..dfb1e34843 100644 --- a/Userland/Libraries/LibWeb/CSS/Serialize.cpp +++ b/Userland/Libraries/LibWeb/CSS/Serialize.cpp @@ -112,7 +112,7 @@ void serialize_a_url(StringBuilder& builder, StringView url) { // To serialize a URL means to create a string represented by "url(", // followed by the serialization of the URL as a string, followed by ")". - builder.append("url("); + builder.append("url("sv); serialize_a_string(builder, url.to_string()); builder.append(')'); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index bf5dde38c0..a77b9ef4da 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -563,7 +563,7 @@ bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView p if (!custom_property_name_token.is(Parser::Token::Type::Ident)) return false; auto custom_property_name = custom_property_name_token.token().ident(); - if (!custom_property_name.starts_with("--")) + if (!custom_property_name.starts_with("--"sv)) return false; // Detect dependency cycles. https://www.w3.org/TR/css-variables-1/#cycles @@ -962,15 +962,15 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele } } - int slope = Gfx::name_to_slope("Normal"); + int slope = Gfx::name_to_slope("Normal"sv); // FIXME: Implement oblique <angle> if (font_style->is_identifier()) { switch (static_cast<IdentifierStyleValue const&>(*font_style).id()) { case CSS::ValueID::Italic: - slope = Gfx::name_to_slope("Italic"); + slope = Gfx::name_to_slope("Italic"sv); break; case CSS::ValueID::Oblique: - slope = Gfx::name_to_slope("Oblique"); + slope = Gfx::name_to_slope("Oblique"sv); break; case CSS::ValueID::Normal: default: diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index e11563aecd..d5f030dd34 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -272,7 +272,7 @@ String BackgroundStyleValue::to_string() const StringBuilder builder; for (size_t i = 0; i < m_layer_count; i++) { if (i) - builder.append(", "); + builder.append(", "sv); if (i == m_layer_count - 1) builder.appendff("{} ", m_color->to_string()); builder.appendff("{} {} {} {} {} {} {}", get_layer_value_string(m_image, i), get_layer_value_string(m_position, i), get_layer_value_string(m_size, i), get_layer_value_string(m_repeat, i), get_layer_value_string(m_attachment, i), get_layer_value_string(m_origin, i), get_layer_value_string(m_clip, i)); @@ -1530,7 +1530,7 @@ String ShadowStyleValue::to_string() const StringBuilder builder; builder.appendff("{} {} {} {} {}", m_color.to_string(), m_offset_x.to_string(), m_offset_y.to_string(), m_blur_radius.to_string(), m_spread_distance.to_string()); if (m_placement == ShadowPlacement::Inner) - builder.append(" inset"); + builder.append(" inset"sv); return builder.to_string(); } @@ -1582,7 +1582,7 @@ String TransformationStyleValue::to_string() const StringBuilder builder; builder.append(CSS::to_string(m_transform_function)); builder.append('('); - builder.join(", ", m_values); + builder.join(", "sv, m_values); builder.append(')'); return builder.to_string(); diff --git a/Userland/Libraries/LibWeb/CSS/Supports.cpp b/Userland/Libraries/LibWeb/CSS/Supports.cpp index eb1a7ea6e6..81793ba47d 100644 --- a/Userland/Libraries/LibWeb/CSS/Supports.cpp +++ b/Userland/Libraries/LibWeb/CSS/Supports.cpp @@ -101,9 +101,9 @@ String Supports::Condition::to_string() const case Type::Not: return String::formatted("not {}", children.first().to_string()); case Type::And: - return String::join(" and ", children); + return String::join(" and "sv, children); case Type::Or: - return String::join(" or ", children); + return String::join(" or "sv, children); } VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp b/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp index 5bd22141de..206fbd78bb 100644 --- a/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp +++ b/Userland/Libraries/LibWeb/Cookie/ParsedCookie.cpp @@ -131,17 +131,17 @@ void parse_attributes(ParsedCookie& parsed_cookie, StringView unparsed_attribute void process_attribute(ParsedCookie& parsed_cookie, StringView attribute_name, StringView attribute_value) { - if (attribute_name.equals_ignoring_case("Expires")) { + if (attribute_name.equals_ignoring_case("Expires"sv)) { on_expires_attribute(parsed_cookie, attribute_value); - } else if (attribute_name.equals_ignoring_case("Max-Age")) { + } else if (attribute_name.equals_ignoring_case("Max-Age"sv)) { on_max_age_attribute(parsed_cookie, attribute_value); - } else if (attribute_name.equals_ignoring_case("Domain")) { + } else if (attribute_name.equals_ignoring_case("Domain"sv)) { on_domain_attribute(parsed_cookie, attribute_value); - } else if (attribute_name.equals_ignoring_case("Path")) { + } else if (attribute_name.equals_ignoring_case("Path"sv)) { on_path_attribute(parsed_cookie, attribute_value); - } else if (attribute_name.equals_ignoring_case("Secure")) { + } else if (attribute_name.equals_ignoring_case("Secure"sv)) { on_secure_attribute(parsed_cookie); - } else if (attribute_name.equals_ignoring_case("HttpOnly")) { + } else if (attribute_name.equals_ignoring_case("HttpOnly"sv)) { on_http_only_attribute(parsed_cookie); } } diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 5800965f1d..7beae1e601 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -50,7 +50,7 @@ public: HTML }; - static NonnullRefPtr<Document> create(const AK::URL& url = "about:blank") + static NonnullRefPtr<Document> create(const AK::URL& url = "about:blank"sv) { return adopt_ref(*new Document(url)); } @@ -190,7 +190,7 @@ public: JS::Realm& realm(); JS::Interpreter& interpreter(); - JS::Value run_javascript(StringView source, StringView filename = "(unknown)"); + JS::Value run_javascript(StringView source, StringView filename = "(unknown)"sv); ExceptionOr<NonnullRefPtr<Element>> create_element(String const& tag_name); ExceptionOr<NonnullRefPtr<Element>> create_element_ns(String const& namespace_, String const& qualified_name); diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 469bf9a9de..2b9e8262ad 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -685,10 +685,10 @@ void Element::serialize_pseudo_elements_as_json(JsonArraySerializer<StringBuilde if (!pseudo_element_node) continue; auto object = MUST(children_array.add_object()); - MUST(object.add("name", String::formatted("::{}", CSS::pseudo_element_name(static_cast<CSS::Selector::PseudoElement>(i))))); - MUST(object.add("type", "pseudo-element")); - MUST(object.add("parent-id", id())); - MUST(object.add("pseudo-element", i)); + MUST(object.add("name"sv, String::formatted("::{}", CSS::pseudo_element_name(static_cast<CSS::Selector::PseudoElement>(i))))); + MUST(object.add("type"sv, "pseudo-element")); + MUST(object.add("parent-id"sv, id())); + MUST(object.add("pseudo-element"sv, i)); MUST(object.finish()); } } diff --git a/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp b/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp index 52bd6a3913..8ae3f2b254 100644 --- a/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp @@ -187,13 +187,13 @@ void EventDispatcher::invoke(Event::PathEntry& struct_, Event& event, Event::Pha // 2. If event’s type attribute value is a match for any of the strings in the first column in the following table, // set event’s type attribute value to the string in the second column on the same row as the matching string, and return otherwise. if (event.type() == "animationend") - event.set_type("webkitAnimationEnd"); + event.set_type("webkitAnimationEnd"sv); else if (event.type() == "animationiteration") - event.set_type("webkitAnimationIteration"); + event.set_type("webkitAnimationIteration"sv); else if (event.type() == "animationstart") - event.set_type("webkitAnimationStart"); + event.set_type("webkitAnimationStart"sv); else if (event.type() == "transitionend") - event.set_type("webkitTransitionEnd"); + event.set_type("webkitTransitionEnd"sv); else return; diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index bc1d78258b..8f6f5a5d2e 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -987,16 +987,16 @@ bool Node::is_uninteresting_whitespace_node() const void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) const { - MUST(object.add("name", node_name().view())); - MUST(object.add("id", id())); + MUST(object.add("name"sv, node_name().view())); + MUST(object.add("id"sv, id())); if (is_document()) { - MUST(object.add("type", "document")); + MUST(object.add("type"sv, "document")); } else if (is_element()) { - MUST(object.add("type", "element")); + MUST(object.add("type"sv, "element")); auto const* element = static_cast<DOM::Element const*>(this); if (element->has_attributes()) { - auto attributes = MUST(object.add_object("attributes")); + auto attributes = MUST(object.add_object("attributes"sv)); element->for_each_attribute([&attributes](auto& name, auto& value) { MUST(attributes.add(name, value)); }); @@ -1006,7 +1006,7 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c if (element->is_browsing_context_container()) { auto const* container = static_cast<HTML::BrowsingContextContainer const*>(element); if (auto const* content_document = container->content_document()) { - auto children = MUST(object.add_array("children")); + auto children = MUST(object.add_array("children"sv)); JsonObjectSerializer<StringBuilder> content_document_object = MUST(children.add_object()); content_document->serialize_tree_as_json(content_document_object); MUST(content_document_object.finish()); @@ -1014,10 +1014,10 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c } } } else if (is_text()) { - MUST(object.add("type", "text")); + MUST(object.add("type"sv, "text")); auto text_node = static_cast<DOM::Text const*>(this); - MUST(object.add("text", text_node->data())); + MUST(object.add("text"sv, text_node->data())); } else if (is_comment()) { MUST(object.add("type"sv, "comment"sv)); MUST(object.add("data"sv, static_cast<DOM::Comment const&>(*this).data())); @@ -1026,7 +1026,7 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c MUST((object.add("visible"sv, !!layout_node()))); if (has_child_nodes()) { - auto children = MUST(object.add_array("children")); + auto children = MUST(object.add_array("children"sv)); for_each_child([&children](DOM::Node& child) { if (child.is_uninteresting_whitespace_node()) return; diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index e0d625b4c0..bbb6bfeaea 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -35,7 +35,7 @@ namespace Web { static void indent(StringBuilder& builder, int levels) { for (int i = 0; i < levels; i++) - builder.append(" "); + builder.append(" "sv); } void dump_tree(DOM::Node const& node) @@ -49,13 +49,13 @@ void dump_tree(StringBuilder& builder, DOM::Node const& node) { static int indent = 0; for (int i = 0; i < indent; ++i) - builder.append(" "); + builder.append(" "sv); if (is<DOM::Element>(node)) { builder.appendff("<{}", verify_cast<DOM::Element>(node).local_name()); verify_cast<DOM::Element>(node).for_each_attribute([&](auto& name, auto& value) { builder.appendff(" {}={}", name, value); }); - builder.append(">\n"); + builder.append(">\n"sv); } else if (is<DOM::Text>(node)) { builder.appendff("\"{}\"\n", verify_cast<DOM::Text>(node).data()); } else { @@ -89,7 +89,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho { static size_t indent = 0; for (size_t i = 0; i < indent; ++i) - builder.append(" "); + builder.append(" "sv); FlyString tag_name; if (layout_node.is_anonymous()) @@ -115,28 +115,28 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho identifier = builder.to_string(); } - char const* nonbox_color_on = ""; - char const* box_color_on = ""; - char const* svg_box_color_on = ""; - char const* positioned_color_on = ""; - char const* floating_color_on = ""; - char const* inline_block_color_on = ""; - char const* line_box_color_on = ""; - char const* fragment_color_on = ""; - char const* flex_color_on = ""; - char const* color_off = ""; + StringView nonbox_color_on = ""sv; + StringView box_color_on = ""sv; + StringView svg_box_color_on = ""sv; + StringView positioned_color_on = ""sv; + StringView floating_color_on = ""sv; + StringView inline_block_color_on = ""sv; + StringView line_box_color_on = ""sv; + StringView fragment_color_on = ""sv; + StringView flex_color_on = ""sv; + StringView color_off = ""sv; if (interactive) { - nonbox_color_on = "\033[33m"; - box_color_on = "\033[34m"; - svg_box_color_on = "\033[31m"; - positioned_color_on = "\033[31;1m"; - floating_color_on = "\033[32;1m"; - inline_block_color_on = "\033[36;1m"; - line_box_color_on = "\033[34;1m"; - fragment_color_on = "\033[35;1m"; - flex_color_on = "\033[34;1m"; - color_off = "\033[0m"; + nonbox_color_on = "\033[33m"sv; + box_color_on = "\033[34m"sv; + svg_box_color_on = "\033[31m"sv; + positioned_color_on = "\033[31;1m"sv; + floating_color_on = "\033[32;1m"sv; + inline_block_color_on = "\033[36;1m"sv; + line_box_color_on = "\033[34;1m"sv; + fragment_color_on = "\033[35;1m"sv; + flex_color_on = "\033[34;1m"sv; + color_off = "\033[0m"sv; } if (!is<Layout::Box>(layout_node)) { @@ -150,7 +150,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho color_off); if (interactive) builder.appendff(" @{:p}", &layout_node); - builder.append("\n"); + builder.append("\n"sv); } else { auto& box = verify_cast<Layout::Box>(layout_node); StringView color_on = is<Layout::SVGBox>(box) ? svg_box_color_on : box_color_on; @@ -226,7 +226,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho builder.appendff(" children: {}", box.children_are_inline() ? "inline" : "not-inline"); - builder.append("\n"); + builder.append("\n"sv); } if (is<Layout::BlockContainer>(layout_node) && static_cast<Layout::BlockContainer const&>(layout_node).children_are_inline()) { @@ -234,7 +234,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho for (size_t line_box_index = 0; block.paint_box() && line_box_index < block.paint_box()->line_boxes().size(); ++line_box_index) { auto& line_box = block.paint_box()->line_boxes()[line_box_index]; for (size_t i = 0; i < indent; ++i) - builder.append(" "); + builder.append(" "sv); builder.appendff(" {}line {}{} width: {}, height: {}, bottom: {}, baseline: {}\n", line_box_color_on, line_box_index, @@ -246,7 +246,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho for (size_t fragment_index = 0; fragment_index < line_box.fragments().size(); ++fragment_index) { auto& fragment = line_box.fragments()[fragment_index]; for (size_t i = 0; i < indent; ++i) - builder.append(" "); + builder.append(" "sv); builder.appendff(" {}frag {}{} from {} ", fragment_color_on, fragment_index, @@ -260,7 +260,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho fragment.absolute_rect().to_string()); if (is<Layout::TextNode>(fragment.layout_node())) { for (size_t i = 0; i < indent; ++i) - builder.append(" "); + builder.append(" "sv); auto& layout_text = static_cast<Layout::TextNode const&>(fragment.layout_node()); auto fragment_text = layout_text.text_for_rendering().substring(fragment.start(), fragment.length()); builder.appendff(" \"{}\"\n", fragment_text); @@ -282,7 +282,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho for (auto& property : properties) { for (size_t i = 0; i < indent; ++i) - builder.append(" "); + builder.append(" "sv); builder.appendff(" ({}: {})\n", property.name, property.value); } } @@ -303,10 +303,10 @@ void dump_selector(CSS::Selector const& selector) void dump_selector(StringBuilder& builder, CSS::Selector const& selector) { - builder.append(" CSS::Selector:\n"); + builder.append(" CSS::Selector:\n"sv); for (auto& relative_selector : selector.compound_selectors()) { - builder.append(" "); + builder.append(" "sv); char const* relation_description = ""; switch (relative_selector.combinator) { @@ -455,22 +455,22 @@ void dump_selector(StringBuilder& builder, CSS::Selector const& selector) } else if (pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::Not || pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::Is || pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::Where) { - builder.append("(["); + builder.append("(["sv); for (auto& selector : pseudo_class.argument_selector_list) dump_selector(builder, selector); - builder.append("])"); + builder.append("])"sv); } else if ((pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::NthChild) || (pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::NthLastChild) || (pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::NthOfType) || (pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::NthLastOfType)) { builder.appendff("(step={}, offset={}", pseudo_class.nth_child_pattern.step_size, pseudo_class.nth_child_pattern.offset); if (!pseudo_class.argument_selector_list.is_empty()) { - builder.append(", selectors=["); + builder.append(", selectors=["sv); for (auto const& child_selector : pseudo_class.argument_selector_list) dump_selector(builder, child_selector); - builder.append("]"); + builder.append("]"sv); } - builder.append(")"); + builder.append(")"sv); } } @@ -529,9 +529,9 @@ void dump_selector(StringBuilder& builder, CSS::Selector const& selector) } if (i != relative_selector.simple_selectors.size() - 1) - builder.append(", "); + builder.append(", "sv); } - builder.append("\n"); + builder.append("\n"sv); } } @@ -573,14 +573,14 @@ void dump_font_face_rule(StringBuilder& builder, CSS::CSSFontFaceRule const& rul builder.appendff("font-family: {}\n", font_face.font_family()); indent(builder, indent_levels + 1); - builder.append("sources:\n"); + builder.append("sources:\n"sv); for (auto const& source : font_face.sources()) { indent(builder, indent_levels + 2); builder.appendff("url={}, format={}\n", source.url, source.format.value_or("???")); } indent(builder, indent_levels + 1); - builder.append("unicode-ranges:\n"); + builder.append("unicode-ranges:\n"sv); for (auto const& unicode_range : font_face.unicode_ranges()) { indent(builder, indent_levels + 2); builder.appendff("{}\n", unicode_range.to_string()); @@ -619,20 +619,20 @@ void dump_style_rule(StringBuilder& builder, CSS::CSSStyleRule const& rule, int dump_selector(builder, selector); } indent(builder, indent_levels); - builder.append(" Declarations:\n"); + builder.append(" Declarations:\n"sv); auto& style_declaration = verify_cast<CSS::PropertyOwningCSSStyleDeclaration>(rule.declaration()); for (auto& property : style_declaration.properties()) { indent(builder, indent_levels); builder.appendff(" {}: '{}'", CSS::string_from_property_id(property.property_id), property.value->to_string()); if (property.important == CSS::Important::Yes) - builder.append(" \033[31;1m!important\033[0m"); + builder.append(" \033[31;1m!important\033[0m"sv); builder.append('\n'); } for (auto& property : style_declaration.custom_properties()) { indent(builder, indent_levels); builder.appendff(" {}: '{}'", property.key, property.value.value->to_string()); if (property.value.important == CSS::Important::Yes) - builder.append(" \033[31;1m!important\033[0m"); + builder.append(" \033[31;1m!important\033[0m"sv); builder.append('\n'); } } diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp index 9ab9efc219..7fc9d22c62 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -35,7 +35,7 @@ NonnullRefPtr<DOM::Document> DOMParser::parse_from_string(String const& string, // 4. Start parser and let it run until it has consumed all the characters just inserted into the input stream. // FIXME: This is to match the default URL. Instead, pass in this's relevant global object's associated Document's URL. - parser->run("about:blank"); + parser->run("about:blank"sv); } else { // -> Otherwise diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index 297a24a73a..bf9ef0b5e6 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -27,7 +27,7 @@ Vector<DOMStringMap::NameValuePair> DOMStringMap::get_name_value_pairs() const // in the order that those attributes are listed in the element's attribute list, add a name-value pair to list whose name is the attribute's name with the first five characters removed and whose value // is the attribute's value. m_associated_element->for_each_attribute([&](auto& name, auto& value) { - if (!name.starts_with("data-")) + if (!name.starts_with("data-"sv)) return; auto name_after_starting_data = name.view().substring_view(5); @@ -102,7 +102,7 @@ DOM::ExceptionOr<void> DOMStringMap::set_value_of_new_named_property(String cons // 3. Insert the string data- at the front of name. // NOTE: This is done out of order because StringBuilder doesn't have prepend. - builder.append("data-"); + builder.append("data-"sv); for (size_t character_index = 0; character_index < name.length(); ++character_index) { // 1. If name contains a U+002D HYPHEN-MINUS character (-) followed by an ASCII lower alpha, then throw a "SyntaxError" DOMException. @@ -147,7 +147,7 @@ bool DOMStringMap::delete_existing_named_property(String const& name) // 2. Insert the string data- at the front of name. // NOTE: This is done out of order because StringBuilder doesn't have prepend. - builder.append("data-"); + builder.append("data-"sv); for (auto character : name) { // 1. For each ASCII upper alpha in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace the character with the same character converted to ASCII lowercase. diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 9ff7ae3a03..5d2bc8959d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -22,15 +22,15 @@ HTMLBodyElement::~HTMLBodyElement() = default; void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) const { for_each_attribute([&](auto& name, auto& value) { - if (name.equals_ignoring_case("bgcolor")) { + if (name.equals_ignoring_case("bgcolor"sv)) { auto color = Color::from_string(value); if (color.has_value()) style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value())); - } else if (name.equals_ignoring_case("text")) { + } else if (name.equals_ignoring_case("text"sv)) { auto color = Color::from_string(value); if (color.has_value()) style.set_property(CSS::PropertyID::Color, CSS::ColorStyleValue::create(color.value())); - } else if (name.equals_ignoring_case("background")) { + } else if (name.equals_ignoring_case("background"sv)) { VERIFY(m_background_style_value); style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value); } @@ -40,19 +40,19 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co void HTMLBodyElement::parse_attribute(FlyString const& name, String const& value) { HTMLElement::parse_attribute(name, value); - if (name.equals_ignoring_case("link")) { + if (name.equals_ignoring_case("link"sv)) { auto color = Color::from_string(value); if (color.has_value()) document().set_link_color(color.value()); - } else if (name.equals_ignoring_case("alink")) { + } else if (name.equals_ignoring_case("alink"sv)) { auto color = Color::from_string(value); if (color.has_value()) document().set_active_link_color(color.value()); - } else if (name.equals_ignoring_case("vlink")) { + } else if (name.equals_ignoring_case("vlink"sv)) { auto color = Color::from_string(value); if (color.has_value()) document().set_visited_link_color(color.value()); - } else if (name.equals_ignoring_case("background")) { + } else if (name.equals_ignoring_case("background"sv)) { m_background_style_value = CSS::ImageStyleValue::create(document().parse_url(value)); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp index 0057e1fcb3..419f4a607c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp @@ -56,7 +56,7 @@ String HTMLButtonElement::type() const auto value = attribute(HTML::AttributeNames::type); #define __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(keyword, _) \ - if (value.equals_ignoring_case(#keyword)) \ + if (value.equals_ignoring_case(#keyword##sv)) \ return #keyword; ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTES #undef __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE @@ -70,7 +70,7 @@ HTMLButtonElement::TypeAttributeState HTMLButtonElement::type_state() const auto value = attribute(HTML::AttributeNames::type); #define __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(keyword, state) \ - if (value.equals_ignoring_case(#keyword)) \ + if (value.equals_ignoring_case(#keyword##sv)) \ return HTMLButtonElement::TypeAttributeState::state; ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTES #undef __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index ed1efe27c2..935b45d32d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -40,10 +40,10 @@ HTMLElement::ContentEditableState HTMLElement::content_editable_state() const { auto contenteditable = attribute(HTML::AttributeNames::contenteditable); // "true", an empty string or a missing value map to the "true" state. - if ((!contenteditable.is_null() && contenteditable.is_empty()) || contenteditable.equals_ignoring_case("true")) + if ((!contenteditable.is_null() && contenteditable.is_empty()) || contenteditable.equals_ignoring_case("true"sv)) return ContentEditableState::True; // "false" maps to the "false" state. - if (contenteditable.equals_ignoring_case("false")) + if (contenteditable.equals_ignoring_case("false"sv)) return ContentEditableState::False; // Having no such attribute or an invalid value maps to the "inherit" state. return ContentEditableState::Inherit; @@ -80,15 +80,15 @@ String HTMLElement::content_editable() const // https://html.spec.whatwg.org/multipage/interaction.html#contenteditable DOM::ExceptionOr<void> HTMLElement::set_content_editable(String const& content_editable) { - if (content_editable.equals_ignoring_case("inherit")) { + if (content_editable.equals_ignoring_case("inherit"sv)) { remove_attribute(HTML::AttributeNames::contenteditable); return {}; } - if (content_editable.equals_ignoring_case("true")) { + if (content_editable.equals_ignoring_case("true"sv)) { set_attribute(HTML::AttributeNames::contenteditable, "true"); return {}; } - if (content_editable.equals_ignoring_case("false")) { + if (content_editable.equals_ignoring_case("false"sv)) { set_attribute(HTML::AttributeNames::contenteditable, "false"); return {}; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp index 181f5a4157..a0c139863c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp @@ -20,7 +20,7 @@ HTMLFontElement::~HTMLFontElement() = default; void HTMLFontElement::apply_presentational_hints(CSS::StyleProperties& style) const { for_each_attribute([&](auto& name, auto& value) { - if (name.equals_ignoring_case("color")) { + if (name.equals_ignoring_case("color"sv)) { auto color = Color::from_string(value); if (color.has_value()) style.set_property(CSS::PropertyID::Color, CSS::ColorStyleValue::create(color.value())); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index 253f385c49..b678522bd2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -167,7 +167,7 @@ static bool is_form_control(DOM::Element const& element) } if (is<HTMLInputElement>(element) - && !element.get_attribute(HTML::AttributeNames::type).equals_ignoring_case("image")) { + && !element.get_attribute(HTML::AttributeNames::type).equals_ignoring_case("image"sv)) { return true; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index b4c05eeef5..766f45d40c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -227,7 +227,7 @@ void HTMLInputElement::parse_attribute(FlyString const& name, String const& valu HTMLInputElement::TypeAttributeState HTMLInputElement::parse_type_attribute(StringView type) { #define __ENUMERATE_HTML_INPUT_TYPE_ATTRIBUTE(keyword, state) \ - if (type.equals_ignoring_case(#keyword)) \ + if (type.equals_ignoring_case(#keyword##sv)) \ return HTMLInputElement::TypeAttributeState::state; ENUMERATE_HTML_INPUT_TYPE_ATTRIBUTES #undef __ENUMERATE_HTML_INPUT_TYPE_ATTRIBUTE diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 860999cd0a..14f5fcdb46 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -175,7 +175,7 @@ void HTMLObjectElement::resource_did_load() // FIXME: For now, ignore application/ MIME types as we cannot render yet them anyways. We will need to implement the MIME type sniffing // algorithm in order to map all unknown MIME types to "application/octet-stream". - else if (auto type = resource()->mime_type(); !type.starts_with("application/")) + else if (auto type = resource()->mime_type(); !type.starts_with("application/"sv)) tentative_type = move(type); // 2. If tentative type is not application/octet-stream, then let resource type be tentative type and jump to the step below labeled handler. @@ -195,7 +195,7 @@ static bool is_xml_mime_type(StringView resource_type) return false; // An XML MIME type is any MIME type whose subtype ends in "+xml" or whose essence is "text/xml" or "application/xml". [RFC7303] - if (mime_type->subtype().ends_with("+xml")) + if (mime_type->subtype().ends_with("+xml"sv)) return true; return mime_type->essence().is_one_of("text/xml"sv, "application/xml"sv); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 32fa015405..79018bbd64 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -162,7 +162,7 @@ void HTMLScriptElement::prepare_script() if (is_javascript_mime_type_essence_match(script_block_type.trim_whitespace())) { // - If the script block's type string with leading and trailing ASCII whitespace stripped is a JavaScript MIME type essence match, the script's type is "classic". m_script_type = ScriptType::Classic; - } else if (script_block_type.equals_ignoring_case("module")) { + } else if (script_block_type.equals_ignoring_case("module"sv)) { // - If the script block's type string is an ASCII case-insensitive match for the string "module", the script's type is "module". m_script_type = ScriptType::Module; } else { @@ -217,13 +217,13 @@ void HTMLScriptElement::prepare_script() event = event.trim_whitespace(); // 4. If for is not an ASCII case-insensitive match for the string "window", then return. The script is not executed. - if (!for_.equals_ignoring_case("window")) { + if (!for_.equals_ignoring_case("window"sv)) { dbgln("HTMLScriptElement: Refusing to run classic script because the provided 'for' attribute is not equal to 'window'"); return; } // 5. If event is not an ASCII case-insensitive match for either the string "onload" or the string "onload()", then return. The script is not executed. - if (!event.equals_ignoring_case("onload") && !event.equals_ignoring_case("onload()")) { + if (!event.equals_ignoring_case("onload"sv) && !event.equals_ignoring_case("onload()"sv)) { dbgln("HTMLScriptElement: Refusing to run classic script because the provided 'event' attribute is not equal to 'onload' or 'onload()'"); return; } diff --git a/Userland/Libraries/LibWeb/HTML/Parser/Entities.cpp b/Userland/Libraries/LibWeb/HTML/Parser/Entities.cpp index 6371b62d8f..d4852639db 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/Entities.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/Entities.cpp @@ -16,2144 +16,2144 @@ Optional<EntityMatch> code_points_from_entity(StringView entity) StringView entity; u32 code_point; } single_code_point_entities[] = { - { "AElig;", 0x000C6 }, - { "AElig", 0x000C6 }, - { "AMP;", 0x00026 }, - { "AMP", 0x00026 }, - { "Aacute;", 0x000C1 }, - { "Aacute", 0x000C1 }, - { "Abreve;", 0x00102 }, - { "Acirc;", 0x000C2 }, - { "Acirc", 0x000C2 }, - { "Acy;", 0x00410 }, - { "Afr;", 0x1D504 }, - { "Agrave;", 0x000C0 }, - { "Agrave", 0x000C0 }, - { "Alpha;", 0x00391 }, - { "Amacr;", 0x00100 }, - { "And;", 0x02A53 }, - { "Aogon;", 0x00104 }, - { "Aopf;", 0x1D538 }, - { "ApplyFunction;", 0x02061 }, - { "Aring;", 0x000C5 }, - { "Aring", 0x000C5 }, - { "Ascr;", 0x1D49C }, - { "Assign;", 0x02254 }, - { "Atilde;", 0x000C3 }, - { "Atilde", 0x000C3 }, - { "Auml;", 0x000C4 }, - { "Auml", 0x000C4 }, - { "Backslash;", 0x02216 }, - { "Barv;", 0x02AE7 }, - { "Barwed;", 0x02306 }, - { "Bcy;", 0x00411 }, - { "Because;", 0x02235 }, - { "Bernoullis;", 0x0212C }, - { "Beta;", 0x00392 }, - { "Bfr;", 0x1D505 }, - { "Bopf;", 0x1D539 }, - { "Breve;", 0x002D8 }, - { "Bscr;", 0x0212C }, - { "Bumpeq;", 0x0224E }, - { "CHcy;", 0x00427 }, - { "COPY;", 0x000A9 }, - { "COPY", 0x000A9 }, - { "Cacute;", 0x00106 }, - { "Cap;", 0x022D2 }, - { "CapitalDifferentialD;", 0x02145 }, - { "Cayleys;", 0x0212D }, - { "Ccaron;", 0x0010C }, - { "Ccedil;", 0x000C7 }, - { "Ccedil", 0x000C7 }, - { "Ccirc;", 0x00108 }, - { "Cconint;", 0x02230 }, - { "Cdot;", 0x0010A }, - { "Cedilla;", 0x000B8 }, - { "CenterDot;", 0x000B7 }, - { "Cfr;", 0x0212D }, - { "Chi;", 0x003A7 }, - { "CircleDot;", 0x02299 }, - { "CircleMinus;", 0x02296 }, - { "CirclePlus;", 0x02295 }, - { "CircleTimes;", 0x02297 }, - { "ClockwiseContourIntegral;", 0x02232 }, - { "CloseCurlyDoubleQuote;", 0x0201D }, - { "CloseCurlyQuote;", 0x02019 }, - { "Colon;", 0x02237 }, - { "Colone;", 0x02A74 }, - { "Congruent;", 0x02261 }, - { "Conint;", 0x0222F }, - { "ContourIntegral;", 0x0222E }, - { "Copf;", 0x02102 }, - { "Coproduct;", 0x02210 }, - { "CounterClockwiseContourIntegral;", 0x02233 }, - { "Cross;", 0x02A2F }, - { "Cscr;", 0x1D49E }, - { "Cup;", 0x022D3 }, - { "CupCap;", 0x0224D }, - { "DD;", 0x02145 }, - { "DDotrahd;", 0x02911 }, - { "DJcy;", 0x00402 }, - { "DScy;", 0x00405 }, - { "DZcy;", 0x0040F }, - { "Dagger;", 0x02021 }, - { "Darr;", 0x021A1 }, - { "Dashv;", 0x02AE4 }, - { "Dcaron;", 0x0010E }, - { "Dcy;", 0x00414 }, - { "Del;", 0x02207 }, - { "Delta;", 0x00394 }, - { "Dfr;", 0x1D507 }, - { "DiacriticalAcute;", 0x000B4 }, - { "DiacriticalDot;", 0x002D9 }, - { "DiacriticalDoubleAcute;", 0x002DD }, - { "DiacriticalGrave;", 0x00060 }, - { "DiacriticalTilde;", 0x002DC }, - { "Diamond;", 0x022C4 }, - { "DifferentialD;", 0x02146 }, - { "Dopf;", 0x1D53B }, - { "Dot;", 0x000A8 }, - { "DotDot;", 0x020DC }, - { "DotEqual;", 0x02250 }, - { "DoubleContourIntegral;", 0x0222F }, - { "DoubleDot;", 0x000A8 }, - { "DoubleDownArrow;", 0x021D3 }, - { "DoubleLeftArrow;", 0x021D0 }, - { "DoubleLeftRightArrow;", 0x021D4 }, - { "DoubleLeftTee;", 0x02AE4 }, - { "DoubleLongLeftArrow;", 0x027F8 }, - { "DoubleLongLeftRightArrow;", 0x027FA }, - { "DoubleLongRightArrow;", 0x027F9 }, - { "DoubleRightArrow;", 0x021D2 }, - { "DoubleRightTee;", 0x022A8 }, - { "DoubleUpArrow;", 0x021D1 }, - { "DoubleUpDownArrow;", 0x021D5 }, - { "DoubleVerticalBar;", 0x02225 }, - { "DownArrow;", 0x02193 }, - { "DownArrowBar;", 0x02913 }, - { "DownArrowUpArrow;", 0x021F5 }, - { "DownBreve;", 0x00311 }, - { "DownLeftRightVector;", 0x02950 }, - { "DownLeftTeeVector;", 0x0295E }, - { "DownLeftVector;", 0x021BD }, - { "DownLeftVectorBar;", 0x02956 }, - { "DownRightTeeVector;", 0x0295F }, - { "DownRightVector;", 0x021C1 }, - { "DownRightVectorBar;", 0x02957 }, - { "DownTee;", 0x022A4 }, - { "DownTeeArrow;", 0x021A7 }, - { "Downarrow;", 0x021D3 }, - { "Dscr;", 0x1D49F }, - { "Dstrok;", 0x00110 }, - { "ENG;", 0x0014A }, - { "ETH;", 0x000D0 }, - { "ETH", 0x000D0 }, - { "Eacute;", 0x000C9 }, - { "Eacute", 0x000C9 }, - { "Ecaron;", 0x0011A }, - { "Ecirc;", 0x000CA }, - { "Ecirc", 0x000CA }, - { "Ecy;", 0x0042D }, - { "Edot;", 0x00116 }, - { "Efr;", 0x1D508 }, - { "Egrave;", 0x000C8 }, - { "Egrave", 0x000C8 }, - { "Element;", 0x02208 }, - { "Emacr;", 0x00112 }, - { "EmptySmallSquare;", 0x025FB }, - { "EmptyVerySmallSquare;", 0x025AB }, - { "Eogon;", 0x00118 }, - { "Eopf;", 0x1D53C }, - { "Epsilon;", 0x00395 }, - { "Equal;", 0x02A75 }, - { "EqualTilde;", 0x02242 }, - { "Equilibrium;", 0x021CC }, - { "Escr;", 0x02130 }, - { "Esim;", 0x02A73 }, - { "Eta;", 0x00397 }, - { "Euml;", 0x000CB }, - { "Euml", 0x000CB }, - { "Exists;", 0x02203 }, - { "ExponentialE;", 0x02147 }, - { "Fcy;", 0x00424 }, - { "Ffr;", 0x1D509 }, - { "FilledSmallSquare;", 0x025FC }, - { "FilledVerySmallSquare;", 0x025AA }, - { "Fopf;", 0x1D53D }, - { "ForAll;", 0x02200 }, - { "Fouriertrf;", 0x02131 }, - { "Fscr;", 0x02131 }, - { "GJcy;", 0x00403 }, - { "GT;", 0x0003E }, - { "GT", 0x0003E }, - { "Gamma;", 0x00393 }, - { "Gammad;", 0x003DC }, - { "Gbreve;", 0x0011E }, - { "Gcedil;", 0x00122 }, - { "Gcirc;", 0x0011C }, - { "Gcy;", 0x00413 }, - { "Gdot;", 0x00120 }, - { "Gfr;", 0x1D50A }, - { "Gg;", 0x022D9 }, - { "Gopf;", 0x1D53E }, - { "GreaterEqual;", 0x02265 }, - { "GreaterEqualLess;", 0x022DB }, - { "GreaterFullEqual;", 0x02267 }, - { "GreaterGreater;", 0x02AA2 }, - { "GreaterLess;", 0x02277 }, - { "GreaterSlantEqual;", 0x02A7E }, - { "GreaterTilde;", 0x02273 }, - { "Gscr;", 0x1D4A2 }, - { "Gt;", 0x0226B }, - { "HARDcy;", 0x0042A }, - { "Hacek;", 0x002C7 }, - { "Hat;", 0x0005E }, - { "Hcirc;", 0x00124 }, - { "Hfr;", 0x0210C }, - { "HilbertSpace;", 0x0210B }, - { "Hopf;", 0x0210D }, - { "HorizontalLine;", 0x02500 }, - { "Hscr;", 0x0210B }, - { "Hstrok;", 0x00126 }, - { "HumpDownHump;", 0x0224E }, - { "HumpEqual;", 0x0224F }, - { "IEcy;", 0x00415 }, - { "IJlig;", 0x00132 }, - { "IOcy;", 0x00401 }, - { "Iacute;", 0x000CD }, - { "Iacute", 0x000CD }, - { "Icirc;", 0x000CE }, - { "Icirc", 0x000CE }, - { "Icy;", 0x00418 }, - { "Idot;", 0x00130 }, - { "Ifr;", 0x02111 }, - { "Igrave;", 0x000CC }, - { "Igrave", 0x000CC }, - { "Im;", 0x02111 }, - { "Imacr;", 0x0012A }, - { "ImaginaryI;", 0x02148 }, - { "Implies;", 0x021D2 }, - { "Int;", 0x0222C }, - { "Integral;", 0x0222B }, - { "Intersection;", 0x022C2 }, - { "InvisibleComma;", 0x02063 }, - { "InvisibleTimes;", 0x02062 }, - { "Iogon;", 0x0012E }, - { "Iopf;", 0x1D540 }, - { "Iota;", 0x00399 }, - { "Iscr;", 0x02110 }, - { "Itilde;", 0x00128 }, - { "Iukcy;", 0x00406 }, - { "Iuml;", 0x000CF }, - { "Iuml", 0x000CF }, - { "Jcirc;", 0x00134 }, - { "Jcy;", 0x00419 }, - { "Jfr;", 0x1D50D }, - { "Jopf;", 0x1D541 }, - { "Jscr;", 0x1D4A5 }, - { "Jsercy;", 0x00408 }, - { "Jukcy;", 0x00404 }, - { "KHcy;", 0x00425 }, - { "KJcy;", 0x0040C }, - { "Kappa;", 0x0039A }, - { "Kcedil;", 0x00136 }, - { "Kcy;", 0x0041A }, - { "Kfr;", 0x1D50E }, - { "Kopf;", 0x1D542 }, - { "Kscr;", 0x1D4A6 }, - { "LJcy;", 0x00409 }, - { "LT;", 0x0003C }, - { "LT", 0x0003C }, - { "Lacute;", 0x00139 }, - { "Lambda;", 0x0039B }, - { "Lang;", 0x027EA }, - { "Laplacetrf;", 0x02112 }, - { "Larr;", 0x0219E }, - { "Lcaron;", 0x0013D }, - { "Lcedil;", 0x0013B }, - { "Lcy;", 0x0041B }, - { "LeftAngleBracket;", 0x027E8 }, - { "LeftArrow;", 0x02190 }, - { "LeftArrowBar;", 0x021E4 }, - { "LeftArrowRightArrow;", 0x021C6 }, - { "LeftCeiling;", 0x02308 }, - { "LeftDoubleBracket;", 0x027E6 }, - { "LeftDownTeeVector;", 0x02961 }, - { "LeftDownVector;", 0x021C3 }, - { "LeftDownVectorBar;", 0x02959 }, - { "LeftFloor;", 0x0230A }, - { "LeftRightArrow;", 0x02194 }, - { "LeftRightVector;", 0x0294E }, - { "LeftTee;", 0x022A3 }, - { "LeftTeeArrow;", 0x021A4 }, - { "LeftTeeVector;", 0x0295A }, - { "LeftTriangle;", 0x022B2 }, - { "LeftTriangleBar;", 0x029CF }, - { "LeftTriangleEqual;", 0x022B4 }, - { "LeftUpDownVector;", 0x02951 }, - { "LeftUpTeeVector;", 0x02960 }, - { "LeftUpVector;", 0x021BF }, - { "LeftUpVectorBar;", 0x02958 }, - { "LeftVector;", 0x021BC }, - { "LeftVectorBar;", 0x02952 }, - { "Leftarrow;", 0x021D0 }, - { "Leftrightarrow;", 0x021D4 }, - { "LessEqualGreater;", 0x022DA }, - { "LessFullEqual;", 0x02266 }, - { "LessGreater;", 0x02276 }, - { "LessLess;", 0x02AA1 }, - { "LessSlantEqual;", 0x02A7D }, - { "LessTilde;", 0x02272 }, - { "Lfr;", 0x1D50F }, - { "Ll;", 0x022D8 }, - { "Lleftarrow;", 0x021DA }, - { "Lmidot;", 0x0013F }, - { "LongLeftArrow;", 0x027F5 }, - { "LongLeftRightArrow;", 0x027F7 }, - { "LongRightArrow;", 0x027F6 }, - { "Longleftarrow;", 0x027F8 }, - { "Longleftrightarrow;", 0x027FA }, - { "Longrightarrow;", 0x027F9 }, - { "Lopf;", 0x1D543 }, - { "LowerLeftArrow;", 0x02199 }, - { "LowerRightArrow;", 0x02198 }, - { "Lscr;", 0x02112 }, - { "Lsh;", 0x021B0 }, - { "Lstrok;", 0x00141 }, - { "Lt;", 0x0226A }, - { "Map;", 0x02905 }, - { "Mcy;", 0x0041C }, - { "MediumSpace;", 0x0205F }, - { "Mellintrf;", 0x02133 }, - { "Mfr;", 0x1D510 }, - { "MinusPlus;", 0x02213 }, - { "Mopf;", 0x1D544 }, - { "Mscr;", 0x02133 }, - { "Mu;", 0x0039C }, - { "NJcy;", 0x0040A }, - { "Nacute;", 0x00143 }, - { "Ncaron;", 0x00147 }, - { "Ncedil;", 0x00145 }, - { "Ncy;", 0x0041D }, - { "NegativeMediumSpace;", 0x0200B }, - { "NegativeThickSpace;", 0x0200B }, - { "NegativeThinSpace;", 0x0200B }, - { "NegativeVeryThinSpace;", 0x0200B }, - { "NestedGreaterGreater;", 0x0226B }, - { "NestedLessLess;", 0x0226A }, - { "NewLine;", 0x0000A }, - { "Nfr;", 0x1D511 }, - { "NoBreak;", 0x02060 }, - { "NonBreakingSpace;", 0x000A0 }, - { "Nopf;", 0x02115 }, - { "Not;", 0x02AEC }, - { "NotCongruent;", 0x02262 }, - { "NotCupCap;", 0x0226D }, - { "NotDoubleVerticalBar;", 0x02226 }, - { "NotElement;", 0x02209 }, - { "NotEqual;", 0x02260 }, - { "NotExists;", 0x02204 }, - { "NotGreater;", 0x0226F }, - { "NotGreaterEqual;", 0x02271 }, - { "NotGreaterLess;", 0x02279 }, - { "NotGreaterTilde;", 0x02275 }, - { "NotLeftTriangle;", 0x022EA }, - { "NotLeftTriangleEqual;", 0x022EC }, - { "NotLess;", 0x0226E }, - { "NotLessEqual;", 0x02270 }, - { "NotLessGreater;", 0x02278 }, - { "NotLessTilde;", 0x02274 }, - { "NotPrecedes;", 0x02280 }, - { "NotPrecedesSlantEqual;", 0x022E0 }, - { "NotReverseElement;", 0x0220C }, - { "NotRightTriangle;", 0x022EB }, - { "NotRightTriangleEqual;", 0x022ED }, - { "NotSquareSubsetEqual;", 0x022E2 }, - { "NotSquareSupersetEqual;", 0x022E3 }, - { "NotSubsetEqual;", 0x02288 }, - { "NotSucceeds;", 0x02281 }, - { "NotSucceedsSlantEqual;", 0x022E1 }, - { "NotSupersetEqual;", 0x02289 }, - { "NotTilde;", 0x02241 }, - { "NotTildeEqual;", 0x02244 }, - { "NotTildeFullEqual;", 0x02247 }, - { "NotTildeTilde;", 0x02249 }, - { "NotVerticalBar;", 0x02224 }, - { "Nscr;", 0x1D4A9 }, - { "Ntilde;", 0x000D1 }, - { "Ntilde", 0x000D1 }, - { "Nu;", 0x0039D }, - { "OElig;", 0x00152 }, - { "Oacute;", 0x000D3 }, - { "Oacute", 0x000D3 }, - { "Ocirc;", 0x000D4 }, - { "Ocirc", 0x000D4 }, - { "Ocy;", 0x0041E }, - { "Odblac;", 0x00150 }, - { "Ofr;", 0x1D512 }, - { "Ograve;", 0x000D2 }, - { "Ograve", 0x000D2 }, - { "Omacr;", 0x0014C }, - { "Omega;", 0x003A9 }, - { "Omicron;", 0x0039F }, - { "Oopf;", 0x1D546 }, - { "OpenCurlyDoubleQuote;", 0x0201C }, - { "OpenCurlyQuote;", 0x02018 }, - { "Or;", 0x02A54 }, - { "Oscr;", 0x1D4AA }, - { "Oslash;", 0x000D8 }, - { "Oslash", 0x000D8 }, - { "Otilde;", 0x000D5 }, - { "Otilde", 0x000D5 }, - { "Otimes;", 0x02A37 }, - { "Ouml;", 0x000D6 }, - { "Ouml", 0x000D6 }, - { "OverBar;", 0x0203E }, - { "OverBrace;", 0x023DE }, - { "OverBracket;", 0x023B4 }, - { "OverParenthesis;", 0x023DC }, - { "PartialD;", 0x02202 }, - { "Pcy;", 0x0041F }, - { "Pfr;", 0x1D513 }, - { "Phi;", 0x003A6 }, - { "Pi;", 0x003A0 }, - { "PlusMinus;", 0x000B1 }, - { "Poincareplane;", 0x0210C }, - { "Popf;", 0x02119 }, - { "Pr;", 0x02ABB }, - { "Precedes;", 0x0227A }, - { "PrecedesEqual;", 0x02AAF }, - { "PrecedesSlantEqual;", 0x0227C }, - { "PrecedesTilde;", 0x0227E }, - { "Prime;", 0x02033 }, - { "Product;", 0x0220F }, - { "Proportion;", 0x02237 }, - { "Proportional;", 0x0221D }, - { "Pscr;", 0x1D4AB }, - { "Psi;", 0x003A8 }, - { "QUOT;", 0x00022 }, - { "QUOT", 0x00022 }, - { "Qfr;", 0x1D514 }, - { "Qopf;", 0x0211A }, - { "Qscr;", 0x1D4AC }, - { "RBarr;", 0x02910 }, - { "REG;", 0x000AE }, - { "REG", 0x000AE }, - { "Racute;", 0x00154 }, - { "Rang;", 0x027EB }, - { "Rarr;", 0x021A0 }, - { "Rarrtl;", 0x02916 }, - { "Rcaron;", 0x00158 }, - { "Rcedil;", 0x00156 }, - { "Rcy;", 0x00420 }, - { "Re;", 0x0211C }, - { "ReverseElement;", 0x0220B }, - { "ReverseEquilibrium;", 0x021CB }, - { "ReverseUpEquilibrium;", 0x0296F }, - { "Rfr;", 0x0211C }, - { "Rho;", 0x003A1 }, - { "RightAngleBracket;", 0x027E9 }, - { "RightArrow;", 0x02192 }, - { "RightArrowBar;", 0x021E5 }, - { "RightArrowLeftArrow;", 0x021C4 }, - { "RightCeiling;", 0x02309 }, - { "RightDoubleBracket;", 0x027E7 }, - { "RightDownTeeVector;", 0x0295D }, - { "RightDownVector;", 0x021C2 }, - { "RightDownVectorBar;", 0x02955 }, - { "RightFloor;", 0x0230B }, - { "RightTee;", 0x022A2 }, - { "RightTeeArrow;", 0x021A6 }, - { "RightTeeVector;", 0x0295B }, - { "RightTriangle;", 0x022B3 }, - { "RightTriangleBar;", 0x029D0 }, - { "RightTriangleEqual;", 0x022B5 }, - { "RightUpDownVector;", 0x0294F }, - { "RightUpTeeVector;", 0x0295C }, - { "RightUpVector;", 0x021BE }, - { "RightUpVectorBar;", 0x02954 }, - { "RightVector;", 0x021C0 }, - { "RightVectorBar;", 0x02953 }, - { "Rightarrow;", 0x021D2 }, - { "Ropf;", 0x0211D }, - { "RoundImplies;", 0x02970 }, - { "Rrightarrow;", 0x021DB }, - { "Rscr;", 0x0211B }, - { "Rsh;", 0x021B1 }, - { "RuleDelayed;", 0x029F4 }, - { "SHCHcy;", 0x00429 }, - { "SHcy;", 0x00428 }, - { "SOFTcy;", 0x0042C }, - { "Sacute;", 0x0015A }, - { "Sc;", 0x02ABC }, - { "Scaron;", 0x00160 }, - { "Scedil;", 0x0015E }, - { "Scirc;", 0x0015C }, - { "Scy;", 0x00421 }, - { "Sfr;", 0x1D516 }, - { "ShortDownArrow;", 0x02193 }, - { "ShortLeftArrow;", 0x02190 }, - { "ShortRightArrow;", 0x02192 }, - { "ShortUpArrow;", 0x02191 }, - { "Sigma;", 0x003A3 }, - { "SmallCircle;", 0x02218 }, - { "Sopf;", 0x1D54A }, - { "Sqrt;", 0x0221A }, - { "Square;", 0x025A1 }, - { "SquareIntersection;", 0x02293 }, - { "SquareSubset;", 0x0228F }, - { "SquareSubsetEqual;", 0x02291 }, - { "SquareSuperset;", 0x02290 }, - { "SquareSupersetEqual;", 0x02292 }, - { "SquareUnion;", 0x02294 }, - { "Sscr;", 0x1D4AE }, - { "Star;", 0x022C6 }, - { "Sub;", 0x022D0 }, - { "Subset;", 0x022D0 }, - { "SubsetEqual;", 0x02286 }, - { "Succeeds;", 0x0227B }, - { "SucceedsEqual;", 0x02AB0 }, - { "SucceedsSlantEqual;", 0x0227D }, - { "SucceedsTilde;", 0x0227F }, - { "SuchThat;", 0x0220B }, - { "Sum;", 0x02211 }, - { "Sup;", 0x022D1 }, - { "Superset;", 0x02283 }, - { "SupersetEqual;", 0x02287 }, - { "Supset;", 0x022D1 }, - { "THORN;", 0x000DE }, - { "THORN", 0x000DE }, - { "TRADE;", 0x02122 }, - { "TSHcy;", 0x0040B }, - { "TScy;", 0x00426 }, - { "Tab;", 0x00009 }, - { "Tau;", 0x003A4 }, - { "Tcaron;", 0x00164 }, - { "Tcedil;", 0x00162 }, - { "Tcy;", 0x00422 }, - { "Tfr;", 0x1D517 }, - { "Therefore;", 0x02234 }, - { "Theta;", 0x00398 }, - { "ThinSpace;", 0x02009 }, - { "Tilde;", 0x0223C }, - { "TildeEqual;", 0x02243 }, - { "TildeFullEqual;", 0x02245 }, - { "TildeTilde;", 0x02248 }, - { "Topf;", 0x1D54B }, - { "TripleDot;", 0x020DB }, - { "Tscr;", 0x1D4AF }, - { "Tstrok;", 0x00166 }, - { "Uacute;", 0x000DA }, - { "Uacute", 0x000DA }, - { "Uarr;", 0x0219F }, - { "Uarrocir;", 0x02949 }, - { "Ubrcy;", 0x0040E }, - { "Ubreve;", 0x0016C }, - { "Ucirc;", 0x000DB }, - { "Ucirc", 0x000DB }, - { "Ucy;", 0x00423 }, - { "Udblac;", 0x00170 }, - { "Ufr;", 0x1D518 }, - { "Ugrave;", 0x000D9 }, - { "Ugrave", 0x000D9 }, - { "Umacr;", 0x0016A }, - { "UnderBar;", 0x0005F }, - { "UnderBrace;", 0x023DF }, - { "UnderBracket;", 0x023B5 }, - { "UnderParenthesis;", 0x023DD }, - { "Union;", 0x022C3 }, - { "UnionPlus;", 0x0228E }, - { "Uogon;", 0x00172 }, - { "Uopf;", 0x1D54C }, - { "UpArrow;", 0x02191 }, - { "UpArrowBar;", 0x02912 }, - { "UpArrowDownArrow;", 0x021C5 }, - { "UpDownArrow;", 0x02195 }, - { "UpEquilibrium;", 0x0296E }, - { "UpTee;", 0x022A5 }, - { "UpTeeArrow;", 0x021A5 }, - { "Uparrow;", 0x021D1 }, - { "Updownarrow;", 0x021D5 }, - { "UpperLeftArrow;", 0x02196 }, - { "UpperRightArrow;", 0x02197 }, - { "Upsi;", 0x003D2 }, - { "Upsilon;", 0x003A5 }, - { "Uring;", 0x0016E }, - { "Uscr;", 0x1D4B0 }, - { "Utilde;", 0x00168 }, - { "Uuml;", 0x000DC }, - { "Uuml", 0x000DC }, - { "VDash;", 0x022AB }, - { "Vbar;", 0x02AEB }, - { "Vcy;", 0x00412 }, - { "Vdash;", 0x022A9 }, - { "Vdashl;", 0x02AE6 }, - { "Vee;", 0x022C1 }, - { "Verbar;", 0x02016 }, - { "Vert;", 0x02016 }, - { "VerticalBar;", 0x02223 }, - { "VerticalLine;", 0x0007C }, - { "VerticalSeparator;", 0x02758 }, - { "VerticalTilde;", 0x02240 }, - { "VeryThinSpace;", 0x0200A }, - { "Vfr;", 0x1D519 }, - { "Vopf;", 0x1D54D }, - { "Vscr;", 0x1D4B1 }, - { "Vvdash;", 0x022AA }, - { "Wcirc;", 0x00174 }, - { "Wedge;", 0x022C0 }, - { "Wfr;", 0x1D51A }, - { "Wopf;", 0x1D54E }, - { "Wscr;", 0x1D4B2 }, - { "Xfr;", 0x1D51B }, - { "Xi;", 0x0039E }, - { "Xopf;", 0x1D54F }, - { "Xscr;", 0x1D4B3 }, - { "YAcy;", 0x0042F }, - { "YIcy;", 0x00407 }, - { "YUcy;", 0x0042E }, - { "Yacute;", 0x000DD }, - { "Yacute", 0x000DD }, - { "Ycirc;", 0x00176 }, - { "Ycy;", 0x0042B }, - { "Yfr;", 0x1D51C }, - { "Yopf;", 0x1D550 }, - { "Yscr;", 0x1D4B4 }, - { "Yuml;", 0x00178 }, - { "ZHcy;", 0x00416 }, - { "Zacute;", 0x00179 }, - { "Zcaron;", 0x0017D }, - { "Zcy;", 0x00417 }, - { "Zdot;", 0x0017B }, - { "ZeroWidthSpace;", 0x0200B }, - { "Zeta;", 0x00396 }, - { "Zfr;", 0x02128 }, - { "Zopf;", 0x02124 }, - { "Zscr;", 0x1D4B5 }, - { "aacute;", 0x000E1 }, - { "aacute", 0x000E1 }, - { "abreve;", 0x00103 }, - { "ac;", 0x0223E }, - { "acd;", 0x0223F }, - { "acirc;", 0x000E2 }, - { "acirc", 0x000E2 }, - { "acute;", 0x000B4 }, - { "acute", 0x000B4 }, - { "acy;", 0x00430 }, - { "aelig;", 0x000E6 }, - { "aelig", 0x000E6 }, - { "af;", 0x02061 }, - { "afr;", 0x1D51E }, - { "agrave;", 0x000E0 }, - { "agrave", 0x000E0 }, - { "alefsym;", 0x02135 }, - { "aleph;", 0x02135 }, - { "alpha;", 0x003B1 }, - { "amacr;", 0x00101 }, - { "amalg;", 0x02A3F }, - { "amp;", 0x00026 }, - { "amp", 0x00026 }, - { "and;", 0x02227 }, - { "andand;", 0x02A55 }, - { "andd;", 0x02A5C }, - { "andslope;", 0x02A58 }, - { "andv;", 0x02A5A }, - { "ang;", 0x02220 }, - { "ange;", 0x029A4 }, - { "angle;", 0x02220 }, - { "angmsd;", 0x02221 }, - { "angmsdaa;", 0x029A8 }, - { "angmsdab;", 0x029A9 }, - { "angmsdac;", 0x029AA }, - { "angmsdad;", 0x029AB }, - { "angmsdae;", 0x029AC }, - { "angmsdaf;", 0x029AD }, - { "angmsdag;", 0x029AE }, - { "angmsdah;", 0x029AF }, - { "angrt;", 0x0221F }, - { "angrtvb;", 0x022BE }, - { "angrtvbd;", 0x0299D }, - { "angsph;", 0x02222 }, - { "angst;", 0x000C5 }, - { "angzarr;", 0x0237C }, - { "aogon;", 0x00105 }, - { "aopf;", 0x1D552 }, - { "ap;", 0x02248 }, - { "apE;", 0x02A70 }, - { "apacir;", 0x02A6F }, - { "ape;", 0x0224A }, - { "apid;", 0x0224B }, - { "apos;", 0x00027 }, - { "approx;", 0x02248 }, - { "approxeq;", 0x0224A }, - { "aring;", 0x000E5 }, - { "aring", 0x000E5 }, - { "ascr;", 0x1D4B6 }, - { "ast;", 0x0002A }, - { "asymp;", 0x02248 }, - { "asympeq;", 0x0224D }, - { "atilde;", 0x000E3 }, - { "atilde", 0x000E3 }, - { "auml;", 0x000E4 }, - { "auml", 0x000E4 }, - { "awconint;", 0x02233 }, - { "awint;", 0x02A11 }, - { "bNot;", 0x02AED }, - { "backcong;", 0x0224C }, - { "backepsilon;", 0x003F6 }, - { "backprime;", 0x02035 }, - { "backsim;", 0x0223D }, - { "backsimeq;", 0x022CD }, - { "barvee;", 0x022BD }, - { "barwed;", 0x02305 }, - { "barwedge;", 0x02305 }, - { "bbrk;", 0x023B5 }, - { "bbrktbrk;", 0x023B6 }, - { "bcong;", 0x0224C }, - { "bcy;", 0x00431 }, - { "bdquo;", 0x0201E }, - { "becaus;", 0x02235 }, - { "because;", 0x02235 }, - { "bemptyv;", 0x029B0 }, - { "bepsi;", 0x003F6 }, - { "bernou;", 0x0212C }, - { "beta;", 0x003B2 }, - { "beth;", 0x02136 }, - { "between;", 0x0226C }, - { "bfr;", 0x1D51F }, - { "bigcap;", 0x022C2 }, - { "bigcirc;", 0x025EF }, - { "bigcup;", 0x022C3 }, - { "bigodot;", 0x02A00 }, - { "bigoplus;", 0x02A01 }, - { "bigotimes;", 0x02A02 }, - { "bigsqcup;", 0x02A06 }, - { "bigstar;", 0x02605 }, - { "bigtriangledown;", 0x025BD }, - { "bigtriangleup;", 0x025B3 }, - { "biguplus;", 0x02A04 }, - { "bigvee;", 0x022C1 }, - { "bigwedge;", 0x022C0 }, - { "bkarow;", 0x0290D }, - { "blacklozenge;", 0x029EB }, - { "blacksquare;", 0x025AA }, - { "blacktriangle;", 0x025B4 }, - { "blacktriangledown;", 0x025BE }, - { "blacktriangleleft;", 0x025C2 }, - { "blacktriangleright;", 0x025B8 }, - { "blank;", 0x02423 }, - { "blk12;", 0x02592 }, - { "blk14;", 0x02591 }, - { "blk34;", 0x02593 }, - { "block;", 0x02588 }, - { "bnot;", 0x02310 }, - { "bopf;", 0x1D553 }, - { "bot;", 0x022A5 }, - { "bottom;", 0x022A5 }, - { "bowtie;", 0x022C8 }, - { "boxDL;", 0x02557 }, - { "boxDR;", 0x02554 }, - { "boxDl;", 0x02556 }, - { "boxDr;", 0x02553 }, - { "boxH;", 0x02550 }, - { "boxHD;", 0x02566 }, - { "boxHU;", 0x02569 }, - { "boxHd;", 0x02564 }, - { "boxHu;", 0x02567 }, - { "boxUL;", 0x0255D }, - { "boxUR;", 0x0255A }, - { "boxUl;", 0x0255C }, - { "boxUr;", 0x02559 }, - { "boxV;", 0x02551 }, - { "boxVH;", 0x0256C }, - { "boxVL;", 0x02563 }, - { "boxVR;", 0x02560 }, - { "boxVh;", 0x0256B }, - { "boxVl;", 0x02562 }, - { "boxVr;", 0x0255F }, - { "boxbox;", 0x029C9 }, - { "boxdL;", 0x02555 }, - { "boxdR;", 0x02552 }, - { "boxdl;", 0x02510 }, - { "boxdr;", 0x0250C }, - { "boxh;", 0x02500 }, - { "boxhD;", 0x02565 }, - { "boxhU;", 0x02568 }, - { "boxhd;", 0x0252C }, - { "boxhu;", 0x02534 }, - { "boxminus;", 0x0229F }, - { "boxplus;", 0x0229E }, - { "boxtimes;", 0x022A0 }, - { "boxuL;", 0x0255B }, - { "boxuR;", 0x02558 }, - { "boxul;", 0x02518 }, - { "boxur;", 0x02514 }, - { "boxv;", 0x02502 }, - { "boxvH;", 0x0256A }, - { "boxvL;", 0x02561 }, - { "boxvR;", 0x0255E }, - { "boxvh;", 0x0253C }, - { "boxvl;", 0x02524 }, - { "boxvr;", 0x0251C }, - { "bprime;", 0x02035 }, - { "breve;", 0x002D8 }, - { "brvbar;", 0x000A6 }, - { "brvbar", 0x000A6 }, - { "bscr;", 0x1D4B7 }, - { "bsemi;", 0x0204F }, - { "bsim;", 0x0223D }, - { "bsime;", 0x022CD }, - { "bsol;", 0x0005C }, - { "bsolb;", 0x029C5 }, - { "bsolhsub;", 0x027C8 }, - { "bull;", 0x02022 }, - { "bullet;", 0x02022 }, - { "bump;", 0x0224E }, - { "bumpE;", 0x02AAE }, - { "bumpe;", 0x0224F }, - { "bumpeq;", 0x0224F }, - { "cacute;", 0x00107 }, - { "cap;", 0x02229 }, - { "capand;", 0x02A44 }, - { "capbrcup;", 0x02A49 }, - { "capcap;", 0x02A4B }, - { "capcup;", 0x02A47 }, - { "capdot;", 0x02A40 }, - { "caret;", 0x02041 }, - { "caron;", 0x002C7 }, - { "ccaps;", 0x02A4D }, - { "ccaron;", 0x0010D }, - { "ccedil;", 0x000E7 }, - { "ccedil", 0x000E7 }, - { "ccirc;", 0x00109 }, - { "ccups;", 0x02A4C }, - { "ccupssm;", 0x02A50 }, - { "cdot;", 0x0010B }, - { "cedil;", 0x000B8 }, - { "cedil", 0x000B8 }, - { "cemptyv;", 0x029B2 }, - { "cent;", 0x000A2 }, - { "cent", 0x000A2 }, - { "centerdot;", 0x000B7 }, - { "cfr;", 0x1D520 }, - { "chcy;", 0x00447 }, - { "check;", 0x02713 }, - { "checkmark;", 0x02713 }, - { "chi;", 0x003C7 }, - { "cir;", 0x025CB }, - { "cirE;", 0x029C3 }, - { "circ;", 0x002C6 }, - { "circeq;", 0x02257 }, - { "circlearrowleft;", 0x021BA }, - { "circlearrowright;", 0x021BB }, - { "circledR;", 0x000AE }, - { "circledS;", 0x024C8 }, - { "circledast;", 0x0229B }, - { "circledcirc;", 0x0229A }, - { "circleddash;", 0x0229D }, - { "cire;", 0x02257 }, - { "cirfnint;", 0x02A10 }, - { "cirmid;", 0x02AEF }, - { "cirscir;", 0x029C2 }, - { "clubs;", 0x02663 }, - { "clubsuit;", 0x02663 }, - { "colon;", 0x0003A }, - { "colone;", 0x02254 }, - { "coloneq;", 0x02254 }, - { "comma;", 0x0002C }, - { "commat;", 0x00040 }, - { "comp;", 0x02201 }, - { "compfn;", 0x02218 }, - { "complement;", 0x02201 }, - { "complexes;", 0x02102 }, - { "cong;", 0x02245 }, - { "congdot;", 0x02A6D }, - { "conint;", 0x0222E }, - { "copf;", 0x1D554 }, - { "coprod;", 0x02210 }, - { "copy;", 0x000A9 }, - { "copy", 0x000A9 }, - { "copysr;", 0x02117 }, - { "crarr;", 0x021B5 }, - { "cross;", 0x02717 }, - { "cscr;", 0x1D4B8 }, - { "csub;", 0x02ACF }, - { "csube;", 0x02AD1 }, - { "csup;", 0x02AD0 }, - { "csupe;", 0x02AD2 }, - { "ctdot;", 0x022EF }, - { "cudarrl;", 0x02938 }, - { "cudarrr;", 0x02935 }, - { "cuepr;", 0x022DE }, - { "cuesc;", 0x022DF }, - { "cularr;", 0x021B6 }, - { "cularrp;", 0x0293D }, - { "cup;", 0x0222A }, - { "cupbrcap;", 0x02A48 }, - { "cupcap;", 0x02A46 }, - { "cupcup;", 0x02A4A }, - { "cupdot;", 0x0228D }, - { "cupor;", 0x02A45 }, - { "curarr;", 0x021B7 }, - { "curarrm;", 0x0293C }, - { "curlyeqprec;", 0x022DE }, - { "curlyeqsucc;", 0x022DF }, - { "curlyvee;", 0x022CE }, - { "curlywedge;", 0x022CF }, - { "curren;", 0x000A4 }, - { "curren", 0x000A4 }, - { "curvearrowleft;", 0x021B6 }, - { "curvearrowright;", 0x021B7 }, - { "cuvee;", 0x022CE }, - { "cuwed;", 0x022CF }, - { "cwconint;", 0x02232 }, - { "cwint;", 0x02231 }, - { "cylcty;", 0x0232D }, - { "dArr;", 0x021D3 }, - { "dHar;", 0x02965 }, - { "dagger;", 0x02020 }, - { "daleth;", 0x02138 }, - { "darr;", 0x02193 }, - { "dash;", 0x02010 }, - { "dashv;", 0x022A3 }, - { "dbkarow;", 0x0290F }, - { "dblac;", 0x002DD }, - { "dcaron;", 0x0010F }, - { "dcy;", 0x00434 }, - { "dd;", 0x02146 }, - { "ddagger;", 0x02021 }, - { "ddarr;", 0x021CA }, - { "ddotseq;", 0x02A77 }, - { "deg;", 0x000B0 }, - { "deg", 0x000B0 }, - { "delta;", 0x003B4 }, - { "demptyv;", 0x029B1 }, - { "dfisht;", 0x0297F }, - { "dfr;", 0x1D521 }, - { "dharl;", 0x021C3 }, - { "dharr;", 0x021C2 }, - { "diam;", 0x022C4 }, - { "diamond;", 0x022C4 }, - { "diamondsuit;", 0x02666 }, - { "diams;", 0x02666 }, - { "die;", 0x000A8 }, - { "digamma;", 0x003DD }, - { "disin;", 0x022F2 }, - { "div;", 0x000F7 }, - { "divide;", 0x000F7 }, - { "divide", 0x000F7 }, - { "divideontimes;", 0x022C7 }, - { "divonx;", 0x022C7 }, - { "djcy;", 0x00452 }, - { "dlcorn;", 0x0231E }, - { "dlcrop;", 0x0230D }, - { "dollar;", 0x00024 }, - { "dopf;", 0x1D555 }, - { "dot;", 0x002D9 }, - { "doteq;", 0x02250 }, - { "doteqdot;", 0x02251 }, - { "dotminus;", 0x02238 }, - { "dotplus;", 0x02214 }, - { "dotsquare;", 0x022A1 }, - { "doublebarwedge;", 0x02306 }, - { "downarrow;", 0x02193 }, - { "downdownarrows;", 0x021CA }, - { "downharpoonleft;", 0x021C3 }, - { "downharpoonright;", 0x021C2 }, - { "drbkarow;", 0x02910 }, - { "drcorn;", 0x0231F }, - { "drcrop;", 0x0230C }, - { "dscr;", 0x1D4B9 }, - { "dscy;", 0x00455 }, - { "dsol;", 0x029F6 }, - { "dstrok;", 0x00111 }, - { "dtdot;", 0x022F1 }, - { "dtri;", 0x025BF }, - { "dtrif;", 0x025BE }, - { "duarr;", 0x021F5 }, - { "duhar;", 0x0296F }, - { "dwangle;", 0x029A6 }, - { "dzcy;", 0x0045F }, - { "dzigrarr;", 0x027FF }, - { "eDDot;", 0x02A77 }, - { "eDot;", 0x02251 }, - { "eacute;", 0x000E9 }, - { "eacute", 0x000E9 }, - { "easter;", 0x02A6E }, - { "ecaron;", 0x0011B }, - { "ecir;", 0x02256 }, - { "ecirc;", 0x000EA }, - { "ecirc", 0x000EA }, - { "ecolon;", 0x02255 }, - { "ecy;", 0x0044D }, - { "edot;", 0x00117 }, - { "ee;", 0x02147 }, - { "efDot;", 0x02252 }, - { "efr;", 0x1D522 }, - { "eg;", 0x02A9A }, - { "egrave;", 0x000E8 }, - { "egrave", 0x000E8 }, - { "egs;", 0x02A96 }, - { "egsdot;", 0x02A98 }, - { "el;", 0x02A99 }, - { "elinters;", 0x023E7 }, - { "ell;", 0x02113 }, - { "els;", 0x02A95 }, - { "elsdot;", 0x02A97 }, - { "emacr;", 0x00113 }, - { "empty;", 0x02205 }, - { "emptyset;", 0x02205 }, - { "emptyv;", 0x02205 }, - { "emsp13;", 0x02004 }, - { "emsp14;", 0x02005 }, - { "emsp;", 0x02003 }, - { "eng;", 0x0014B }, - { "ensp;", 0x02002 }, - { "eogon;", 0x00119 }, - { "eopf;", 0x1D556 }, - { "epar;", 0x022D5 }, - { "eparsl;", 0x029E3 }, - { "eplus;", 0x02A71 }, - { "epsi;", 0x003B5 }, - { "epsilon;", 0x003B5 }, - { "epsiv;", 0x003F5 }, - { "eqcirc;", 0x02256 }, - { "eqcolon;", 0x02255 }, - { "eqsim;", 0x02242 }, - { "eqslantgtr;", 0x02A96 }, - { "eqslantless;", 0x02A95 }, - { "equals;", 0x0003D }, - { "equest;", 0x0225F }, - { "equiv;", 0x02261 }, - { "equivDD;", 0x02A78 }, - { "eqvparsl;", 0x029E5 }, - { "erDot;", 0x02253 }, - { "erarr;", 0x02971 }, - { "escr;", 0x0212F }, - { "esdot;", 0x02250 }, - { "esim;", 0x02242 }, - { "eta;", 0x003B7 }, - { "eth;", 0x000F0 }, - { "eth", 0x000F0 }, - { "euml;", 0x000EB }, - { "euml", 0x000EB }, - { "euro;", 0x020AC }, - { "excl;", 0x00021 }, - { "exist;", 0x02203 }, - { "expectation;", 0x02130 }, - { "exponentiale;", 0x02147 }, - { "fallingdotseq;", 0x02252 }, - { "fcy;", 0x00444 }, - { "female;", 0x02640 }, - { "ffilig;", 0x0FB03 }, - { "fflig;", 0x0FB00 }, - { "ffllig;", 0x0FB04 }, - { "ffr;", 0x1D523 }, - { "filig;", 0x0FB01 }, - { "flat;", 0x0266D }, - { "fllig;", 0x0FB02 }, - { "fltns;", 0x025B1 }, - { "fnof;", 0x00192 }, - { "fopf;", 0x1D557 }, - { "forall;", 0x02200 }, - { "fork;", 0x022D4 }, - { "forkv;", 0x02AD9 }, - { "fpartint;", 0x02A0D }, - { "frac12;", 0x000BD }, - { "frac12", 0x000BD }, - { "frac13;", 0x02153 }, - { "frac14;", 0x000BC }, - { "frac14", 0x000BC }, - { "frac15;", 0x02155 }, - { "frac16;", 0x02159 }, - { "frac18;", 0x0215B }, - { "frac23;", 0x02154 }, - { "frac25;", 0x02156 }, - { "frac34;", 0x000BE }, - { "frac34", 0x000BE }, - { "frac35;", 0x02157 }, - { "frac38;", 0x0215C }, - { "frac45;", 0x02158 }, - { "frac56;", 0x0215A }, - { "frac58;", 0x0215D }, - { "frac78;", 0x0215E }, - { "frasl;", 0x02044 }, - { "frown;", 0x02322 }, - { "fscr;", 0x1D4BB }, - { "gE;", 0x02267 }, - { "gEl;", 0x02A8C }, - { "gacute;", 0x001F5 }, - { "gamma;", 0x003B3 }, - { "gammad;", 0x003DD }, - { "gap;", 0x02A86 }, - { "gbreve;", 0x0011F }, - { "gcirc;", 0x0011D }, - { "gcy;", 0x00433 }, - { "gdot;", 0x00121 }, - { "ge;", 0x02265 }, - { "gel;", 0x022DB }, - { "geq;", 0x02265 }, - { "geqq;", 0x02267 }, - { "geqslant;", 0x02A7E }, - { "ges;", 0x02A7E }, - { "gescc;", 0x02AA9 }, - { "gesdot;", 0x02A80 }, - { "gesdoto;", 0x02A82 }, - { "gesdotol;", 0x02A84 }, - { "gesles;", 0x02A94 }, - { "gfr;", 0x1D524 }, - { "gg;", 0x0226B }, - { "ggg;", 0x022D9 }, - { "gimel;", 0x02137 }, - { "gjcy;", 0x00453 }, - { "gl;", 0x02277 }, - { "glE;", 0x02A92 }, - { "gla;", 0x02AA5 }, - { "glj;", 0x02AA4 }, - { "gnE;", 0x02269 }, - { "gnap;", 0x02A8A }, - { "gnapprox;", 0x02A8A }, - { "gne;", 0x02A88 }, - { "gneq;", 0x02A88 }, - { "gneqq;", 0x02269 }, - { "gnsim;", 0x022E7 }, - { "gopf;", 0x1D558 }, - { "grave;", 0x00060 }, - { "gscr;", 0x0210A }, - { "gsim;", 0x02273 }, - { "gsime;", 0x02A8E }, - { "gsiml;", 0x02A90 }, - { "gt;", 0x0003E }, - { "gt", 0x0003E }, - { "gtcc;", 0x02AA7 }, - { "gtcir;", 0x02A7A }, - { "gtdot;", 0x022D7 }, - { "gtlPar;", 0x02995 }, - { "gtquest;", 0x02A7C }, - { "gtrapprox;", 0x02A86 }, - { "gtrarr;", 0x02978 }, - { "gtrdot;", 0x022D7 }, - { "gtreqless;", 0x022DB }, - { "gtreqqless;", 0x02A8C }, - { "gtrless;", 0x02277 }, - { "gtrsim;", 0x02273 }, - { "hArr;", 0x021D4 }, - { "hairsp;", 0x0200A }, - { "half;", 0x000BD }, - { "hamilt;", 0x0210B }, - { "hardcy;", 0x0044A }, - { "harr;", 0x02194 }, - { "harrcir;", 0x02948 }, - { "harrw;", 0x021AD }, - { "hbar;", 0x0210F }, - { "hcirc;", 0x00125 }, - { "hearts;", 0x02665 }, - { "heartsuit;", 0x02665 }, - { "hellip;", 0x02026 }, - { "hercon;", 0x022B9 }, - { "hfr;", 0x1D525 }, - { "hksearow;", 0x02925 }, - { "hkswarow;", 0x02926 }, - { "hoarr;", 0x021FF }, - { "homtht;", 0x0223B }, - { "hookleftarrow;", 0x021A9 }, - { "hookrightarrow;", 0x021AA }, - { "hopf;", 0x1D559 }, - { "horbar;", 0x02015 }, - { "hscr;", 0x1D4BD }, - { "hslash;", 0x0210F }, - { "hstrok;", 0x00127 }, - { "hybull;", 0x02043 }, - { "hyphen;", 0x02010 }, - { "iacute;", 0x000ED }, - { "iacute", 0x000ED }, - { "ic;", 0x02063 }, - { "icirc;", 0x000EE }, - { "icirc", 0x000EE }, - { "icy;", 0x00438 }, - { "iecy;", 0x00435 }, - { "iexcl;", 0x000A1 }, - { "iexcl", 0x000A1 }, - { "iff;", 0x021D4 }, - { "ifr;", 0x1D526 }, - { "igrave;", 0x000EC }, - { "igrave", 0x000EC }, - { "ii;", 0x02148 }, - { "iiiint;", 0x02A0C }, - { "iiint;", 0x0222D }, - { "iinfin;", 0x029DC }, - { "iiota;", 0x02129 }, - { "ijlig;", 0x00133 }, - { "imacr;", 0x0012B }, - { "image;", 0x02111 }, - { "imagline;", 0x02110 }, - { "imagpart;", 0x02111 }, - { "imath;", 0x00131 }, - { "imof;", 0x022B7 }, - { "imped;", 0x001B5 }, - { "in;", 0x02208 }, - { "incare;", 0x02105 }, - { "infin;", 0x0221E }, - { "infintie;", 0x029DD }, - { "inodot;", 0x00131 }, - { "int;", 0x0222B }, - { "intcal;", 0x022BA }, - { "integers;", 0x02124 }, - { "intercal;", 0x022BA }, - { "intlarhk;", 0x02A17 }, - { "intprod;", 0x02A3C }, - { "iocy;", 0x00451 }, - { "iogon;", 0x0012F }, - { "iopf;", 0x1D55A }, - { "iota;", 0x003B9 }, - { "iprod;", 0x02A3C }, - { "iquest;", 0x000BF }, - { "iquest", 0x000BF }, - { "iscr;", 0x1D4BE }, - { "isin;", 0x02208 }, - { "isinE;", 0x022F9 }, - { "isindot;", 0x022F5 }, - { "isins;", 0x022F4 }, - { "isinsv;", 0x022F3 }, - { "isinv;", 0x02208 }, - { "it;", 0x02062 }, - { "itilde;", 0x00129 }, - { "iukcy;", 0x00456 }, - { "iuml;", 0x000EF }, - { "iuml", 0x000EF }, - { "jcirc;", 0x00135 }, - { "jcy;", 0x00439 }, - { "jfr;", 0x1D527 }, - { "jmath;", 0x00237 }, - { "jopf;", 0x1D55B }, - { "jscr;", 0x1D4BF }, - { "jsercy;", 0x00458 }, - { "jukcy;", 0x00454 }, - { "kappa;", 0x003BA }, - { "kappav;", 0x003F0 }, - { "kcedil;", 0x00137 }, - { "kcy;", 0x0043A }, - { "kfr;", 0x1D528 }, - { "kgreen;", 0x00138 }, - { "khcy;", 0x00445 }, - { "kjcy;", 0x0045C }, - { "kopf;", 0x1D55C }, - { "kscr;", 0x1D4C0 }, - { "lAarr;", 0x021DA }, - { "lArr;", 0x021D0 }, - { "lAtail;", 0x0291B }, - { "lBarr;", 0x0290E }, - { "lE;", 0x02266 }, - { "lEg;", 0x02A8B }, - { "lHar;", 0x02962 }, - { "lacute;", 0x0013A }, - { "laemptyv;", 0x029B4 }, - { "lagran;", 0x02112 }, - { "lambda;", 0x003BB }, - { "lang;", 0x027E8 }, - { "langd;", 0x02991 }, - { "langle;", 0x027E8 }, - { "lap;", 0x02A85 }, - { "laquo;", 0x000AB }, - { "laquo", 0x000AB }, - { "larr;", 0x02190 }, - { "larrb;", 0x021E4 }, - { "larrbfs;", 0x0291F }, - { "larrfs;", 0x0291D }, - { "larrhk;", 0x021A9 }, - { "larrlp;", 0x021AB }, - { "larrpl;", 0x02939 }, - { "larrsim;", 0x02973 }, - { "larrtl;", 0x021A2 }, - { "lat;", 0x02AAB }, - { "latail;", 0x02919 }, - { "late;", 0x02AAD }, - { "lbarr;", 0x0290C }, - { "lbbrk;", 0x02772 }, - { "lbrace;", 0x0007B }, - { "lbrack;", 0x0005B }, - { "lbrke;", 0x0298B }, - { "lbrksld;", 0x0298F }, - { "lbrkslu;", 0x0298D }, - { "lcaron;", 0x0013E }, - { "lcedil;", 0x0013C }, - { "lceil;", 0x02308 }, - { "lcub;", 0x0007B }, - { "lcy;", 0x0043B }, - { "ldca;", 0x02936 }, - { "ldquo;", 0x0201C }, - { "ldquor;", 0x0201E }, - { "ldrdhar;", 0x02967 }, - { "ldrushar;", 0x0294B }, - { "ldsh;", 0x021B2 }, - { "le;", 0x02264 }, - { "leftarrow;", 0x02190 }, - { "leftarrowtail;", 0x021A2 }, - { "leftharpoondown;", 0x021BD }, - { "leftharpoonup;", 0x021BC }, - { "leftleftarrows;", 0x021C7 }, - { "leftrightarrow;", 0x02194 }, - { "leftrightarrows;", 0x021C6 }, - { "leftrightharpoons;", 0x021CB }, - { "leftrightsquigarrow;", 0x021AD }, - { "leftthreetimes;", 0x022CB }, - { "leg;", 0x022DA }, - { "leq;", 0x02264 }, - { "leqq;", 0x02266 }, - { "leqslant;", 0x02A7D }, - { "les;", 0x02A7D }, - { "lescc;", 0x02AA8 }, - { "lesdot;", 0x02A7F }, - { "lesdoto;", 0x02A81 }, - { "lesdotor;", 0x02A83 }, - { "lesges;", 0x02A93 }, - { "lessapprox;", 0x02A85 }, - { "lessdot;", 0x022D6 }, - { "lesseqgtr;", 0x022DA }, - { "lesseqqgtr;", 0x02A8B }, - { "lessgtr;", 0x02276 }, - { "lesssim;", 0x02272 }, - { "lfisht;", 0x0297C }, - { "lfloor;", 0x0230A }, - { "lfr;", 0x1D529 }, - { "lg;", 0x02276 }, - { "lgE;", 0x02A91 }, - { "lhard;", 0x021BD }, - { "lharu;", 0x021BC }, - { "lharul;", 0x0296A }, - { "lhblk;", 0x02584 }, - { "ljcy;", 0x00459 }, - { "ll;", 0x0226A }, - { "llarr;", 0x021C7 }, - { "llcorner;", 0x0231E }, - { "llhard;", 0x0296B }, - { "lltri;", 0x025FA }, - { "lmidot;", 0x00140 }, - { "lmoust;", 0x023B0 }, - { "lmoustache;", 0x023B0 }, - { "lnE;", 0x02268 }, - { "lnap;", 0x02A89 }, - { "lnapprox;", 0x02A89 }, - { "lne;", 0x02A87 }, - { "lneq;", 0x02A87 }, - { "lneqq;", 0x02268 }, - { "lnsim;", 0x022E6 }, - { "loang;", 0x027EC }, - { "loarr;", 0x021FD }, - { "lobrk;", 0x027E6 }, - { "longleftarrow;", 0x027F5 }, - { "longleftrightarrow;", 0x027F7 }, - { "longmapsto;", 0x027FC }, - { "longrightarrow;", 0x027F6 }, - { "looparrowleft;", 0x021AB }, - { "looparrowright;", 0x021AC }, - { "lopar;", 0x02985 }, - { "lopf;", 0x1D55D }, - { "loplus;", 0x02A2D }, - { "lotimes;", 0x02A34 }, - { "lowast;", 0x02217 }, - { "lowbar;", 0x0005F }, - { "loz;", 0x025CA }, - { "lozenge;", 0x025CA }, - { "lozf;", 0x029EB }, - { "lpar;", 0x00028 }, - { "lparlt;", 0x02993 }, - { "lrarr;", 0x021C6 }, - { "lrcorner;", 0x0231F }, - { "lrhar;", 0x021CB }, - { "lrhard;", 0x0296D }, - { "lrm;", 0x0200E }, - { "lrtri;", 0x022BF }, - { "lsaquo;", 0x02039 }, - { "lscr;", 0x1D4C1 }, - { "lsh;", 0x021B0 }, - { "lsim;", 0x02272 }, - { "lsime;", 0x02A8D }, - { "lsimg;", 0x02A8F }, - { "lsqb;", 0x0005B }, - { "lsquo;", 0x02018 }, - { "lsquor;", 0x0201A }, - { "lstrok;", 0x00142 }, - { "lt;", 0x0003C }, - { "lt", 0x0003C }, - { "ltcc;", 0x02AA6 }, - { "ltcir;", 0x02A79 }, - { "ltdot;", 0x022D6 }, - { "lthree;", 0x022CB }, - { "ltimes;", 0x022C9 }, - { "ltlarr;", 0x02976 }, - { "ltquest;", 0x02A7B }, - { "ltrPar;", 0x02996 }, - { "ltri;", 0x025C3 }, - { "ltrie;", 0x022B4 }, - { "ltrif;", 0x025C2 }, - { "lurdshar;", 0x0294A }, - { "luruhar;", 0x02966 }, - { "mDDot;", 0x0223A }, - { "macr;", 0x000AF }, - { "macr", 0x000AF }, - { "male;", 0x02642 }, - { "malt;", 0x02720 }, - { "maltese;", 0x02720 }, - { "map;", 0x021A6 }, - { "mapsto;", 0x021A6 }, - { "mapstodown;", 0x021A7 }, - { "mapstoleft;", 0x021A4 }, - { "mapstoup;", 0x021A5 }, - { "marker;", 0x025AE }, - { "mcomma;", 0x02A29 }, - { "mcy;", 0x0043C }, - { "mdash;", 0x02014 }, - { "measuredangle;", 0x02221 }, - { "mfr;", 0x1D52A }, - { "mho;", 0x02127 }, - { "micro;", 0x000B5 }, - { "micro", 0x000B5 }, - { "mid;", 0x02223 }, - { "midast;", 0x0002A }, - { "midcir;", 0x02AF0 }, - { "middot;", 0x000B7 }, - { "middot", 0x000B7 }, - { "minus;", 0x02212 }, - { "minusb;", 0x0229F }, - { "minusd;", 0x02238 }, - { "minusdu;", 0x02A2A }, - { "mlcp;", 0x02ADB }, - { "mldr;", 0x02026 }, - { "mnplus;", 0x02213 }, - { "models;", 0x022A7 }, - { "mopf;", 0x1D55E }, - { "mp;", 0x02213 }, - { "mscr;", 0x1D4C2 }, - { "mstpos;", 0x0223E }, - { "mu;", 0x003BC }, - { "multimap;", 0x022B8 }, - { "mumap;", 0x022B8 }, - { "nLeftarrow;", 0x021CD }, - { "nLeftrightarrow;", 0x021CE }, - { "nRightarrow;", 0x021CF }, - { "nVDash;", 0x022AF }, - { "nVdash;", 0x022AE }, - { "nabla;", 0x02207 }, - { "nacute;", 0x00144 }, - { "nap;", 0x02249 }, - { "napos;", 0x00149 }, - { "napprox;", 0x02249 }, - { "natur;", 0x0266E }, - { "natural;", 0x0266E }, - { "naturals;", 0x02115 }, - { "nbsp;", 0x000A0 }, - { "nbsp", 0x000A0 }, - { "ncap;", 0x02A43 }, - { "ncaron;", 0x00148 }, - { "ncedil;", 0x00146 }, - { "ncong;", 0x02247 }, - { "ncup;", 0x02A42 }, - { "ncy;", 0x0043D }, - { "ndash;", 0x02013 }, - { "ne;", 0x02260 }, - { "neArr;", 0x021D7 }, - { "nearhk;", 0x02924 }, - { "nearr;", 0x02197 }, - { "nearrow;", 0x02197 }, - { "nequiv;", 0x02262 }, - { "nesear;", 0x02928 }, - { "nexist;", 0x02204 }, - { "nexists;", 0x02204 }, - { "nfr;", 0x1D52B }, - { "nge;", 0x02271 }, - { "ngeq;", 0x02271 }, - { "ngsim;", 0x02275 }, - { "ngt;", 0x0226F }, - { "ngtr;", 0x0226F }, - { "nhArr;", 0x021CE }, - { "nharr;", 0x021AE }, - { "nhpar;", 0x02AF2 }, - { "ni;", 0x0220B }, - { "nis;", 0x022FC }, - { "nisd;", 0x022FA }, - { "niv;", 0x0220B }, - { "njcy;", 0x0045A }, - { "nlArr;", 0x021CD }, - { "nlarr;", 0x0219A }, - { "nldr;", 0x02025 }, - { "nle;", 0x02270 }, - { "nleftarrow;", 0x0219A }, - { "nleftrightarrow;", 0x021AE }, - { "nleq;", 0x02270 }, - { "nless;", 0x0226E }, - { "nlsim;", 0x02274 }, - { "nlt;", 0x0226E }, - { "nltri;", 0x022EA }, - { "nltrie;", 0x022EC }, - { "nmid;", 0x02224 }, - { "nopf;", 0x1D55F }, - { "not;", 0x000AC }, - { "not", 0x000AC }, - { "notin;", 0x02209 }, - { "notinva;", 0x02209 }, - { "notinvb;", 0x022F7 }, - { "notinvc;", 0x022F6 }, - { "notni;", 0x0220C }, - { "notniva;", 0x0220C }, - { "notnivb;", 0x022FE }, - { "notnivc;", 0x022FD }, - { "npar;", 0x02226 }, - { "nparallel;", 0x02226 }, - { "npolint;", 0x02A14 }, - { "npr;", 0x02280 }, - { "nprcue;", 0x022E0 }, - { "nprec;", 0x02280 }, - { "nrArr;", 0x021CF }, - { "nrarr;", 0x0219B }, - { "nrightarrow;", 0x0219B }, - { "nrtri;", 0x022EB }, - { "nrtrie;", 0x022ED }, - { "nsc;", 0x02281 }, - { "nsccue;", 0x022E1 }, - { "nscr;", 0x1D4C3 }, - { "nshortmid;", 0x02224 }, - { "nshortparallel;", 0x02226 }, - { "nsim;", 0x02241 }, - { "nsime;", 0x02244 }, - { "nsimeq;", 0x02244 }, - { "nsmid;", 0x02224 }, - { "nspar;", 0x02226 }, - { "nsqsube;", 0x022E2 }, - { "nsqsupe;", 0x022E3 }, - { "nsub;", 0x02284 }, - { "nsube;", 0x02288 }, - { "nsubseteq;", 0x02288 }, - { "nsucc;", 0x02281 }, - { "nsup;", 0x02285 }, - { "nsupe;", 0x02289 }, - { "nsupseteq;", 0x02289 }, - { "ntgl;", 0x02279 }, - { "ntilde;", 0x000F1 }, - { "ntilde", 0x000F1 }, - { "ntlg;", 0x02278 }, - { "ntriangleleft;", 0x022EA }, - { "ntrianglelefteq;", 0x022EC }, - { "ntriangleright;", 0x022EB }, - { "ntrianglerighteq;", 0x022ED }, - { "nu;", 0x003BD }, - { "num;", 0x00023 }, - { "numero;", 0x02116 }, - { "numsp;", 0x02007 }, - { "nvDash;", 0x022AD }, - { "nvHarr;", 0x02904 }, - { "nvdash;", 0x022AC }, - { "nvinfin;", 0x029DE }, - { "nvlArr;", 0x02902 }, - { "nvrArr;", 0x02903 }, - { "nwArr;", 0x021D6 }, - { "nwarhk;", 0x02923 }, - { "nwarr;", 0x02196 }, - { "nwarrow;", 0x02196 }, - { "nwnear;", 0x02927 }, - { "oS;", 0x024C8 }, - { "oacute;", 0x000F3 }, - { "oacute", 0x000F3 }, - { "oast;", 0x0229B }, - { "ocir;", 0x0229A }, - { "ocirc;", 0x000F4 }, - { "ocirc", 0x000F4 }, - { "ocy;", 0x0043E }, - { "odash;", 0x0229D }, - { "odblac;", 0x00151 }, - { "odiv;", 0x02A38 }, - { "odot;", 0x02299 }, - { "odsold;", 0x029BC }, - { "oelig;", 0x00153 }, - { "ofcir;", 0x029BF }, - { "ofr;", 0x1D52C }, - { "ogon;", 0x002DB }, - { "ograve;", 0x000F2 }, - { "ograve", 0x000F2 }, - { "ogt;", 0x029C1 }, - { "ohbar;", 0x029B5 }, - { "ohm;", 0x003A9 }, - { "oint;", 0x0222E }, - { "olarr;", 0x021BA }, - { "olcir;", 0x029BE }, - { "olcross;", 0x029BB }, - { "oline;", 0x0203E }, - { "olt;", 0x029C0 }, - { "omacr;", 0x0014D }, - { "omega;", 0x003C9 }, - { "omicron;", 0x003BF }, - { "omid;", 0x029B6 }, - { "ominus;", 0x02296 }, - { "oopf;", 0x1D560 }, - { "opar;", 0x029B7 }, - { "operp;", 0x029B9 }, - { "oplus;", 0x02295 }, - { "or;", 0x02228 }, - { "orarr;", 0x021BB }, - { "ord;", 0x02A5D }, - { "order;", 0x02134 }, - { "orderof;", 0x02134 }, - { "ordf;", 0x000AA }, - { "ordf", 0x000AA }, - { "ordm;", 0x000BA }, - { "ordm", 0x000BA }, - { "origof;", 0x022B6 }, - { "oror;", 0x02A56 }, - { "orslope;", 0x02A57 }, - { "orv;", 0x02A5B }, - { "oscr;", 0x02134 }, - { "oslash;", 0x000F8 }, - { "oslash", 0x000F8 }, - { "osol;", 0x02298 }, - { "otilde;", 0x000F5 }, - { "otilde", 0x000F5 }, - { "otimes;", 0x02297 }, - { "otimesas;", 0x02A36 }, - { "ouml;", 0x000F6 }, - { "ouml", 0x000F6 }, - { "ovbar;", 0x0233D }, - { "par;", 0x02225 }, - { "para;", 0x000B6 }, - { "para", 0x000B6 }, - { "parallel;", 0x02225 }, - { "parsim;", 0x02AF3 }, - { "parsl;", 0x02AFD }, - { "part;", 0x02202 }, - { "pcy;", 0x0043F }, - { "percnt;", 0x00025 }, - { "period;", 0x0002E }, - { "permil;", 0x02030 }, - { "perp;", 0x022A5 }, - { "pertenk;", 0x02031 }, - { "pfr;", 0x1D52D }, - { "phi;", 0x003C6 }, - { "phiv;", 0x003D5 }, - { "phmmat;", 0x02133 }, - { "phone;", 0x0260E }, - { "pi;", 0x003C0 }, - { "pitchfork;", 0x022D4 }, - { "piv;", 0x003D6 }, - { "planck;", 0x0210F }, - { "planckh;", 0x0210E }, - { "plankv;", 0x0210F }, - { "plus;", 0x0002B }, - { "plusacir;", 0x02A23 }, - { "plusb;", 0x0229E }, - { "pluscir;", 0x02A22 }, - { "plusdo;", 0x02214 }, - { "plusdu;", 0x02A25 }, - { "pluse;", 0x02A72 }, - { "plusmn;", 0x000B1 }, - { "plusmn", 0x000B1 }, - { "plussim;", 0x02A26 }, - { "plustwo;", 0x02A27 }, - { "pm;", 0x000B1 }, - { "pointint;", 0x02A15 }, - { "popf;", 0x1D561 }, - { "pound;", 0x000A3 }, - { "pound", 0x000A3 }, - { "pr;", 0x0227A }, - { "prE;", 0x02AB3 }, - { "prap;", 0x02AB7 }, - { "prcue;", 0x0227C }, - { "pre;", 0x02AAF }, - { "prec;", 0x0227A }, - { "precapprox;", 0x02AB7 }, - { "preccurlyeq;", 0x0227C }, - { "preceq;", 0x02AAF }, - { "precnapprox;", 0x02AB9 }, - { "precneqq;", 0x02AB5 }, - { "precnsim;", 0x022E8 }, - { "precsim;", 0x0227E }, - { "prime;", 0x02032 }, - { "primes;", 0x02119 }, - { "prnE;", 0x02AB5 }, - { "prnap;", 0x02AB9 }, - { "prnsim;", 0x022E8 }, - { "prod;", 0x0220F }, - { "profalar;", 0x0232E }, - { "profline;", 0x02312 }, - { "profsurf;", 0x02313 }, - { "prop;", 0x0221D }, - { "propto;", 0x0221D }, - { "prsim;", 0x0227E }, - { "prurel;", 0x022B0 }, - { "pscr;", 0x1D4C5 }, - { "psi;", 0x003C8 }, - { "puncsp;", 0x02008 }, - { "qfr;", 0x1D52E }, - { "qint;", 0x02A0C }, - { "qopf;", 0x1D562 }, - { "qprime;", 0x02057 }, - { "qscr;", 0x1D4C6 }, - { "quaternions;", 0x0210D }, - { "quatint;", 0x02A16 }, - { "quest;", 0x0003F }, - { "questeq;", 0x0225F }, - { "quot;", 0x00022 }, - { "quot", 0x00022 }, - { "rAarr;", 0x021DB }, - { "rArr;", 0x021D2 }, - { "rAtail;", 0x0291C }, - { "rBarr;", 0x0290F }, - { "rHar;", 0x02964 }, - { "racute;", 0x00155 }, - { "radic;", 0x0221A }, - { "raemptyv;", 0x029B3 }, - { "rang;", 0x027E9 }, - { "rangd;", 0x02992 }, - { "range;", 0x029A5 }, - { "rangle;", 0x027E9 }, - { "raquo;", 0x000BB }, - { "raquo", 0x000BB }, - { "rarr;", 0x02192 }, - { "rarrap;", 0x02975 }, - { "rarrb;", 0x021E5 }, - { "rarrbfs;", 0x02920 }, - { "rarrc;", 0x02933 }, - { "rarrfs;", 0x0291E }, - { "rarrhk;", 0x021AA }, - { "rarrlp;", 0x021AC }, - { "rarrpl;", 0x02945 }, - { "rarrsim;", 0x02974 }, - { "rarrtl;", 0x021A3 }, - { "rarrw;", 0x0219D }, - { "ratail;", 0x0291A }, - { "ratio;", 0x02236 }, - { "rationals;", 0x0211A }, - { "rbarr;", 0x0290D }, - { "rbbrk;", 0x02773 }, - { "rbrace;", 0x0007D }, - { "rbrack;", 0x0005D }, - { "rbrke;", 0x0298C }, - { "rbrksld;", 0x0298E }, - { "rbrkslu;", 0x02990 }, - { "rcaron;", 0x00159 }, - { "rcedil;", 0x00157 }, - { "rceil;", 0x02309 }, - { "rcub;", 0x0007D }, - { "rcy;", 0x00440 }, - { "rdca;", 0x02937 }, - { "rdldhar;", 0x02969 }, - { "rdquo;", 0x0201D }, - { "rdquor;", 0x0201D }, - { "rdsh;", 0x021B3 }, - { "real;", 0x0211C }, - { "realine;", 0x0211B }, - { "realpart;", 0x0211C }, - { "reals;", 0x0211D }, - { "rect;", 0x025AD }, - { "reg;", 0x000AE }, - { "reg", 0x000AE }, - { "rfisht;", 0x0297D }, - { "rfloor;", 0x0230B }, - { "rfr;", 0x1D52F }, - { "rhard;", 0x021C1 }, - { "rharu;", 0x021C0 }, - { "rharul;", 0x0296C }, - { "rho;", 0x003C1 }, - { "rhov;", 0x003F1 }, - { "rightarrow;", 0x02192 }, - { "rightarrowtail;", 0x021A3 }, - { "rightharpoondown;", 0x021C1 }, - { "rightharpoonup;", 0x021C0 }, - { "rightleftarrows;", 0x021C4 }, - { "rightleftharpoons;", 0x021CC }, - { "rightrightarrows;", 0x021C9 }, - { "rightsquigarrow;", 0x0219D }, - { "rightthreetimes;", 0x022CC }, - { "ring;", 0x002DA }, - { "risingdotseq;", 0x02253 }, - { "rlarr;", 0x021C4 }, - { "rlhar;", 0x021CC }, - { "rlm;", 0x0200F }, - { "rmoust;", 0x023B1 }, - { "rmoustache;", 0x023B1 }, - { "rnmid;", 0x02AEE }, - { "roang;", 0x027ED }, - { "roarr;", 0x021FE }, - { "robrk;", 0x027E7 }, - { "ropar;", 0x02986 }, - { "ropf;", 0x1D563 }, - { "roplus;", 0x02A2E }, - { "rotimes;", 0x02A35 }, - { "rpar;", 0x00029 }, - { "rpargt;", 0x02994 }, - { "rppolint;", 0x02A12 }, - { "rrarr;", 0x021C9 }, - { "rsaquo;", 0x0203A }, - { "rscr;", 0x1D4C7 }, - { "rsh;", 0x021B1 }, - { "rsqb;", 0x0005D }, - { "rsquo;", 0x02019 }, - { "rsquor;", 0x02019 }, - { "rthree;", 0x022CC }, - { "rtimes;", 0x022CA }, - { "rtri;", 0x025B9 }, - { "rtrie;", 0x022B5 }, - { "rtrif;", 0x025B8 }, - { "rtriltri;", 0x029CE }, - { "ruluhar;", 0x02968 }, - { "rx;", 0x0211E }, - { "sacute;", 0x0015B }, - { "sbquo;", 0x0201A }, - { "sc;", 0x0227B }, - { "scE;", 0x02AB4 }, - { "scap;", 0x02AB8 }, - { "scaron;", 0x00161 }, - { "sccue;", 0x0227D }, - { "sce;", 0x02AB0 }, - { "scedil;", 0x0015F }, - { "scirc;", 0x0015D }, - { "scnE;", 0x02AB6 }, - { "scnap;", 0x02ABA }, - { "scnsim;", 0x022E9 }, - { "scpolint;", 0x02A13 }, - { "scsim;", 0x0227F }, - { "scy;", 0x00441 }, - { "sdot;", 0x022C5 }, - { "sdotb;", 0x022A1 }, - { "sdote;", 0x02A66 }, - { "seArr;", 0x021D8 }, - { "searhk;", 0x02925 }, - { "searr;", 0x02198 }, - { "searrow;", 0x02198 }, - { "sect;", 0x000A7 }, - { "sect", 0x000A7 }, - { "semi;", 0x0003B }, - { "seswar;", 0x02929 }, - { "setminus;", 0x02216 }, - { "setmn;", 0x02216 }, - { "sext;", 0x02736 }, - { "sfr;", 0x1D530 }, - { "sfrown;", 0x02322 }, - { "sharp;", 0x0266F }, - { "shchcy;", 0x00449 }, - { "shcy;", 0x00448 }, - { "shortmid;", 0x02223 }, - { "shortparallel;", 0x02225 }, - { "shy;", 0x000AD }, - { "shy", 0x000AD }, - { "sigma;", 0x003C3 }, - { "sigmaf;", 0x003C2 }, - { "sigmav;", 0x003C2 }, - { "sim;", 0x0223C }, - { "simdot;", 0x02A6A }, - { "sime;", 0x02243 }, - { "simeq;", 0x02243 }, - { "simg;", 0x02A9E }, - { "simgE;", 0x02AA0 }, - { "siml;", 0x02A9D }, - { "simlE;", 0x02A9F }, - { "simne;", 0x02246 }, - { "simplus;", 0x02A24 }, - { "simrarr;", 0x02972 }, - { "slarr;", 0x02190 }, - { "smallsetminus;", 0x02216 }, - { "smashp;", 0x02A33 }, - { "smeparsl;", 0x029E4 }, - { "smid;", 0x02223 }, - { "smile;", 0x02323 }, - { "smt;", 0x02AAA }, - { "smte;", 0x02AAC }, - { "softcy;", 0x0044C }, - { "sol;", 0x0002F }, - { "solb;", 0x029C4 }, - { "solbar;", 0x0233F }, - { "sopf;", 0x1D564 }, - { "spades;", 0x02660 }, - { "spadesuit;", 0x02660 }, - { "spar;", 0x02225 }, - { "sqcap;", 0x02293 }, - { "sqcup;", 0x02294 }, - { "sqsub;", 0x0228F }, - { "sqsube;", 0x02291 }, - { "sqsubset;", 0x0228F }, - { "sqsubseteq;", 0x02291 }, - { "sqsup;", 0x02290 }, - { "sqsupe;", 0x02292 }, - { "sqsupset;", 0x02290 }, - { "sqsupseteq;", 0x02292 }, - { "squ;", 0x025A1 }, - { "square;", 0x025A1 }, - { "squarf;", 0x025AA }, - { "squf;", 0x025AA }, - { "srarr;", 0x02192 }, - { "sscr;", 0x1D4C8 }, - { "ssetmn;", 0x02216 }, - { "ssmile;", 0x02323 }, - { "sstarf;", 0x022C6 }, - { "star;", 0x02606 }, - { "starf;", 0x02605 }, - { "straightepsilon;", 0x003F5 }, - { "straightphi;", 0x003D5 }, - { "strns;", 0x000AF }, - { "sub;", 0x02282 }, - { "subE;", 0x02AC5 }, - { "subdot;", 0x02ABD }, - { "sube;", 0x02286 }, - { "subedot;", 0x02AC3 }, - { "submult;", 0x02AC1 }, - { "subnE;", 0x02ACB }, - { "subne;", 0x0228A }, - { "subplus;", 0x02ABF }, - { "subrarr;", 0x02979 }, - { "subset;", 0x02282 }, - { "subseteq;", 0x02286 }, - { "subseteqq;", 0x02AC5 }, - { "subsetneq;", 0x0228A }, - { "subsetneqq;", 0x02ACB }, - { "subsim;", 0x02AC7 }, - { "subsub;", 0x02AD5 }, - { "subsup;", 0x02AD3 }, - { "succ;", 0x0227B }, - { "succapprox;", 0x02AB8 }, - { "succcurlyeq;", 0x0227D }, - { "succeq;", 0x02AB0 }, - { "succnapprox;", 0x02ABA }, - { "succneqq;", 0x02AB6 }, - { "succnsim;", 0x022E9 }, - { "succsim;", 0x0227F }, - { "sum;", 0x02211 }, - { "sung;", 0x0266A }, - { "sup1;", 0x000B9 }, - { "sup1", 0x000B9 }, - { "sup2;", 0x000B2 }, - { "sup2", 0x000B2 }, - { "sup3;", 0x000B3 }, - { "sup3", 0x000B3 }, - { "sup;", 0x02283 }, - { "supE;", 0x02AC6 }, - { "supdot;", 0x02ABE }, - { "supdsub;", 0x02AD8 }, - { "supe;", 0x02287 }, - { "supedot;", 0x02AC4 }, - { "suphsol;", 0x027C9 }, - { "suphsub;", 0x02AD7 }, - { "suplarr;", 0x0297B }, - { "supmult;", 0x02AC2 }, - { "supnE;", 0x02ACC }, - { "supne;", 0x0228B }, - { "supplus;", 0x02AC0 }, - { "supset;", 0x02283 }, - { "supseteq;", 0x02287 }, - { "supseteqq;", 0x02AC6 }, - { "supsetneq;", 0x0228B }, - { "supsetneqq;", 0x02ACC }, - { "supsim;", 0x02AC8 }, - { "supsub;", 0x02AD4 }, - { "supsup;", 0x02AD6 }, - { "swArr;", 0x021D9 }, - { "swarhk;", 0x02926 }, - { "swarr;", 0x02199 }, - { "swarrow;", 0x02199 }, - { "swnwar;", 0x0292A }, - { "szlig;", 0x000DF }, - { "szlig", 0x000DF }, - { "target;", 0x02316 }, - { "tau;", 0x003C4 }, - { "tbrk;", 0x023B4 }, - { "tcaron;", 0x00165 }, - { "tcedil;", 0x00163 }, - { "tcy;", 0x00442 }, - { "tdot;", 0x020DB }, - { "telrec;", 0x02315 }, - { "tfr;", 0x1D531 }, - { "there4;", 0x02234 }, - { "therefore;", 0x02234 }, - { "theta;", 0x003B8 }, - { "thetasym;", 0x003D1 }, - { "thetav;", 0x003D1 }, - { "thickapprox;", 0x02248 }, - { "thicksim;", 0x0223C }, - { "thinsp;", 0x02009 }, - { "thkap;", 0x02248 }, - { "thksim;", 0x0223C }, - { "thorn;", 0x000FE }, - { "thorn", 0x000FE }, - { "tilde;", 0x002DC }, - { "times;", 0x000D7 }, - { "times", 0x000D7 }, - { "timesb;", 0x022A0 }, - { "timesbar;", 0x02A31 }, - { "timesd;", 0x02A30 }, - { "tint;", 0x0222D }, - { "toea;", 0x02928 }, - { "top;", 0x022A4 }, - { "topbot;", 0x02336 }, - { "topcir;", 0x02AF1 }, - { "topf;", 0x1D565 }, - { "topfork;", 0x02ADA }, - { "tosa;", 0x02929 }, - { "tprime;", 0x02034 }, - { "trade;", 0x02122 }, - { "triangle;", 0x025B5 }, - { "triangledown;", 0x025BF }, - { "triangleleft;", 0x025C3 }, - { "trianglelefteq;", 0x022B4 }, - { "triangleq;", 0x0225C }, - { "triangleright;", 0x025B9 }, - { "trianglerighteq;", 0x022B5 }, - { "tridot;", 0x025EC }, - { "trie;", 0x0225C }, - { "triminus;", 0x02A3A }, - { "triplus;", 0x02A39 }, - { "trisb;", 0x029CD }, - { "tritime;", 0x02A3B }, - { "trpezium;", 0x023E2 }, - { "tscr;", 0x1D4C9 }, - { "tscy;", 0x00446 }, - { "tshcy;", 0x0045B }, - { "tstrok;", 0x00167 }, - { "twixt;", 0x0226C }, - { "twoheadleftarrow;", 0x0219E }, - { "twoheadrightarrow;", 0x021A0 }, - { "uArr;", 0x021D1 }, - { "uHar;", 0x02963 }, - { "uacute;", 0x000FA }, - { "uacute", 0x000FA }, - { "uarr;", 0x02191 }, - { "ubrcy;", 0x0045E }, - { "ubreve;", 0x0016D }, - { "ucirc;", 0x000FB }, - { "ucirc", 0x000FB }, - { "ucy;", 0x00443 }, - { "udarr;", 0x021C5 }, - { "udblac;", 0x00171 }, - { "udhar;", 0x0296E }, - { "ufisht;", 0x0297E }, - { "ufr;", 0x1D532 }, - { "ugrave;", 0x000F9 }, - { "ugrave", 0x000F9 }, - { "uharl;", 0x021BF }, - { "uharr;", 0x021BE }, - { "uhblk;", 0x02580 }, - { "ulcorn;", 0x0231C }, - { "ulcorner;", 0x0231C }, - { "ulcrop;", 0x0230F }, - { "ultri;", 0x025F8 }, - { "umacr;", 0x0016B }, - { "uml;", 0x000A8 }, - { "uml", 0x000A8 }, - { "uogon;", 0x00173 }, - { "uopf;", 0x1D566 }, - { "uparrow;", 0x02191 }, - { "updownarrow;", 0x02195 }, - { "upharpoonleft;", 0x021BF }, - { "upharpoonright;", 0x021BE }, - { "uplus;", 0x0228E }, - { "upsi;", 0x003C5 }, - { "upsih;", 0x003D2 }, - { "upsilon;", 0x003C5 }, - { "upuparrows;", 0x021C8 }, - { "urcorn;", 0x0231D }, - { "urcorner;", 0x0231D }, - { "urcrop;", 0x0230E }, - { "uring;", 0x0016F }, - { "urtri;", 0x025F9 }, - { "uscr;", 0x1D4CA }, - { "utdot;", 0x022F0 }, - { "utilde;", 0x00169 }, - { "utri;", 0x025B5 }, - { "utrif;", 0x025B4 }, - { "uuarr;", 0x021C8 }, - { "uuml;", 0x000FC }, - { "uuml", 0x000FC }, - { "uwangle;", 0x029A7 }, - { "vArr;", 0x021D5 }, - { "vBar;", 0x02AE8 }, - { "vBarv;", 0x02AE9 }, - { "vDash;", 0x022A8 }, - { "vangrt;", 0x0299C }, - { "varepsilon;", 0x003F5 }, - { "varkappa;", 0x003F0 }, - { "varnothing;", 0x02205 }, - { "varphi;", 0x003D5 }, - { "varpi;", 0x003D6 }, - { "varpropto;", 0x0221D }, - { "varr;", 0x02195 }, - { "varrho;", 0x003F1 }, - { "varsigma;", 0x003C2 }, - { "vartheta;", 0x003D1 }, - { "vartriangleleft;", 0x022B2 }, - { "vartriangleright;", 0x022B3 }, - { "vcy;", 0x00432 }, - { "vdash;", 0x022A2 }, - { "vee;", 0x02228 }, - { "veebar;", 0x022BB }, - { "veeeq;", 0x0225A }, - { "vellip;", 0x022EE }, - { "verbar;", 0x0007C }, - { "vert;", 0x0007C }, - { "vfr;", 0x1D533 }, - { "vltri;", 0x022B2 }, - { "vopf;", 0x1D567 }, - { "vprop;", 0x0221D }, - { "vrtri;", 0x022B3 }, - { "vscr;", 0x1D4CB }, - { "vzigzag;", 0x0299A }, - { "wcirc;", 0x00175 }, - { "wedbar;", 0x02A5F }, - { "wedge;", 0x02227 }, - { "wedgeq;", 0x02259 }, - { "weierp;", 0x02118 }, - { "wfr;", 0x1D534 }, - { "wopf;", 0x1D568 }, - { "wp;", 0x02118 }, - { "wr;", 0x02240 }, - { "wreath;", 0x02240 }, - { "wscr;", 0x1D4CC }, - { "xcap;", 0x022C2 }, - { "xcirc;", 0x025EF }, - { "xcup;", 0x022C3 }, - { "xdtri;", 0x025BD }, - { "xfr;", 0x1D535 }, - { "xhArr;", 0x027FA }, - { "xharr;", 0x027F7 }, - { "xi;", 0x003BE }, - { "xlArr;", 0x027F8 }, - { "xlarr;", 0x027F5 }, - { "xmap;", 0x027FC }, - { "xnis;", 0x022FB }, - { "xodot;", 0x02A00 }, - { "xopf;", 0x1D569 }, - { "xoplus;", 0x02A01 }, - { "xotime;", 0x02A02 }, - { "xrArr;", 0x027F9 }, - { "xrarr;", 0x027F6 }, - { "xscr;", 0x1D4CD }, - { "xsqcup;", 0x02A06 }, - { "xuplus;", 0x02A04 }, - { "xutri;", 0x025B3 }, - { "xvee;", 0x022C1 }, - { "xwedge;", 0x022C0 }, - { "yacute;", 0x000FD }, - { "yacute", 0x000FD }, - { "yacy;", 0x0044F }, - { "ycirc;", 0x00177 }, - { "ycy;", 0x0044B }, - { "yen;", 0x000A5 }, - { "yen", 0x000A5 }, - { "yfr;", 0x1D536 }, - { "yicy;", 0x00457 }, - { "yopf;", 0x1D56A }, - { "yscr;", 0x1D4CE }, - { "yucy;", 0x0044E }, - { "yuml;", 0x000FF }, - { "yuml", 0x000FF }, - { "zacute;", 0x0017A }, - { "zcaron;", 0x0017E }, - { "zcy;", 0x00437 }, - { "zdot;", 0x0017C }, - { "zeetrf;", 0x02128 }, - { "zeta;", 0x003B6 }, - { "zfr;", 0x1D537 }, - { "zhcy;", 0x00436 }, - { "zigrarr;", 0x021DD }, - { "zopf;", 0x1D56B }, - { "zscr;", 0x1D4CF }, - { "zwj;", 0x0200D }, - { "zwnj;", 0x0200C } + { "AElig;"sv, 0x000C6 }, + { "AElig"sv, 0x000C6 }, + { "AMP;"sv, 0x00026 }, + { "AMP"sv, 0x00026 }, + { "Aacute;"sv, 0x000C1 }, + { "Aacute"sv, 0x000C1 }, + { "Abreve;"sv, 0x00102 }, + { "Acirc;"sv, 0x000C2 }, + { "Acirc"sv, 0x000C2 }, + { "Acy;"sv, 0x00410 }, + { "Afr;"sv, 0x1D504 }, + { "Agrave;"sv, 0x000C0 }, + { "Agrave"sv, 0x000C0 }, + { "Alpha;"sv, 0x00391 }, + { "Amacr;"sv, 0x00100 }, + { "And;"sv, 0x02A53 }, + { "Aogon;"sv, 0x00104 }, + { "Aopf;"sv, 0x1D538 }, + { "ApplyFunction;"sv, 0x02061 }, + { "Aring;"sv, 0x000C5 }, + { "Aring"sv, 0x000C5 }, + { "Ascr;"sv, 0x1D49C }, + { "Assign;"sv, 0x02254 }, + { "Atilde;"sv, 0x000C3 }, + { "Atilde"sv, 0x000C3 }, + { "Auml;"sv, 0x000C4 }, + { "Auml"sv, 0x000C4 }, + { "Backslash;"sv, 0x02216 }, + { "Barv;"sv, 0x02AE7 }, + { "Barwed;"sv, 0x02306 }, + { "Bcy;"sv, 0x00411 }, + { "Because;"sv, 0x02235 }, + { "Bernoullis;"sv, 0x0212C }, + { "Beta;"sv, 0x00392 }, + { "Bfr;"sv, 0x1D505 }, + { "Bopf;"sv, 0x1D539 }, + { "Breve;"sv, 0x002D8 }, + { "Bscr;"sv, 0x0212C }, + { "Bumpeq;"sv, 0x0224E }, + { "CHcy;"sv, 0x00427 }, + { "COPY;"sv, 0x000A9 }, + { "COPY"sv, 0x000A9 }, + { "Cacute;"sv, 0x00106 }, + { "Cap;"sv, 0x022D2 }, + { "CapitalDifferentialD;"sv, 0x02145 }, + { "Cayleys;"sv, 0x0212D }, + { "Ccaron;"sv, 0x0010C }, + { "Ccedil;"sv, 0x000C7 }, + { "Ccedil"sv, 0x000C7 }, + { "Ccirc;"sv, 0x00108 }, + { "Cconint;"sv, 0x02230 }, + { "Cdot;"sv, 0x0010A }, + { "Cedilla;"sv, 0x000B8 }, + { "CenterDot;"sv, 0x000B7 }, + { "Cfr;"sv, 0x0212D }, + { "Chi;"sv, 0x003A7 }, + { "CircleDot;"sv, 0x02299 }, + { "CircleMinus;"sv, 0x02296 }, + { "CirclePlus;"sv, 0x02295 }, + { "CircleTimes;"sv, 0x02297 }, + { "ClockwiseContourIntegral;"sv, 0x02232 }, + { "CloseCurlyDoubleQuote;"sv, 0x0201D }, + { "CloseCurlyQuote;"sv, 0x02019 }, + { "Colon;"sv, 0x02237 }, + { "Colone;"sv, 0x02A74 }, + { "Congruent;"sv, 0x02261 }, + { "Conint;"sv, 0x0222F }, + { "ContourIntegral;"sv, 0x0222E }, + { "Copf;"sv, 0x02102 }, + { "Coproduct;"sv, 0x02210 }, + { "CounterClockwiseContourIntegral;"sv, 0x02233 }, + { "Cross;"sv, 0x02A2F }, + { "Cscr;"sv, 0x1D49E }, + { "Cup;"sv, 0x022D3 }, + { "CupCap;"sv, 0x0224D }, + { "DD;"sv, 0x02145 }, + { "DDotrahd;"sv, 0x02911 }, + { "DJcy;"sv, 0x00402 }, + { "DScy;"sv, 0x00405 }, + { "DZcy;"sv, 0x0040F }, + { "Dagger;"sv, 0x02021 }, + { "Darr;"sv, 0x021A1 }, + { "Dashv;"sv, 0x02AE4 }, + { "Dcaron;"sv, 0x0010E }, + { "Dcy;"sv, 0x00414 }, + { "Del;"sv, 0x02207 }, + { "Delta;"sv, 0x00394 }, + { "Dfr;"sv, 0x1D507 }, + { "DiacriticalAcute;"sv, 0x000B4 }, + { "DiacriticalDot;"sv, 0x002D9 }, + { "DiacriticalDoubleAcute;"sv, 0x002DD }, + { "DiacriticalGrave;"sv, 0x00060 }, + { "DiacriticalTilde;"sv, 0x002DC }, + { "Diamond;"sv, 0x022C4 }, + { "DifferentialD;"sv, 0x02146 }, + { "Dopf;"sv, 0x1D53B }, + { "Dot;"sv, 0x000A8 }, + { "DotDot;"sv, 0x020DC }, + { "DotEqual;"sv, 0x02250 }, + { "DoubleContourIntegral;"sv, 0x0222F }, + { "DoubleDot;"sv, 0x000A8 }, + { "DoubleDownArrow;"sv, 0x021D3 }, + { "DoubleLeftArrow;"sv, 0x021D0 }, + { "DoubleLeftRightArrow;"sv, 0x021D4 }, + { "DoubleLeftTee;"sv, 0x02AE4 }, + { "DoubleLongLeftArrow;"sv, 0x027F8 }, + { "DoubleLongLeftRightArrow;"sv, 0x027FA }, + { "DoubleLongRightArrow;"sv, 0x027F9 }, + { "DoubleRightArrow;"sv, 0x021D2 }, + { "DoubleRightTee;"sv, 0x022A8 }, + { "DoubleUpArrow;"sv, 0x021D1 }, + { "DoubleUpDownArrow;"sv, 0x021D5 }, + { "DoubleVerticalBar;"sv, 0x02225 }, + { "DownArrow;"sv, 0x02193 }, + { "DownArrowBar;"sv, 0x02913 }, + { "DownArrowUpArrow;"sv, 0x021F5 }, + { "DownBreve;"sv, 0x00311 }, + { "DownLeftRightVector;"sv, 0x02950 }, + { "DownLeftTeeVector;"sv, 0x0295E }, + { "DownLeftVector;"sv, 0x021BD }, + { "DownLeftVectorBar;"sv, 0x02956 }, + { "DownRightTeeVector;"sv, 0x0295F }, + { "DownRightVector;"sv, 0x021C1 }, + { "DownRightVectorBar;"sv, 0x02957 }, + { "DownTee;"sv, 0x022A4 }, + { "DownTeeArrow;"sv, 0x021A7 }, + { "Downarrow;"sv, 0x021D3 }, + { "Dscr;"sv, 0x1D49F }, + { "Dstrok;"sv, 0x00110 }, + { "ENG;"sv, 0x0014A }, + { "ETH;"sv, 0x000D0 }, + { "ETH"sv, 0x000D0 }, + { "Eacute;"sv, 0x000C9 }, + { "Eacute"sv, 0x000C9 }, + { "Ecaron;"sv, 0x0011A }, + { "Ecirc;"sv, 0x000CA }, + { "Ecirc"sv, 0x000CA }, + { "Ecy;"sv, 0x0042D }, + { "Edot;"sv, 0x00116 }, + { "Efr;"sv, 0x1D508 }, + { "Egrave;"sv, 0x000C8 }, + { "Egrave"sv, 0x000C8 }, + { "Element;"sv, 0x02208 }, + { "Emacr;"sv, 0x00112 }, + { "EmptySmallSquare;"sv, 0x025FB }, + { "EmptyVerySmallSquare;"sv, 0x025AB }, + { "Eogon;"sv, 0x00118 }, + { "Eopf;"sv, 0x1D53C }, + { "Epsilon;"sv, 0x00395 }, + { "Equal;"sv, 0x02A75 }, + { "EqualTilde;"sv, 0x02242 }, + { "Equilibrium;"sv, 0x021CC }, + { "Escr;"sv, 0x02130 }, + { "Esim;"sv, 0x02A73 }, + { "Eta;"sv, 0x00397 }, + { "Euml;"sv, 0x000CB }, + { "Euml"sv, 0x000CB }, + { "Exists;"sv, 0x02203 }, + { "ExponentialE;"sv, 0x02147 }, + { "Fcy;"sv, 0x00424 }, + { "Ffr;"sv, 0x1D509 }, + { "FilledSmallSquare;"sv, 0x025FC }, + { "FilledVerySmallSquare;"sv, 0x025AA }, + { "Fopf;"sv, 0x1D53D }, + { "ForAll;"sv, 0x02200 }, + { "Fouriertrf;"sv, 0x02131 }, + { "Fscr;"sv, 0x02131 }, + { "GJcy;"sv, 0x00403 }, + { "GT;"sv, 0x0003E }, + { "GT"sv, 0x0003E }, + { "Gamma;"sv, 0x00393 }, + { "Gammad;"sv, 0x003DC }, + { "Gbreve;"sv, 0x0011E }, + { "Gcedil;"sv, 0x00122 }, + { "Gcirc;"sv, 0x0011C }, + { "Gcy;"sv, 0x00413 }, + { "Gdot;"sv, 0x00120 }, + { "Gfr;"sv, 0x1D50A }, + { "Gg;"sv, 0x022D9 }, + { "Gopf;"sv, 0x1D53E }, + { "GreaterEqual;"sv, 0x02265 }, + { "GreaterEqualLess;"sv, 0x022DB }, + { "GreaterFullEqual;"sv, 0x02267 }, + { "GreaterGreater;"sv, 0x02AA2 }, + { "GreaterLess;"sv, 0x02277 }, + { "GreaterSlantEqual;"sv, 0x02A7E }, + { "GreaterTilde;"sv, 0x02273 }, + { "Gscr;"sv, 0x1D4A2 }, + { "Gt;"sv, 0x0226B }, + { "HARDcy;"sv, 0x0042A }, + { "Hacek;"sv, 0x002C7 }, + { "Hat;"sv, 0x0005E }, + { "Hcirc;"sv, 0x00124 }, + { "Hfr;"sv, 0x0210C }, + { "HilbertSpace;"sv, 0x0210B }, + { "Hopf;"sv, 0x0210D }, + { "HorizontalLine;"sv, 0x02500 }, + { "Hscr;"sv, 0x0210B }, + { "Hstrok;"sv, 0x00126 }, + { "HumpDownHump;"sv, 0x0224E }, + { "HumpEqual;"sv, 0x0224F }, + { "IEcy;"sv, 0x00415 }, + { "IJlig;"sv, 0x00132 }, + { "IOcy;"sv, 0x00401 }, + { "Iacute;"sv, 0x000CD }, + { "Iacute"sv, 0x000CD }, + { "Icirc;"sv, 0x000CE }, + { "Icirc"sv, 0x000CE }, + { "Icy;"sv, 0x00418 }, + { "Idot;"sv, 0x00130 }, + { "Ifr;"sv, 0x02111 }, + { "Igrave;"sv, 0x000CC }, + { "Igrave"sv, 0x000CC }, + { "Im;"sv, 0x02111 }, + { "Imacr;"sv, 0x0012A }, + { "ImaginaryI;"sv, 0x02148 }, + { "Implies;"sv, 0x021D2 }, + { "Int;"sv, 0x0222C }, + { "Integral;"sv, 0x0222B }, + { "Intersection;"sv, 0x022C2 }, + { "InvisibleComma;"sv, 0x02063 }, + { "InvisibleTimes;"sv, 0x02062 }, + { "Iogon;"sv, 0x0012E }, + { "Iopf;"sv, 0x1D540 }, + { "Iota;"sv, 0x00399 }, + { "Iscr;"sv, 0x02110 }, + { "Itilde;"sv, 0x00128 }, + { "Iukcy;"sv, 0x00406 }, + { "Iuml;"sv, 0x000CF }, + { "Iuml"sv, 0x000CF }, + { "Jcirc;"sv, 0x00134 }, + { "Jcy;"sv, 0x00419 }, + { "Jfr;"sv, 0x1D50D }, + { "Jopf;"sv, 0x1D541 }, + { "Jscr;"sv, 0x1D4A5 }, + { "Jsercy;"sv, 0x00408 }, + { "Jukcy;"sv, 0x00404 }, + { "KHcy;"sv, 0x00425 }, + { "KJcy;"sv, 0x0040C }, + { "Kappa;"sv, 0x0039A }, + { "Kcedil;"sv, 0x00136 }, + { "Kcy;"sv, 0x0041A }, + { "Kfr;"sv, 0x1D50E }, + { "Kopf;"sv, 0x1D542 }, + { "Kscr;"sv, 0x1D4A6 }, + { "LJcy;"sv, 0x00409 }, + { "LT;"sv, 0x0003C }, + { "LT"sv, 0x0003C }, + { "Lacute;"sv, 0x00139 }, + { "Lambda;"sv, 0x0039B }, + { "Lang;"sv, 0x027EA }, + { "Laplacetrf;"sv, 0x02112 }, + { "Larr;"sv, 0x0219E }, + { "Lcaron;"sv, 0x0013D }, + { "Lcedil;"sv, 0x0013B }, + { "Lcy;"sv, 0x0041B }, + { "LeftAngleBracket;"sv, 0x027E8 }, + { "LeftArrow;"sv, 0x02190 }, + { "LeftArrowBar;"sv, 0x021E4 }, + { "LeftArrowRightArrow;"sv, 0x021C6 }, + { "LeftCeiling;"sv, 0x02308 }, + { "LeftDoubleBracket;"sv, 0x027E6 }, + { "LeftDownTeeVector;"sv, 0x02961 }, + { "LeftDownVector;"sv, 0x021C3 }, + { "LeftDownVectorBar;"sv, 0x02959 }, + { "LeftFloor;"sv, 0x0230A }, + { "LeftRightArrow;"sv, 0x02194 }, + { "LeftRightVector;"sv, 0x0294E }, + { "LeftTee;"sv, 0x022A3 }, + { "LeftTeeArrow;"sv, 0x021A4 }, + { "LeftTeeVector;"sv, 0x0295A }, + { "LeftTriangle;"sv, 0x022B2 }, + { "LeftTriangleBar;"sv, 0x029CF }, + { "LeftTriangleEqual;"sv, 0x022B4 }, + { "LeftUpDownVector;"sv, 0x02951 }, + { "LeftUpTeeVector;"sv, 0x02960 }, + { "LeftUpVector;"sv, 0x021BF }, + { "LeftUpVectorBar;"sv, 0x02958 }, + { "LeftVector;"sv, 0x021BC }, + { "LeftVectorBar;"sv, 0x02952 }, + { "Leftarrow;"sv, 0x021D0 }, + { "Leftrightarrow;"sv, 0x021D4 }, + { "LessEqualGreater;"sv, 0x022DA }, + { "LessFullEqual;"sv, 0x02266 }, + { "LessGreater;"sv, 0x02276 }, + { "LessLess;"sv, 0x02AA1 }, + { "LessSlantEqual;"sv, 0x02A7D }, + { "LessTilde;"sv, 0x02272 }, + { "Lfr;"sv, 0x1D50F }, + { "Ll;"sv, 0x022D8 }, + { "Lleftarrow;"sv, 0x021DA }, + { "Lmidot;"sv, 0x0013F }, + { "LongLeftArrow;"sv, 0x027F5 }, + { "LongLeftRightArrow;"sv, 0x027F7 }, + { "LongRightArrow;"sv, 0x027F6 }, + { "Longleftarrow;"sv, 0x027F8 }, + { "Longleftrightarrow;"sv, 0x027FA }, + { "Longrightarrow;"sv, 0x027F9 }, + { "Lopf;"sv, 0x1D543 }, + { "LowerLeftArrow;"sv, 0x02199 }, + { "LowerRightArrow;"sv, 0x02198 }, + { "Lscr;"sv, 0x02112 }, + { "Lsh;"sv, 0x021B0 }, + { "Lstrok;"sv, 0x00141 }, + { "Lt;"sv, 0x0226A }, + { "Map;"sv, 0x02905 }, + { "Mcy;"sv, 0x0041C }, + { "MediumSpace;"sv, 0x0205F }, + { "Mellintrf;"sv, 0x02133 }, + { "Mfr;"sv, 0x1D510 }, + { "MinusPlus;"sv, 0x02213 }, + { "Mopf;"sv, 0x1D544 }, + { "Mscr;"sv, 0x02133 }, + { "Mu;"sv, 0x0039C }, + { "NJcy;"sv, 0x0040A }, + { "Nacute;"sv, 0x00143 }, + { "Ncaron;"sv, 0x00147 }, + { "Ncedil;"sv, 0x00145 }, + { "Ncy;"sv, 0x0041D }, + { "NegativeMediumSpace;"sv, 0x0200B }, + { "NegativeThickSpace;"sv, 0x0200B }, + { "NegativeThinSpace;"sv, 0x0200B }, + { "NegativeVeryThinSpace;"sv, 0x0200B }, + { "NestedGreaterGreater;"sv, 0x0226B }, + { "NestedLessLess;"sv, 0x0226A }, + { "NewLine;"sv, 0x0000A }, + { "Nfr;"sv, 0x1D511 }, + { "NoBreak;"sv, 0x02060 }, + { "NonBreakingSpace;"sv, 0x000A0 }, + { "Nopf;"sv, 0x02115 }, + { "Not;"sv, 0x02AEC }, + { "NotCongruent;"sv, 0x02262 }, + { "NotCupCap;"sv, 0x0226D }, + { "NotDoubleVerticalBar;"sv, 0x02226 }, + { "NotElement;"sv, 0x02209 }, + { "NotEqual;"sv, 0x02260 }, + { "NotExists;"sv, 0x02204 }, + { "NotGreater;"sv, 0x0226F }, + { "NotGreaterEqual;"sv, 0x02271 }, + { "NotGreaterLess;"sv, 0x02279 }, + { "NotGreaterTilde;"sv, 0x02275 }, + { "NotLeftTriangle;"sv, 0x022EA }, + { "NotLeftTriangleEqual;"sv, 0x022EC }, + { "NotLess;"sv, 0x0226E }, + { "NotLessEqual;"sv, 0x02270 }, + { "NotLessGreater;"sv, 0x02278 }, + { "NotLessTilde;"sv, 0x02274 }, + { "NotPrecedes;"sv, 0x02280 }, + { "NotPrecedesSlantEqual;"sv, 0x022E0 }, + { "NotReverseElement;"sv, 0x0220C }, + { "NotRightTriangle;"sv, 0x022EB }, + { "NotRightTriangleEqual;"sv, 0x022ED }, + { "NotSquareSubsetEqual;"sv, 0x022E2 }, + { "NotSquareSupersetEqual;"sv, 0x022E3 }, + { "NotSubsetEqual;"sv, 0x02288 }, + { "NotSucceeds;"sv, 0x02281 }, + { "NotSucceedsSlantEqual;"sv, 0x022E1 }, + { "NotSupersetEqual;"sv, 0x02289 }, + { "NotTilde;"sv, 0x02241 }, + { "NotTildeEqual;"sv, 0x02244 }, + { "NotTildeFullEqual;"sv, 0x02247 }, + { "NotTildeTilde;"sv, 0x02249 }, + { "NotVerticalBar;"sv, 0x02224 }, + { "Nscr;"sv, 0x1D4A9 }, + { "Ntilde;"sv, 0x000D1 }, + { "Ntilde"sv, 0x000D1 }, + { "Nu;"sv, 0x0039D }, + { "OElig;"sv, 0x00152 }, + { "Oacute;"sv, 0x000D3 }, + { "Oacute"sv, 0x000D3 }, + { "Ocirc;"sv, 0x000D4 }, + { "Ocirc"sv, 0x000D4 }, + { "Ocy;"sv, 0x0041E }, + { "Odblac;"sv, 0x00150 }, + { "Ofr;"sv, 0x1D512 }, + { "Ograve;"sv, 0x000D2 }, + { "Ograve"sv, 0x000D2 }, + { "Omacr;"sv, 0x0014C }, + { "Omega;"sv, 0x003A9 }, + { "Omicron;"sv, 0x0039F }, + { "Oopf;"sv, 0x1D546 }, + { "OpenCurlyDoubleQuote;"sv, 0x0201C }, + { "OpenCurlyQuote;"sv, 0x02018 }, + { "Or;"sv, 0x02A54 }, + { "Oscr;"sv, 0x1D4AA }, + { "Oslash;"sv, 0x000D8 }, + { "Oslash"sv, 0x000D8 }, + { "Otilde;"sv, 0x000D5 }, + { "Otilde"sv, 0x000D5 }, + { "Otimes;"sv, 0x02A37 }, + { "Ouml;"sv, 0x000D6 }, + { "Ouml"sv, 0x000D6 }, + { "OverBar;"sv, 0x0203E }, + { "OverBrace;"sv, 0x023DE }, + { "OverBracket;"sv, 0x023B4 }, + { "OverParenthesis;"sv, 0x023DC }, + { "PartialD;"sv, 0x02202 }, + { "Pcy;"sv, 0x0041F }, + { "Pfr;"sv, 0x1D513 }, + { "Phi;"sv, 0x003A6 }, + { "Pi;"sv, 0x003A0 }, + { "PlusMinus;"sv, 0x000B1 }, + { "Poincareplane;"sv, 0x0210C }, + { "Popf;"sv, 0x02119 }, + { "Pr;"sv, 0x02ABB }, + { "Precedes;"sv, 0x0227A }, + { "PrecedesEqual;"sv, 0x02AAF }, + { "PrecedesSlantEqual;"sv, 0x0227C }, + { "PrecedesTilde;"sv, 0x0227E }, + { "Prime;"sv, 0x02033 }, + { "Product;"sv, 0x0220F }, + { "Proportion;"sv, 0x02237 }, + { "Proportional;"sv, 0x0221D }, + { "Pscr;"sv, 0x1D4AB }, + { "Psi;"sv, 0x003A8 }, + { "QUOT;"sv, 0x00022 }, + { "QUOT"sv, 0x00022 }, + { "Qfr;"sv, 0x1D514 }, + { "Qopf;"sv, 0x0211A }, + { "Qscr;"sv, 0x1D4AC }, + { "RBarr;"sv, 0x02910 }, + { "REG;"sv, 0x000AE }, + { "REG"sv, 0x000AE }, + { "Racute;"sv, 0x00154 }, + { "Rang;"sv, 0x027EB }, + { "Rarr;"sv, 0x021A0 }, + { "Rarrtl;"sv, 0x02916 }, + { "Rcaron;"sv, 0x00158 }, + { "Rcedil;"sv, 0x00156 }, + { "Rcy;"sv, 0x00420 }, + { "Re;"sv, 0x0211C }, + { "ReverseElement;"sv, 0x0220B }, + { "ReverseEquilibrium;"sv, 0x021CB }, + { "ReverseUpEquilibrium;"sv, 0x0296F }, + { "Rfr;"sv, 0x0211C }, + { "Rho;"sv, 0x003A1 }, + { "RightAngleBracket;"sv, 0x027E9 }, + { "RightArrow;"sv, 0x02192 }, + { "RightArrowBar;"sv, 0x021E5 }, + { "RightArrowLeftArrow;"sv, 0x021C4 }, + { "RightCeiling;"sv, 0x02309 }, + { "RightDoubleBracket;"sv, 0x027E7 }, + { "RightDownTeeVector;"sv, 0x0295D }, + { "RightDownVector;"sv, 0x021C2 }, + { "RightDownVectorBar;"sv, 0x02955 }, + { "RightFloor;"sv, 0x0230B }, + { "RightTee;"sv, 0x022A2 }, + { "RightTeeArrow;"sv, 0x021A6 }, + { "RightTeeVector;"sv, 0x0295B }, + { "RightTriangle;"sv, 0x022B3 }, + { "RightTriangleBar;"sv, 0x029D0 }, + { "RightTriangleEqual;"sv, 0x022B5 }, + { "RightUpDownVector;"sv, 0x0294F }, + { "RightUpTeeVector;"sv, 0x0295C }, + { "RightUpVector;"sv, 0x021BE }, + { "RightUpVectorBar;"sv, 0x02954 }, + { "RightVector;"sv, 0x021C0 }, + { "RightVectorBar;"sv, 0x02953 }, + { "Rightarrow;"sv, 0x021D2 }, + { "Ropf;"sv, 0x0211D }, + { "RoundImplies;"sv, 0x02970 }, + { "Rrightarrow;"sv, 0x021DB }, + { "Rscr;"sv, 0x0211B }, + { "Rsh;"sv, 0x021B1 }, + { "RuleDelayed;"sv, 0x029F4 }, + { "SHCHcy;"sv, 0x00429 }, + { "SHcy;"sv, 0x00428 }, + { "SOFTcy;"sv, 0x0042C }, + { "Sacute;"sv, 0x0015A }, + { "Sc;"sv, 0x02ABC }, + { "Scaron;"sv, 0x00160 }, + { "Scedil;"sv, 0x0015E }, + { "Scirc;"sv, 0x0015C }, + { "Scy;"sv, 0x00421 }, + { "Sfr;"sv, 0x1D516 }, + { "ShortDownArrow;"sv, 0x02193 }, + { "ShortLeftArrow;"sv, 0x02190 }, + { "ShortRightArrow;"sv, 0x02192 }, + { "ShortUpArrow;"sv, 0x02191 }, + { "Sigma;"sv, 0x003A3 }, + { "SmallCircle;"sv, 0x02218 }, + { "Sopf;"sv, 0x1D54A }, + { "Sqrt;"sv, 0x0221A }, + { "Square;"sv, 0x025A1 }, + { "SquareIntersection;"sv, 0x02293 }, + { "SquareSubset;"sv, 0x0228F }, + { "SquareSubsetEqual;"sv, 0x02291 }, + { "SquareSuperset;"sv, 0x02290 }, + { "SquareSupersetEqual;"sv, 0x02292 }, + { "SquareUnion;"sv, 0x02294 }, + { "Sscr;"sv, 0x1D4AE }, + { "Star;"sv, 0x022C6 }, + { "Sub;"sv, 0x022D0 }, + { "Subset;"sv, 0x022D0 }, + { "SubsetEqual;"sv, 0x02286 }, + { "Succeeds;"sv, 0x0227B }, + { "SucceedsEqual;"sv, 0x02AB0 }, + { "SucceedsSlantEqual;"sv, 0x0227D }, + { "SucceedsTilde;"sv, 0x0227F }, + { "SuchThat;"sv, 0x0220B }, + { "Sum;"sv, 0x02211 }, + { "Sup;"sv, 0x022D1 }, + { "Superset;"sv, 0x02283 }, + { "SupersetEqual;"sv, 0x02287 }, + { "Supset;"sv, 0x022D1 }, + { "THORN;"sv, 0x000DE }, + { "THORN"sv, 0x000DE }, + { "TRADE;"sv, 0x02122 }, + { "TSHcy;"sv, 0x0040B }, + { "TScy;"sv, 0x00426 }, + { "Tab;"sv, 0x00009 }, + { "Tau;"sv, 0x003A4 }, + { "Tcaron;"sv, 0x00164 }, + { "Tcedil;"sv, 0x00162 }, + { "Tcy;"sv, 0x00422 }, + { "Tfr;"sv, 0x1D517 }, + { "Therefore;"sv, 0x02234 }, + { "Theta;"sv, 0x00398 }, + { "ThinSpace;"sv, 0x02009 }, + { "Tilde;"sv, 0x0223C }, + { "TildeEqual;"sv, 0x02243 }, + { "TildeFullEqual;"sv, 0x02245 }, + { "TildeTilde;"sv, 0x02248 }, + { "Topf;"sv, 0x1D54B }, + { "TripleDot;"sv, 0x020DB }, + { "Tscr;"sv, 0x1D4AF }, + { "Tstrok;"sv, 0x00166 }, + { "Uacute;"sv, 0x000DA }, + { "Uacute"sv, 0x000DA }, + { "Uarr;"sv, 0x0219F }, + { "Uarrocir;"sv, 0x02949 }, + { "Ubrcy;"sv, 0x0040E }, + { "Ubreve;"sv, 0x0016C }, + { "Ucirc;"sv, 0x000DB }, + { "Ucirc"sv, 0x000DB }, + { "Ucy;"sv, 0x00423 }, + { "Udblac;"sv, 0x00170 }, + { "Ufr;"sv, 0x1D518 }, + { "Ugrave;"sv, 0x000D9 }, + { "Ugrave"sv, 0x000D9 }, + { "Umacr;"sv, 0x0016A }, + { "UnderBar;"sv, 0x0005F }, + { "UnderBrace;"sv, 0x023DF }, + { "UnderBracket;"sv, 0x023B5 }, + { "UnderParenthesis;"sv, 0x023DD }, + { "Union;"sv, 0x022C3 }, + { "UnionPlus;"sv, 0x0228E }, + { "Uogon;"sv, 0x00172 }, + { "Uopf;"sv, 0x1D54C }, + { "UpArrow;"sv, 0x02191 }, + { "UpArrowBar;"sv, 0x02912 }, + { "UpArrowDownArrow;"sv, 0x021C5 }, + { "UpDownArrow;"sv, 0x02195 }, + { "UpEquilibrium;"sv, 0x0296E }, + { "UpTee;"sv, 0x022A5 }, + { "UpTeeArrow;"sv, 0x021A5 }, + { "Uparrow;"sv, 0x021D1 }, + { "Updownarrow;"sv, 0x021D5 }, + { "UpperLeftArrow;"sv, 0x02196 }, + { "UpperRightArrow;"sv, 0x02197 }, + { "Upsi;"sv, 0x003D2 }, + { "Upsilon;"sv, 0x003A5 }, + { "Uring;"sv, 0x0016E }, + { "Uscr;"sv, 0x1D4B0 }, + { "Utilde;"sv, 0x00168 }, + { "Uuml;"sv, 0x000DC }, + { "Uuml"sv, 0x000DC }, + { "VDash;"sv, 0x022AB }, + { "Vbar;"sv, 0x02AEB }, + { "Vcy;"sv, 0x00412 }, + { "Vdash;"sv, 0x022A9 }, + { "Vdashl;"sv, 0x02AE6 }, + { "Vee;"sv, 0x022C1 }, + { "Verbar;"sv, 0x02016 }, + { "Vert;"sv, 0x02016 }, + { "VerticalBar;"sv, 0x02223 }, + { "VerticalLine;"sv, 0x0007C }, + { "VerticalSeparator;"sv, 0x02758 }, + { "VerticalTilde;"sv, 0x02240 }, + { "VeryThinSpace;"sv, 0x0200A }, + { "Vfr;"sv, 0x1D519 }, + { "Vopf;"sv, 0x1D54D }, + { "Vscr;"sv, 0x1D4B1 }, + { "Vvdash;"sv, 0x022AA }, + { "Wcirc;"sv, 0x00174 }, + { "Wedge;"sv, 0x022C0 }, + { "Wfr;"sv, 0x1D51A }, + { "Wopf;"sv, 0x1D54E }, + { "Wscr;"sv, 0x1D4B2 }, + { "Xfr;"sv, 0x1D51B }, + { "Xi;"sv, 0x0039E }, + { "Xopf;"sv, 0x1D54F }, + { "Xscr;"sv, 0x1D4B3 }, + { "YAcy;"sv, 0x0042F }, + { "YIcy;"sv, 0x00407 }, + { "YUcy;"sv, 0x0042E }, + { "Yacute;"sv, 0x000DD }, + { "Yacute"sv, 0x000DD }, + { "Ycirc;"sv, 0x00176 }, + { "Ycy;"sv, 0x0042B }, + { "Yfr;"sv, 0x1D51C }, + { "Yopf;"sv, 0x1D550 }, + { "Yscr;"sv, 0x1D4B4 }, + { "Yuml;"sv, 0x00178 }, + { "ZHcy;"sv, 0x00416 }, + { "Zacute;"sv, 0x00179 }, + { "Zcaron;"sv, 0x0017D }, + { "Zcy;"sv, 0x00417 }, + { "Zdot;"sv, 0x0017B }, + { "ZeroWidthSpace;"sv, 0x0200B }, + { "Zeta;"sv, 0x00396 }, + { "Zfr;"sv, 0x02128 }, + { "Zopf;"sv, 0x02124 }, + { "Zscr;"sv, 0x1D4B5 }, + { "aacute;"sv, 0x000E1 }, + { "aacute"sv, 0x000E1 }, + { "abreve;"sv, 0x00103 }, + { "ac;"sv, 0x0223E }, + { "acd;"sv, 0x0223F }, + { "acirc;"sv, 0x000E2 }, + { "acirc"sv, 0x000E2 }, + { "acute;"sv, 0x000B4 }, + { "acute"sv, 0x000B4 }, + { "acy;"sv, 0x00430 }, + { "aelig;"sv, 0x000E6 }, + { "aelig"sv, 0x000E6 }, + { "af;"sv, 0x02061 }, + { "afr;"sv, 0x1D51E }, + { "agrave;"sv, 0x000E0 }, + { "agrave"sv, 0x000E0 }, + { "alefsym;"sv, 0x02135 }, + { "aleph;"sv, 0x02135 }, + { "alpha;"sv, 0x003B1 }, + { "amacr;"sv, 0x00101 }, + { "amalg;"sv, 0x02A3F }, + { "amp;"sv, 0x00026 }, + { "amp"sv, 0x00026 }, + { "and;"sv, 0x02227 }, + { "andand;"sv, 0x02A55 }, + { "andd;"sv, 0x02A5C }, + { "andslope;"sv, 0x02A58 }, + { "andv;"sv, 0x02A5A }, + { "ang;"sv, 0x02220 }, + { "ange;"sv, 0x029A4 }, + { "angle;"sv, 0x02220 }, + { "angmsd;"sv, 0x02221 }, + { "angmsdaa;"sv, 0x029A8 }, + { "angmsdab;"sv, 0x029A9 }, + { "angmsdac;"sv, 0x029AA }, + { "angmsdad;"sv, 0x029AB }, + { "angmsdae;"sv, 0x029AC }, + { "angmsdaf;"sv, 0x029AD }, + { "angmsdag;"sv, 0x029AE }, + { "angmsdah;"sv, 0x029AF }, + { "angrt;"sv, 0x0221F }, + { "angrtvb;"sv, 0x022BE }, + { "angrtvbd;"sv, 0x0299D }, + { "angsph;"sv, 0x02222 }, + { "angst;"sv, 0x000C5 }, + { "angzarr;"sv, 0x0237C }, + { "aogon;"sv, 0x00105 }, + { "aopf;"sv, 0x1D552 }, + { "ap;"sv, 0x02248 }, + { "apE;"sv, 0x02A70 }, + { "apacir;"sv, 0x02A6F }, + { "ape;"sv, 0x0224A }, + { "apid;"sv, 0x0224B }, + { "apos;"sv, 0x00027 }, + { "approx;"sv, 0x02248 }, + { "approxeq;"sv, 0x0224A }, + { "aring;"sv, 0x000E5 }, + { "aring"sv, 0x000E5 }, + { "ascr;"sv, 0x1D4B6 }, + { "ast;"sv, 0x0002A }, + { "asymp;"sv, 0x02248 }, + { "asympeq;"sv, 0x0224D }, + { "atilde;"sv, 0x000E3 }, + { "atilde"sv, 0x000E3 }, + { "auml;"sv, 0x000E4 }, + { "auml"sv, 0x000E4 }, + { "awconint;"sv, 0x02233 }, + { "awint;"sv, 0x02A11 }, + { "bNot;"sv, 0x02AED }, + { "backcong;"sv, 0x0224C }, + { "backepsilon;"sv, 0x003F6 }, + { "backprime;"sv, 0x02035 }, + { "backsim;"sv, 0x0223D }, + { "backsimeq;"sv, 0x022CD }, + { "barvee;"sv, 0x022BD }, + { "barwed;"sv, 0x02305 }, + { "barwedge;"sv, 0x02305 }, + { "bbrk;"sv, 0x023B5 }, + { "bbrktbrk;"sv, 0x023B6 }, + { "bcong;"sv, 0x0224C }, + { "bcy;"sv, 0x00431 }, + { "bdquo;"sv, 0x0201E }, + { "becaus;"sv, 0x02235 }, + { "because;"sv, 0x02235 }, + { "bemptyv;"sv, 0x029B0 }, + { "bepsi;"sv, 0x003F6 }, + { "bernou;"sv, 0x0212C }, + { "beta;"sv, 0x003B2 }, + { "beth;"sv, 0x02136 }, + { "between;"sv, 0x0226C }, + { "bfr;"sv, 0x1D51F }, + { "bigcap;"sv, 0x022C2 }, + { "bigcirc;"sv, 0x025EF }, + { "bigcup;"sv, 0x022C3 }, + { "bigodot;"sv, 0x02A00 }, + { "bigoplus;"sv, 0x02A01 }, + { "bigotimes;"sv, 0x02A02 }, + { "bigsqcup;"sv, 0x02A06 }, + { "bigstar;"sv, 0x02605 }, + { "bigtriangledown;"sv, 0x025BD }, + { "bigtriangleup;"sv, 0x025B3 }, + { "biguplus;"sv, 0x02A04 }, + { "bigvee;"sv, 0x022C1 }, + { "bigwedge;"sv, 0x022C0 }, + { "bkarow;"sv, 0x0290D }, + { "blacklozenge;"sv, 0x029EB }, + { "blacksquare;"sv, 0x025AA }, + { "blacktriangle;"sv, 0x025B4 }, + { "blacktriangledown;"sv, 0x025BE }, + { "blacktriangleleft;"sv, 0x025C2 }, + { "blacktriangleright;"sv, 0x025B8 }, + { "blank;"sv, 0x02423 }, + { "blk12;"sv, 0x02592 }, + { "blk14;"sv, 0x02591 }, + { "blk34;"sv, 0x02593 }, + { "block;"sv, 0x02588 }, + { "bnot;"sv, 0x02310 }, + { "bopf;"sv, 0x1D553 }, + { "bot;"sv, 0x022A5 }, + { "bottom;"sv, 0x022A5 }, + { "bowtie;"sv, 0x022C8 }, + { "boxDL;"sv, 0x02557 }, + { "boxDR;"sv, 0x02554 }, + { "boxDl;"sv, 0x02556 }, + { "boxDr;"sv, 0x02553 }, + { "boxH;"sv, 0x02550 }, + { "boxHD;"sv, 0x02566 }, + { "boxHU;"sv, 0x02569 }, + { "boxHd;"sv, 0x02564 }, + { "boxHu;"sv, 0x02567 }, + { "boxUL;"sv, 0x0255D }, + { "boxUR;"sv, 0x0255A }, + { "boxUl;"sv, 0x0255C }, + { "boxUr;"sv, 0x02559 }, + { "boxV;"sv, 0x02551 }, + { "boxVH;"sv, 0x0256C }, + { "boxVL;"sv, 0x02563 }, + { "boxVR;"sv, 0x02560 }, + { "boxVh;"sv, 0x0256B }, + { "boxVl;"sv, 0x02562 }, + { "boxVr;"sv, 0x0255F }, + { "boxbox;"sv, 0x029C9 }, + { "boxdL;"sv, 0x02555 }, + { "boxdR;"sv, 0x02552 }, + { "boxdl;"sv, 0x02510 }, + { "boxdr;"sv, 0x0250C }, + { "boxh;"sv, 0x02500 }, + { "boxhD;"sv, 0x02565 }, + { "boxhU;"sv, 0x02568 }, + { "boxhd;"sv, 0x0252C }, + { "boxhu;"sv, 0x02534 }, + { "boxminus;"sv, 0x0229F }, + { "boxplus;"sv, 0x0229E }, + { "boxtimes;"sv, 0x022A0 }, + { "boxuL;"sv, 0x0255B }, + { "boxuR;"sv, 0x02558 }, + { "boxul;"sv, 0x02518 }, + { "boxur;"sv, 0x02514 }, + { "boxv;"sv, 0x02502 }, + { "boxvH;"sv, 0x0256A }, + { "boxvL;"sv, 0x02561 }, + { "boxvR;"sv, 0x0255E }, + { "boxvh;"sv, 0x0253C }, + { "boxvl;"sv, 0x02524 }, + { "boxvr;"sv, 0x0251C }, + { "bprime;"sv, 0x02035 }, + { "breve;"sv, 0x002D8 }, + { "brvbar;"sv, 0x000A6 }, + { "brvbar"sv, 0x000A6 }, + { "bscr;"sv, 0x1D4B7 }, + { "bsemi;"sv, 0x0204F }, + { "bsim;"sv, 0x0223D }, + { "bsime;"sv, 0x022CD }, + { "bsol;"sv, 0x0005C }, + { "bsolb;"sv, 0x029C5 }, + { "bsolhsub;"sv, 0x027C8 }, + { "bull;"sv, 0x02022 }, + { "bullet;"sv, 0x02022 }, + { "bump;"sv, 0x0224E }, + { "bumpE;"sv, 0x02AAE }, + { "bumpe;"sv, 0x0224F }, + { "bumpeq;"sv, 0x0224F }, + { "cacute;"sv, 0x00107 }, + { "cap;"sv, 0x02229 }, + { "capand;"sv, 0x02A44 }, + { "capbrcup;"sv, 0x02A49 }, + { "capcap;"sv, 0x02A4B }, + { "capcup;"sv, 0x02A47 }, + { "capdot;"sv, 0x02A40 }, + { "caret;"sv, 0x02041 }, + { "caron;"sv, 0x002C7 }, + { "ccaps;"sv, 0x02A4D }, + { "ccaron;"sv, 0x0010D }, + { "ccedil;"sv, 0x000E7 }, + { "ccedil"sv, 0x000E7 }, + { "ccirc;"sv, 0x00109 }, + { "ccups;"sv, 0x02A4C }, + { "ccupssm;"sv, 0x02A50 }, + { "cdot;"sv, 0x0010B }, + { "cedil;"sv, 0x000B8 }, + { "cedil"sv, 0x000B8 }, + { "cemptyv;"sv, 0x029B2 }, + { "cent;"sv, 0x000A2 }, + { "cent"sv, 0x000A2 }, + { "centerdot;"sv, 0x000B7 }, + { "cfr;"sv, 0x1D520 }, + { "chcy;"sv, 0x00447 }, + { "check;"sv, 0x02713 }, + { "checkmark;"sv, 0x02713 }, + { "chi;"sv, 0x003C7 }, + { "cir;"sv, 0x025CB }, + { "cirE;"sv, 0x029C3 }, + { "circ;"sv, 0x002C6 }, + { "circeq;"sv, 0x02257 }, + { "circlearrowleft;"sv, 0x021BA }, + { "circlearrowright;"sv, 0x021BB }, + { "circledR;"sv, 0x000AE }, + { "circledS;"sv, 0x024C8 }, + { "circledast;"sv, 0x0229B }, + { "circledcirc;"sv, 0x0229A }, + { "circleddash;"sv, 0x0229D }, + { "cire;"sv, 0x02257 }, + { "cirfnint;"sv, 0x02A10 }, + { "cirmid;"sv, 0x02AEF }, + { "cirscir;"sv, 0x029C2 }, + { "clubs;"sv, 0x02663 }, + { "clubsuit;"sv, 0x02663 }, + { "colon;"sv, 0x0003A }, + { "colone;"sv, 0x02254 }, + { "coloneq;"sv, 0x02254 }, + { "comma;"sv, 0x0002C }, + { "commat;"sv, 0x00040 }, + { "comp;"sv, 0x02201 }, + { "compfn;"sv, 0x02218 }, + { "complement;"sv, 0x02201 }, + { "complexes;"sv, 0x02102 }, + { "cong;"sv, 0x02245 }, + { "congdot;"sv, 0x02A6D }, + { "conint;"sv, 0x0222E }, + { "copf;"sv, 0x1D554 }, + { "coprod;"sv, 0x02210 }, + { "copy;"sv, 0x000A9 }, + { "copy"sv, 0x000A9 }, + { "copysr;"sv, 0x02117 }, + { "crarr;"sv, 0x021B5 }, + { "cross;"sv, 0x02717 }, + { "cscr;"sv, 0x1D4B8 }, + { "csub;"sv, 0x02ACF }, + { "csube;"sv, 0x02AD1 }, + { "csup;"sv, 0x02AD0 }, + { "csupe;"sv, 0x02AD2 }, + { "ctdot;"sv, 0x022EF }, + { "cudarrl;"sv, 0x02938 }, + { "cudarrr;"sv, 0x02935 }, + { "cuepr;"sv, 0x022DE }, + { "cuesc;"sv, 0x022DF }, + { "cularr;"sv, 0x021B6 }, + { "cularrp;"sv, 0x0293D }, + { "cup;"sv, 0x0222A }, + { "cupbrcap;"sv, 0x02A48 }, + { "cupcap;"sv, 0x02A46 }, + { "cupcup;"sv, 0x02A4A }, + { "cupdot;"sv, 0x0228D }, + { "cupor;"sv, 0x02A45 }, + { "curarr;"sv, 0x021B7 }, + { "curarrm;"sv, 0x0293C }, + { "curlyeqprec;"sv, 0x022DE }, + { "curlyeqsucc;"sv, 0x022DF }, + { "curlyvee;"sv, 0x022CE }, + { "curlywedge;"sv, 0x022CF }, + { "curren;"sv, 0x000A4 }, + { "curren"sv, 0x000A4 }, + { "curvearrowleft;"sv, 0x021B6 }, + { "curvearrowright;"sv, 0x021B7 }, + { "cuvee;"sv, 0x022CE }, + { "cuwed;"sv, 0x022CF }, + { "cwconint;"sv, 0x02232 }, + { "cwint;"sv, 0x02231 }, + { "cylcty;"sv, 0x0232D }, + { "dArr;"sv, 0x021D3 }, + { "dHar;"sv, 0x02965 }, + { "dagger;"sv, 0x02020 }, + { "daleth;"sv, 0x02138 }, + { "darr;"sv, 0x02193 }, + { "dash;"sv, 0x02010 }, + { "dashv;"sv, 0x022A3 }, + { "dbkarow;"sv, 0x0290F }, + { "dblac;"sv, 0x002DD }, + { "dcaron;"sv, 0x0010F }, + { "dcy;"sv, 0x00434 }, + { "dd;"sv, 0x02146 }, + { "ddagger;"sv, 0x02021 }, + { "ddarr;"sv, 0x021CA }, + { "ddotseq;"sv, 0x02A77 }, + { "deg;"sv, 0x000B0 }, + { "deg"sv, 0x000B0 }, + { "delta;"sv, 0x003B4 }, + { "demptyv;"sv, 0x029B1 }, + { "dfisht;"sv, 0x0297F }, + { "dfr;"sv, 0x1D521 }, + { "dharl;"sv, 0x021C3 }, + { "dharr;"sv, 0x021C2 }, + { "diam;"sv, 0x022C4 }, + { "diamond;"sv, 0x022C4 }, + { "diamondsuit;"sv, 0x02666 }, + { "diams;"sv, 0x02666 }, + { "die;"sv, 0x000A8 }, + { "digamma;"sv, 0x003DD }, + { "disin;"sv, 0x022F2 }, + { "div;"sv, 0x000F7 }, + { "divide;"sv, 0x000F7 }, + { "divide"sv, 0x000F7 }, + { "divideontimes;"sv, 0x022C7 }, + { "divonx;"sv, 0x022C7 }, + { "djcy;"sv, 0x00452 }, + { "dlcorn;"sv, 0x0231E }, + { "dlcrop;"sv, 0x0230D }, + { "dollar;"sv, 0x00024 }, + { "dopf;"sv, 0x1D555 }, + { "dot;"sv, 0x002D9 }, + { "doteq;"sv, 0x02250 }, + { "doteqdot;"sv, 0x02251 }, + { "dotminus;"sv, 0x02238 }, + { "dotplus;"sv, 0x02214 }, + { "dotsquare;"sv, 0x022A1 }, + { "doublebarwedge;"sv, 0x02306 }, + { "downarrow;"sv, 0x02193 }, + { "downdownarrows;"sv, 0x021CA }, + { "downharpoonleft;"sv, 0x021C3 }, + { "downharpoonright;"sv, 0x021C2 }, + { "drbkarow;"sv, 0x02910 }, + { "drcorn;"sv, 0x0231F }, + { "drcrop;"sv, 0x0230C }, + { "dscr;"sv, 0x1D4B9 }, + { "dscy;"sv, 0x00455 }, + { "dsol;"sv, 0x029F6 }, + { "dstrok;"sv, 0x00111 }, + { "dtdot;"sv, 0x022F1 }, + { "dtri;"sv, 0x025BF }, + { "dtrif;"sv, 0x025BE }, + { "duarr;"sv, 0x021F5 }, + { "duhar;"sv, 0x0296F }, + { "dwangle;"sv, 0x029A6 }, + { "dzcy;"sv, 0x0045F }, + { "dzigrarr;"sv, 0x027FF }, + { "eDDot;"sv, 0x02A77 }, + { "eDot;"sv, 0x02251 }, + { "eacute;"sv, 0x000E9 }, + { "eacute"sv, 0x000E9 }, + { "easter;"sv, 0x02A6E }, + { "ecaron;"sv, 0x0011B }, + { "ecir;"sv, 0x02256 }, + { "ecirc;"sv, 0x000EA }, + { "ecirc"sv, 0x000EA }, + { "ecolon;"sv, 0x02255 }, + { "ecy;"sv, 0x0044D }, + { "edot;"sv, 0x00117 }, + { "ee;"sv, 0x02147 }, + { "efDot;"sv, 0x02252 }, + { "efr;"sv, 0x1D522 }, + { "eg;"sv, 0x02A9A }, + { "egrave;"sv, 0x000E8 }, + { "egrave"sv, 0x000E8 }, + { "egs;"sv, 0x02A96 }, + { "egsdot;"sv, 0x02A98 }, + { "el;"sv, 0x02A99 }, + { "elinters;"sv, 0x023E7 }, + { "ell;"sv, 0x02113 }, + { "els;"sv, 0x02A95 }, + { "elsdot;"sv, 0x02A97 }, + { "emacr;"sv, 0x00113 }, + { "empty;"sv, 0x02205 }, + { "emptyset;"sv, 0x02205 }, + { "emptyv;"sv, 0x02205 }, + { "emsp13;"sv, 0x02004 }, + { "emsp14;"sv, 0x02005 }, + { "emsp;"sv, 0x02003 }, + { "eng;"sv, 0x0014B }, + { "ensp;"sv, 0x02002 }, + { "eogon;"sv, 0x00119 }, + { "eopf;"sv, 0x1D556 }, + { "epar;"sv, 0x022D5 }, + { "eparsl;"sv, 0x029E3 }, + { "eplus;"sv, 0x02A71 }, + { "epsi;"sv, 0x003B5 }, + { "epsilon;"sv, 0x003B5 }, + { "epsiv;"sv, 0x003F5 }, + { "eqcirc;"sv, 0x02256 }, + { "eqcolon;"sv, 0x02255 }, + { "eqsim;"sv, 0x02242 }, + { "eqslantgtr;"sv, 0x02A96 }, + { "eqslantless;"sv, 0x02A95 }, + { "equals;"sv, 0x0003D }, + { "equest;"sv, 0x0225F }, + { "equiv;"sv, 0x02261 }, + { "equivDD;"sv, 0x02A78 }, + { "eqvparsl;"sv, 0x029E5 }, + { "erDot;"sv, 0x02253 }, + { "erarr;"sv, 0x02971 }, + { "escr;"sv, 0x0212F }, + { "esdot;"sv, 0x02250 }, + { "esim;"sv, 0x02242 }, + { "eta;"sv, 0x003B7 }, + { "eth;"sv, 0x000F0 }, + { "eth"sv, 0x000F0 }, + { "euml;"sv, 0x000EB }, + { "euml"sv, 0x000EB }, + { "euro;"sv, 0x020AC }, + { "excl;"sv, 0x00021 }, + { "exist;"sv, 0x02203 }, + { "expectation;"sv, 0x02130 }, + { "exponentiale;"sv, 0x02147 }, + { "fallingdotseq;"sv, 0x02252 }, + { "fcy;"sv, 0x00444 }, + { "female;"sv, 0x02640 }, + { "ffilig;"sv, 0x0FB03 }, + { "fflig;"sv, 0x0FB00 }, + { "ffllig;"sv, 0x0FB04 }, + { "ffr;"sv, 0x1D523 }, + { "filig;"sv, 0x0FB01 }, + { "flat;"sv, 0x0266D }, + { "fllig;"sv, 0x0FB02 }, + { "fltns;"sv, 0x025B1 }, + { "fnof;"sv, 0x00192 }, + { "fopf;"sv, 0x1D557 }, + { "forall;"sv, 0x02200 }, + { "fork;"sv, 0x022D4 }, + { "forkv;"sv, 0x02AD9 }, + { "fpartint;"sv, 0x02A0D }, + { "frac12;"sv, 0x000BD }, + { "frac12"sv, 0x000BD }, + { "frac13;"sv, 0x02153 }, + { "frac14;"sv, 0x000BC }, + { "frac14"sv, 0x000BC }, + { "frac15;"sv, 0x02155 }, + { "frac16;"sv, 0x02159 }, + { "frac18;"sv, 0x0215B }, + { "frac23;"sv, 0x02154 }, + { "frac25;"sv, 0x02156 }, + { "frac34;"sv, 0x000BE }, + { "frac34"sv, 0x000BE }, + { "frac35;"sv, 0x02157 }, + { "frac38;"sv, 0x0215C }, + { "frac45;"sv, 0x02158 }, + { "frac56;"sv, 0x0215A }, + { "frac58;"sv, 0x0215D }, + { "frac78;"sv, 0x0215E }, + { "frasl;"sv, 0x02044 }, + { "frown;"sv, 0x02322 }, + { "fscr;"sv, 0x1D4BB }, + { "gE;"sv, 0x02267 }, + { "gEl;"sv, 0x02A8C }, + { "gacute;"sv, 0x001F5 }, + { "gamma;"sv, 0x003B3 }, + { "gammad;"sv, 0x003DD }, + { "gap;"sv, 0x02A86 }, + { "gbreve;"sv, 0x0011F }, + { "gcirc;"sv, 0x0011D }, + { "gcy;"sv, 0x00433 }, + { "gdot;"sv, 0x00121 }, + { "ge;"sv, 0x02265 }, + { "gel;"sv, 0x022DB }, + { "geq;"sv, 0x02265 }, + { "geqq;"sv, 0x02267 }, + { "geqslant;"sv, 0x02A7E }, + { "ges;"sv, 0x02A7E }, + { "gescc;"sv, 0x02AA9 }, + { "gesdot;"sv, 0x02A80 }, + { "gesdoto;"sv, 0x02A82 }, + { "gesdotol;"sv, 0x02A84 }, + { "gesles;"sv, 0x02A94 }, + { "gfr;"sv, 0x1D524 }, + { "gg;"sv, 0x0226B }, + { "ggg;"sv, 0x022D9 }, + { "gimel;"sv, 0x02137 }, + { "gjcy;"sv, 0x00453 }, + { "gl;"sv, 0x02277 }, + { "glE;"sv, 0x02A92 }, + { "gla;"sv, 0x02AA5 }, + { "glj;"sv, 0x02AA4 }, + { "gnE;"sv, 0x02269 }, + { "gnap;"sv, 0x02A8A }, + { "gnapprox;"sv, 0x02A8A }, + { "gne;"sv, 0x02A88 }, + { "gneq;"sv, 0x02A88 }, + { "gneqq;"sv, 0x02269 }, + { "gnsim;"sv, 0x022E7 }, + { "gopf;"sv, 0x1D558 }, + { "grave;"sv, 0x00060 }, + { "gscr;"sv, 0x0210A }, + { "gsim;"sv, 0x02273 }, + { "gsime;"sv, 0x02A8E }, + { "gsiml;"sv, 0x02A90 }, + { "gt;"sv, 0x0003E }, + { "gt"sv, 0x0003E }, + { "gtcc;"sv, 0x02AA7 }, + { "gtcir;"sv, 0x02A7A }, + { "gtdot;"sv, 0x022D7 }, + { "gtlPar;"sv, 0x02995 }, + { "gtquest;"sv, 0x02A7C }, + { "gtrapprox;"sv, 0x02A86 }, + { "gtrarr;"sv, 0x02978 }, + { "gtrdot;"sv, 0x022D7 }, + { "gtreqless;"sv, 0x022DB }, + { "gtreqqless;"sv, 0x02A8C }, + { "gtrless;"sv, 0x02277 }, + { "gtrsim;"sv, 0x02273 }, + { "hArr;"sv, 0x021D4 }, + { "hairsp;"sv, 0x0200A }, + { "half;"sv, 0x000BD }, + { "hamilt;"sv, 0x0210B }, + { "hardcy;"sv, 0x0044A }, + { "harr;"sv, 0x02194 }, + { "harrcir;"sv, 0x02948 }, + { "harrw;"sv, 0x021AD }, + { "hbar;"sv, 0x0210F }, + { "hcirc;"sv, 0x00125 }, + { "hearts;"sv, 0x02665 }, + { "heartsuit;"sv, 0x02665 }, + { "hellip;"sv, 0x02026 }, + { "hercon;"sv, 0x022B9 }, + { "hfr;"sv, 0x1D525 }, + { "hksearow;"sv, 0x02925 }, + { "hkswarow;"sv, 0x02926 }, + { "hoarr;"sv, 0x021FF }, + { "homtht;"sv, 0x0223B }, + { "hookleftarrow;"sv, 0x021A9 }, + { "hookrightarrow;"sv, 0x021AA }, + { "hopf;"sv, 0x1D559 }, + { "horbar;"sv, 0x02015 }, + { "hscr;"sv, 0x1D4BD }, + { "hslash;"sv, 0x0210F }, + { "hstrok;"sv, 0x00127 }, + { "hybull;"sv, 0x02043 }, + { "hyphen;"sv, 0x02010 }, + { "iacute;"sv, 0x000ED }, + { "iacute"sv, 0x000ED }, + { "ic;"sv, 0x02063 }, + { "icirc;"sv, 0x000EE }, + { "icirc"sv, 0x000EE }, + { "icy;"sv, 0x00438 }, + { "iecy;"sv, 0x00435 }, + { "iexcl;"sv, 0x000A1 }, + { "iexcl"sv, 0x000A1 }, + { "iff;"sv, 0x021D4 }, + { "ifr;"sv, 0x1D526 }, + { "igrave;"sv, 0x000EC }, + { "igrave"sv, 0x000EC }, + { "ii;"sv, 0x02148 }, + { "iiiint;"sv, 0x02A0C }, + { "iiint;"sv, 0x0222D }, + { "iinfin;"sv, 0x029DC }, + { "iiota;"sv, 0x02129 }, + { "ijlig;"sv, 0x00133 }, + { "imacr;"sv, 0x0012B }, + { "image;"sv, 0x02111 }, + { "imagline;"sv, 0x02110 }, + { "imagpart;"sv, 0x02111 }, + { "imath;"sv, 0x00131 }, + { "imof;"sv, 0x022B7 }, + { "imped;"sv, 0x001B5 }, + { "in;"sv, 0x02208 }, + { "incare;"sv, 0x02105 }, + { "infin;"sv, 0x0221E }, + { "infintie;"sv, 0x029DD }, + { "inodot;"sv, 0x00131 }, + { "int;"sv, 0x0222B }, + { "intcal;"sv, 0x022BA }, + { "integers;"sv, 0x02124 }, + { "intercal;"sv, 0x022BA }, + { "intlarhk;"sv, 0x02A17 }, + { "intprod;"sv, 0x02A3C }, + { "iocy;"sv, 0x00451 }, + { "iogon;"sv, 0x0012F }, + { "iopf;"sv, 0x1D55A }, + { "iota;"sv, 0x003B9 }, + { "iprod;"sv, 0x02A3C }, + { "iquest;"sv, 0x000BF }, + { "iquest"sv, 0x000BF }, + { "iscr;"sv, 0x1D4BE }, + { "isin;"sv, 0x02208 }, + { "isinE;"sv, 0x022F9 }, + { "isindot;"sv, 0x022F5 }, + { "isins;"sv, 0x022F4 }, + { "isinsv;"sv, 0x022F3 }, + { "isinv;"sv, 0x02208 }, + { "it;"sv, 0x02062 }, + { "itilde;"sv, 0x00129 }, + { "iukcy;"sv, 0x00456 }, + { "iuml;"sv, 0x000EF }, + { "iuml"sv, 0x000EF }, + { "jcirc;"sv, 0x00135 }, + { "jcy;"sv, 0x00439 }, + { "jfr;"sv, 0x1D527 }, + { "jmath;"sv, 0x00237 }, + { "jopf;"sv, 0x1D55B }, + { "jscr;"sv, 0x1D4BF }, + { "jsercy;"sv, 0x00458 }, + { "jukcy;"sv, 0x00454 }, + { "kappa;"sv, 0x003BA }, + { "kappav;"sv, 0x003F0 }, + { "kcedil;"sv, 0x00137 }, + { "kcy;"sv, 0x0043A }, + { "kfr;"sv, 0x1D528 }, + { "kgreen;"sv, 0x00138 }, + { "khcy;"sv, 0x00445 }, + { "kjcy;"sv, 0x0045C }, + { "kopf;"sv, 0x1D55C }, + { "kscr;"sv, 0x1D4C0 }, + { "lAarr;"sv, 0x021DA }, + { "lArr;"sv, 0x021D0 }, + { "lAtail;"sv, 0x0291B }, + { "lBarr;"sv, 0x0290E }, + { "lE;"sv, 0x02266 }, + { "lEg;"sv, 0x02A8B }, + { "lHar;"sv, 0x02962 }, + { "lacute;"sv, 0x0013A }, + { "laemptyv;"sv, 0x029B4 }, + { "lagran;"sv, 0x02112 }, + { "lambda;"sv, 0x003BB }, + { "lang;"sv, 0x027E8 }, + { "langd;"sv, 0x02991 }, + { "langle;"sv, 0x027E8 }, + { "lap;"sv, 0x02A85 }, + { "laquo;"sv, 0x000AB }, + { "laquo"sv, 0x000AB }, + { "larr;"sv, 0x02190 }, + { "larrb;"sv, 0x021E4 }, + { "larrbfs;"sv, 0x0291F }, + { "larrfs;"sv, 0x0291D }, + { "larrhk;"sv, 0x021A9 }, + { "larrlp;"sv, 0x021AB }, + { "larrpl;"sv, 0x02939 }, + { "larrsim;"sv, 0x02973 }, + { "larrtl;"sv, 0x021A2 }, + { "lat;"sv, 0x02AAB }, + { "latail;"sv, 0x02919 }, + { "late;"sv, 0x02AAD }, + { "lbarr;"sv, 0x0290C }, + { "lbbrk;"sv, 0x02772 }, + { "lbrace;"sv, 0x0007B }, + { "lbrack;"sv, 0x0005B }, + { "lbrke;"sv, 0x0298B }, + { "lbrksld;"sv, 0x0298F }, + { "lbrkslu;"sv, 0x0298D }, + { "lcaron;"sv, 0x0013E }, + { "lcedil;"sv, 0x0013C }, + { "lceil;"sv, 0x02308 }, + { "lcub;"sv, 0x0007B }, + { "lcy;"sv, 0x0043B }, + { "ldca;"sv, 0x02936 }, + { "ldquo;"sv, 0x0201C }, + { "ldquor;"sv, 0x0201E }, + { "ldrdhar;"sv, 0x02967 }, + { "ldrushar;"sv, 0x0294B }, + { "ldsh;"sv, 0x021B2 }, + { "le;"sv, 0x02264 }, + { "leftarrow;"sv, 0x02190 }, + { "leftarrowtail;"sv, 0x021A2 }, + { "leftharpoondown;"sv, 0x021BD }, + { "leftharpoonup;"sv, 0x021BC }, + { "leftleftarrows;"sv, 0x021C7 }, + { "leftrightarrow;"sv, 0x02194 }, + { "leftrightarrows;"sv, 0x021C6 }, + { "leftrightharpoons;"sv, 0x021CB }, + { "leftrightsquigarrow;"sv, 0x021AD }, + { "leftthreetimes;"sv, 0x022CB }, + { "leg;"sv, 0x022DA }, + { "leq;"sv, 0x02264 }, + { "leqq;"sv, 0x02266 }, + { "leqslant;"sv, 0x02A7D }, + { "les;"sv, 0x02A7D }, + { "lescc;"sv, 0x02AA8 }, + { "lesdot;"sv, 0x02A7F }, + { "lesdoto;"sv, 0x02A81 }, + { "lesdotor;"sv, 0x02A83 }, + { "lesges;"sv, 0x02A93 }, + { "lessapprox;"sv, 0x02A85 }, + { "lessdot;"sv, 0x022D6 }, + { "lesseqgtr;"sv, 0x022DA }, + { "lesseqqgtr;"sv, 0x02A8B }, + { "lessgtr;"sv, 0x02276 }, + { "lesssim;"sv, 0x02272 }, + { "lfisht;"sv, 0x0297C }, + { "lfloor;"sv, 0x0230A }, + { "lfr;"sv, 0x1D529 }, + { "lg;"sv, 0x02276 }, + { "lgE;"sv, 0x02A91 }, + { "lhard;"sv, 0x021BD }, + { "lharu;"sv, 0x021BC }, + { "lharul;"sv, 0x0296A }, + { "lhblk;"sv, 0x02584 }, + { "ljcy;"sv, 0x00459 }, + { "ll;"sv, 0x0226A }, + { "llarr;"sv, 0x021C7 }, + { "llcorner;"sv, 0x0231E }, + { "llhard;"sv, 0x0296B }, + { "lltri;"sv, 0x025FA }, + { "lmidot;"sv, 0x00140 }, + { "lmoust;"sv, 0x023B0 }, + { "lmoustache;"sv, 0x023B0 }, + { "lnE;"sv, 0x02268 }, + { "lnap;"sv, 0x02A89 }, + { "lnapprox;"sv, 0x02A89 }, + { "lne;"sv, 0x02A87 }, + { "lneq;"sv, 0x02A87 }, + { "lneqq;"sv, 0x02268 }, + { "lnsim;"sv, 0x022E6 }, + { "loang;"sv, 0x027EC }, + { "loarr;"sv, 0x021FD }, + { "lobrk;"sv, 0x027E6 }, + { "longleftarrow;"sv, 0x027F5 }, + { "longleftrightarrow;"sv, 0x027F7 }, + { "longmapsto;"sv, 0x027FC }, + { "longrightarrow;"sv, 0x027F6 }, + { "looparrowleft;"sv, 0x021AB }, + { "looparrowright;"sv, 0x021AC }, + { "lopar;"sv, 0x02985 }, + { "lopf;"sv, 0x1D55D }, + { "loplus;"sv, 0x02A2D }, + { "lotimes;"sv, 0x02A34 }, + { "lowast;"sv, 0x02217 }, + { "lowbar;"sv, 0x0005F }, + { "loz;"sv, 0x025CA }, + { "lozenge;"sv, 0x025CA }, + { "lozf;"sv, 0x029EB }, + { "lpar;"sv, 0x00028 }, + { "lparlt;"sv, 0x02993 }, + { "lrarr;"sv, 0x021C6 }, + { "lrcorner;"sv, 0x0231F }, + { "lrhar;"sv, 0x021CB }, + { "lrhard;"sv, 0x0296D }, + { "lrm;"sv, 0x0200E }, + { "lrtri;"sv, 0x022BF }, + { "lsaquo;"sv, 0x02039 }, + { "lscr;"sv, 0x1D4C1 }, + { "lsh;"sv, 0x021B0 }, + { "lsim;"sv, 0x02272 }, + { "lsime;"sv, 0x02A8D }, + { "lsimg;"sv, 0x02A8F }, + { "lsqb;"sv, 0x0005B }, + { "lsquo;"sv, 0x02018 }, + { "lsquor;"sv, 0x0201A }, + { "lstrok;"sv, 0x00142 }, + { "lt;"sv, 0x0003C }, + { "lt"sv, 0x0003C }, + { "ltcc;"sv, 0x02AA6 }, + { "ltcir;"sv, 0x02A79 }, + { "ltdot;"sv, 0x022D6 }, + { "lthree;"sv, 0x022CB }, + { "ltimes;"sv, 0x022C9 }, + { "ltlarr;"sv, 0x02976 }, + { "ltquest;"sv, 0x02A7B }, + { "ltrPar;"sv, 0x02996 }, + { "ltri;"sv, 0x025C3 }, + { "ltrie;"sv, 0x022B4 }, + { "ltrif;"sv, 0x025C2 }, + { "lurdshar;"sv, 0x0294A }, + { "luruhar;"sv, 0x02966 }, + { "mDDot;"sv, 0x0223A }, + { "macr;"sv, 0x000AF }, + { "macr"sv, 0x000AF }, + { "male;"sv, 0x02642 }, + { "malt;"sv, 0x02720 }, + { "maltese;"sv, 0x02720 }, + { "map;"sv, 0x021A6 }, + { "mapsto;"sv, 0x021A6 }, + { "mapstodown;"sv, 0x021A7 }, + { "mapstoleft;"sv, 0x021A4 }, + { "mapstoup;"sv, 0x021A5 }, + { "marker;"sv, 0x025AE }, + { "mcomma;"sv, 0x02A29 }, + { "mcy;"sv, 0x0043C }, + { "mdash;"sv, 0x02014 }, + { "measuredangle;"sv, 0x02221 }, + { "mfr;"sv, 0x1D52A }, + { "mho;"sv, 0x02127 }, + { "micro;"sv, 0x000B5 }, + { "micro"sv, 0x000B5 }, + { "mid;"sv, 0x02223 }, + { "midast;"sv, 0x0002A }, + { "midcir;"sv, 0x02AF0 }, + { "middot;"sv, 0x000B7 }, + { "middot"sv, 0x000B7 }, + { "minus;"sv, 0x02212 }, + { "minusb;"sv, 0x0229F }, + { "minusd;"sv, 0x02238 }, + { "minusdu;"sv, 0x02A2A }, + { "mlcp;"sv, 0x02ADB }, + { "mldr;"sv, 0x02026 }, + { "mnplus;"sv, 0x02213 }, + { "models;"sv, 0x022A7 }, + { "mopf;"sv, 0x1D55E }, + { "mp;"sv, 0x02213 }, + { "mscr;"sv, 0x1D4C2 }, + { "mstpos;"sv, 0x0223E }, + { "mu;"sv, 0x003BC }, + { "multimap;"sv, 0x022B8 }, + { "mumap;"sv, 0x022B8 }, + { "nLeftarrow;"sv, 0x021CD }, + { "nLeftrightarrow;"sv, 0x021CE }, + { "nRightarrow;"sv, 0x021CF }, + { "nVDash;"sv, 0x022AF }, + { "nVdash;"sv, 0x022AE }, + { "nabla;"sv, 0x02207 }, + { "nacute;"sv, 0x00144 }, + { "nap;"sv, 0x02249 }, + { "napos;"sv, 0x00149 }, + { "napprox;"sv, 0x02249 }, + { "natur;"sv, 0x0266E }, + { "natural;"sv, 0x0266E }, + { "naturals;"sv, 0x02115 }, + { "nbsp;"sv, 0x000A0 }, + { "nbsp"sv, 0x000A0 }, + { "ncap;"sv, 0x02A43 }, + { "ncaron;"sv, 0x00148 }, + { "ncedil;"sv, 0x00146 }, + { "ncong;"sv, 0x02247 }, + { "ncup;"sv, 0x02A42 }, + { "ncy;"sv, 0x0043D }, + { "ndash;"sv, 0x02013 }, + { "ne;"sv, 0x02260 }, + { "neArr;"sv, 0x021D7 }, + { "nearhk;"sv, 0x02924 }, + { "nearr;"sv, 0x02197 }, + { "nearrow;"sv, 0x02197 }, + { "nequiv;"sv, 0x02262 }, + { "nesear;"sv, 0x02928 }, + { "nexist;"sv, 0x02204 }, + { "nexists;"sv, 0x02204 }, + { "nfr;"sv, 0x1D52B }, + { "nge;"sv, 0x02271 }, + { "ngeq;"sv, 0x02271 }, + { "ngsim;"sv, 0x02275 }, + { "ngt;"sv, 0x0226F }, + { "ngtr;"sv, 0x0226F }, + { "nhArr;"sv, 0x021CE }, + { "nharr;"sv, 0x021AE }, + { "nhpar;"sv, 0x02AF2 }, + { "ni;"sv, 0x0220B }, + { "nis;"sv, 0x022FC }, + { "nisd;"sv, 0x022FA }, + { "niv;"sv, 0x0220B }, + { "njcy;"sv, 0x0045A }, + { "nlArr;"sv, 0x021CD }, + { "nlarr;"sv, 0x0219A }, + { "nldr;"sv, 0x02025 }, + { "nle;"sv, 0x02270 }, + { "nleftarrow;"sv, 0x0219A }, + { "nleftrightarrow;"sv, 0x021AE }, + { "nleq;"sv, 0x02270 }, + { "nless;"sv, 0x0226E }, + { "nlsim;"sv, 0x02274 }, + { "nlt;"sv, 0x0226E }, + { "nltri;"sv, 0x022EA }, + { "nltrie;"sv, 0x022EC }, + { "nmid;"sv, 0x02224 }, + { "nopf;"sv, 0x1D55F }, + { "not;"sv, 0x000AC }, + { "not"sv, 0x000AC }, + { "notin;"sv, 0x02209 }, + { "notinva;"sv, 0x02209 }, + { "notinvb;"sv, 0x022F7 }, + { "notinvc;"sv, 0x022F6 }, + { "notni;"sv, 0x0220C }, + { "notniva;"sv, 0x0220C }, + { "notnivb;"sv, 0x022FE }, + { "notnivc;"sv, 0x022FD }, + { "npar;"sv, 0x02226 }, + { "nparallel;"sv, 0x02226 }, + { "npolint;"sv, 0x02A14 }, + { "npr;"sv, 0x02280 }, + { "nprcue;"sv, 0x022E0 }, + { "nprec;"sv, 0x02280 }, + { "nrArr;"sv, 0x021CF }, + { "nrarr;"sv, 0x0219B }, + { "nrightarrow;"sv, 0x0219B }, + { "nrtri;"sv, 0x022EB }, + { "nrtrie;"sv, 0x022ED }, + { "nsc;"sv, 0x02281 }, + { "nsccue;"sv, 0x022E1 }, + { "nscr;"sv, 0x1D4C3 }, + { "nshortmid;"sv, 0x02224 }, + { "nshortparallel;"sv, 0x02226 }, + { "nsim;"sv, 0x02241 }, + { "nsime;"sv, 0x02244 }, + { "nsimeq;"sv, 0x02244 }, + { "nsmid;"sv, 0x02224 }, + { "nspar;"sv, 0x02226 }, + { "nsqsube;"sv, 0x022E2 }, + { "nsqsupe;"sv, 0x022E3 }, + { "nsub;"sv, 0x02284 }, + { "nsube;"sv, 0x02288 }, + { "nsubseteq;"sv, 0x02288 }, + { "nsucc;"sv, 0x02281 }, + { "nsup;"sv, 0x02285 }, + { "nsupe;"sv, 0x02289 }, + { "nsupseteq;"sv, 0x02289 }, + { "ntgl;"sv, 0x02279 }, + { "ntilde;"sv, 0x000F1 }, + { "ntilde"sv, 0x000F1 }, + { "ntlg;"sv, 0x02278 }, + { "ntriangleleft;"sv, 0x022EA }, + { "ntrianglelefteq;"sv, 0x022EC }, + { "ntriangleright;"sv, 0x022EB }, + { "ntrianglerighteq;"sv, 0x022ED }, + { "nu;"sv, 0x003BD }, + { "num;"sv, 0x00023 }, + { "numero;"sv, 0x02116 }, + { "numsp;"sv, 0x02007 }, + { "nvDash;"sv, 0x022AD }, + { "nvHarr;"sv, 0x02904 }, + { "nvdash;"sv, 0x022AC }, + { "nvinfin;"sv, 0x029DE }, + { "nvlArr;"sv, 0x02902 }, + { "nvrArr;"sv, 0x02903 }, + { "nwArr;"sv, 0x021D6 }, + { "nwarhk;"sv, 0x02923 }, + { "nwarr;"sv, 0x02196 }, + { "nwarrow;"sv, 0x02196 }, + { "nwnear;"sv, 0x02927 }, + { "oS;"sv, 0x024C8 }, + { "oacute;"sv, 0x000F3 }, + { "oacute"sv, 0x000F3 }, + { "oast;"sv, 0x0229B }, + { "ocir;"sv, 0x0229A }, + { "ocirc;"sv, 0x000F4 }, + { "ocirc"sv, 0x000F4 }, + { "ocy;"sv, 0x0043E }, + { "odash;"sv, 0x0229D }, + { "odblac;"sv, 0x00151 }, + { "odiv;"sv, 0x02A38 }, + { "odot;"sv, 0x02299 }, + { "odsold;"sv, 0x029BC }, + { "oelig;"sv, 0x00153 }, + { "ofcir;"sv, 0x029BF }, + { "ofr;"sv, 0x1D52C }, + { "ogon;"sv, 0x002DB }, + { "ograve;"sv, 0x000F2 }, + { "ograve"sv, 0x000F2 }, + { "ogt;"sv, 0x029C1 }, + { "ohbar;"sv, 0x029B5 }, + { "ohm;"sv, 0x003A9 }, + { "oint;"sv, 0x0222E }, + { "olarr;"sv, 0x021BA }, + { "olcir;"sv, 0x029BE }, + { "olcross;"sv, 0x029BB }, + { "oline;"sv, 0x0203E }, + { "olt;"sv, 0x029C0 }, + { "omacr;"sv, 0x0014D }, + { "omega;"sv, 0x003C9 }, + { "omicron;"sv, 0x003BF }, + { "omid;"sv, 0x029B6 }, + { "ominus;"sv, 0x02296 }, + { "oopf;"sv, 0x1D560 }, + { "opar;"sv, 0x029B7 }, + { "operp;"sv, 0x029B9 }, + { "oplus;"sv, 0x02295 }, + { "or;"sv, 0x02228 }, + { "orarr;"sv, 0x021BB }, + { "ord;"sv, 0x02A5D }, + { "order;"sv, 0x02134 }, + { "orderof;"sv, 0x02134 }, + { "ordf;"sv, 0x000AA }, + { "ordf"sv, 0x000AA }, + { "ordm;"sv, 0x000BA }, + { "ordm"sv, 0x000BA }, + { "origof;"sv, 0x022B6 }, + { "oror;"sv, 0x02A56 }, + { "orslope;"sv, 0x02A57 }, + { "orv;"sv, 0x02A5B }, + { "oscr;"sv, 0x02134 }, + { "oslash;"sv, 0x000F8 }, + { "oslash"sv, 0x000F8 }, + { "osol;"sv, 0x02298 }, + { "otilde;"sv, 0x000F5 }, + { "otilde"sv, 0x000F5 }, + { "otimes;"sv, 0x02297 }, + { "otimesas;"sv, 0x02A36 }, + { "ouml;"sv, 0x000F6 }, + { "ouml"sv, 0x000F6 }, + { "ovbar;"sv, 0x0233D }, + { "par;"sv, 0x02225 }, + { "para;"sv, 0x000B6 }, + { "para"sv, 0x000B6 }, + { "parallel;"sv, 0x02225 }, + { "parsim;"sv, 0x02AF3 }, + { "parsl;"sv, 0x02AFD }, + { "part;"sv, 0x02202 }, + { "pcy;"sv, 0x0043F }, + { "percnt;"sv, 0x00025 }, + { "period;"sv, 0x0002E }, + { "permil;"sv, 0x02030 }, + { "perp;"sv, 0x022A5 }, + { "pertenk;"sv, 0x02031 }, + { "pfr;"sv, 0x1D52D }, + { "phi;"sv, 0x003C6 }, + { "phiv;"sv, 0x003D5 }, + { "phmmat;"sv, 0x02133 }, + { "phone;"sv, 0x0260E }, + { "pi;"sv, 0x003C0 }, + { "pitchfork;"sv, 0x022D4 }, + { "piv;"sv, 0x003D6 }, + { "planck;"sv, 0x0210F }, + { "planckh;"sv, 0x0210E }, + { "plankv;"sv, 0x0210F }, + { "plus;"sv, 0x0002B }, + { "plusacir;"sv, 0x02A23 }, + { "plusb;"sv, 0x0229E }, + { "pluscir;"sv, 0x02A22 }, + { "plusdo;"sv, 0x02214 }, + { "plusdu;"sv, 0x02A25 }, + { "pluse;"sv, 0x02A72 }, + { "plusmn;"sv, 0x000B1 }, + { "plusmn"sv, 0x000B1 }, + { "plussim;"sv, 0x02A26 }, + { "plustwo;"sv, 0x02A27 }, + { "pm;"sv, 0x000B1 }, + { "pointint;"sv, 0x02A15 }, + { "popf;"sv, 0x1D561 }, + { "pound;"sv, 0x000A3 }, + { "pound"sv, 0x000A3 }, + { "pr;"sv, 0x0227A }, + { "prE;"sv, 0x02AB3 }, + { "prap;"sv, 0x02AB7 }, + { "prcue;"sv, 0x0227C }, + { "pre;"sv, 0x02AAF }, + { "prec;"sv, 0x0227A }, + { "precapprox;"sv, 0x02AB7 }, + { "preccurlyeq;"sv, 0x0227C }, + { "preceq;"sv, 0x02AAF }, + { "precnapprox;"sv, 0x02AB9 }, + { "precneqq;"sv, 0x02AB5 }, + { "precnsim;"sv, 0x022E8 }, + { "precsim;"sv, 0x0227E }, + { "prime;"sv, 0x02032 }, + { "primes;"sv, 0x02119 }, + { "prnE;"sv, 0x02AB5 }, + { "prnap;"sv, 0x02AB9 }, + { "prnsim;"sv, 0x022E8 }, + { "prod;"sv, 0x0220F }, + { "profalar;"sv, 0x0232E }, + { "profline;"sv, 0x02312 }, + { "profsurf;"sv, 0x02313 }, + { "prop;"sv, 0x0221D }, + { "propto;"sv, 0x0221D }, + { "prsim;"sv, 0x0227E }, + { "prurel;"sv, 0x022B0 }, + { "pscr;"sv, 0x1D4C5 }, + { "psi;"sv, 0x003C8 }, + { "puncsp;"sv, 0x02008 }, + { "qfr;"sv, 0x1D52E }, + { "qint;"sv, 0x02A0C }, + { "qopf;"sv, 0x1D562 }, + { "qprime;"sv, 0x02057 }, + { "qscr;"sv, 0x1D4C6 }, + { "quaternions;"sv, 0x0210D }, + { "quatint;"sv, 0x02A16 }, + { "quest;"sv, 0x0003F }, + { "questeq;"sv, 0x0225F }, + { "quot;"sv, 0x00022 }, + { "quot"sv, 0x00022 }, + { "rAarr;"sv, 0x021DB }, + { "rArr;"sv, 0x021D2 }, + { "rAtail;"sv, 0x0291C }, + { "rBarr;"sv, 0x0290F }, + { "rHar;"sv, 0x02964 }, + { "racute;"sv, 0x00155 }, + { "radic;"sv, 0x0221A }, + { "raemptyv;"sv, 0x029B3 }, + { "rang;"sv, 0x027E9 }, + { "rangd;"sv, 0x02992 }, + { "range;"sv, 0x029A5 }, + { "rangle;"sv, 0x027E9 }, + { "raquo;"sv, 0x000BB }, + { "raquo"sv, 0x000BB }, + { "rarr;"sv, 0x02192 }, + { "rarrap;"sv, 0x02975 }, + { "rarrb;"sv, 0x021E5 }, + { "rarrbfs;"sv, 0x02920 }, + { "rarrc;"sv, 0x02933 }, + { "rarrfs;"sv, 0x0291E }, + { "rarrhk;"sv, 0x021AA }, + { "rarrlp;"sv, 0x021AC }, + { "rarrpl;"sv, 0x02945 }, + { "rarrsim;"sv, 0x02974 }, + { "rarrtl;"sv, 0x021A3 }, + { "rarrw;"sv, 0x0219D }, + { "ratail;"sv, 0x0291A }, + { "ratio;"sv, 0x02236 }, + { "rationals;"sv, 0x0211A }, + { "rbarr;"sv, 0x0290D }, + { "rbbrk;"sv, 0x02773 }, + { "rbrace;"sv, 0x0007D }, + { "rbrack;"sv, 0x0005D }, + { "rbrke;"sv, 0x0298C }, + { "rbrksld;"sv, 0x0298E }, + { "rbrkslu;"sv, 0x02990 }, + { "rcaron;"sv, 0x00159 }, + { "rcedil;"sv, 0x00157 }, + { "rceil;"sv, 0x02309 }, + { "rcub;"sv, 0x0007D }, + { "rcy;"sv, 0x00440 }, + { "rdca;"sv, 0x02937 }, + { "rdldhar;"sv, 0x02969 }, + { "rdquo;"sv, 0x0201D }, + { "rdquor;"sv, 0x0201D }, + { "rdsh;"sv, 0x021B3 }, + { "real;"sv, 0x0211C }, + { "realine;"sv, 0x0211B }, + { "realpart;"sv, 0x0211C }, + { "reals;"sv, 0x0211D }, + { "rect;"sv, 0x025AD }, + { "reg;"sv, 0x000AE }, + { "reg"sv, 0x000AE }, + { "rfisht;"sv, 0x0297D }, + { "rfloor;"sv, 0x0230B }, + { "rfr;"sv, 0x1D52F }, + { "rhard;"sv, 0x021C1 }, + { "rharu;"sv, 0x021C0 }, + { "rharul;"sv, 0x0296C }, + { "rho;"sv, 0x003C1 }, + { "rhov;"sv, 0x003F1 }, + { "rightarrow;"sv, 0x02192 }, + { "rightarrowtail;"sv, 0x021A3 }, + { "rightharpoondown;"sv, 0x021C1 }, + { "rightharpoonup;"sv, 0x021C0 }, + { "rightleftarrows;"sv, 0x021C4 }, + { "rightleftharpoons;"sv, 0x021CC }, + { "rightrightarrows;"sv, 0x021C9 }, + { "rightsquigarrow;"sv, 0x0219D }, + { "rightthreetimes;"sv, 0x022CC }, + { "ring;"sv, 0x002DA }, + { "risingdotseq;"sv, 0x02253 }, + { "rlarr;"sv, 0x021C4 }, + { "rlhar;"sv, 0x021CC }, + { "rlm;"sv, 0x0200F }, + { "rmoust;"sv, 0x023B1 }, + { "rmoustache;"sv, 0x023B1 }, + { "rnmid;"sv, 0x02AEE }, + { "roang;"sv, 0x027ED }, + { "roarr;"sv, 0x021FE }, + { "robrk;"sv, 0x027E7 }, + { "ropar;"sv, 0x02986 }, + { "ropf;"sv, 0x1D563 }, + { "roplus;"sv, 0x02A2E }, + { "rotimes;"sv, 0x02A35 }, + { "rpar;"sv, 0x00029 }, + { "rpargt;"sv, 0x02994 }, + { "rppolint;"sv, 0x02A12 }, + { "rrarr;"sv, 0x021C9 }, + { "rsaquo;"sv, 0x0203A }, + { "rscr;"sv, 0x1D4C7 }, + { "rsh;"sv, 0x021B1 }, + { "rsqb;"sv, 0x0005D }, + { "rsquo;"sv, 0x02019 }, + { "rsquor;"sv, 0x02019 }, + { "rthree;"sv, 0x022CC }, + { "rtimes;"sv, 0x022CA }, + { "rtri;"sv, 0x025B9 }, + { "rtrie;"sv, 0x022B5 }, + { "rtrif;"sv, 0x025B8 }, + { "rtriltri;"sv, 0x029CE }, + { "ruluhar;"sv, 0x02968 }, + { "rx;"sv, 0x0211E }, + { "sacute;"sv, 0x0015B }, + { "sbquo;"sv, 0x0201A }, + { "sc;"sv, 0x0227B }, + { "scE;"sv, 0x02AB4 }, + { "scap;"sv, 0x02AB8 }, + { "scaron;"sv, 0x00161 }, + { "sccue;"sv, 0x0227D }, + { "sce;"sv, 0x02AB0 }, + { "scedil;"sv, 0x0015F }, + { "scirc;"sv, 0x0015D }, + { "scnE;"sv, 0x02AB6 }, + { "scnap;"sv, 0x02ABA }, + { "scnsim;"sv, 0x022E9 }, + { "scpolint;"sv, 0x02A13 }, + { "scsim;"sv, 0x0227F }, + { "scy;"sv, 0x00441 }, + { "sdot;"sv, 0x022C5 }, + { "sdotb;"sv, 0x022A1 }, + { "sdote;"sv, 0x02A66 }, + { "seArr;"sv, 0x021D8 }, + { "searhk;"sv, 0x02925 }, + { "searr;"sv, 0x02198 }, + { "searrow;"sv, 0x02198 }, + { "sect;"sv, 0x000A7 }, + { "sect"sv, 0x000A7 }, + { "semi;"sv, 0x0003B }, + { "seswar;"sv, 0x02929 }, + { "setminus;"sv, 0x02216 }, + { "setmn;"sv, 0x02216 }, + { "sext;"sv, 0x02736 }, + { "sfr;"sv, 0x1D530 }, + { "sfrown;"sv, 0x02322 }, + { "sharp;"sv, 0x0266F }, + { "shchcy;"sv, 0x00449 }, + { "shcy;"sv, 0x00448 }, + { "shortmid;"sv, 0x02223 }, + { "shortparallel;"sv, 0x02225 }, + { "shy;"sv, 0x000AD }, + { "shy"sv, 0x000AD }, + { "sigma;"sv, 0x003C3 }, + { "sigmaf;"sv, 0x003C2 }, + { "sigmav;"sv, 0x003C2 }, + { "sim;"sv, 0x0223C }, + { "simdot;"sv, 0x02A6A }, + { "sime;"sv, 0x02243 }, + { "simeq;"sv, 0x02243 }, + { "simg;"sv, 0x02A9E }, + { "simgE;"sv, 0x02AA0 }, + { "siml;"sv, 0x02A9D }, + { "simlE;"sv, 0x02A9F }, + { "simne;"sv, 0x02246 }, + { "simplus;"sv, 0x02A24 }, + { "simrarr;"sv, 0x02972 }, + { "slarr;"sv, 0x02190 }, + { "smallsetminus;"sv, 0x02216 }, + { "smashp;"sv, 0x02A33 }, + { "smeparsl;"sv, 0x029E4 }, + { "smid;"sv, 0x02223 }, + { "smile;"sv, 0x02323 }, + { "smt;"sv, 0x02AAA }, + { "smte;"sv, 0x02AAC }, + { "softcy;"sv, 0x0044C }, + { "sol;"sv, 0x0002F }, + { "solb;"sv, 0x029C4 }, + { "solbar;"sv, 0x0233F }, + { "sopf;"sv, 0x1D564 }, + { "spades;"sv, 0x02660 }, + { "spadesuit;"sv, 0x02660 }, + { "spar;"sv, 0x02225 }, + { "sqcap;"sv, 0x02293 }, + { "sqcup;"sv, 0x02294 }, + { "sqsub;"sv, 0x0228F }, + { "sqsube;"sv, 0x02291 }, + { "sqsubset;"sv, 0x0228F }, + { "sqsubseteq;"sv, 0x02291 }, + { "sqsup;"sv, 0x02290 }, + { "sqsupe;"sv, 0x02292 }, + { "sqsupset;"sv, 0x02290 }, + { "sqsupseteq;"sv, 0x02292 }, + { "squ;"sv, 0x025A1 }, + { "square;"sv, 0x025A1 }, + { "squarf;"sv, 0x025AA }, + { "squf;"sv, 0x025AA }, + { "srarr;"sv, 0x02192 }, + { "sscr;"sv, 0x1D4C8 }, + { "ssetmn;"sv, 0x02216 }, + { "ssmile;"sv, 0x02323 }, + { "sstarf;"sv, 0x022C6 }, + { "star;"sv, 0x02606 }, + { "starf;"sv, 0x02605 }, + { "straightepsilon;"sv, 0x003F5 }, + { "straightphi;"sv, 0x003D5 }, + { "strns;"sv, 0x000AF }, + { "sub;"sv, 0x02282 }, + { "subE;"sv, 0x02AC5 }, + { "subdot;"sv, 0x02ABD }, + { "sube;"sv, 0x02286 }, + { "subedot;"sv, 0x02AC3 }, + { "submult;"sv, 0x02AC1 }, + { "subnE;"sv, 0x02ACB }, + { "subne;"sv, 0x0228A }, + { "subplus;"sv, 0x02ABF }, + { "subrarr;"sv, 0x02979 }, + { "subset;"sv, 0x02282 }, + { "subseteq;"sv, 0x02286 }, + { "subseteqq;"sv, 0x02AC5 }, + { "subsetneq;"sv, 0x0228A }, + { "subsetneqq;"sv, 0x02ACB }, + { "subsim;"sv, 0x02AC7 }, + { "subsub;"sv, 0x02AD5 }, + { "subsup;"sv, 0x02AD3 }, + { "succ;"sv, 0x0227B }, + { "succapprox;"sv, 0x02AB8 }, + { "succcurlyeq;"sv, 0x0227D }, + { "succeq;"sv, 0x02AB0 }, + { "succnapprox;"sv, 0x02ABA }, + { "succneqq;"sv, 0x02AB6 }, + { "succnsim;"sv, 0x022E9 }, + { "succsim;"sv, 0x0227F }, + { "sum;"sv, 0x02211 }, + { "sung;"sv, 0x0266A }, + { "sup1;"sv, 0x000B9 }, + { "sup1"sv, 0x000B9 }, + { "sup2;"sv, 0x000B2 }, + { "sup2"sv, 0x000B2 }, + { "sup3;"sv, 0x000B3 }, + { "sup3"sv, 0x000B3 }, + { "sup;"sv, 0x02283 }, + { "supE;"sv, 0x02AC6 }, + { "supdot;"sv, 0x02ABE }, + { "supdsub;"sv, 0x02AD8 }, + { "supe;"sv, 0x02287 }, + { "supedot;"sv, 0x02AC4 }, + { "suphsol;"sv, 0x027C9 }, + { "suphsub;"sv, 0x02AD7 }, + { "suplarr;"sv, 0x0297B }, + { "supmult;"sv, 0x02AC2 }, + { "supnE;"sv, 0x02ACC }, + { "supne;"sv, 0x0228B }, + { "supplus;"sv, 0x02AC0 }, + { "supset;"sv, 0x02283 }, + { "supseteq;"sv, 0x02287 }, + { "supseteqq;"sv, 0x02AC6 }, + { "supsetneq;"sv, 0x0228B }, + { "supsetneqq;"sv, 0x02ACC }, + { "supsim;"sv, 0x02AC8 }, + { "supsub;"sv, 0x02AD4 }, + { "supsup;"sv, 0x02AD6 }, + { "swArr;"sv, 0x021D9 }, + { "swarhk;"sv, 0x02926 }, + { "swarr;"sv, 0x02199 }, + { "swarrow;"sv, 0x02199 }, + { "swnwar;"sv, 0x0292A }, + { "szlig;"sv, 0x000DF }, + { "szlig"sv, 0x000DF }, + { "target;"sv, 0x02316 }, + { "tau;"sv, 0x003C4 }, + { "tbrk;"sv, 0x023B4 }, + { "tcaron;"sv, 0x00165 }, + { "tcedil;"sv, 0x00163 }, + { "tcy;"sv, 0x00442 }, + { "tdot;"sv, 0x020DB }, + { "telrec;"sv, 0x02315 }, + { "tfr;"sv, 0x1D531 }, + { "there4;"sv, 0x02234 }, + { "therefore;"sv, 0x02234 }, + { "theta;"sv, 0x003B8 }, + { "thetasym;"sv, 0x003D1 }, + { "thetav;"sv, 0x003D1 }, + { "thickapprox;"sv, 0x02248 }, + { "thicksim;"sv, 0x0223C }, + { "thinsp;"sv, 0x02009 }, + { "thkap;"sv, 0x02248 }, + { "thksim;"sv, 0x0223C }, + { "thorn;"sv, 0x000FE }, + { "thorn"sv, 0x000FE }, + { "tilde;"sv, 0x002DC }, + { "times;"sv, 0x000D7 }, + { "times"sv, 0x000D7 }, + { "timesb;"sv, 0x022A0 }, + { "timesbar;"sv, 0x02A31 }, + { "timesd;"sv, 0x02A30 }, + { "tint;"sv, 0x0222D }, + { "toea;"sv, 0x02928 }, + { "top;"sv, 0x022A4 }, + { "topbot;"sv, 0x02336 }, + { "topcir;"sv, 0x02AF1 }, + { "topf;"sv, 0x1D565 }, + { "topfork;"sv, 0x02ADA }, + { "tosa;"sv, 0x02929 }, + { "tprime;"sv, 0x02034 }, + { "trade;"sv, 0x02122 }, + { "triangle;"sv, 0x025B5 }, + { "triangledown;"sv, 0x025BF }, + { "triangleleft;"sv, 0x025C3 }, + { "trianglelefteq;"sv, 0x022B4 }, + { "triangleq;"sv, 0x0225C }, + { "triangleright;"sv, 0x025B9 }, + { "trianglerighteq;"sv, 0x022B5 }, + { "tridot;"sv, 0x025EC }, + { "trie;"sv, 0x0225C }, + { "triminus;"sv, 0x02A3A }, + { "triplus;"sv, 0x02A39 }, + { "trisb;"sv, 0x029CD }, + { "tritime;"sv, 0x02A3B }, + { "trpezium;"sv, 0x023E2 }, + { "tscr;"sv, 0x1D4C9 }, + { "tscy;"sv, 0x00446 }, + { "tshcy;"sv, 0x0045B }, + { "tstrok;"sv, 0x00167 }, + { "twixt;"sv, 0x0226C }, + { "twoheadleftarrow;"sv, 0x0219E }, + { "twoheadrightarrow;"sv, 0x021A0 }, + { "uArr;"sv, 0x021D1 }, + { "uHar;"sv, 0x02963 }, + { "uacute;"sv, 0x000FA }, + { "uacute"sv, 0x000FA }, + { "uarr;"sv, 0x02191 }, + { "ubrcy;"sv, 0x0045E }, + { "ubreve;"sv, 0x0016D }, + { "ucirc;"sv, 0x000FB }, + { "ucirc"sv, 0x000FB }, + { "ucy;"sv, 0x00443 }, + { "udarr;"sv, 0x021C5 }, + { "udblac;"sv, 0x00171 }, + { "udhar;"sv, 0x0296E }, + { "ufisht;"sv, 0x0297E }, + { "ufr;"sv, 0x1D532 }, + { "ugrave;"sv, 0x000F9 }, + { "ugrave"sv, 0x000F9 }, + { "uharl;"sv, 0x021BF }, + { "uharr;"sv, 0x021BE }, + { "uhblk;"sv, 0x02580 }, + { "ulcorn;"sv, 0x0231C }, + { "ulcorner;"sv, 0x0231C }, + { "ulcrop;"sv, 0x0230F }, + { "ultri;"sv, 0x025F8 }, + { "umacr;"sv, 0x0016B }, + { "uml;"sv, 0x000A8 }, + { "uml"sv, 0x000A8 }, + { "uogon;"sv, 0x00173 }, + { "uopf;"sv, 0x1D566 }, + { "uparrow;"sv, 0x02191 }, + { "updownarrow;"sv, 0x02195 }, + { "upharpoonleft;"sv, 0x021BF }, + { "upharpoonright;"sv, 0x021BE }, + { "uplus;"sv, 0x0228E }, + { "upsi;"sv, 0x003C5 }, + { "upsih;"sv, 0x003D2 }, + { "upsilon;"sv, 0x003C5 }, + { "upuparrows;"sv, 0x021C8 }, + { "urcorn;"sv, 0x0231D }, + { "urcorner;"sv, 0x0231D }, + { "urcrop;"sv, 0x0230E }, + { "uring;"sv, 0x0016F }, + { "urtri;"sv, 0x025F9 }, + { "uscr;"sv, 0x1D4CA }, + { "utdot;"sv, 0x022F0 }, + { "utilde;"sv, 0x00169 }, + { "utri;"sv, 0x025B5 }, + { "utrif;"sv, 0x025B4 }, + { "uuarr;"sv, 0x021C8 }, + { "uuml;"sv, 0x000FC }, + { "uuml"sv, 0x000FC }, + { "uwangle;"sv, 0x029A7 }, + { "vArr;"sv, 0x021D5 }, + { "vBar;"sv, 0x02AE8 }, + { "vBarv;"sv, 0x02AE9 }, + { "vDash;"sv, 0x022A8 }, + { "vangrt;"sv, 0x0299C }, + { "varepsilon;"sv, 0x003F5 }, + { "varkappa;"sv, 0x003F0 }, + { "varnothing;"sv, 0x02205 }, + { "varphi;"sv, 0x003D5 }, + { "varpi;"sv, 0x003D6 }, + { "varpropto;"sv, 0x0221D }, + { "varr;"sv, 0x02195 }, + { "varrho;"sv, 0x003F1 }, + { "varsigma;"sv, 0x003C2 }, + { "vartheta;"sv, 0x003D1 }, + { "vartriangleleft;"sv, 0x022B2 }, + { "vartriangleright;"sv, 0x022B3 }, + { "vcy;"sv, 0x00432 }, + { "vdash;"sv, 0x022A2 }, + { "vee;"sv, 0x02228 }, + { "veebar;"sv, 0x022BB }, + { "veeeq;"sv, 0x0225A }, + { "vellip;"sv, 0x022EE }, + { "verbar;"sv, 0x0007C }, + { "vert;"sv, 0x0007C }, + { "vfr;"sv, 0x1D533 }, + { "vltri;"sv, 0x022B2 }, + { "vopf;"sv, 0x1D567 }, + { "vprop;"sv, 0x0221D }, + { "vrtri;"sv, 0x022B3 }, + { "vscr;"sv, 0x1D4CB }, + { "vzigzag;"sv, 0x0299A }, + { "wcirc;"sv, 0x00175 }, + { "wedbar;"sv, 0x02A5F }, + { "wedge;"sv, 0x02227 }, + { "wedgeq;"sv, 0x02259 }, + { "weierp;"sv, 0x02118 }, + { "wfr;"sv, 0x1D534 }, + { "wopf;"sv, 0x1D568 }, + { "wp;"sv, 0x02118 }, + { "wr;"sv, 0x02240 }, + { "wreath;"sv, 0x02240 }, + { "wscr;"sv, 0x1D4CC }, + { "xcap;"sv, 0x022C2 }, + { "xcirc;"sv, 0x025EF }, + { "xcup;"sv, 0x022C3 }, + { "xdtri;"sv, 0x025BD }, + { "xfr;"sv, 0x1D535 }, + { "xhArr;"sv, 0x027FA }, + { "xharr;"sv, 0x027F7 }, + { "xi;"sv, 0x003BE }, + { "xlArr;"sv, 0x027F8 }, + { "xlarr;"sv, 0x027F5 }, + { "xmap;"sv, 0x027FC }, + { "xnis;"sv, 0x022FB }, + { "xodot;"sv, 0x02A00 }, + { "xopf;"sv, 0x1D569 }, + { "xoplus;"sv, 0x02A01 }, + { "xotime;"sv, 0x02A02 }, + { "xrArr;"sv, 0x027F9 }, + { "xrarr;"sv, 0x027F6 }, + { "xscr;"sv, 0x1D4CD }, + { "xsqcup;"sv, 0x02A06 }, + { "xuplus;"sv, 0x02A04 }, + { "xutri;"sv, 0x025B3 }, + { "xvee;"sv, 0x022C1 }, + { "xwedge;"sv, 0x022C0 }, + { "yacute;"sv, 0x000FD }, + { "yacute"sv, 0x000FD }, + { "yacy;"sv, 0x0044F }, + { "ycirc;"sv, 0x00177 }, + { "ycy;"sv, 0x0044B }, + { "yen;"sv, 0x000A5 }, + { "yen"sv, 0x000A5 }, + { "yfr;"sv, 0x1D536 }, + { "yicy;"sv, 0x00457 }, + { "yopf;"sv, 0x1D56A }, + { "yscr;"sv, 0x1D4CE }, + { "yucy;"sv, 0x0044E }, + { "yuml;"sv, 0x000FF }, + { "yuml"sv, 0x000FF }, + { "zacute;"sv, 0x0017A }, + { "zcaron;"sv, 0x0017E }, + { "zcy;"sv, 0x00437 }, + { "zdot;"sv, 0x0017C }, + { "zeetrf;"sv, 0x02128 }, + { "zeta;"sv, 0x003B6 }, + { "zfr;"sv, 0x1D537 }, + { "zhcy;"sv, 0x00436 }, + { "zigrarr;"sv, 0x021DD }, + { "zopf;"sv, 0x1D56B }, + { "zscr;"sv, 0x1D4CF }, + { "zwj;"sv, 0x0200D }, + { "zwnj;"sv, 0x0200C } }; constexpr struct { @@ -2161,99 +2161,99 @@ Optional<EntityMatch> code_points_from_entity(StringView entity) u32 code_point1; u32 code_point2; } double_code_point_entities[] = { - { "NotEqualTilde;", 0x02242, 0x00338 }, - { "NotGreaterFullEqual;", 0x02267, 0x00338 }, - { "NotGreaterGreater;", 0x0226B, 0x00338 }, - { "NotGreaterSlantEqual;", 0x02A7E, 0x00338 }, - { "NotHumpDownHump;", 0x0224E, 0x00338 }, - { "NotHumpEqual;", 0x0224F, 0x00338 }, - { "NotLeftTriangleBar;", 0x029CF, 0x00338 }, - { "NotLessLess;", 0x0226A, 0x00338 }, - { "NotLessSlantEqual;", 0x02A7D, 0x00338 }, - { "NotNestedGreaterGreater;", 0x02AA2, 0x00338 }, - { "NotNestedLessLess;", 0x02AA1, 0x00338 }, - { "NotPrecedesEqual;", 0x02AAF, 0x00338 }, - { "NotRightTriangleBar;", 0x029D0, 0x00338 }, - { "NotSquareSubset;", 0x0228F, 0x00338 }, - { "NotSquareSuperset;", 0x02290, 0x00338 }, - { "NotSubset;", 0x02282, 0x020D2 }, - { "NotSucceedsEqual;", 0x02AB0, 0x00338 }, - { "NotSucceedsTilde;", 0x0227F, 0x00338 }, - { "NotSuperset;", 0x02283, 0x020D2 }, - { "ThickSpace;", 0x0205F, 0x0200A }, - { "acE;", 0x0223E, 0x00333 }, - { "bne;", 0x0003D, 0x020E5 }, - { "bnequiv;", 0x02261, 0x020E5 }, - { "caps;", 0x02229, 0x0FE00 }, - { "cups;", 0x0222A, 0x0FE00 }, - { "fjlig;", 0x00066, 0x0006A }, - { "gesl;", 0x022DB, 0x0FE00 }, - { "gvertneqq;", 0x02269, 0x0FE00 }, - { "gvnE;", 0x02269, 0x0FE00 }, - { "lates;", 0x02AAD, 0x0FE00 }, - { "lesg;", 0x022DA, 0x0FE00 }, - { "lvertneqq;", 0x02268, 0x0FE00 }, - { "lvnE;", 0x02268, 0x0FE00 }, - { "nGg;", 0x022D9, 0x00338 }, - { "nGt;", 0x0226B, 0x020D2 }, - { "nGtv;", 0x0226B, 0x00338 }, - { "nLl;", 0x022D8, 0x00338 }, - { "nLt;", 0x0226A, 0x020D2 }, - { "nLtv;", 0x0226A, 0x00338 }, - { "nang;", 0x02220, 0x020D2 }, - { "napE;", 0x02A70, 0x00338 }, - { "napid;", 0x0224B, 0x00338 }, - { "nbump;", 0x0224E, 0x00338 }, - { "nbumpe;", 0x0224F, 0x00338 }, - { "ncongdot;", 0x02A6D, 0x00338 }, - { "nedot;", 0x02250, 0x00338 }, - { "nesim;", 0x02242, 0x00338 }, - { "ngE;", 0x02267, 0x00338 }, - { "ngeqq;", 0x02267, 0x00338 }, - { "ngeqslant;", 0x02A7E, 0x00338 }, - { "nges;", 0x02A7E, 0x00338 }, - { "nlE;", 0x02266, 0x00338 }, - { "nleqq;", 0x02266, 0x00338 }, - { "nleqslant;", 0x02A7D, 0x00338 }, - { "nles;", 0x02A7D, 0x00338 }, - { "notinE;", 0x022F9, 0x00338 }, - { "notindot;", 0x022F5, 0x00338 }, - { "nparsl;", 0x02AFD, 0x020E5 }, - { "npart;", 0x02202, 0x00338 }, - { "npre;", 0x02AAF, 0x00338 }, - { "npreceq;", 0x02AAF, 0x00338 }, - { "nrarrc;", 0x02933, 0x00338 }, - { "nrarrw;", 0x0219D, 0x00338 }, - { "nsce;", 0x02AB0, 0x00338 }, - { "nsubE;", 0x02AC5, 0x00338 }, - { "nsubset;", 0x02282, 0x020D2 }, - { "nsubseteqq;", 0x02AC5, 0x00338 }, - { "nsucceq;", 0x02AB0, 0x00338 }, - { "nsupE;", 0x02AC6, 0x00338 }, - { "nsupset;", 0x02283, 0x020D2 }, - { "nsupseteqq;", 0x02AC6, 0x00338 }, - { "nvap;", 0x0224D, 0x020D2 }, - { "nvge;", 0x02265, 0x020D2 }, - { "nvgt;", 0x0003E, 0x020D2 }, - { "nvle;", 0x02264, 0x020D2 }, - { "nvlt;", 0x0003C, 0x020D2 }, - { "nvltrie;", 0x022B4, 0x020D2 }, - { "nvrtrie;", 0x022B5, 0x020D2 }, - { "nvsim;", 0x0223C, 0x020D2 }, - { "race;", 0x0223D, 0x00331 }, - { "smtes;", 0x02AAC, 0x0FE00 }, - { "sqcaps;", 0x02293, 0x0FE00 }, - { "sqcups;", 0x02294, 0x0FE00 }, - { "varsubsetneq;", 0x0228A, 0x0FE00 }, - { "varsubsetneqq;", 0x02ACB, 0x0FE00 }, - { "varsupsetneq;", 0x0228B, 0x0FE00 }, - { "varsupsetneqq;", 0x02ACC, 0x0FE00 }, - { "vnsub;", 0x02282, 0x020D2 }, - { "vnsup;", 0x02283, 0x020D2 }, - { "vsubnE;", 0x02ACB, 0x0FE00 }, - { "vsubne;", 0x0228A, 0x0FE00 }, - { "vsupnE;", 0x02ACC, 0x0FE00 }, - { "vsupne;", 0x0228B, 0x0FE00 }, + { "NotEqualTilde;"sv, 0x02242, 0x00338 }, + { "NotGreaterFullEqual;"sv, 0x02267, 0x00338 }, + { "NotGreaterGreater;"sv, 0x0226B, 0x00338 }, + { "NotGreaterSlantEqual;"sv, 0x02A7E, 0x00338 }, + { "NotHumpDownHump;"sv, 0x0224E, 0x00338 }, + { "NotHumpEqual;"sv, 0x0224F, 0x00338 }, + { "NotLeftTriangleBar;"sv, 0x029CF, 0x00338 }, + { "NotLessLess;"sv, 0x0226A, 0x00338 }, + { "NotLessSlantEqual;"sv, 0x02A7D, 0x00338 }, + { "NotNestedGreaterGreater;"sv, 0x02AA2, 0x00338 }, + { "NotNestedLessLess;"sv, 0x02AA1, 0x00338 }, + { "NotPrecedesEqual;"sv, 0x02AAF, 0x00338 }, + { "NotRightTriangleBar;"sv, 0x029D0, 0x00338 }, + { "NotSquareSubset;"sv, 0x0228F, 0x00338 }, + { "NotSquareSuperset;"sv, 0x02290, 0x00338 }, + { "NotSubset;"sv, 0x02282, 0x020D2 }, + { "NotSucceedsEqual;"sv, 0x02AB0, 0x00338 }, + { "NotSucceedsTilde;"sv, 0x0227F, 0x00338 }, + { "NotSuperset;"sv, 0x02283, 0x020D2 }, + { "ThickSpace;"sv, 0x0205F, 0x0200A }, + { "acE;"sv, 0x0223E, 0x00333 }, + { "bne;"sv, 0x0003D, 0x020E5 }, + { "bnequiv;"sv, 0x02261, 0x020E5 }, + { "caps;"sv, 0x02229, 0x0FE00 }, + { "cups;"sv, 0x0222A, 0x0FE00 }, + { "fjlig;"sv, 0x00066, 0x0006A }, + { "gesl;"sv, 0x022DB, 0x0FE00 }, + { "gvertneqq;"sv, 0x02269, 0x0FE00 }, + { "gvnE;"sv, 0x02269, 0x0FE00 }, + { "lates;"sv, 0x02AAD, 0x0FE00 }, + { "lesg;"sv, 0x022DA, 0x0FE00 }, + { "lvertneqq;"sv, 0x02268, 0x0FE00 }, + { "lvnE;"sv, 0x02268, 0x0FE00 }, + { "nGg;"sv, 0x022D9, 0x00338 }, + { "nGt;"sv, 0x0226B, 0x020D2 }, + { "nGtv;"sv, 0x0226B, 0x00338 }, + { "nLl;"sv, 0x022D8, 0x00338 }, + { "nLt;"sv, 0x0226A, 0x020D2 }, + { "nLtv;"sv, 0x0226A, 0x00338 }, + { "nang;"sv, 0x02220, 0x020D2 }, + { "napE;"sv, 0x02A70, 0x00338 }, + { "napid;"sv, 0x0224B, 0x00338 }, + { "nbump;"sv, 0x0224E, 0x00338 }, + { "nbumpe;"sv, 0x0224F, 0x00338 }, + { "ncongdot;"sv, 0x02A6D, 0x00338 }, + { "nedot;"sv, 0x02250, 0x00338 }, + { "nesim;"sv, 0x02242, 0x00338 }, + { "ngE;"sv, 0x02267, 0x00338 }, + { "ngeqq;"sv, 0x02267, 0x00338 }, + { "ngeqslant;"sv, 0x02A7E, 0x00338 }, + { "nges;"sv, 0x02A7E, 0x00338 }, + { "nlE;"sv, 0x02266, 0x00338 }, + { "nleqq;"sv, 0x02266, 0x00338 }, + { "nleqslant;"sv, 0x02A7D, 0x00338 }, + { "nles;"sv, 0x02A7D, 0x00338 }, + { "notinE;"sv, 0x022F9, 0x00338 }, + { "notindot;"sv, 0x022F5, 0x00338 }, + { "nparsl;"sv, 0x02AFD, 0x020E5 }, + { "npart;"sv, 0x02202, 0x00338 }, + { "npre;"sv, 0x02AAF, 0x00338 }, + { "npreceq;"sv, 0x02AAF, 0x00338 }, + { "nrarrc;"sv, 0x02933, 0x00338 }, + { "nrarrw;"sv, 0x0219D, 0x00338 }, + { "nsce;"sv, 0x02AB0, 0x00338 }, + { "nsubE;"sv, 0x02AC5, 0x00338 }, + { "nsubset;"sv, 0x02282, 0x020D2 }, + { "nsubseteqq;"sv, 0x02AC5, 0x00338 }, + { "nsucceq;"sv, 0x02AB0, 0x00338 }, + { "nsupE;"sv, 0x02AC6, 0x00338 }, + { "nsupset;"sv, 0x02283, 0x020D2 }, + { "nsupseteqq;"sv, 0x02AC6, 0x00338 }, + { "nvap;"sv, 0x0224D, 0x020D2 }, + { "nvge;"sv, 0x02265, 0x020D2 }, + { "nvgt;"sv, 0x0003E, 0x020D2 }, + { "nvle;"sv, 0x02264, 0x020D2 }, + { "nvlt;"sv, 0x0003C, 0x020D2 }, + { "nvltrie;"sv, 0x022B4, 0x020D2 }, + { "nvrtrie;"sv, 0x022B5, 0x020D2 }, + { "nvsim;"sv, 0x0223C, 0x020D2 }, + { "race;"sv, 0x0223D, 0x00331 }, + { "smtes;"sv, 0x02AAC, 0x0FE00 }, + { "sqcaps;"sv, 0x02293, 0x0FE00 }, + { "sqcups;"sv, 0x02294, 0x0FE00 }, + { "varsubsetneq;"sv, 0x0228A, 0x0FE00 }, + { "varsubsetneqq;"sv, 0x02ACB, 0x0FE00 }, + { "varsupsetneq;"sv, 0x0228B, 0x0FE00 }, + { "varsupsetneqq;"sv, 0x02ACC, 0x0FE00 }, + { "vnsub;"sv, 0x02282, 0x020D2 }, + { "vnsup;"sv, 0x02283, 0x020D2 }, + { "vsubnE;"sv, 0x02ACB, 0x0FE00 }, + { "vsubne;"sv, 0x0228A, 0x0FE00 }, + { "vsupnE;"sv, 0x02ACC, 0x0FE00 }, + { "vsupne;"sv, 0x0228B, 0x0FE00 }, }; EntityMatch match; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp index f492a4170f..d8358be0e4 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp @@ -42,7 +42,7 @@ Optional<StringView> extract_character_encoding_from_meta_element(String const& GenericLexer lexer(lowercase_string); for (;;) { - auto charset_index = lexer.remaining().find("charset"); + auto charset_index = lexer.remaining().find("charset"sv); if (!charset_index.has_value()) return {}; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index ea133bd721..0a131cc9f7 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -393,16 +393,16 @@ DOM::QuirksMode HTMLParser::which_quirks_mode(HTMLToken const& doctype_token) co auto const& public_identifier = doctype_token.doctype_data().public_identifier; auto const& system_identifier = doctype_token.doctype_data().system_identifier; - if (public_identifier.equals_ignoring_case("-//W3O//DTD W3 HTML Strict 3.0//EN//")) + if (public_identifier.equals_ignoring_case("-//W3O//DTD W3 HTML Strict 3.0//EN//"sv)) return DOM::QuirksMode::Yes; - if (public_identifier.equals_ignoring_case("-/W3C/DTD HTML 4.0 Transitional/EN")) + if (public_identifier.equals_ignoring_case("-/W3C/DTD HTML 4.0 Transitional/EN"sv)) return DOM::QuirksMode::Yes; - if (public_identifier.equals_ignoring_case("HTML")) + if (public_identifier.equals_ignoring_case("HTML"sv)) return DOM::QuirksMode::Yes; - if (system_identifier.equals_ignoring_case("http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd")) + if (system_identifier.equals_ignoring_case("http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"sv)) return DOM::QuirksMode::Yes; for (auto& public_id : s_quirks_public_ids) { @@ -411,24 +411,24 @@ DOM::QuirksMode HTMLParser::which_quirks_mode(HTMLToken const& doctype_token) co } if (doctype_token.doctype_data().missing_system_identifier) { - if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Frameset//", CaseSensitivity::CaseInsensitive)) + if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Frameset//"sv, CaseSensitivity::CaseInsensitive)) return DOM::QuirksMode::Yes; - if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Transitional//", CaseSensitivity::CaseInsensitive)) + if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Transitional//"sv, CaseSensitivity::CaseInsensitive)) return DOM::QuirksMode::Yes; } - if (public_identifier.starts_with("-//W3C//DTD XHTML 1.0 Frameset//", CaseSensitivity::CaseInsensitive)) + if (public_identifier.starts_with("-//W3C//DTD XHTML 1.0 Frameset//"sv, CaseSensitivity::CaseInsensitive)) return DOM::QuirksMode::Limited; - if (public_identifier.starts_with("-//W3C//DTD XHTML 1.0 Transitional//", CaseSensitivity::CaseInsensitive)) + if (public_identifier.starts_with("-//W3C//DTD XHTML 1.0 Transitional//"sv, CaseSensitivity::CaseInsensitive)) return DOM::QuirksMode::Limited; if (!doctype_token.doctype_data().missing_system_identifier) { - if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Frameset//", CaseSensitivity::CaseInsensitive)) + if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Frameset//"sv, CaseSensitivity::CaseInsensitive)) return DOM::QuirksMode::Limited; - if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Transitional//", CaseSensitivity::CaseInsensitive)) + if (public_identifier.starts_with("-//W3C//DTD HTML 4.01 Transitional//"sv, CaseSensitivity::CaseInsensitive)) return DOM::QuirksMode::Limited; } @@ -1884,7 +1884,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); auto type_attribute = token.attribute(HTML::AttributeNames::type); - if (type_attribute.is_null() || !type_attribute.equals_ignoring_case("hidden")) { + if (type_attribute.is_null() || !type_attribute.equals_ignoring_case("hidden"sv)) { m_frameset_ok = false; } return; @@ -2620,7 +2620,7 @@ void HTMLParser::handle_in_table(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::input) { auto type_attribute = token.attribute(HTML::AttributeNames::type); - if (type_attribute.is_null() || !type_attribute.equals_ignoring_case("hidden")) { + if (type_attribute.is_null() || !type_attribute.equals_ignoring_case("hidden"sv)) { goto AnythingElse; } @@ -3468,18 +3468,18 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node) for (auto& ch : string) { // 1. Replace any occurrence of the "&" character by the string "&". if (ch == '&') - builder.append("&"); + builder.append("&"sv); // 2. Replace any occurrences of the U+00A0 NO-BREAK SPACE character by the string " ". else if (ch == '\xA0') - builder.append(" "); + builder.append(" "sv); // 3. If the algorithm was invoked in the attribute mode, replace any occurrences of the """ character by the string """. else if (ch == '"' && attribute_mode == AttributeMode::Yes) - builder.append("""); + builder.append("""sv); // 4. If the algorithm was not invoked in the attribute mode, replace any occurrences of the "<" character by the string "<", and any occurrences of the ">" character by the string ">". else if (ch == '<' && attribute_mode == AttributeMode::No) - builder.append("<"); + builder.append("<"sv); else if (ch == '>' && attribute_mode == AttributeMode::No) - builder.append(">"); + builder.append(">"sv); else builder.append(ch); } @@ -3544,7 +3544,7 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node) // FIXME: -> If the attribute is in some other namespace: // The attribute's serialized name is the attribute's qualified name. - builder.append("=\""); + builder.append("=\""sv); builder.append(escape_string(value, AttributeMode::Yes)); builder.append('"'); }); @@ -3559,7 +3559,7 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node) // 7. Append the value of running the HTML fragment serialization algorithm on the current node element (thus recursing into this algorithm for that element), // followed by a U+003C LESS-THAN SIGN character (<), a U+002F SOLIDUS character (/), tagname again, and finally a U+003E GREATER-THAN SIGN character (>). builder.append(serialize_html_fragment(element)); - builder.append("</"); + builder.append("</"sv); builder.append(tag_name); builder.append('>'); @@ -3594,9 +3594,9 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node) // 1. Append the literal string "<!--" (U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS), // followed by the value of current node's data IDL attribute, followed by the literal string "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN). - builder.append("<!--"); + builder.append("<!--"sv); builder.append(comment_node.data()); - builder.append("-->"); + builder.append("-->"sv); return IterationDecision::Continue; } @@ -3606,7 +3606,7 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node) // 1. Append the literal string "<?" (U+003C LESS-THAN SIGN, U+003F QUESTION MARK), followed by the value of current node's target IDL attribute, // followed by a single U+0020 SPACE character, followed by the value of current node's data IDL attribute, followed by a single U+003E GREATER-THAN SIGN character (>). - builder.append("<?"); + builder.append("<?"sv); builder.append(processing_instruction_node.target()); builder.append(' '); builder.append(processing_instruction_node.data()); @@ -3621,7 +3621,7 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node) // 1. Append the literal string "<!DOCTYPE" (U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+0044 LATIN CAPITAL LETTER D, U+004F LATIN CAPITAL LETTER O, // U+0043 LATIN CAPITAL LETTER C, U+0054 LATIN CAPITAL LETTER T, U+0059 LATIN CAPITAL LETTER Y, U+0050 LATIN CAPITAL LETTER P, U+0045 LATIN CAPITAL LETTER E), // followed by a space (U+0020 SPACE), followed by the value of current node's name IDL attribute, followed by the literal string ">" (U+003E GREATER-THAN SIGN). - builder.append("<!DOCTYPE "); + builder.append("<!DOCTYPE "sv); builder.append(document_type_node.name()); builder.append('>'); return IterationDecision::Continue; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp index 8446073e81..a53aab07d2 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp @@ -14,54 +14,54 @@ String HTMLToken::to_string() const switch (type()) { case HTMLToken::Type::DOCTYPE: - builder.append("DOCTYPE"); - builder.append(" { name: '"); + builder.append("DOCTYPE"sv); + builder.append(" { name: '"sv); builder.append(doctype_data().name); - builder.append("' }"); + builder.append("' }"sv); break; case HTMLToken::Type::StartTag: - builder.append("StartTag"); + builder.append("StartTag"sv); break; case HTMLToken::Type::EndTag: - builder.append("EndTag"); + builder.append("EndTag"sv); break; case HTMLToken::Type::Comment: - builder.append("Comment"); + builder.append("Comment"sv); break; case HTMLToken::Type::Character: - builder.append("Character"); + builder.append("Character"sv); break; case HTMLToken::Type::EndOfFile: - builder.append("EndOfFile"); + builder.append("EndOfFile"sv); break; case HTMLToken::Type::Invalid: VERIFY_NOT_REACHED(); } if (type() == HTMLToken::Type::StartTag || type() == HTMLToken::Type::EndTag) { - builder.append(" { name: '"); + builder.append(" { name: '"sv); builder.append(tag_name()); - builder.append("', { "); + builder.append("', { "sv); for_each_attribute([&](auto& attribute) { builder.append(attribute.local_name); - builder.append("=\""); + builder.append("=\""sv); builder.append(attribute.value); - builder.append("\" "); + builder.append("\" "sv); return IterationDecision::Continue; }); - builder.append("} }"); + builder.append("} }"sv); } if (is_comment()) { - builder.append(" { data: '"); + builder.append(" { data: '"sv); builder.append(comment()); - builder.append("' }"); + builder.append("' }"sv); } if (is_character()) { - builder.append(" { data: '"); + builder.append(" { data: '"sv); builder.append_code_point(code_point()); - builder.append("' }"); + builder.append("' }"sv); } if (type() == HTMLToken::Type::Character) { diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp index 410f542bd7..b5619786bd 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp @@ -407,22 +407,22 @@ _StartOfFunction: BEGIN_STATE(MarkupDeclarationOpen) { DONT_CONSUME_NEXT_INPUT_CHARACTER; - if (consume_next_if_match("--")) { + if (consume_next_if_match("--"sv)) { create_new_token(HTMLToken::Type::Comment); m_current_token.set_start_position({}, nth_last_position(3)); SWITCH_TO(CommentStart); } - if (consume_next_if_match("DOCTYPE", CaseSensitivity::CaseInsensitive)) { + if (consume_next_if_match("DOCTYPE"sv, CaseSensitivity::CaseInsensitive)) { SWITCH_TO(DOCTYPE); } - if (consume_next_if_match("[CDATA[")) { + if (consume_next_if_match("[CDATA["sv)) { // We keep the parser optional so that syntax highlighting can be lexer-only. // The parser registers itself with the lexer it creates. if (m_parser != nullptr && m_parser->adjusted_current_node().namespace_() != Namespace::HTML) { SWITCH_TO(CDATASection); } else { create_new_token(HTMLToken::Type::Comment); - m_current_builder.append("[CDATA["); + m_current_builder.append("[CDATA["sv); SWITCH_TO_WITH_UNCLEAN_BUILDER(BogusComment); } } @@ -595,10 +595,10 @@ _StartOfFunction: } ANYTHING_ELSE { - if (to_ascii_uppercase(current_input_character.value()) == 'P' && consume_next_if_match("UBLIC", CaseSensitivity::CaseInsensitive)) { + if (to_ascii_uppercase(current_input_character.value()) == 'P' && consume_next_if_match("UBLIC"sv, CaseSensitivity::CaseInsensitive)) { SWITCH_TO(AfterDOCTYPEPublicKeyword); } - if (to_ascii_uppercase(current_input_character.value()) == 'S' && consume_next_if_match("YSTEM", CaseSensitivity::CaseInsensitive)) { + if (to_ascii_uppercase(current_input_character.value()) == 'S' && consume_next_if_match("YSTEM"sv, CaseSensitivity::CaseInsensitive)) { SWITCH_TO(AfterDOCTYPESystemKeyword); } log_parse_error(); @@ -1487,7 +1487,7 @@ _StartOfFunction: } ANYTHING_ELSE { - m_current_builder.append("--"); + m_current_builder.append("--"sv); RECONSUME_IN(Comment); } } @@ -1498,7 +1498,7 @@ _StartOfFunction: { ON('-') { - m_current_builder.append("--!"); + m_current_builder.append("--!"sv); SWITCH_TO_WITH_UNCLEAN_BUILDER(CommentEndDash); } ON('>') @@ -1515,7 +1515,7 @@ _StartOfFunction: } ANYTHING_ELSE { - m_current_builder.append("--!"); + m_current_builder.append("--!"sv); RECONSUME_IN(Comment); } } diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp index 546d6387de..b161dd6db3 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp @@ -22,11 +22,11 @@ NonnullRefPtr<ClassicScript> ClassicScript::create(String filename, StringView s // 2. If muted errors is true, then set baseURL to about:blank. if (muted_errors == MutedErrors::Yes) - base_url = "about:blank"; + base_url = "about:blank"sv; // 3. If scripting is disabled for settings, then set source to the empty string. if (environment_settings_object.is_scripting_disabled()) - source = ""; + source = ""sv; // 4. Let script be a new classic script that this algorithm will subsequently initialize. auto script = adopt_ref(*new ClassicScript(move(base_url), move(filename), environment_settings_object)); diff --git a/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.cpp b/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.cpp index 433f40c83a..2ce0152b9b 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.cpp +++ b/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.cpp @@ -31,7 +31,7 @@ void WorkerDebugConsoleClient::end_group() // 2.3. Printer(logLevel, args[, options]), https://console.spec.whatwg.org/#printer JS::ThrowCompletionOr<JS::Value> WorkerDebugConsoleClient::printer(JS::Console::LogLevel log_level, PrinterArguments arguments) { - String indent = String::repeated(" ", m_group_stack_depth); + String indent = String::repeated(" "sv, m_group_stack_depth); if (log_level == JS::Console::LogLevel::Trace) { auto trace = arguments.get<JS::Console::Trace>(); diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index a825ee167f..fc0b01b266 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -592,7 +592,7 @@ String Node::debug_description() const builder.appendff(".{}", class_name); } } else { - builder.append("(anonymous)"); + builder.append("(anonymous)"sv); } return builder.to_string(); } diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 5b1dc2a381..02d70cdecf 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -142,9 +142,9 @@ bool FrameLoader::parse_document(DOM::Document& document, ByteBuffer const& data parser->run(document.url()); return true; } - if (mime_type.ends_with("+xml") || mime_type.is_one_of("text/xml", "application/xml")) + if (mime_type.ends_with("+xml"sv) || mime_type.is_one_of("text/xml", "application/xml")) return build_xml_document(document, data); - if (mime_type.starts_with("image/")) + if (mime_type.starts_with("image/"sv)) return build_image_document(document, data); if (mime_type == "text/plain" || mime_type == "application/json") return build_text_document(document, data); diff --git a/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp b/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp index b6d00ef408..dc4e3f3544 100644 --- a/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/ImageLoader.cpp @@ -76,7 +76,7 @@ void ImageLoader::resource_did_load() } m_redirects_count = 0; - if (!resource()->mime_type().starts_with("image/")) { + if (!resource()->mime_type().starts_with("image/"sv)) { m_loading_state = LoadingState::Failed; if (on_fail) on_fail(); diff --git a/Userland/Libraries/LibWeb/Loader/Resource.cpp b/Userland/Libraries/LibWeb/Loader/Resource.cpp index 525992697a..e5ac447050 100644 --- a/Userland/Libraries/LibWeb/Loader/Resource.cpp +++ b/Userland/Libraries/LibWeb/Loader/Resource.cpp @@ -103,14 +103,14 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, HashMap<Strin // FIXME: "The Quite OK Image Format" doesn't have an official mime type yet, // and servers like nginx will send a generic octet-stream mime type instead. // Let's use image/x-qoi for now, which is also what our Core::MimeData uses & would guess. - if (m_mime_type == "application/octet-stream" && url().path().ends_with(".qoi")) + if (m_mime_type == "application/octet-stream" && url().path().ends_with(".qoi"sv)) m_mime_type = "image/x-qoi"; } else if (url().protocol() == "data" && !url().data_mime_type().is_empty()) { dbgln_if(RESOURCE_DEBUG, "This is a data URL with mime-type _{}_", url().data_mime_type()); m_mime_type = url().data_mime_type(); } else { auto content_type_options = headers.get("X-Content-Type-Options"); - if (content_type_options.value_or("").equals_ignoring_case("nosniff")) { + if (content_type_options.value_or("").equals_ignoring_case("nosniff"sv)) { m_mime_type = "text/plain"; } else { m_mime_type = Core::guess_mime_type_based_on_filename(url().path()); diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp index 7cde613cfc..f3de86c899 100644 --- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -302,7 +302,7 @@ void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, Has if (status_code.has_value()) error_builder.appendff("Load failed: {}", *status_code); else - error_builder.append("Load failed"); + error_builder.append("Load failed"sv); log_failure(request, error_builder.string_view()); if (error_callback) error_callback(error_builder.to_string(), {}); diff --git a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp index 7d36522b53..753db70ade 100644 --- a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp +++ b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp @@ -42,7 +42,7 @@ static bool contains_only_http_token_code_points(StringView string) // https://mimesniff.spec.whatwg.org/#http-token-code-point // An HTTP token code point is U+0021 (!), U+0023 (#), U+0024 ($), U+0025 (%), U+0026 (&), U+0027 ('), U+002A (*), // U+002B (+), U+002D (-), U+002E (.), U+005E (^), U+005F (_), U+0060 (`), U+007C (|), U+007E (~), or an ASCII alphanumeric. - constexpr auto is_certain_non_ascii_alphanumeric = is_any_of("!#$%&'*+-.^_`|~"); + constexpr auto is_certain_non_ascii_alphanumeric = is_any_of("!#$%&'*+-.^_`|~"sv); for (char ch : string) { if (!is_certain_non_ascii_alphanumeric(ch) && !is_ascii_alphanumeric(ch)) return false; @@ -56,7 +56,7 @@ Optional<MimeType> MimeType::from_string(StringView string) // https://fetch.spec.whatwg.org/#http-whitespace // HTTP whitespace is U+000A LF, U+000D CR, or an HTTP tab or space. // An HTTP tab or space is U+0009 TAB or U+0020 SPACE. - constexpr char const* http_whitespace = "\n\r\t "; + constexpr auto http_whitespace = "\n\r\t "sv; // 1. Remove any leading and trailing HTTP whitespace from input. auto trimmed_string = string.trim(http_whitespace, TrimMode::Both); diff --git a/Userland/Libraries/LibWeb/Origin.h b/Userland/Libraries/LibWeb/Origin.h index 115203ebff..2bfeb2205d 100644 --- a/Userland/Libraries/LibWeb/Origin.h +++ b/Userland/Libraries/LibWeb/Origin.h @@ -78,7 +78,7 @@ public: result.append(protocol()); // 3. Append "://" to result. - result.append("://"); + result.append("://"sv); // 4. Append origin's host, serialized, to result. result.append(host()); diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 56acbbf398..83854a6550 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -234,7 +234,7 @@ bool EventHandler::handle_mouseup(Gfx::IntPoint const& position, unsigned button auto url = document->parse_url(href); dbgln("Web::EventHandler: Clicking on a link to {}", url); if (button == GUI::MouseButton::Primary) { - if (href.starts_with("javascript:")) { + if (href.starts_with("javascript:"sv)) { document->run_javascript(href.substring_view(11, href.length() - 11)); } else if (!url.fragment().is_null() && url.equals(document->url(), AK::URL::ExcludeFragment::Yes)) { m_browsing_context.scroll_to_anchor(url.fragment()); diff --git a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp index ee5d223e9a..e79749c5cf 100644 --- a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp @@ -31,7 +31,7 @@ void ProgressPaintable::paint(PaintContext& context, PaintPhase phase) const if (phase == PaintPhase::Foreground) { // FIXME: This does not support floating point value() and max() - Gfx::StylePainter::paint_progressbar(context.painter(), enclosing_int_rect(absolute_rect()), context.palette(), 0, layout_box().dom_node().max(), layout_box().dom_node().value(), ""); + Gfx::StylePainter::paint_progressbar(context.painter(), enclosing_int_rect(absolute_rect()), context.palette(), 0, layout_box().dom_node().max(), layout_box().dom_node().value(), ""sv); } } diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp index cb46c00077..cbb78986a9 100644 --- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp @@ -405,7 +405,7 @@ void StackingContext::dump(int indent) const if (m_box.computed_values().z_index().has_value()) builder.appendff("{}", m_box.computed_values().z_index().value()); else - builder.append("auto"); + builder.append("auto"sv); builder.append(')'); auto affine_transform = combine_transformations_2d(m_box.computed_values().transformations()); diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index 8de189a7ef..9aeac268c9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -21,18 +21,18 @@ void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style) { CSS::Parser::ParsingContext parsing_context { document() }; for_each_attribute([&](auto& name, auto& value) { - if (name.equals_ignoring_case("fill")) { + if (name.equals_ignoring_case("fill"sv)) { // FIXME: The `fill` attribute and CSS `fill` property are not the same! But our support is limited enough that they are equivalent for now. if (auto fill_value = parse_css_value(parsing_context, value, CSS::PropertyID::Fill)) style.set_property(CSS::PropertyID::Fill, fill_value.release_nonnull()); - } else if (name.equals_ignoring_case("stroke")) { + } else if (name.equals_ignoring_case("stroke"sv)) { // FIXME: The `stroke` attribute and CSS `stroke` property are not the same! But our support is limited enough that they are equivalent for now. if (auto stroke_value = parse_css_value(parsing_context, value, CSS::PropertyID::Stroke)) style.set_property(CSS::PropertyID::Stroke, stroke_value.release_nonnull()); - } else if (name.equals_ignoring_case("stroke-width")) { + } else if (name.equals_ignoring_case("stroke-width"sv)) { if (auto stroke_width_value = parse_css_value(parsing_context, value, CSS::PropertyID::StrokeWidth)) style.set_property(CSS::PropertyID::StrokeWidth, stroke_width_value.release_nonnull()); - } else if (name.equals_ignoring_case("transform")) { + } else if (name.equals_ignoring_case("transform"sv)) { if (auto transform = parse_css_value(parsing_context, value, CSS::PropertyID::Transform)) style.set_property(CSS::PropertyID::Transform, transform.release_nonnull()); } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index b0f6e6e330..10e57ca3c3 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -299,7 +299,7 @@ JS::ThrowCompletionOr<size_t> WebAssemblyObject::instantiate_module(Wasm::Module if (link_result.is_error()) { // FIXME: Throw a LinkError. StringBuilder builder; - builder.append("LinkError: Missing "); + builder.append("LinkError: Missing "sv); builder.join(' ', link_result.error().missing_imports); return vm.throw_completion<JS::TypeError>(global_object, builder.build()); } diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 62dbc8d64b..6e2b9ab97d 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -161,7 +161,7 @@ String XMLHttpRequest::get_text_response() const if (mime_type.essence().is_one_of("text/xml"sv, "application/xml"sv)) return true; - return mime_type.subtype().ends_with("+xml"); + return mime_type.subtype().ends_with("+xml"sv); }; // 3. If xhr’s response type is the empty string, charset is null, and the result of get a final MIME type for xhr is an XML MIME type, @@ -171,7 +171,7 @@ String XMLHttpRequest::get_text_response() const // 4. If charset is null, then set charset to UTF-8. if (!charset.has_value()) - charset = "UTF-8"; + charset = "UTF-8"sv; // 5. Return the result of running decode on xhr’s received bytes using fallback encoding charset. auto* decoder = TextCodec::decoder_for(charset.value()); @@ -300,7 +300,7 @@ Optional<Vector<String>> XMLHttpRequest::get_decode_and_split(String const& head // 3. Remove all HTTP tab or space from the start and end of value. // https://fetch.spec.whatwg.org/#http-tab-or-space // An HTTP tab or space is U+0009 TAB or U+0020 SPACE. - auto trimmed_value = value.to_string().trim("\t ", TrimMode::Both); + auto trimmed_value = value.to_string().trim("\t "sv, TrimMode::Both); // 4. Append value to values. values.append(move(trimmed_value)); @@ -374,7 +374,7 @@ Optional<MimeSniff::MimeType> XMLHttpRequest::extract_mime_type(HashMap<String, // https://fetch.spec.whatwg.org/#forbidden-header-name static bool is_forbidden_header_name(String const& header_name) { - if (header_name.starts_with("Proxy-", CaseSensitivity::CaseInsensitive) || header_name.starts_with("Sec-", CaseSensitivity::CaseInsensitive)) + if (header_name.starts_with("Proxy-"sv, CaseSensitivity::CaseInsensitive) || header_name.starts_with("Sec-"sv, CaseSensitivity::CaseInsensitive)) return true; auto lowercase_header_name = header_name.to_lowercase(); @@ -699,9 +699,9 @@ String XMLHttpRequest::get_all_response_headers() const for (auto& key : keys) { builder.append(key); - builder.append(": "); + builder.append(": "sv); builder.append(m_response_headers.get(key).value()); - builder.append("\r\n"); + builder.append("\r\n"sv); } return builder.to_string(); } diff --git a/Userland/Libraries/LibWebSocket/WebSocket.cpp b/Userland/Libraries/LibWebSocket/WebSocket.cpp index 3aa12da472..31f4557acb 100644 --- a/Userland/Libraries/LibWebSocket/WebSocket.cpp +++ b/Userland/Libraries/LibWebSocket/WebSocket.cpp @@ -147,11 +147,11 @@ void WebSocket::send_client_handshake() builder.appendff(":{}", url.port_or_default()); else if (m_connection.is_secure() && url.port_or_default() != 443) builder.appendff(":{}", url.port_or_default()); - builder.append("\r\n"); + builder.append("\r\n"sv); // 5. and 6. Connection Upgrade - builder.append("Upgrade: websocket\r\n"); - builder.append("Connection: Upgrade\r\n"); + builder.append("Upgrade: websocket\r\n"sv); + builder.append("Connection: Upgrade\r\n"sv); // 7. 16-byte nonce encoded as Base64 u8 nonce_data[16]; @@ -165,20 +165,20 @@ void WebSocket::send_client_handshake() } // 9. Websocket version - builder.append("Sec-WebSocket-Version: 13\r\n"); + builder.append("Sec-WebSocket-Version: 13\r\n"sv); // 10. Websocket protocol (optional field) if (!m_connection.protocols().is_empty()) { - builder.append("Sec-WebSocket-Protocol: "); - builder.join(",", m_connection.protocols()); - builder.append("\r\n"); + builder.append("Sec-WebSocket-Protocol: "sv); + builder.join(',', m_connection.protocols()); + builder.append("\r\n"sv); } // 11. Websocket extensions (optional field) if (!m_connection.extensions().is_empty()) { - builder.append("Sec-WebSocket-Extensions: "); - builder.join(",", m_connection.extensions()); - builder.append("\r\n"); + builder.append("Sec-WebSocket-Extensions: "sv); + builder.join(',', m_connection.extensions()); + builder.append("\r\n"sv); } // 12. Additional headers @@ -186,7 +186,7 @@ void WebSocket::send_client_handshake() builder.appendff("{}: {}\r\n", header.name, header.value); } - builder.append("\r\n"); + builder.append("\r\n"sv); m_state = WebSocket::InternalState::WaitingForServerHandshake; auto success = m_impl->send(builder.to_string().bytes()); @@ -267,9 +267,9 @@ void WebSocket::read_server_handshake() auto header_name = parts[0]; - if (header_name.equals_ignoring_case("Upgrade")) { + if (header_name.equals_ignoring_case("Upgrade"sv)) { // 2. |Upgrade| should be case-insensitive "websocket" - if (!parts[1].trim_whitespace().equals_ignoring_case("websocket")) { + if (!parts[1].trim_whitespace().equals_ignoring_case("websocket"sv)) { dbgln("WebSocket: Server HTTP Handshake Header |Upgrade| should be 'websocket', got '{}'. Failing connection.", parts[1]); fatal_error(WebSocket::Error::ConnectionUpgradeFailed); return; @@ -279,9 +279,9 @@ void WebSocket::read_server_handshake() continue; } - if (header_name.equals_ignoring_case("Connection")) { + if (header_name.equals_ignoring_case("Connection"sv)) { // 3. |Connection| should be case-insensitive "Upgrade" - if (!parts[1].trim_whitespace().equals_ignoring_case("Upgrade")) { + if (!parts[1].trim_whitespace().equals_ignoring_case("Upgrade"sv)) { dbgln("WebSocket: Server HTTP Handshake Header |Connection| should be 'Upgrade', got '{}'. Failing connection.", parts[1]); return; } @@ -290,7 +290,7 @@ void WebSocket::read_server_handshake() continue; } - if (header_name.equals_ignoring_case("Sec-WebSocket-Accept")) { + if (header_name.equals_ignoring_case("Sec-WebSocket-Accept"sv)) { // 4. |Sec-WebSocket-Accept| should be base64(SHA1(|Sec-WebSocket-Key| + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")) auto expected_content = String::formatted("{}258EAFA5-E914-47DA-95CA-C5AB0DC85B11", m_websocket_key); @@ -309,7 +309,7 @@ void WebSocket::read_server_handshake() continue; } - if (header_name.equals_ignoring_case("Sec-WebSocket-Extensions")) { + if (header_name.equals_ignoring_case("Sec-WebSocket-Extensions"sv)) { // 5. |Sec-WebSocket-Extensions| should not contain an extension that doesn't appear in m_connection->extensions() auto server_extensions = parts[1].split(','); for (auto const& extension : server_extensions) { @@ -329,7 +329,7 @@ void WebSocket::read_server_handshake() continue; } - if (header_name.equals_ignoring_case("Sec-WebSocket-Protocol")) { + if (header_name.equals_ignoring_case("Sec-WebSocket-Protocol"sv)) { // 6. |Sec-WebSocket-Protocol| should not contain an extension that doesn't appear in m_connection->protocols() auto server_protocols = parts[1].split(','); for (auto const& protocol : server_protocols) { diff --git a/Userland/Libraries/LibWebView/DOMTreeModel.cpp b/Userland/Libraries/LibWebView/DOMTreeModel.cpp index 404e9b4eed..c3ff3f016a 100644 --- a/Userland/Libraries/LibWebView/DOMTreeModel.cpp +++ b/Userland/Libraries/LibWebView/DOMTreeModel.cpp @@ -18,9 +18,9 @@ DOMTreeModel::DOMTreeModel(JsonObject dom_tree, GUI::TreeView& tree_view) : m_tree_view(tree_view) , m_dom_tree(move(dom_tree)) { - m_document_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-html.png").release_value_but_fixme_should_propagate_errors()); - m_element_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png").release_value_but_fixme_should_propagate_errors()); - m_text_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-unknown.png").release_value_but_fixme_should_propagate_errors()); + m_document_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-html.png"sv).release_value_but_fixme_should_propagate_errors()); + m_element_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors()); + m_text_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-unknown.png"sv).release_value_but_fixme_should_propagate_errors()); map_dom_nodes_to_parent(nullptr, &m_dom_tree); } @@ -116,8 +116,8 @@ static String with_whitespace_collapsed(StringView string) GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const { auto const& node = *static_cast<JsonObject const*>(index.internal_data()); - auto node_name = node.get("name").as_string(); - auto type = node.get("type").as_string_or("unknown"); + auto node_name = node.get("name"sv).as_string(); + auto type = node.get("type"sv).as_string_or("unknown"sv); if (role == GUI::ModelRole::ForegroundColor) { // FIXME: Allow models to return a foreground color *role*. @@ -126,7 +126,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol return m_tree_view.palette().syntax_comment(); if (type == "pseudo-element"sv) return m_tree_view.palette().syntax_type(); - if (!node.get("visible").to_bool(true)) + if (!node.get("visible"sv).to_bool(true)) return m_tree_view.palette().syntax_comment(); return {}; } @@ -141,7 +141,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol } if (role == GUI::ModelRole::Display) { if (type == "text") - return with_whitespace_collapsed(node.get("text").as_string()); + return with_whitespace_collapsed(node.get("text"sv).as_string()); if (type == "comment"sv) return String::formatted("<!--{}-->", node.get("data"sv).as_string()); if (type != "element") @@ -150,8 +150,8 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol StringBuilder builder; builder.append('<'); builder.append(node_name.to_lowercase()); - if (node.has("attributes")) { - auto attributes = node.get("attributes").as_object(); + if (node.has("attributes"sv)) { + auto attributes = node.get("attributes"sv).as_object(); attributes.for_each_member([&builder](auto& name, JsonValue const& value) { builder.append(' '); builder.append(name); @@ -170,7 +170,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol void DOMTreeModel::map_dom_nodes_to_parent(JsonObject const* parent, JsonObject const* node) { m_dom_node_to_parent_map.set(node, parent); - m_node_id_to_dom_node_map.set(node->get("id").to_i32(), node); + m_node_id_to_dom_node_map.set(node->get("id"sv).to_i32(), node); auto const* children = get_children(*node); if (!children) @@ -191,10 +191,10 @@ GUI::ModelIndex DOMTreeModel::index_for_node(i32 node_id, Optional<Web::CSS::Sel auto node_children = get_children(*node); for (size_t i = 0; i < node_children->size(); i++) { auto& child = node_children->at(i).as_object(); - if (!child.has("pseudo-element")) + if (!child.has("pseudo-element"sv)) continue; - auto child_pseudo_element = child.get("pseudo-element"); + auto child_pseudo_element = child.get("pseudo-element"sv); if (!child_pseudo_element.is_i32()) continue; @@ -214,7 +214,7 @@ GUI::ModelIndex DOMTreeModel::index_for_node(i32 node_id, Optional<Web::CSS::Sel } } - dbgln("Didn't find index for node {}, pseudo-element {}!", node_id, pseudo_element.has_value() ? Web::CSS::pseudo_element_name(pseudo_element.value()) : "NONE"); + dbgln("Didn't find index for node {}, pseudo-element {}!", node_id, pseudo_element.has_value() ? Web::CSS::pseudo_element_name(pseudo_element.value()) : "NONE"sv); return {}; } diff --git a/Userland/Libraries/LibWebView/DOMTreeModel.h b/Userland/Libraries/LibWebView/DOMTreeModel.h index 019b230357..90cfb6ca8f 100644 --- a/Userland/Libraries/LibWebView/DOMTreeModel.h +++ b/Userland/Libraries/LibWebView/DOMTreeModel.h @@ -45,7 +45,7 @@ private: ALWAYS_INLINE static JsonArray const* get_children(JsonObject const& o) { - if (auto const* maybe_children = o.get_ptr("children"); maybe_children) + if (auto const* maybe_children = o.get_ptr("children"sv); maybe_children) return &maybe_children->as_array(); return nullptr; } diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index ed6967f567..ac56242659 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -43,17 +43,17 @@ void OutOfProcessWebView::handle_web_content_process_crash() handle_resize(); StringBuilder builder; - builder.append("<html><head><title>Crashed: "); + builder.append("<html><head><title>Crashed: "sv); builder.append(escape_html_entities(m_url.to_string())); - builder.append("</title></head><body>"); - builder.append("<h1>Web page crashed"); + builder.append("</title></head><body>"sv); + builder.append("<h1>Web page crashed"sv); if (!m_url.host().is_empty()) { builder.appendff(" on {}", escape_html_entities(m_url.host())); } - builder.append("</h1>"); + builder.append("</h1>"sv); auto escaped_url = escape_html_entities(m_url.to_string()); builder.appendff("The web page <a href=\"{}\">{}</a> has crashed.<br><br>You can reload the page to try again.", escaped_url, escaped_url); - builder.append("</body></html>"); + builder.append("</body></html>"sv); load_html(builder.to_string(), m_url); } @@ -329,19 +329,19 @@ void OutOfProcessWebView::notify_server_did_request_image_context_menu(Badge<Web void OutOfProcessWebView::notify_server_did_request_alert(Badge<WebContentClient>, String const& message) { - GUI::MessageBox::show(window(), message, "Alert", GUI::MessageBox::Type::Information); + GUI::MessageBox::show(window(), message, "Alert"sv, GUI::MessageBox::Type::Information); } bool OutOfProcessWebView::notify_server_did_request_confirm(Badge<WebContentClient>, String const& message) { - auto confirm_result = GUI::MessageBox::show(window(), message, "Confirm", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel); + auto confirm_result = GUI::MessageBox::show(window(), message, "Confirm"sv, GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel); return confirm_result == GUI::Dialog::ExecResult::OK; } String OutOfProcessWebView::notify_server_did_request_prompt(Badge<WebContentClient>, String const& message, String const& default_) { String response { default_ }; - if (GUI::InputBox::show(window(), response, message, "Prompt") == GUI::InputBox::ExecResult::OK) + if (GUI::InputBox::show(window(), response, message, "Prompt"sv) == GUI::InputBox::ExecResult::OK) return response; return {}; } diff --git a/Userland/Libraries/LibX86/Instruction.cpp b/Userland/Libraries/LibX86/Instruction.cpp index 7c3af20a36..d4a7624e59 100644 --- a/Userland/Libraries/LibX86/Instruction.cpp +++ b/Userland/Libraries/LibX86/Instruction.cpp @@ -1533,15 +1533,15 @@ String Instruction::to_string(u32 origin, SymbolProvider const* symbol_provider, if (has_segment_prefix()) builder.appendff("{}: ", register_name(segment_prefix().value())); if (has_address_size_override_prefix()) - builder.append(m_a32 ? "a32 " : "a16 "); + builder.append(m_a32 ? "a32 "sv : "a16 "sv); // Note: SSE2 Uses this to change to doubles in SSE instruction or xmm registers in MMX instructions if (has_operand_size_override_prefix() && !(m_descriptor->format > __SSE && m_descriptor->format < __EndFormatsWithRMByte)) - builder.append(m_o32 ? "o32 " : "o16 "); + builder.append(m_o32 ? "o32 "sv : "o16 "sv); if (has_lock_prefix()) - builder.append("lock "); + builder.append("lock "sv); // Note: SSE instructions use these to toggle between packed and single data if (has_rep_prefix() && !(m_descriptor->format > __SSE && m_descriptor->format < __EndFormatsWithRMByte)) - builder.append(m_rep_prefix == Prefix::REPNZ ? "repnz " : "repz "); + builder.append(m_rep_prefix == Prefix::REPNZ ? "repnz "sv : "repz "sv); to_string_internal(builder, origin, symbol_provider, x32); return builder.to_string(); } @@ -1564,7 +1564,7 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP if (symbol_provider) { u32 symbol_offset = 0; auto symbol = symbol_provider->symbolicate(origin + offset, &symbol_offset); - builder.append(" <"); + builder.append(" <"sv); builder.append(symbol); if (symbol_offset) builder.appendff("+{:#x}", symbol_offset); @@ -1626,7 +1626,7 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP append_mmrm64(); }; - auto append = [&](auto& content) { builder.append(content); }; + auto append = [&](auto content) { builder.append(content); }; auto append_moff = [&] { builder.append('['); if (m_a32) { @@ -1674,7 +1674,7 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP break; case OP_AL_imm8: append_mnemonic_space(); - append("al,"); + append("al,"sv); append_imm8(); break; case OP_imm8: @@ -1684,37 +1684,37 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP case OP_reg8_imm8: append_mnemonic_space(); append_reg8(); - append(","); + append(','); append_imm8(); break; case OP_AX_imm8: append_mnemonic_space(); - append("ax,"); + append("ax,"sv); append_imm8(); break; case OP_EAX_imm8: append_mnemonic_space(); - append("eax,"); + append("eax,"sv); append_imm8(); break; case OP_imm8_AL: append_mnemonic_space(); append_imm8(); - append(",al"); + append(",al"sv); break; case OP_imm8_AX: append_mnemonic_space(); append_imm8(); - append(",ax"); + append(",ax"sv); break; case OP_imm8_EAX: append_mnemonic_space(); append_imm8(); - append(",eax"); + append(",eax"sv); break; case OP_AX_imm16: append_mnemonic_space(); - append("ax,"); + append("ax,"sv); append_imm16(); break; case OP_imm16: @@ -1749,32 +1749,32 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP break; case OP_EAX_imm32: append_mnemonic_space(); - append("eax,"); + append("eax,"sv); append_imm32(); break; case OP_CS: append_mnemonic_space(); - append("cs"); + append("cs"sv); break; case OP_DS: append_mnemonic_space(); - append("ds"); + append("ds"sv); break; case OP_ES: append_mnemonic_space(); - append("es"); + append("es"sv); break; case OP_SS: append_mnemonic_space(); - append("ss"); + append("ss"sv); break; case OP_FS: append_mnemonic_space(); - append("fs"); + append("fs"sv); break; case OP_GS: append_mnemonic_space(); - append("gs"); + append("gs"sv); break; case OP: append_mnemonic(); @@ -1786,86 +1786,86 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP case OP_imm16_imm8: append_mnemonic_space(); append_imm16_1(); - append(","); + append(','); append_imm8_2(); break; case OP_moff8_AL: append_mnemonic_space(); append_moff(); - append(",al"); + append(",al"sv); break; case OP_moff16_AX: append_mnemonic_space(); append_moff(); - append(",ax"); + append(",ax"sv); break; case OP_moff32_EAX: append_mnemonic_space(); append_moff(); - append(",eax"); + append(",eax"sv); break; case OP_AL_moff8: append_mnemonic_space(); - append("al,"); + append("al,"sv); append_moff(); break; case OP_AX_moff16: append_mnemonic_space(); - append("ax,"); + append("ax,"sv); append_moff(); break; case OP_EAX_moff32: append_mnemonic_space(); - append("eax,"); + append("eax,"sv); append_moff(); break; case OP_imm16_imm16: append_mnemonic_space(); append_imm16_1(); - append(":"); + append(":"sv); append_imm16_2(); break; case OP_imm16_imm32: append_mnemonic_space(); append_imm16_1(); - append(":"); + append(":"sv); append_imm32_2(); break; case OP_reg32_imm32: append_mnemonic_space(); append_reg32(); - append(","); + append(','); append_imm32(); break; case OP_RM8_1: append_mnemonic_space(); append_rm8(); - append(",0x01"); + append(",0x01"sv); break; case OP_RM16_1: append_mnemonic_space(); append_rm16(); - append(",0x01"); + append(",0x01"sv); break; case OP_RM32_1: append_mnemonic_space(); append_rm32(); - append(",0x01"); + append(",0x01"sv); break; case OP_RM8_CL: append_mnemonic_space(); append_rm8(); - append(",cl"); + append(",cl"sv); break; case OP_RM16_CL: append_mnemonic_space(); append_rm16(); - append(",cl"); + append(",cl"sv); break; case OP_RM32_CL: append_mnemonic_space(); append_rm32(); - append(",cl"); + append(",cl"sv); break; case OP_reg16: append_mnemonic_space(); @@ -1873,46 +1873,46 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP break; case OP_AX_reg16: append_mnemonic_space(); - append("ax,"); + append("ax,"sv); append_reg16(); break; case OP_EAX_reg32: append_mnemonic_space(); - append("eax,"); + append("eax,"sv); append_reg32(); break; case OP_3: append_mnemonic_space(); - append("0x03"); + append("0x03"sv); break; case OP_AL_DX: append_mnemonic_space(); - append("al,dx"); + append("al,dx"sv); break; case OP_AX_DX: append_mnemonic_space(); - append("ax,dx"); + append("ax,dx"sv); break; case OP_EAX_DX: append_mnemonic_space(); - append("eax,dx"); + append("eax,dx"sv); break; case OP_DX_AL: append_mnemonic_space(); - append("dx,al"); + append("dx,al"sv); break; case OP_DX_AX: append_mnemonic_space(); - append("dx,ax"); + append("dx,ax"sv); break; case OP_DX_EAX: append_mnemonic_space(); - append("dx,eax"); + append("dx,eax"sv); break; case OP_reg8_CL: append_mnemonic_space(); append_reg8(); - append(",cl"); + append(",cl"sv); break; case OP_RM8: append_mnemonic_space(); diff --git a/Userland/Libraries/LibXML/Parser/Parser.cpp b/Userland/Libraries/LibXML/Parser/Parser.cpp index 1fd23effc1..ed5b79ac51 100644 --- a/Userland/Libraries/LibXML/Parser/Parser.cpp +++ b/Userland/Libraries/LibXML/Parser/Parser.cpp @@ -190,7 +190,7 @@ ErrorOr<void, ParseError> Parser::skip_whitespace(Required required) auto rule = enter_rule(); // S ::= (#x20 | #x9 | #xD | #xA)+ - auto matched = m_lexer.consume_while(is_any_of("\x20\x09\x0d\x0a")); + auto matched = m_lexer.consume_while(is_any_of("\x20\x09\x0d\x0a"sv)); if (required == Required::Yes && matched.is_empty()) return parse_error(m_lexer.tell(), "Expected whitespace"); @@ -315,14 +315,14 @@ ErrorOr<void, ParseError> Parser::parse_xml_decl() // XMLDecl::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' - TRY(expect("<?xml")); + TRY(expect("<?xml"sv)); auto accept = accept_rule(); TRY(parse_version_info()); (void)parse_encoding_decl(); (void)parse_standalone_document_decl(); TRY(skip_whitespace()); - TRY(expect("?>")); + TRY(expect("?>"sv)); rollback.disarm(); return {}; @@ -336,11 +336,11 @@ ErrorOr<void, ParseError> Parser::parse_version_info() // VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') TRY(skip_whitespace(Required::Yes)); - TRY(expect("version")); + TRY(expect("version"sv)); auto accept = accept_rule(); TRY(parse_eq()); - TRY(expect(is_any_of("'\""), "one of ' or \"")); + TRY(expect(is_any_of("'\""sv), "one of ' or \""sv)); m_lexer.retreat(); auto version_string = m_lexer.consume_quoted_string(); @@ -367,7 +367,7 @@ ErrorOr<void, ParseError> Parser::parse_eq() // Eq ::= S? '=' S? auto accept = accept_rule(); TRY(skip_whitespace()); - TRY(expect("=")); + TRY(expect("="sv)); TRY(skip_whitespace()); rollback.disarm(); return {}; @@ -381,11 +381,11 @@ ErrorOr<void, ParseError> Parser::parse_encoding_decl() // EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" ) TRY(skip_whitespace(Required::Yes)); - TRY(expect("encoding")); + TRY(expect("encoding"sv)); auto accept = accept_rule(); TRY(parse_eq()); - TRY(expect(is_any_of("'\""), "one of ' or \"")); + TRY(expect(is_any_of("'\""sv), "one of ' or \""sv)); m_lexer.retreat(); // FIXME: Actually do something with this encoding. @@ -403,10 +403,10 @@ ErrorOr<void, ParseError> Parser::parse_standalone_document_decl() // SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) TRY(skip_whitespace(Required::Yes)); - TRY(expect("standalone")); + TRY(expect("standalone"sv)); auto accept = accept_rule(); - TRY(expect(is_any_of("'\""), "one of ' or \"")); + TRY(expect(is_any_of("'\""sv), "one of ' or \""sv)); m_lexer.retreat(); auto value = m_lexer.consume_quoted_string(); @@ -451,7 +451,7 @@ ErrorOr<void, ParseError> Parser::parse_comment() auto rule = enter_rule(); // Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' - TRY(expect("<!--")); + TRY(expect("<!--"sv)); auto accept = accept_rule(); bool last_seen_a_dash = false; @@ -474,7 +474,7 @@ ErrorOr<void, ParseError> Parser::parse_comment() text = text.substring_view(0, text.length() - 1); } - TRY(expect("-->")); + TRY(expect("-->"sv)); if (m_options.preserve_comments) append_comment(text); @@ -490,14 +490,14 @@ ErrorOr<void, ParseError> Parser::parse_processing_instruction() auto rule = enter_rule(); // PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' - TRY(expect("<?")); + TRY(expect("<?"sv)); auto accept = accept_rule(); auto target = TRY(parse_processing_instruction_target()); String data; if (auto result = skip_whitespace(Required::Yes); !result.is_error()) data = m_lexer.consume_until("?>"); - TRY(expect("?>")); + TRY(expect("?>"sv)); m_processing_instructions.set(target, data); rollback.disarm(); @@ -514,7 +514,7 @@ ErrorOr<Name, ParseError> Parser::parse_processing_instruction_target() auto target = TRY(parse_name()); auto accept = accept_rule(); - if (target.equals_ignoring_case("xml") && m_options.treat_errors_as_fatal) { + if (target.equals_ignoring_case("xml"sv) && m_options.treat_errors_as_fatal) { return parse_error( m_lexer.tell() - target.length(), "Use of the reserved 'xml' name for processing instruction target name is disallowed"); @@ -537,7 +537,7 @@ ErrorOr<Name, ParseError> Parser::parse_name() auto rule = enter_rule(); // Name ::= NameStartChar (NameChar)* - auto start = TRY(expect(s_name_start_characters, "a NameStartChar")); + auto start = TRY(expect(s_name_start_characters, "a NameStartChar"sv)); auto accept = accept_rule(); auto rest = m_lexer.consume_while(s_name_characters); @@ -557,7 +557,7 @@ ErrorOr<void, ParseError> Parser::parse_doctype_decl() Doctype doctype; // doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>' - TRY(expect("<!DOCTYPE")); + TRY(expect("<!DOCTYPE"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); @@ -589,12 +589,12 @@ ErrorOr<void, ParseError> Parser::parse_doctype_decl() TRY(skip_whitespace(Required::No)); if (m_lexer.consume_specific('[')) { auto internal_subset = TRY(parse_internal_subset()); - TRY(expect("]")); + TRY(expect("]"sv)); TRY(skip_whitespace()); doctype.markup_declarations.extend(internal_subset); } - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); m_doctype = move(doctype); @@ -646,7 +646,7 @@ ErrorOr<NonnullOwnPtr<Node>, ParseError> Parser::parse_empty_element_tag() auto rule = enter_rule(); // EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' - TRY(expect("<")); + TRY(expect("<"sv)); auto accept = accept_rule(); auto name = TRY(parse_name()); @@ -665,7 +665,7 @@ ErrorOr<NonnullOwnPtr<Node>, ParseError> Parser::parse_empty_element_tag() } TRY(skip_whitespace()); - TRY(expect("/>")); + TRY(expect("/>"sv)); rollback.disarm(); return make<Node>(Node::Element { move(name), move(attributes), {} }); @@ -699,7 +699,7 @@ ErrorOr<String, ParseError> Parser::parse_attribute_value() // AttValue ::= '"' ([^<&"] | Reference)* '"' // | "'" ([^<&'] | Reference)* "'" - auto quote = TRY(expect(is_any_of("'\""), "one of ' or \"")); + auto quote = TRY(expect(is_any_of("'\""sv), "one of ' or \""sv)); auto accept = accept_rule(); auto text = TRY(parse_attribute_value_inner(quote)); @@ -752,29 +752,29 @@ ErrorOr<Variant<Parser::EntityReference, String>, ParseError> Parser::parse_refe // | '&#x' [0-9a-fA-F]+ ';' auto reference_start = m_lexer.tell(); - TRY(expect("&")); + TRY(expect("&"sv)); auto accept = accept_rule(); auto name_result = parse_name(); if (name_result.is_error()) { - TRY(expect("#")); + TRY(expect("#"sv)); Optional<u32> code_point; if (m_lexer.consume_specific('x')) { auto hex = TRY(expect_many( ranges_for_search<Range('0', '9'), Range('a', 'f'), Range('A', 'F')>(), - "any of [0-9a-fA-F]")); + "any of [0-9a-fA-F]"sv)); code_point = AK::StringUtils::convert_to_uint_from_hex<u32>(hex); } else { auto decimal = TRY(expect_many( ranges_for_search<Range('0', '9')>(), - "any of [0-9]")); + "any of [0-9]"sv)); code_point = decimal.to_uint<u32>(); } if (!code_point.has_value() || !s_characters.contains(*code_point)) return parse_error(reference_start, "Invalid character reference"); - TRY(expect(";")); + TRY(expect(";"sv)); StringBuilder builder; builder.append_code_point(*code_point); @@ -784,7 +784,7 @@ ErrorOr<Variant<Parser::EntityReference, String>, ParseError> Parser::parse_refe } auto name = name_result.release_value(); - TRY(expect(";")); + TRY(expect(";"sv)); rollback.disarm(); return EntityReference { move(name) }; @@ -797,7 +797,7 @@ ErrorOr<NonnullOwnPtr<Node>, ParseError> Parser::parse_start_tag() auto rule = enter_rule(); // STag ::= '<' Name (S Attribute)* S? '>' - TRY(expect("<")); + TRY(expect("<"sv)); auto accept = accept_rule(); auto name = TRY(parse_name()); @@ -816,7 +816,7 @@ ErrorOr<NonnullOwnPtr<Node>, ParseError> Parser::parse_start_tag() } TRY(skip_whitespace()); - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); return make<Node>(Node::Element { move(name), move(attributes), {} }); @@ -829,12 +829,12 @@ ErrorOr<Name, ParseError> Parser::parse_end_tag() auto rule = enter_rule(); // ETag ::= '</' Name S? '>' - TRY(expect("</")); + TRY(expect("</"sv)); auto accept = accept_rule(); auto name = TRY(parse_name()); TRY(skip_whitespace()); - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); return name; @@ -1019,11 +1019,11 @@ ErrorOr<Name, ParseError> Parser::parse_parameter_entity_reference() auto rule = enter_rule(); // PEReference ::= '%' Name ';' - TRY(expect("%")); + TRY(expect("%"sv)); auto accept = accept_rule(); auto name = TRY(parse_name()); - TRY(expect(";")); + TRY(expect(";"sv)); rollback.disarm(); return name; @@ -1038,14 +1038,14 @@ ErrorOr<ElementDeclaration, ParseError> Parser::parse_element_declaration() // FIXME: Apparently both name _and_ contentspec here are allowed to be PEReferences, // but the grammar does not allow that, figure this out. // elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' - TRY(expect("<!ELEMENT")); + TRY(expect("<!ELEMENT"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); auto name = TRY(parse_name()); TRY(skip_whitespace(Required::Yes)); auto spec = TRY(parse_content_spec()); - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); return ElementDeclaration { @@ -1062,7 +1062,7 @@ ErrorOr<AttributeListDeclaration, ParseError> Parser::parse_attribute_list_decla AttributeListDeclaration declaration; // AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' - TRY(expect("<!ATTLIST")); + TRY(expect("<!ATTLIST"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); @@ -1076,7 +1076,7 @@ ErrorOr<AttributeListDeclaration, ParseError> Parser::parse_attribute_list_decla } TRY(skip_whitespace()); - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); return declaration; @@ -1128,33 +1128,33 @@ ErrorOr<AttributeListDeclaration::Definition, ParseError> Parser::parse_attribut } else if (m_lexer.consume_specific("NOTATION")) { HashTable<Name> names; TRY(skip_whitespace(Required::Yes)); - TRY(expect("(")); + TRY(expect("("sv)); TRY(skip_whitespace()); names.set(TRY(parse_name())); while (true) { TRY(skip_whitespace()); - if (auto result = expect("|"); result.is_error()) + if (auto result = expect("|"sv); result.is_error()) break; TRY(skip_whitespace()); names.set(TRY(parse_name())); } TRY(skip_whitespace()); - TRY(expect(")")); + TRY(expect(")"sv)); type = AttributeListDeclaration::NotationType { move(names) }; } else { HashTable<String> names; - TRY(expect("(")); + TRY(expect("("sv)); TRY(skip_whitespace()); names.set(TRY(parse_nm_token())); while (true) { TRY(skip_whitespace()); - if (auto result = expect("|"); result.is_error()) + if (auto result = expect("|"sv); result.is_error()) break; TRY(skip_whitespace()); names.set(TRY(parse_nm_token())); } TRY(skip_whitespace()); - TRY(expect(")")); + TRY(expect(")"sv)); type = AttributeListDeclaration::Enumeration { move(names) }; } @@ -1194,7 +1194,7 @@ ErrorOr<StringView, ParseError> Parser::parse_nm_token() auto rule = enter_rule(); // Nmtoken ::= (NameChar)+ - auto token = TRY(expect_many(s_name_characters, "a NameChar")); + auto token = TRY(expect_many(s_name_characters, "a NameChar"sv)); rollback.disarm(); return token; @@ -1208,7 +1208,7 @@ ErrorOr<NotationDeclaration, ParseError> Parser::parse_notation_declaration() Variant<ExternalID, PublicID, Empty> notation; // NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>' - TRY(expect("<!NOTATION")); + TRY(expect("<!NOTATION"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); @@ -1220,7 +1220,7 @@ ErrorOr<NotationDeclaration, ParseError> Parser::parse_notation_declaration() else notation = TRY(parse_public_id()); - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); return NotationDeclaration { @@ -1242,7 +1242,7 @@ ErrorOr<ElementDeclaration::ContentSpec, ParseError> Parser::parse_content_spec( } else if (m_lexer.consume_specific("ANY")) { content_spec = ElementDeclaration::Any {}; } else { - TRY(expect("(")); + TRY(expect("("sv)); TRY(skip_whitespace()); if (m_lexer.consume_specific("#PCDATA")) { HashTable<Name> names; @@ -1265,7 +1265,7 @@ ErrorOr<ElementDeclaration::ContentSpec, ParseError> Parser::parse_content_spec( return parse_error(m_lexer.tell(), "Expected a Name"); } TRY(skip_whitespace()); - TRY(expect(")*")); + TRY(expect(")*"sv)); content_spec = ElementDeclaration::Mixed { .types = move(names), .many = true }; } } else { @@ -1307,7 +1307,7 @@ ErrorOr<ElementDeclaration::ContentSpec, ParseError> Parser::parse_content_spec( auto rollback = rollback_point(); auto rule = enter_rule(); - TRY(expect("(")); + TRY(expect("("sv)); auto accept = accept_rule(); TRY(skip_whitespace()); @@ -1321,7 +1321,7 @@ ErrorOr<ElementDeclaration::ContentSpec, ParseError> Parser::parse_content_spec( choices.append(TRY(parse_cp())); } - TRY(expect(")")); + TRY(expect(")"sv)); if (choices.size() < 2) return parse_error(m_lexer.tell(), "Expected more than one choice"); @@ -1339,7 +1339,7 @@ ErrorOr<ElementDeclaration::ContentSpec, ParseError> Parser::parse_content_spec( auto rollback = rollback_point(); auto rule = enter_rule(); - TRY(expect("(")); + TRY(expect("("sv)); auto accept = accept_rule(); TRY(skip_whitespace()); @@ -1353,7 +1353,7 @@ ErrorOr<ElementDeclaration::ContentSpec, ParseError> Parser::parse_content_spec( entries.append(TRY(parse_cp())); } - TRY(expect(")")); + TRY(expect(")"sv)); TRY(skip_whitespace()); auto qualifier = parse_qualifier(); @@ -1430,7 +1430,7 @@ ErrorOr<EntityDeclaration, ParseError> Parser::parse_general_entity_declaration( Variant<String, EntityDefinition, Empty> definition; // GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>' - TRY(expect("<!ENTITY")); + TRY(expect("<!ENTITY"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); @@ -1452,7 +1452,7 @@ ErrorOr<EntityDeclaration, ParseError> Parser::parse_general_entity_declaration( } TRY(skip_whitespace()); - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); return GEDeclaration { @@ -1469,11 +1469,11 @@ ErrorOr<EntityDeclaration, ParseError> Parser::parse_parameter_entity_declaratio Variant<String, ExternalID, Empty> definition; // PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>' - TRY(expect("<!ENTITY")); + TRY(expect("<!ENTITY"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); - TRY(expect("%")); + TRY(expect("%"sv)); TRY(skip_whitespace(Required::Yes)); auto name = TRY(parse_name()); TRY(skip_whitespace(Required::Yes)); @@ -1484,7 +1484,7 @@ ErrorOr<EntityDeclaration, ParseError> Parser::parse_parameter_entity_declaratio definition = TRY(parse_external_id()); TRY(skip_whitespace()); - TRY(expect(">")); + TRY(expect(">"sv)); rollback.disarm(); return PEDeclaration { @@ -1500,7 +1500,7 @@ ErrorOr<PublicID, ParseError> Parser::parse_public_id() auto rule = enter_rule(); // PublicID ::= 'PUBLIC' S PubidLiteral - TRY(expect("PUBLIC")); + TRY(expect("PUBLIC"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); @@ -1521,14 +1521,14 @@ ErrorOr<StringView, ParseError> Parser::parse_public_id_literal() auto rule = enter_rule(); // PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" - auto quote = TRY(expect(is_any_of("'\""), "any of ' or \"")); + auto quote = TRY(expect(is_any_of("'\""sv), "any of ' or \""sv)); auto accept = accept_rule(); auto id = TRY(expect_many( [q = quote[0]](auto x) { return (q == '\'' ? x != '\'' : true) && s_public_id_characters.contains(x); }, - "a PubidChar")); + "a PubidChar"sv)); TRY(expect(quote)); rollback.disarm(); @@ -1542,10 +1542,10 @@ ErrorOr<StringView, ParseError> Parser::parse_system_id_literal() auto rule = enter_rule(); // SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") - auto quote = TRY(expect(is_any_of("'\""), "any of ' or \"")); + auto quote = TRY(expect(is_any_of("'\""sv), "any of ' or \""sv)); auto accept = accept_rule(); - auto id = TRY(expect_many(is_not_any_of(quote), "not a quote")); + auto id = TRY(expect_many(is_not_any_of(quote), "not a quote"sv)); TRY(expect(quote)); rollback.disarm(); @@ -1568,7 +1568,7 @@ ErrorOr<ExternalID, ParseError> Parser::parse_external_id() TRY(skip_whitespace(Required::Yes)); system_id = SystemID { TRY(parse_system_id_literal()) }; } else { - TRY(expect("PUBLIC")); + TRY(expect("PUBLIC"sv)); auto accept = accept_rule(); TRY(skip_whitespace(Required::Yes)); @@ -1594,7 +1594,7 @@ ErrorOr<Name, ParseError> Parser::parse_notation_data_declaration() TRY(skip_whitespace(Required::Yes)); auto accept = accept_rule(); - TRY(expect("NDATA")); + TRY(expect("NDATA"sv)); TRY(skip_whitespace(Required::Yes)); auto name = TRY(parse_name()); @@ -1611,7 +1611,7 @@ ErrorOr<String, ParseError> Parser::parse_entity_value() // EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' // | "'" ([^%&'] | PEReference | Reference)* "'" - auto quote = TRY(expect(is_any_of("'\""), "any of ' or \"")); + auto quote = TRY(expect(is_any_of("'\""sv), "any of ' or \""sv)); auto accept = accept_rule(); while (true) { @@ -1649,7 +1649,7 @@ ErrorOr<StringView, ParseError> Parser::parse_cdata_section() // CDStart ::= '<![CDATA[' // CData ::= (Char* - (Char* ']]>' Char*)) // CDEnd ::= ']]>' - TRY(expect("<![CDATA[")); + TRY(expect("<![CDATA["sv)); auto accept = accept_rule(); auto section_start = m_lexer.tell(); @@ -1659,7 +1659,7 @@ ErrorOr<StringView, ParseError> Parser::parse_cdata_section() m_lexer.ignore(); } auto section_end = m_lexer.tell(); - TRY(expect("]]>")); + TRY(expect("]]>"sv)); rollback.disarm(); return m_source.substring_view(section_start, section_end - section_start); @@ -1686,13 +1686,13 @@ ErrorOr<void, ParseError> Parser::parse_text_declaration() auto rule = enter_rule(); // TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' - TRY(expect("<?xml")); + TRY(expect("<?xml"sv)); auto accept = accept_rule(); (void)parse_version_info(); TRY(parse_encoding_decl()); TRY(skip_whitespace()); - TRY(expect("?>")); + TRY(expect("?>"sv)); rollback.disarm(); return {}; @@ -1768,7 +1768,7 @@ ErrorOr<String, ParseError> Parser::resolve_reference(EntityReference const& ref TemporaryChange lexer { m_lexer, GenericLexer(m_source) }; switch (placement) { case ReferencePlacement::AttributeValue: - return TRY(parse_attribute_value_inner("")); + return TRY(parse_attribute_value_inner(""sv)); case ReferencePlacement::Content: TRY(parse_content()); return ""; diff --git a/Userland/Libraries/LibXML/Parser/Parser.h b/Userland/Libraries/LibXML/Parser/Parser.h index fca39ab2a6..0d45e9420b 100644 --- a/Userland/Libraries/LibXML/Parser/Parser.h +++ b/Userland/Libraries/LibXML/Parser/Parser.h @@ -150,7 +150,7 @@ private: [this, position = m_lexer.tell(), location] { m_lexer.retreat(m_lexer.tell() - position); (void)location; - dbgln_if(XML_PARSER_DEBUG, "{:->{}}FAIL @ {} -- \x1b[31m{}\x1b[0m", " ", s_debug_indent_level * 2, location, m_lexer.remaining().substring_view(0, min(16, m_lexer.tell_remaining())).replace("\n", "\\n", ReplaceMode::All)); + dbgln_if(XML_PARSER_DEBUG, "{:->{}}FAIL @ {} -- \x1b[31m{}\x1b[0m", " ", s_debug_indent_level * 2, location, m_lexer.remaining().substring_view(0, min(16, m_lexer.tell_remaining())).replace("\n"sv, "\\n"sv, ReplaceMode::All)); } }; } @@ -181,7 +181,7 @@ private: auto error = ParseError { forward<Ts>(args)... }; if (m_current_rule.accept) { auto rule_name = m_current_rule.rule.value_or("<?>"); - if (rule_name.starts_with("parse_")) + if (rule_name.starts_with("parse_"sv)) rule_name = rule_name.substring_view(6); m_parse_errors.append({ error.offset, @@ -218,6 +218,6 @@ template<> struct AK::Formatter<XML::ParseError> : public AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, XML::ParseError const& error) { - return Formatter<FormatString>::format(builder, "{} at offset {}", error.error, error.offset); + return Formatter<FormatString>::format(builder, "{} at offset {}"sv, error.error, error.offset); } }; |