1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -40,7 +40,7 @@ void WordGame::reset()
if (maybe_word.has_value())
m_current_word = maybe_word.value();
else {
GUI::MessageBox::show(window(), DeprecatedString::formatted("Could not get a random {} letter word. Defaulting to 5.", m_num_letters), "MasterWord"sv);
GUI::MessageBox::show(window(), ByteString::formatted("Could not get a random {} letter word. Defaulting to 5.", m_num_letters), "MasterWord"sv);
if (m_num_letters != 5) {
m_num_letters = 5;
reset();
@ -53,7 +53,7 @@ void WordGame::reset()
void WordGame::pick_font()
{
DeprecatedString best_font_name;
ByteString best_font_name;
auto best_font_size = -1;
auto& font_database = Gfx::FontDatabase::the();
font_database.for_each_font([&](Gfx::Font const& font) {
@ -61,7 +61,7 @@ void WordGame::pick_font()
return;
auto size = font.pixel_size_rounded_up();
if (size * 2 <= m_letter_height && size > best_font_size) {
best_font_name = font.qualified_name().to_deprecated_string();
best_font_name = font.qualified_name().to_byte_string();
best_font_size = size;
}
});
@ -80,7 +80,7 @@ void WordGame::keydown_event(GUI::KeyEvent& event)
{
// If we can still add a letter and the key was alpha
if (m_current_guess.length() < m_num_letters && is_ascii_alpha(event.code_point())) {
m_current_guess = DeprecatedString::formatted("{}{}", m_current_guess, event.text().to_uppercase());
m_current_guess = ByteString::formatted("{}{}", m_current_guess, event.text().to_uppercase());
m_last_word_invalid = false;
}
// If backspace pressed and already have some letters entered
@ -107,7 +107,7 @@ void WordGame::keydown_event(GUI::KeyEvent& event)
GUI::MessageBox::show(window(), "You win!"sv, "MasterWord"sv);
reset();
} else if (m_guesses.size() == m_max_guesses) {
GUI::MessageBox::show(window(), DeprecatedString::formatted("You lose!\nThe word was {}", m_current_word), "MasterWord"sv);
GUI::MessageBox::show(window(), ByteString::formatted("You lose!\nThe word was {}", m_current_word), "MasterWord"sv);
reset();
}
}
@ -194,7 +194,7 @@ void WordGame::read_words()
}
}
Optional<DeprecatedString> WordGame::random_word(size_t length)
Optional<ByteString> WordGame::random_word(size_t length)
{
auto words_for_length = m_words.get(length);
if (words_for_length.has_value()) {