mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include "FindDialog.h"
|
||||
#include <AK/Array.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Hex.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <Applications/HexEditor/FindDialogGML.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
|
@ -31,7 +31,7 @@ static constexpr Array<Option, 2> options = {
|
|||
}
|
||||
};
|
||||
|
||||
GUI::Dialog::ExecResult FindDialog::show(GUI::Window* parent_window, String& out_text, ByteBuffer& out_buffer, bool& find_all)
|
||||
GUI::Dialog::ExecResult FindDialog::show(GUI::Window* parent_window, DeprecatedString& out_text, ByteBuffer& out_buffer, bool& find_all)
|
||||
{
|
||||
auto dialog = FindDialog::construct();
|
||||
|
||||
|
@ -67,13 +67,13 @@ GUI::Dialog::ExecResult FindDialog::show(GUI::Window* parent_window, String& out
|
|||
return result;
|
||||
}
|
||||
|
||||
Result<ByteBuffer, String> FindDialog::process_input(String text_value, OptionId opt)
|
||||
Result<ByteBuffer, DeprecatedString> FindDialog::process_input(DeprecatedString text_value, OptionId opt)
|
||||
{
|
||||
dbgln("process_input opt={}", (int)opt);
|
||||
switch (opt) {
|
||||
case OPTION_ASCII_STRING: {
|
||||
if (text_value.is_empty())
|
||||
return String("Input is empty");
|
||||
return DeprecatedString("Input is empty");
|
||||
|
||||
return text_value.to_byte_buffer();
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ Result<ByteBuffer, String> FindDialog::process_input(String text_value, OptionId
|
|||
case OPTION_HEX_VALUE: {
|
||||
auto decoded = decode_hex(text_value.replace(" "sv, ""sv, ReplaceMode::All));
|
||||
if (decoded.is_error())
|
||||
return String::formatted("Input is invalid: {}", decoded.error().string_literal());
|
||||
return DeprecatedString::formatted("Input is invalid: {}", decoded.error().string_literal());
|
||||
|
||||
return decoded.value();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue