1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 16:37:47 +00:00

Everywhere: Rename to_{string => deprecated_string}() where applicable

This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
This commit is contained in:
Linus Groh 2022-12-06 01:12:49 +00:00 committed by Andreas Kling
parent 6e19ab2bbc
commit 57dc179b1f
597 changed files with 1973 additions and 1972 deletions

View file

@ -27,7 +27,7 @@ char const* inet_ntop(int af, void const* src, char* dst, socklen_t len)
errno = ENOSPC;
return nullptr;
}
auto str = IPv6Address(((in6_addr const*)src)->s6_addr).to_string();
auto str = IPv6Address(((in6_addr const*)src)->s6_addr).to_deprecated_string();
if (!str.copy_characters_to_buffer(dst, len)) {
errno = ENOSPC;
return nullptr;

View file

@ -98,7 +98,7 @@ hostent* gethostbyname(char const* name)
auto ipv4_address = IPv4Address::from_string({ name, strlen(name) });
if (ipv4_address.has_value()) {
gethostbyname_name_buffer = ipv4_address.value().to_string();
gethostbyname_name_buffer = ipv4_address.value().to_deprecated_string();
__gethostbyname_buffer.h_name = const_cast<char*>(gethostbyname_name_buffer.characters());
__gethostbyname_alias_list_buffer[0] = nullptr;
__gethostbyname_buffer.h_aliases = __gethostbyname_alias_list_buffer;

View file

@ -930,7 +930,7 @@ int vasprintf(char** strp, char const* fmt, va_list ap)
builder.appendvf(fmt, ap);
VERIFY(builder.length() <= NumericLimits<int>::max());
int length = builder.length();
*strp = strdup(builder.to_string().characters());
*strp = strdup(builder.to_deprecated_string().characters());
return length;
}
@ -944,7 +944,7 @@ int asprintf(char** strp, char const* fmt, ...)
va_end(ap);
VERIFY(builder.length() <= NumericLimits<int>::max());
int length = builder.length();
*strp = strdup(builder.to_string().characters());
*strp = strdup(builder.to_deprecated_string().characters());
return length;
}

View file

@ -333,7 +333,7 @@ DeprecatedString Board::to_fen() const
// 6. Fullmove number
builder.append(DeprecatedString::number(1 + m_moves.size() / 2));
return builder.to_string();
return builder.to_deprecated_string();
}
Piece Board::get_piece(Square const& square) const
@ -886,7 +886,7 @@ void Board::set_resigned(Chess::Color c)
m_resigned = c;
}
DeprecatedString Board::result_to_string(Result result, Color turn)
DeprecatedString Board::result_to_deprecated_string(Result result, Color turn)
{
switch (result) {
case Result::CheckMate:
@ -915,7 +915,7 @@ DeprecatedString Board::result_to_string(Result result, Color turn)
}
}
DeprecatedString Board::result_to_points(Result result, Color turn)
DeprecatedString Board::result_to_points_deprecated_string(Result result, Color turn)
{
switch (result) {
case Result::CheckMate:

View file

@ -145,8 +145,8 @@ public:
NotFinished,
};
static DeprecatedString result_to_string(Result, Color turn);
static DeprecatedString result_to_points(Result, Color turn);
static DeprecatedString result_to_deprecated_string(Result, Color turn);
static DeprecatedString result_to_points_deprecated_string(Result, Color turn);
template<typename Callback>
void generate_moves(Callback callback, Color color = Color::None) const;

View file

@ -17,7 +17,7 @@ UCICommand UCICommand::from_string(StringView command)
return UCICommand();
}
DeprecatedString UCICommand::to_string() const
DeprecatedString UCICommand::to_deprecated_string() const
{
return "uci\n";
}
@ -35,7 +35,7 @@ DebugCommand DebugCommand::from_string(StringView command)
VERIFY_NOT_REACHED();
}
DeprecatedString DebugCommand::to_string() const
DeprecatedString DebugCommand::to_deprecated_string() const
{
if (flag() == Flag::On) {
return "debug on\n";
@ -52,7 +52,7 @@ IsReadyCommand IsReadyCommand::from_string(StringView command)
return IsReadyCommand();
}
DeprecatedString IsReadyCommand::to_string() const
DeprecatedString IsReadyCommand::to_deprecated_string() const
{
return "isready\n";
}
@ -92,10 +92,10 @@ SetOptionCommand SetOptionCommand::from_string(StringView command)
VERIFY(!name.is_empty());
return SetOptionCommand(name.to_string().trim_whitespace(), value.to_string().trim_whitespace());
return SetOptionCommand(name.to_deprecated_string().trim_whitespace(), value.to_deprecated_string().trim_whitespace());
}
DeprecatedString SetOptionCommand::to_string() const
DeprecatedString SetOptionCommand::to_deprecated_string() const
{
StringBuilder builder;
builder.append("setoption name "sv);
@ -126,7 +126,7 @@ PositionCommand PositionCommand::from_string(StringView command)
return PositionCommand(fen, moves);
}
DeprecatedString PositionCommand::to_string() const
DeprecatedString PositionCommand::to_deprecated_string() const
{
StringBuilder builder;
builder.append("position "sv);
@ -190,7 +190,7 @@ GoCommand GoCommand::from_string(StringView command)
return go_command;
}
DeprecatedString GoCommand::to_string() const
DeprecatedString GoCommand::to_deprecated_string() const
{
StringBuilder builder;
builder.append("go"sv);
@ -238,7 +238,7 @@ StopCommand StopCommand::from_string(StringView command)
return StopCommand();
}
DeprecatedString StopCommand::to_string() const
DeprecatedString StopCommand::to_deprecated_string() const
{
return "stop\n";
}
@ -263,7 +263,7 @@ IdCommand IdCommand::from_string(StringView command)
VERIFY_NOT_REACHED();
}
DeprecatedString IdCommand::to_string() const
DeprecatedString IdCommand::to_deprecated_string() const
{
StringBuilder builder;
builder.append("id "sv);
@ -285,7 +285,7 @@ UCIOkCommand UCIOkCommand::from_string(StringView command)
return UCIOkCommand();
}
DeprecatedString UCIOkCommand::to_string() const
DeprecatedString UCIOkCommand::to_deprecated_string() const
{
return "uciok\n";
}
@ -298,7 +298,7 @@ ReadyOkCommand ReadyOkCommand::from_string(StringView command)
return ReadyOkCommand();
}
DeprecatedString ReadyOkCommand::to_string() const
DeprecatedString ReadyOkCommand::to_deprecated_string() const
{
return "readyok\n";
}
@ -311,7 +311,7 @@ BestMoveCommand BestMoveCommand::from_string(StringView command)
return BestMoveCommand(Move(tokens[1]));
}
DeprecatedString BestMoveCommand::to_string() const
DeprecatedString BestMoveCommand::to_deprecated_string() const
{
StringBuilder builder;
builder.append("bestmove "sv);
@ -326,7 +326,7 @@ InfoCommand InfoCommand::from_string([[maybe_unused]] StringView command)
VERIFY_NOT_REACHED();
}
DeprecatedString InfoCommand::to_string() const
DeprecatedString InfoCommand::to_deprecated_string() const
{
// FIXME: Implement this.
VERIFY_NOT_REACHED();

View file

@ -44,7 +44,7 @@ public:
{
}
virtual DeprecatedString to_string() const = 0;
virtual DeprecatedString to_deprecated_string() const = 0;
virtual ~Command() = default;
};
@ -58,7 +58,7 @@ public:
static UCICommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
};
class DebugCommand : public Command {
@ -76,7 +76,7 @@ public:
static DebugCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
Flag flag() const { return m_flag; }
@ -93,7 +93,7 @@ public:
static IsReadyCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
};
class SetOptionCommand : public Command {
@ -107,7 +107,7 @@ public:
static SetOptionCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
DeprecatedString const& name() const { return m_name; }
Optional<DeprecatedString> const& value() const { return m_value; }
@ -128,7 +128,7 @@ public:
static PositionCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
Optional<DeprecatedString> const& fen() const { return m_fen; }
Vector<Chess::Move> const& moves() const { return m_moves; }
@ -147,7 +147,7 @@ public:
static GoCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
Optional<Vector<Chess::Move>> searchmoves;
bool ponder { false };
@ -172,7 +172,7 @@ public:
static StopCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
};
class IdCommand : public Command {
@ -191,7 +191,7 @@ public:
static IdCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
Type field_type() const { return m_field_type; }
DeprecatedString const& value() const { return m_value; }
@ -210,7 +210,7 @@ public:
static UCIOkCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
};
class ReadyOkCommand : public Command {
@ -222,7 +222,7 @@ public:
static ReadyOkCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
};
class BestMoveCommand : public Command {
@ -235,7 +235,7 @@ public:
static BestMoveCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
Chess::Move move() const { return m_move; }
@ -252,7 +252,7 @@ public:
static InfoCommand from_string(StringView command);
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
Optional<int> depth;
Optional<int> seldepth;

View file

@ -23,8 +23,8 @@ Endpoint::Endpoint(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevic
void Endpoint::send_command(Command const& command)
{
dbgln_if(UCI_DEBUG, "{} Sent UCI Command: {}", class_name(), DeprecatedString(command.to_string().characters(), Chomp));
m_out->write(command.to_string());
dbgln_if(UCI_DEBUG, "{} Sent UCI Command: {}", class_name(), DeprecatedString(command.to_deprecated_string().characters(), Chomp));
m_out->write(command.to_deprecated_string());
}
void Endpoint::event(Core::Event& event)

View file

@ -774,7 +774,7 @@ DeprecatedString CppComprehensionEngine::SymbolName::scope_as_string() const
builder.appendff("{}::", scope[i]);
}
builder.append(scope.last());
return builder.to_string();
return builder.to_deprecated_string();
}
CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(StringView name, Vector<StringView>&& scope)
@ -790,7 +790,7 @@ CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(St
return SymbolName::create(name, move(parts));
}
DeprecatedString CppComprehensionEngine::SymbolName::to_string() const
DeprecatedString CppComprehensionEngine::SymbolName::to_deprecated_string() const
{
if (scope.is_empty())
return name;

View file

@ -40,7 +40,7 @@ private:
static SymbolName create(StringView, Vector<StringView>&&);
static SymbolName create(StringView);
DeprecatedString scope_as_string() const;
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
bool operator==(SymbolName const&) const = default;
};

View file

@ -164,7 +164,7 @@ Optional<DeprecatedString> GzipDecompressor::describe_header(ReadonlyBytes bytes
return {};
LittleEndian<u32> original_size = *reinterpret_cast<u32 const*>(bytes.offset(bytes.size() - sizeof(u32)));
return DeprecatedString::formatted("last modified: {}, original size {}", Core::DateTime::from_timestamp(header.modification_time).to_string(), (u32)original_size);
return DeprecatedString::formatted("last modified: {}, original size {}", Core::DateTime::from_timestamp(header.modification_time).to_deprecated_string(), (u32)original_size);
}
bool GzipDecompressor::read_or_error(Bytes bytes)

View file

@ -252,7 +252,7 @@ ErrorOr<DeprecatedString> Account::generate_passwd_file() const
if (errno)
return Error::from_errno(errno);
return builder.to_string();
return builder.to_deprecated_string();
}
#ifndef AK_OS_BSD_GENERIC
@ -293,7 +293,7 @@ ErrorOr<DeprecatedString> Account::generate_shadow_file() const
if (errno)
return Error::from_errno(errno);
return builder.to_string();
return builder.to_deprecated_string();
}
#endif

View file

@ -818,7 +818,7 @@ void ArgsParser::autocomplete(FILE* file, StringView program_name, Span<char con
object.set("invariant_offset", has_invariant ? option_to_complete.length() : 0u);
object.set("display_trivia", option.help_string);
object.set("trailing_trivia", option.argument_mode == OptionArgumentMode::Required ? " " : "");
outln(file, "{}", object.to_string());
outln(file, "{}", object.to_deprecated_string());
};
if (option_to_complete.starts_with("--"sv)) {

View file

@ -113,7 +113,7 @@ ErrorOr<void> ConfigFile::reparse()
builder.append(line[i]);
++i;
}
current_group = &m_groups.ensure(builder.to_string());
current_group = &m_groups.ensure(builder.to_deprecated_string());
break;
}
default: { // Start of key
@ -132,8 +132,8 @@ ErrorOr<void> ConfigFile::reparse()
// We're not in a group yet, create one with the name ""...
current_group = &m_groups.ensure("");
}
auto value_string = value_builder.to_string();
current_group->set(key_builder.to_string(), value_string.trim_whitespace(TrimMode::Right));
auto value_string = value_builder.to_deprecated_string();
current_group->set(key_builder.to_deprecated_string(), value_string.trim_whitespace(TrimMode::Right));
}
}
}

View file

@ -84,7 +84,7 @@ void DateTime::set_time(int year, int month, int day, int hour, int minute, int
m_second = tm.tm_sec;
}
DeprecatedString DateTime::to_string(StringView format) const
DeprecatedString DateTime::to_deprecated_string(StringView format) const
{
struct tm tm;
localtime_r(&m_timestamp, &tm);

View file

@ -31,7 +31,7 @@ public:
bool is_leap_year() const;
void set_time(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
DeprecatedString to_string(StringView format = "%Y-%m-%d %H:%M:%S"sv) const;
DeprecatedString to_deprecated_string(StringView format = "%Y-%m-%d %H:%M:%S"sv) const;
static DateTime create(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
static DateTime now();

View file

@ -92,7 +92,7 @@ DeprecatedString DirIterator::next_full_path()
if (!m_path.ends_with('/'))
builder.append('/');
builder.append(next_path());
return builder.to_string();
return builder.to_deprecated_string();
}
int DirIterator::fd() const

View file

@ -211,7 +211,7 @@ private:
public:
void send_response(JsonObject const& response)
{
auto serialized = response.to_string();
auto serialized = response.to_deprecated_string();
auto bytes_to_send = serialized.bytes();
u32 length = bytes_to_send.size();
// FIXME: Propagate errors
@ -280,7 +280,7 @@ public:
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"sv).to_string(), request.get("value"sv));
bool success = object.set_property(request.get("name"sv).to_deprecated_string(), request.get("value"sv));
JsonObject response;
response.set("type", "SetProperty");
response.set("success", success);

View file

@ -45,7 +45,7 @@ ErrorOr<DeprecatedString> Group::generate_group_file() const
if (errno)
return Error::from_errno(errno);
return builder.to_string();
return builder.to_deprecated_string();
}
ErrorOr<void> Group::sync()

View file

@ -35,7 +35,7 @@ void MimeData::set_urls(Vector<URL> const& urls)
{
StringBuilder builder;
for (auto& url : urls) {
builder.append(url.to_string());
builder.append(url.to_deprecated_string());
builder.append('\n');
}
set_data("text/uri-list", builder.to_byte_buffer());

View file

@ -301,7 +301,7 @@ requires IsBaseOf<Object, T>
property_name, \
[this] { return this->getter(); }, \
[this](auto& value) { \
this->setter(value.to_string()); \
this->setter(value.to_deprecated_string()); \
return true; \
});

View file

@ -53,11 +53,11 @@ Optional<AllProcessesStatistics> ProcessStatisticsReader::get_all(RefPtr<Core::F
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.name = process_object.get("name"sv).to_deprecated_string();
process.executable = process_object.get("executable"sv).to_deprecated_string();
process.tty = process_object.get("tty"sv).to_deprecated_string();
process.pledge = process_object.get("pledge"sv).to_deprecated_string();
process.veil = process_object.get("veil"sv).to_deprecated_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();
@ -73,8 +73,8 @@ Optional<AllProcessesStatistics> ProcessStatisticsReader::get_all(RefPtr<Core::F
Core::ThreadStatistics thread;
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.name = thread_object.get("name"sv).to_deprecated_string();
thread.state = thread_object.get("state"sv).to_deprecated_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();

View file

@ -51,7 +51,7 @@ public:
IPv4Address ipv4_address() const { return m_ipv4_address; }
u16 port() const { return m_port; }
DeprecatedString to_string() const
DeprecatedString to_deprecated_string() const
{
switch (m_type) {
case Type::IPv4:
@ -97,6 +97,6 @@ template<>
struct AK::Formatter<Core::SocketAddress> : Formatter<DeprecatedString> {
ErrorOr<void> format(FormatBuilder& builder, Core::SocketAddress const& value)
{
return Formatter<DeprecatedString>::format(builder, value.to_string());
return Formatter<DeprecatedString>::format(builder, value.to_deprecated_string());
}
};

View file

@ -30,7 +30,7 @@ DeprecatedString StandardPaths::desktop_directory()
StringBuilder builder;
builder.append(home_directory());
builder.append("/Desktop"sv);
return LexicalPath::canonicalized_path(builder.to_string());
return LexicalPath::canonicalized_path(builder.to_deprecated_string());
}
DeprecatedString StandardPaths::documents_directory()
@ -38,7 +38,7 @@ DeprecatedString StandardPaths::documents_directory()
StringBuilder builder;
builder.append(home_directory());
builder.append("/Documents"sv);
return LexicalPath::canonicalized_path(builder.to_string());
return LexicalPath::canonicalized_path(builder.to_deprecated_string());
}
DeprecatedString StandardPaths::downloads_directory()
@ -46,7 +46,7 @@ DeprecatedString StandardPaths::downloads_directory()
StringBuilder builder;
builder.append(home_directory());
builder.append("/Downloads"sv);
return LexicalPath::canonicalized_path(builder.to_string());
return LexicalPath::canonicalized_path(builder.to_deprecated_string());
}
DeprecatedString StandardPaths::config_directory()
@ -54,7 +54,7 @@ DeprecatedString StandardPaths::config_directory()
StringBuilder builder;
builder.append(home_directory());
builder.append("/.config"sv);
return LexicalPath::canonicalized_path(builder.to_string());
return LexicalPath::canonicalized_path(builder.to_deprecated_string());
}
DeprecatedString StandardPaths::tempfile_directory()

View file

@ -702,7 +702,7 @@ ErrorOr<void> clock_settime(clockid_t clock_id, struct timespec* ts)
static ALWAYS_INLINE ErrorOr<pid_t> posix_spawn_wrapper(StringView path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const arguments[], char* const envp[], StringView function_name, decltype(::posix_spawn) spawn_function)
{
pid_t child_pid;
if ((errno = spawn_function(&child_pid, path.to_string().characters(), file_actions, attr, arguments, envp)))
if ((errno = spawn_function(&child_pid, path.to_deprecated_string().characters(), file_actions, attr, arguments, envp)))
return Error::from_syscall(function_name, -errno);
return child_pid;
}
@ -1082,7 +1082,7 @@ ErrorOr<void> exec(StringView filename, Span<StringView> arguments, SearchInPath
exec_filename = maybe_executable.release_value();
} else {
exec_filename = filename.to_string();
exec_filename = filename.to_deprecated_string();
}
params.path = { exec_filename.characters(), exec_filename.length() };
@ -1094,7 +1094,7 @@ ErrorOr<void> exec(StringView filename, Span<StringView> arguments, SearchInPath
auto argument_strings = TRY(FixedArray<DeprecatedString>::try_create(arguments.size()));
auto argv = TRY(FixedArray<char*>::try_create(arguments.size() + 1));
for (size_t i = 0; i < arguments.size(); ++i) {
argument_strings[i] = arguments[i].to_string();
argument_strings[i] = arguments[i].to_deprecated_string();
argv[i] = const_cast<char*>(argument_strings[i].characters());
}
argv[arguments.size()] = nullptr;
@ -1104,7 +1104,7 @@ ErrorOr<void> exec(StringView filename, Span<StringView> arguments, SearchInPath
auto environment_strings = TRY(FixedArray<DeprecatedString>::try_create(environment->size()));
auto envp = TRY(FixedArray<char*>::try_create(environment->size() + 1));
for (size_t i = 0; i < environment->size(); ++i) {
environment_strings[i] = environment->at(i).to_string();
environment_strings[i] = environment->at(i).to_deprecated_string();
envp[i] = const_cast<char*>(environment_strings[i].characters());
}
envp[environment->size()] = nullptr;

View file

@ -25,7 +25,7 @@ static void parse_sockets_from_system_server()
for (auto& socket : StringView { sockets, strlen(sockets) }.split_view(' ')) {
auto params = socket.split_view(':');
s_overtaken_sockets.set(params[0].to_string(), strtol(params[1].to_string().characters(), nullptr, 10));
s_overtaken_sockets.set(params[0].to_deprecated_string(), strtol(params[1].to_deprecated_string().characters(), nullptr, 10));
}
s_overtaken_sockets_parsed = true;

View file

@ -128,7 +128,7 @@ void Backtrace::add_entry(Reader const& coredump, FlatPtr ip)
m_entries.append({ ip, object_name, function_name, source_position });
}
DeprecatedString Backtrace::Entry::to_string(bool color) const
DeprecatedString Backtrace::Entry::to_deprecated_string(bool color) const
{
StringBuilder builder;
builder.appendff("{:p}: ", eip);

View file

@ -35,7 +35,7 @@ public:
DeprecatedString function_name;
Debug::DebugInfo::SourcePositionWithInlines source_position_with_inlines;
DeprecatedString to_string(bool color = false) const;
DeprecatedString to_deprecated_string(bool color = false) const;
};
Backtrace(Reader const&, const ELF::Core::ThreadInfo&, Function<void(size_t, size_t)> on_progress = {});

View file

@ -72,10 +72,10 @@ void Type::dump(FILE* output, size_t indent) const
{
ASTNode::dump(output, indent);
print_indent(output, indent + 1);
outln(output, "{}", to_string());
outln(output, "{}", to_deprecated_string());
}
DeprecatedString NamedType::to_string() const
DeprecatedString NamedType::to_deprecated_string() const
{
DeprecatedString qualifiers_string;
if (!qualifiers().is_empty())
@ -90,33 +90,33 @@ DeprecatedString NamedType::to_string() const
return DeprecatedString::formatted("{}{}", qualifiers_string, name);
}
DeprecatedString Pointer::to_string() const
DeprecatedString Pointer::to_deprecated_string() const
{
if (!m_pointee)
return {};
StringBuilder builder;
builder.append(m_pointee->to_string());
builder.append(m_pointee->to_deprecated_string());
builder.append('*');
return builder.to_string();
return builder.to_deprecated_string();
}
DeprecatedString Reference::to_string() const
DeprecatedString Reference::to_deprecated_string() const
{
if (!m_referenced_type)
return {};
StringBuilder builder;
builder.append(m_referenced_type->to_string());
builder.append(m_referenced_type->to_deprecated_string());
if (m_kind == Kind::Lvalue)
builder.append('&');
else
builder.append("&&"sv);
return builder.to_string();
return builder.to_deprecated_string();
}
DeprecatedString FunctionType::to_string() const
DeprecatedString FunctionType::to_deprecated_string() const
{
StringBuilder builder;
builder.append(m_return_type->to_string());
builder.append(m_return_type->to_deprecated_string());
builder.append('(');
bool first = true;
for (auto& parameter : m_parameters) {
@ -125,14 +125,14 @@ DeprecatedString FunctionType::to_string() const
else
builder.append(", "sv);
if (parameter.type())
builder.append(parameter.type()->to_string());
builder.append(parameter.type()->to_deprecated_string());
if (parameter.name() && !parameter.full_name().is_empty()) {
builder.append(' ');
builder.append(parameter.full_name());
}
}
builder.append(')');
return builder.to_string();
return builder.to_deprecated_string();
}
void Parameter::dump(FILE* output, size_t indent) const
@ -552,7 +552,7 @@ StringView Name::full_name() const
builder.appendff("{}::", scope.name());
}
}
m_full_name = DeprecatedString::formatted("{}{}", builder.to_string(), m_name.is_null() ? ""sv : m_name->name());
m_full_name = DeprecatedString::formatted("{}{}", builder.to_deprecated_string(), m_name.is_null() ? ""sv : m_name->name());
return *m_full_name;
}
@ -565,10 +565,10 @@ StringView TemplatizedName::full_name() const
name.append(Name::full_name());
name.append('<');
for (auto& type : m_template_arguments) {
name.append(type.to_string());
name.append(type.to_deprecated_string());
}
name.append('>');
m_full_name = name.to_string();
m_full_name = name.to_deprecated_string();
return *m_full_name;
}

View file

@ -228,7 +228,7 @@ public:
virtual bool is_type() const override { return true; }
virtual bool is_templatized() const { return false; }
virtual bool is_named_type() const { return false; }
virtual DeprecatedString to_string() const = 0;
virtual DeprecatedString to_deprecated_string() const = 0;
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
bool is_auto() const { return m_is_auto; }
@ -251,7 +251,7 @@ class NamedType : public Type {
public:
virtual ~NamedType() override = default;
virtual StringView class_name() const override { return "NamedType"sv; }
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
virtual bool is_named_type() const override { return true; }
NamedType(ASTNode* parent, Optional<Position> start, Optional<Position> end, DeprecatedString const& filename)
@ -271,7 +271,7 @@ public:
virtual ~Pointer() override = default;
virtual StringView class_name() const override { return "Pointer"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
Pointer(ASTNode* parent, Optional<Position> start, Optional<Position> end, DeprecatedString const& filename)
: Type(parent, start, end, filename)
@ -290,7 +290,7 @@ public:
virtual ~Reference() override = default;
virtual StringView class_name() const override { return "Reference"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
enum class Kind {
Lvalue,
@ -317,7 +317,7 @@ public:
virtual ~FunctionType() override = default;
virtual StringView class_name() const override { return "FunctionType"sv; }
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
virtual DeprecatedString to_string() const override;
virtual DeprecatedString to_deprecated_string() const override;
FunctionType(ASTNode* parent, Optional<Position> start, Optional<Position> end, DeprecatedString const& filename)
: Type(parent, start, end, filename)

View file

@ -11,7 +11,7 @@
#include <AK/ScopeLogger.h>
#include <LibCpp/Lexer.h>
#define LOG_SCOPE() ScopeLogger<CPP_DEBUG> logger(DeprecatedString::formatted("'{}' - {} ({})", peek().text(), peek().type_as_string(), m_state.token_index))
#define LOG_SCOPE() ScopeLogger<CPP_DEBUG> logger(DeprecatedString::formatted("'{}' - {} ({})", peek().text(), peek().type_as_deprecated_string(), m_state.token_index))
namespace Cpp {
@ -22,7 +22,7 @@ Parser::Parser(Vector<Token> tokens, DeprecatedString const& filename)
if constexpr (CPP_DEBUG) {
dbgln("Tokens:");
for (size_t i = 0; i < m_tokens.size(); ++i) {
dbgln("{}- {}", i, m_tokens[i].to_string());
dbgln("{}- {}", i, m_tokens[i].to_deprecated_string());
}
}
}
@ -579,7 +579,7 @@ NonnullRefPtr<Expression> Parser::parse_secondary_expression(ASTNode& parent, No
return func;
}
default: {
error(DeprecatedString::formatted("unexpected operator for expression. operator: {}", peek().to_string()));
error(DeprecatedString::formatted("unexpected operator for expression. operator: {}", peek().to_deprecated_string()));
auto token = consume();
return create_ast_node<InvalidExpression>(parent, token.start(), token.end());
}
@ -880,7 +880,7 @@ DeprecatedString Parser::text_in_range(Position start, Position end) const
for (auto token : tokens_in_range(start, end)) {
builder.append(token.text());
}
return builder.to_string();
return builder.to_deprecated_string();
}
Vector<Token> Parser::tokens_in_range(Position start, Position end) const
@ -1008,7 +1008,7 @@ Optional<size_t> Parser::index_of_token_at(Position pos) const
void Parser::print_tokens() const
{
for (auto& token : m_tokens) {
outln("{}", token.to_string());
outln("{}", token.to_deprecated_string());
}
}
@ -1110,7 +1110,7 @@ Token Parser::consume_keyword(DeprecatedString const& keyword)
{
auto token = consume();
if (token.type() != Token::Type::Keyword) {
error(DeprecatedString::formatted("unexpected token: {}, expected Keyword", token.to_string()));
error(DeprecatedString::formatted("unexpected token: {}, expected Keyword", token.to_deprecated_string()));
return token;
}
if (text_of_token(token) != keyword) {

View file

@ -371,7 +371,7 @@ DeprecatedString Preprocessor::remove_escaped_newlines(StringView value)
processed_value.append(lexer.consume_until(escaped_newline));
lexer.ignore(escaped_newline.length());
}
return processed_value.to_string();
return processed_value.to_deprecated_string();
}
DeprecatedString Preprocessor::evaluate_macro_call(MacroCall const& macro_call, Definition const& definition)
@ -401,7 +401,7 @@ DeprecatedString Preprocessor::evaluate_macro_call(MacroCall const& macro_call,
}
});
return processed_value.to_string();
return processed_value.to_deprecated_string();
}
};

View file

@ -27,10 +27,10 @@ void SemanticSyntaxHighlighter::rehighlight(Palette const& palette)
StringBuilder previous_tokens_as_lines;
for (auto& token : current_tokens)
current_tokens_as_lines.appendff("{}\n", token.type_as_string());
current_tokens_as_lines.appendff("{}\n", token.type_as_deprecated_string());
for (Cpp::Token const& token : m_saved_tokens)
previous_tokens_as_lines.appendff("{}\n", token.type_as_string());
previous_tokens_as_lines.appendff("{}\n", token.type_as_deprecated_string());
auto previous = previous_tokens_as_lines.build();
auto current = current_tokens_as_lines.build();

View file

@ -63,7 +63,7 @@ void SyntaxHighlighter::rehighlight(Palette const& palette)
Vector<GUI::TextDocumentSpan> spans;
lexer.lex_iterable([&](auto token) {
// FIXME: The +1 for the token end column is a quick hack due to not wanting to modify the lexer (which is also used by the parser). Maybe there's a better way to do this.
dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "{} @ {}:{} - {}:{}", token.type_as_string(), token.start().line, token.start().column, token.end().line, token.end().column + 1);
dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "{} @ {}:{} - {}:{}", token.type_as_deprecated_string(), token.start().line, token.start().column, token.end().line, token.end().column + 1);
GUI::TextDocumentSpan span;
span.range.set_start({ token.start().line, token.start().column });
span.range.set_end({ token.end().line, token.end().column + 1 });

View file

@ -26,12 +26,12 @@ bool Position::operator<=(Position const& other) const
return !(*this > other);
}
DeprecatedString Token::to_string() const
DeprecatedString Token::to_deprecated_string() const
{
return DeprecatedString::formatted("{} {}:{}-{}:{} ({})", type_to_string(m_type), start().line, start().column, end().line, end().column, text());
}
DeprecatedString Token::type_as_string() const
DeprecatedString Token::type_as_deprecated_string() const
{
return type_to_string(m_type);
}

View file

@ -116,8 +116,8 @@ struct Token {
VERIFY_NOT_REACHED();
}
DeprecatedString to_string() const;
DeprecatedString type_as_string() const;
DeprecatedString to_deprecated_string() const;
DeprecatedString type_as_deprecated_string() const;
Position const& start() const { return m_start; }
Position const& end() const { return m_end; }

View file

@ -184,7 +184,7 @@ void BigFraction::reduce()
m_denominator = denominator_divide.quotient;
}
DeprecatedString BigFraction::to_string(unsigned rounding_threshold) const
DeprecatedString BigFraction::to_deprecated_string(unsigned rounding_threshold) const
{
StringBuilder builder;
if (m_numerator.is_negative() && m_numerator != "0"_bigint)
@ -239,7 +239,7 @@ DeprecatedString BigFraction::to_string(unsigned rounding_threshold) const
builder.append(fractional_value);
}
return builder.to_string();
return builder.to_deprecated_string();
}
BigFraction BigFraction::sqrt() const

View file

@ -54,7 +54,7 @@ public:
// - m_denominator = 10000
BigFraction rounded(unsigned rounding_threshold) const;
DeprecatedString to_string(unsigned rounding_threshold) const;
DeprecatedString to_deprecated_string(unsigned rounding_threshold) const;
double to_double() const;
private:

View file

@ -60,7 +60,7 @@ DeprecatedString SignedBigInteger::to_base(u16 N) const
builder.append(m_unsigned_data.to_base(N));
return builder.to_string();
return builder.to_deprecated_string();
}
u64 SignedBigInteger::to_u64() const

View file

@ -164,7 +164,7 @@ DeprecatedString UnsignedBigInteger::to_base(u16 N) const
temp.set_to(quotient);
}
return builder.to_string().reverse();
return builder.to_deprecated_string().reverse();
}
u64 UnsignedBigInteger::to_u64() const

View file

@ -25,7 +25,7 @@ constexpr void swap_keys(u32* keys, size_t i, size_t j)
}
#ifndef KERNEL
DeprecatedString AESCipherBlock::to_string() const
DeprecatedString AESCipherBlock::to_deprecated_string() const
{
StringBuilder builder;
for (auto value : m_data)
@ -33,7 +33,7 @@ DeprecatedString AESCipherBlock::to_string() const
return builder.build();
}
DeprecatedString AESCipherKey::to_string() const
DeprecatedString AESCipherKey::to_deprecated_string() const
{
StringBuilder builder;
for (size_t i = 0; i < (rounds() + 1) * 4; ++i)

View file

@ -49,7 +49,7 @@ public:
}
#ifndef KERNEL
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
#endif
private:
@ -65,7 +65,7 @@ struct AESCipherKey : public CipherKey {
static bool is_valid_key_size(size_t bits) { return bits == 128 || bits == 192 || bits == 256; };
#ifndef KERNEL
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
#endif
u32 const* round_keys() const

View file

@ -32,7 +32,7 @@ Name Name::parse(u8 const* data, size_t& offset, size_t max_offset, size_t recur
u8 b = data[offset++];
if (b == '\0') {
// This terminates the name.
return builder.to_string();
return builder.to_deprecated_string();
} else if ((b & 0xc0) == 0xc0) {
// The two bytes tell us the offset when to continue from.
if (offset >= max_offset)
@ -40,7 +40,7 @@ Name Name::parse(u8 const* data, size_t& offset, size_t max_offset, size_t recur
size_t dummy = (b & 0x3f) << 8 | data[offset++];
auto rest_of_name = parse(data, dummy, max_offset, recursion_level + 1);
builder.append(rest_of_name.as_string());
return builder.to_string();
return builder.to_deprecated_string();
} else {
// This is the length of a part.
if (offset + b >= max_offset)
@ -72,7 +72,7 @@ void Name::randomize_case()
}
builder.append(c);
}
m_name = builder.to_string();
m_name = builder.to_deprecated_string();
}
OutputStream& operator<<(OutputStream& stream, Name const& name)

View file

@ -334,7 +334,7 @@ void DebugInfo::add_type_info_to_variable(Dwarf::DIE const& type_die, PtraceRegi
array_type_name.append(DeprecatedString::formatted("{:d}", array_size));
array_type_name.append(']');
}
parent_variable->type_name = array_type_name.to_string();
parent_variable->type_name = array_type_name.to_deprecated_string();
}
parent_variable->type = move(type_info);
parent_variable->type->type_tag = type_die.tag();

View file

@ -447,7 +447,7 @@ void DebugSession::update_loaded_libs()
auto rc = segment_name_re.search(vm_name, result);
if (!rc)
return {};
auto lib_name = result.capture_group_matches.at(0).at(0).view.string_view().to_string();
auto lib_name = result.capture_group_matches.at(0).at(0).view.string_view().to_deprecated_string();
if (lib_name.starts_with('/'))
return lib_name;
return DeprecatedString::formatted("/usr/lib/{}", lib_name);

View file

@ -19,10 +19,10 @@ auto Launcher::Details::from_details_str(DeprecatedString const& details_str) ->
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"sv).to_string();
details->name = obj.get("name"sv).to_string();
details->executable = obj.get("executable"sv).to_deprecated_string();
details->name = obj.get("name"sv).to_deprecated_string();
if (auto type_value = obj.get_ptr("type"sv)) {
auto type_str = type_value->to_string();
auto type_str = type_value->to_deprecated_string();
if (type_str == "app")
details->launcher_type = LauncherType::Application;
else if (type_str == "userpreferred")
@ -100,12 +100,12 @@ bool Launcher::open(const URL& url, Details const& details)
Vector<DeprecatedString> Launcher::get_handlers_for_url(const URL& url)
{
return connection().get_handlers_for_url(url.to_string());
return connection().get_handlers_for_url(url.to_deprecated_string());
}
auto Launcher::get_handlers_with_details_for_url(const URL& url) -> NonnullRefPtrVector<Details>
{
auto details = connection().get_handlers_with_details_for_url(url.to_string());
auto details = connection().get_handlers_with_details_for_url(url.to_deprecated_string());
NonnullRefPtrVector<Details> handlers_with_details;
for (auto& value : details) {
handlers_with_details.append(Details::from_details_str(value));

View file

@ -18,6 +18,6 @@ DeprecatedString generate_only_additions(DeprecatedString const& text)
for (auto const& line : lines) {
builder.appendff("+{}\n", line);
}
return builder.to_string();
return builder.to_deprecated_string();
}
};

View file

@ -67,7 +67,7 @@ struct [[gnu::packed]] MemoryRegionInfo {
auto maybe_colon_index = memory_region_name.find(':');
if (!maybe_colon_index.has_value())
return {};
return memory_region_name.substring_view(0, *maybe_colon_index).to_string();
return memory_region_name.substring_view(0, *maybe_colon_index).to_deprecated_string();
}
#endif
};

View file

@ -408,7 +408,7 @@ void DynamicLoader::load_program_headers()
MAP_FILE | MAP_SHARED | MAP_FIXED,
m_image_fd,
VirtualAddress { region.offset() }.page_base().get(),
builder.to_string().characters());
builder.to_deprecated_string().characters());
if (segment_base == MAP_FAILED) {
perror("mmap non-writable");

View file

@ -72,7 +72,7 @@ void AbstractTableView::auto_resize_column(int column)
} else if (cell_data.is_bitmap()) {
cell_width = cell_data.as_bitmap().width();
} else if (cell_data.is_valid()) {
cell_width = font().width(cell_data.to_string());
cell_width = font().width(cell_data.to_deprecated_string());
}
if (is_empty && cell_width > 0)
is_empty = false;
@ -110,7 +110,7 @@ void AbstractTableView::update_column_sizes()
} else if (cell_data.is_bitmap()) {
cell_width = cell_data.as_bitmap().width();
} else if (cell_data.is_valid()) {
cell_width = font().width(cell_data.to_string());
cell_width = font().width(cell_data.to_deprecated_string());
}
column_width = max(column_width, cell_width);
}

View file

@ -605,7 +605,7 @@ void AbstractView::keydown_event(KeyEvent& event)
}
auto index = find_next_search_match(sb.string_view());
if (index.is_valid()) {
m_highlighted_search = sb.to_string();
m_highlighted_search = sb.to_deprecated_string();
highlight_search(index);
start_highlighted_search_timer();
}
@ -630,7 +630,7 @@ void AbstractView::keydown_event(KeyEvent& event)
auto index = find_next_search_match(sb.string_view());
if (index.is_valid()) {
m_highlighted_search = sb.to_string();
m_highlighted_search = sb.to_deprecated_string();
highlight_search(index);
start_highlighted_search_timer();
set_cursor(index, SelectionUpdate::None, true);

View file

@ -183,7 +183,7 @@ CodeComprehension::AutocompleteResultEntry::HideAutocompleteAfterApplying Autoco
return hide_when_done;
auto suggestion_index = m_suggestion_view->model()->index(selected_index.row());
auto completion = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::Completion).to_string();
auto completion = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::Completion).to_deprecated_string();
size_t partial_length = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::PartialInputLength).to_i64();
auto hide_after_applying = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::HideAutocompleteAfterApplying).to_bool();

View file

@ -43,7 +43,7 @@ void ColorInput::set_color_internal(Color color, AllowCallback allow_callback, b
return;
m_color = color;
if (change_text)
set_text(m_color_has_alpha_channel ? color.to_string() : color.to_string_without_alpha(), AllowCallback::No);
set_text(m_color_has_alpha_channel ? color.to_deprecated_string() : color.to_deprecated_string_without_alpha(), AllowCallback::No);
update();
if (allow_callback == AllowCallback::Yes && on_change)
on_change();

View file

@ -320,7 +320,7 @@ void ColorPicker::build_ui_custom(Widget& root_container)
html_label.set_text("HTML:");
m_html_text = html_container.add<GUI::TextBox>();
m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_string() : m_color.to_string_without_alpha());
m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_deprecated_string() : m_color.to_deprecated_string_without_alpha());
m_html_text->on_change = [this]() {
auto color_name = m_html_text->text();
auto optional_color = Color::from_string(color_name);
@ -416,7 +416,7 @@ void ColorPicker::update_color_widgets()
{
m_preview_widget->set_color(m_color);
m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_string() : m_color.to_string_without_alpha());
m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_deprecated_string() : m_color.to_deprecated_string_without_alpha());
m_red_spinbox->set_value(m_color.red());
m_green_spinbox->set_value(m_color.green());

View file

@ -158,7 +158,7 @@ void ColumnsView::paint_event(PaintEvent& event)
icon_rect.right() + 1 + icon_spacing(), row * item_height(),
column.width - icon_spacing() - icon_size() - icon_spacing() - icon_spacing() - static_cast<int>(s_arrow_bitmap.width()) - icon_spacing(), item_height()
};
draw_item_text(painter, index, is_selected_row, text_rect, index.data().to_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::None);
draw_item_text(painter, index, is_selected_row, text_rect, index.data().to_deprecated_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::None);
if (is_focused() && index == cursor_index()) {
painter.draw_rect(row_rect, palette().color(background_role()));
@ -227,7 +227,7 @@ void ColumnsView::update_column_sizes()
for (int row = 0; row < row_count; row++) {
ModelIndex index = model()->index(row, m_model_column, column.parent_index);
VERIFY(index.is_valid());
auto text = index.data().to_string();
auto text = index.data().to_deprecated_string();
int row_width = icon_spacing() + icon_size() + icon_spacing() + font().width(text) + icon_spacing() + s_arrow_bitmap.width() + icon_spacing();
if (row_width > column.width)
column.width = row_width;

View file

@ -182,7 +182,7 @@ void ComboBox::selection_updated(ModelIndex const& index)
m_selected_index = index;
else
m_selected_index.clear();
auto new_value = index.data().to_string();
auto new_value = index.data().to_deprecated_string();
m_editor->set_text(new_value);
if (!m_only_allow_values_from_model)
m_editor->select_all();

View file

@ -129,7 +129,7 @@ public:
case Column::Shortcut:
if (!action.shortcut().is_valid())
return "";
return action.shortcut().to_string();
return action.shortcut().to_deprecated_string();
}
VERIFY_NOT_REACHED();

View file

@ -61,8 +61,8 @@ void CommonLocationsProvider::load_from_json(DeprecatedString const& json_path)
if (!entry_value.is_object())
continue;
auto entry = entry_value.as_object();
auto name = entry.get("name"sv).to_string();
auto path = entry.get("path"sv).to_string();
auto name = entry.get("name"sv).to_deprecated_string();
auto path = entry.get("path"sv).to_deprecated_string();
s_common_locations.append({ name, path });
}

View file

@ -155,24 +155,24 @@ static Action* action_for_shortcut(Window& window, Shortcut const& shortcut)
if (!shortcut.is_valid())
return nullptr;
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, "Looking up action for {}", shortcut.to_string());
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, "Looking up action for {}", shortcut.to_deprecated_string());
for (auto* widget = window.focused_widget(); widget; widget = widget->parent_widget()) {
if (auto* action = widget->action_for_shortcut(shortcut)) {
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Focused widget {} gave action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", *widget, action, action->text(), action->is_enabled(), action->shortcut().to_string(), action->alternate_shortcut().to_string());
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Focused widget {} gave action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", *widget, action, action->text(), action->is_enabled(), action->shortcut().to_deprecated_string(), action->alternate_shortcut().to_deprecated_string());
return action;
}
}
if (auto* action = window.action_for_shortcut(shortcut)) {
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked window {}, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", window, action, action->text(), action->is_enabled(), action->shortcut().to_string(), action->alternate_shortcut().to_string());
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked window {}, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", window, action, action->text(), action->is_enabled(), action->shortcut().to_deprecated_string(), action->alternate_shortcut().to_deprecated_string());
return action;
}
// NOTE: Application-global shortcuts are ignored while a blocking modal window is up.
if (!window.is_blocking() && !window.is_popup()) {
if (auto* action = Application::the()->action_for_shortcut(shortcut)) {
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked application, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", action, action->text(), action->is_enabled(), action->shortcut().to_string(), action->alternate_shortcut().to_string());
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked application, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", action, action->text(), action->is_enabled(), action->shortcut().to_deprecated_string(), action->alternate_shortcut().to_deprecated_string());
return action;
}
}

View file

@ -174,7 +174,7 @@ auto EmojiInputDialog::supported_emoji() -> Vector<Emoji>
builder.append_code_point(*code_point);
code_points.append(*code_point);
});
auto text = builder.to_string();
auto text = builder.to_deprecated_string();
auto emoji = Unicode::find_emoji_for_code_points(code_points);
if (!emoji.has_value()) {

View file

@ -20,7 +20,7 @@ DropEvent::DropEvent(Gfx::IntPoint const& position, DeprecatedString const& text
{
}
DeprecatedString KeyEvent::to_string() const
DeprecatedString KeyEvent::to_deprecated_string() const
{
Vector<DeprecatedString, 8> parts;
@ -44,7 +44,7 @@ DeprecatedString KeyEvent::to_string() const
if (i != parts.size() - 1)
builder.append('+');
}
return builder.to_string();
return builder.to_deprecated_string();
}
ActionEvent::ActionEvent(Type type, Action& action)

View file

@ -390,11 +390,11 @@ public:
{
StringBuilder sb;
sb.append_code_point(m_code_point);
return sb.to_string();
return sb.to_deprecated_string();
}
u32 scancode() const { return m_scancode; }
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
bool is_arrow_key() const
{

View file

@ -194,7 +194,7 @@ DeprecatedString FileSystemModel::Node::full_path() const
}
builder.append('/');
builder.append(name);
return LexicalPath::canonicalized_path(builder.to_string());
return LexicalPath::canonicalized_path(builder.to_deprecated_string());
}
ModelIndex FileSystemModel::index(DeprecatedString path, int column) const
@ -325,7 +325,7 @@ static DeprecatedString permission_string(mode_t mode)
builder.append('t');
else
builder.append(mode & S_IXOTH ? 'x' : '-');
return builder.to_string();
return builder.to_deprecated_string();
}
void FileSystemModel::Node::set_selected(bool selected)
@ -761,7 +761,7 @@ void FileSystemModel::set_data(ModelIndex const& index, Variant const& data)
VERIFY(is_editable(index));
Node& node = const_cast<Node&>(this->node(index));
auto dirname = LexicalPath::dirname(node.full_path());
auto new_full_path = DeprecatedString::formatted("{}/{}", dirname, data.to_string());
auto new_full_path = DeprecatedString::formatted("{}/{}", dirname, data.to_deprecated_string());
int rc = rename(node.full_path().characters(), new_full_path.characters());
if (rc < 0) {
if (on_rename_error)

View file

@ -140,7 +140,7 @@ public:
static DeprecatedString timestamp_string(time_t timestamp)
{
return Core::DateTime::from_timestamp(timestamp).to_string();
return Core::DateTime::from_timestamp(timestamp).to_deprecated_string();
}
bool should_show_dotfiles() const { return m_should_show_dotfiles; }

View file

@ -58,7 +58,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo
m_family_list_view->on_selection_change = [this] {
const auto& index = m_family_list_view->selection().first();
m_family = index.data().to_string();
m_family = index.data().to_deprecated_string();
m_variants.clear();
Gfx::FontDatabase::the().for_each_typeface([&](auto& typeface) {
if (m_fixed_width_only && !typeface.is_fixed_width())
@ -79,7 +79,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo
m_variant_list_view->on_selection_change = [this] {
const auto& index = m_variant_list_view->selection().first();
bool font_is_fixed_size = false;
m_variant = index.data().to_string();
m_variant = index.data().to_deprecated_string();
m_sizes.clear();
Gfx::FontDatabase::the().for_each_typeface([&](auto& typeface) {
if (m_fixed_width_only && !typeface.is_fixed_width())

View file

@ -37,11 +37,11 @@ public:
return try_make_ref_counted<NodeT>(token.m_view);
}
DeprecatedString to_string() const
DeprecatedString to_deprecated_string() const
{
StringBuilder builder;
format(builder, 0, false);
return builder.to_string();
return builder.to_deprecated_string();
}
// Format this AST node with the builder at the given indentation level.

View file

@ -15,7 +15,7 @@ namespace GUI::GML {
inline ErrorOr<DeprecatedString> format_gml(StringView string)
{
return TRY(parse_gml(string))->to_string();
return TRY(parse_gml(string))->to_deprecated_string();
}
}

View file

@ -100,7 +100,7 @@ auto IconView::get_item_data(int item_index) const -> ItemData&
return item_data;
item_data.index = model()->index(item_index, model_column());
item_data.text = item_data.index.data().to_string();
item_data.text = item_data.index.data().to_deprecated_string();
get_item_rects(item_index, item_data, font_for_index(item_data.index));
item_data.valid = true;
return item_data;

View file

@ -96,7 +96,7 @@ public:
for (auto it = m_data.begin(); it != m_data.end(); ++it) {
for (auto it2d = (*it).begin(); it2d != (*it).end(); ++it2d) {
GUI::ModelIndex index = this->index(it.index(), it2d.index());
if (!string_matches(data(index, ModelRole::Display).to_string(), searching, flags))
if (!string_matches(data(index, ModelRole::Display).to_deprecated_string(), searching, flags))
continue;
found_indices.append(index);
@ -107,7 +107,7 @@ public:
} else {
for (auto it = m_data.begin(); it != m_data.end(); ++it) {
GUI::ModelIndex index = this->index(it.index());
if (!string_matches(data(index, ModelRole::Display).to_string(), searching, flags))
if (!string_matches(data(index, ModelRole::Display).to_deprecated_string(), searching, flags))
continue;
found_indices.append(index);

View file

@ -54,7 +54,7 @@ bool JsonArrayModel::store()
return false;
}
file->write(m_array.to_string());
file->write(m_array.to_deprecated_string());
file->close();
return true;
}
@ -124,7 +124,7 @@ Variant JsonArrayModel::data(ModelIndex const& index, ModelRole role) const
return field_spec.massage_for_display(object);
if (data.is_number())
return data;
return object.get(json_field_name).to_string();
return object.get(json_field_name).to_deprecated_string();
}
if (role == ModelRole::Sort) {

View file

@ -42,7 +42,7 @@ void ListView::update_content_size()
int content_width = 0;
for (int row = 0, row_count = model()->row_count(); row < row_count; ++row) {
auto text = model()->index(row, m_model_column).data();
content_width = max(content_width, font().width(text.to_string()) + horizontal_padding() * 2);
content_width = max(content_width, font().width(text.to_deprecated_string()) + horizontal_padding() * 2);
}
m_max_item_width = content_width;
content_width = max(content_width, widget_inner_rect().width());
@ -133,7 +133,7 @@ void ListView::paint_list_item(Painter& painter, int row_index, int painted_item
text_rect.translate_by(horizontal_padding(), 0);
text_rect.set_width(text_rect.width() - horizontal_padding() * 2);
auto text_alignment = index.data(ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft);
draw_item_text(painter, index, is_selected_row, text_rect, data.to_string(), font, text_alignment, Gfx::TextElision::None);
draw_item_text(painter, index, is_selected_row, text_rect, data.to_deprecated_string(), font, text_alignment, Gfx::TextElision::None);
}
}

View file

@ -197,7 +197,7 @@ void Menu::realize_menu_item(MenuItem& item, int item_id)
break;
case MenuItem::Type::Action: {
auto& action = *item.action();
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : DeprecatedString();
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_deprecated_string() : DeprecatedString();
bool exclusive = action.group() && action.group()->is_exclusive() && action.is_checkable();
bool is_default = (m_current_default_action.ptr() == &action);
auto icon = action.icon() ? action.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap();

View file

@ -73,7 +73,7 @@ void MenuItem::update_window_server()
if (m_menu_id < 0)
return;
auto& action = *m_action;
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : DeprecatedString();
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_deprecated_string() : DeprecatedString();
auto icon = action.icon() ? action.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap();
ConnectionToWindowServer::the().async_update_menu_item(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, m_default, shortcut_text, icon);
}

View file

@ -109,12 +109,12 @@ RefPtr<Core::MimeData> Model::mime_data(ModelSelection const& selection) const
auto text_data = index.data();
if (!first)
text_builder.append(", "sv);
text_builder.append(text_data.to_string());
text_builder.append(text_data.to_deprecated_string());
if (!first)
data_builder.append('\n');
auto data = index.data(ModelRole::MimeData);
data_builder.append(data.to_string());
data_builder.append(data.to_deprecated_string());
first = false;
@ -126,7 +126,7 @@ RefPtr<Core::MimeData> Model::mime_data(ModelSelection const& selection) const
});
mime_data->set_data(drag_data_type(), data_builder.to_byte_buffer());
mime_data->set_text(text_builder.to_string());
mime_data->set_text(text_builder.to_deprecated_string());
if (bitmap)
mime_data->set_data("image/x-raw-bitmap", bitmap->serialize_to_byte_buffer());

View file

@ -96,7 +96,7 @@ public:
virtual void set_value(Variant const& value, SelectionBehavior selection_behavior) override
{
auto& textbox = static_cast<TextBox&>(*widget());
textbox.set_text(value.to_string());
textbox.set_text(value.to_deprecated_string());
if (selection_behavior == SelectionBehavior::SelectAll)
textbox.select_all();
}

View file

@ -67,7 +67,7 @@ void Progressbar::paint_event(PaintEvent& event)
} else if (m_format == Format::ValueSlashMax) {
builder.appendff("{}/{}", m_value, m_max);
}
progress_text = builder.to_string();
progress_text = builder.to_deprecated_string();
}
Gfx::StylePainter::paint_progressbar(painter, rect, palette(), m_min, m_max, m_value, progress_text, m_orientation);

View file

@ -12,7 +12,7 @@
namespace GUI {
DeprecatedString Shortcut::to_string() const
DeprecatedString Shortcut::to_deprecated_string() const
{
Vector<DeprecatedString, 8> parts;
@ -41,7 +41,7 @@ DeprecatedString Shortcut::to_string() const
StringBuilder builder;
builder.join('+', parts);
return builder.to_string();
return builder.to_deprecated_string();
}
}

View file

@ -46,7 +46,7 @@ public:
Mouse,
};
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
Type type() const { return m_type; }
bool is_valid() const { return m_type == Type::Keyboard ? (m_keyboard_key != Key_Invalid) : (m_mouse_button != MouseButton::None); }
u8 modifiers() const { return m_modifiers; }

View file

@ -42,7 +42,7 @@ TabWidget::TabWidget()
"text_alignment",
[this] { return Gfx::to_string(text_alignment()); },
[this](auto& value) {
auto alignment = Gfx::text_alignment_from_string(value.to_string());
auto alignment = Gfx::text_alignment_from_string(value.to_deprecated_string());
if (alignment.has_value()) {
set_text_alignment(alignment.value());
return true;

View file

@ -131,7 +131,7 @@ void TableView::paint_event(PaintEvent& event)
}
auto text_alignment = cell_index.data(ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft);
draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right);
draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_deprecated_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right);
}
}

View file

@ -152,7 +152,7 @@ DeprecatedString TextDocumentLine::to_utf8() const
{
StringBuilder builder;
builder.append(view());
return builder.to_string();
return builder.to_deprecated_string();
}
TextDocumentLine::TextDocumentLine(TextDocument& document)
@ -353,7 +353,7 @@ DeprecatedString TextDocument::text() const
if (i != line_count() - 1)
builder.append('\n');
}
return builder.to_string();
return builder.to_deprecated_string();
}
DeprecatedString TextDocument::text_in_range(TextRange const& a_range) const
@ -379,7 +379,7 @@ DeprecatedString TextDocument::text_in_range(TextRange const& a_range) const
builder.append('\n');
}
return builder.to_string();
return builder.to_deprecated_string();
}
u32 TextDocument::code_point_at(TextPosition const& position) const
@ -800,7 +800,7 @@ bool InsertTextCommand::merge_with(GUI::Command const& other)
StringBuilder builder(m_text.length() + typed_other.m_text.length());
builder.append(m_text);
builder.append(typed_other.m_text);
m_text = builder.to_string();
m_text = builder.to_deprecated_string();
m_range.set_end(typed_other.m_range.end());
m_timestamp = Time::now_monotonic();
@ -900,7 +900,7 @@ bool RemoveTextCommand::merge_with(GUI::Command const& other)
StringBuilder builder(m_text.length() + typed_other.m_text.length());
builder.append(typed_other.m_text);
builder.append(m_text);
m_text = builder.to_string();
m_text = builder.to_deprecated_string();
m_range.set_start(typed_other.m_range.start());
m_timestamp = Time::now_monotonic();

View file

@ -1189,7 +1189,7 @@ void TextEditor::add_code_point(u32 code_point)
else
m_autocomplete_timer->start();
}
insert_at_cursor_or_replace_selection(sb.to_string());
insert_at_cursor_or_replace_selection(sb.to_deprecated_string());
};
void TextEditor::reset_cursor_blink()
@ -2047,7 +2047,7 @@ void TextEditor::document_did_update_undo_stack()
builder.append(' ');
builder.append(suffix.value());
}
return builder.to_string();
return builder.to_deprecated_string();
};
m_undo_action->set_enabled(can_undo() && !text_is_secret());

View file

@ -76,10 +76,10 @@ private:
builder.append(action.text());
if (action.shortcut().is_valid()) {
builder.append(" ("sv);
builder.append(action.shortcut().to_string());
builder.append(action.shortcut().to_deprecated_string());
builder.append(')');
}
return builder.to_string();
return builder.to_deprecated_string();
}
virtual void enter_event(Core::Event& event) override

View file

@ -185,7 +185,7 @@ void TreeView::traverse_in_paint_order(Callback callback) const
if (index.is_valid()) {
auto& metadata = ensure_metadata_for_index(index);
int x_offset = tree_column_x_offset + horizontal_padding() + indent_level * indent_width_in_pixels();
auto node_text = index.data().to_string();
auto node_text = index.data().to_deprecated_string();
Gfx::IntRect rect = {
x_offset, y_offset,
icon_size() + icon_spacing() + text_padding() + font_for_index(index)->width(node_text) + text_padding(), row_height()
@ -317,7 +317,7 @@ void TreeView::paint_event(PaintEvent& event)
}
} else {
auto text_alignment = cell_index.data(ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft);
draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right);
draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_deprecated_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right);
}
}
} else {
@ -346,7 +346,7 @@ void TreeView::paint_event(PaintEvent& event)
}
auto display_data = index.data();
if (display_data.is_string() || display_data.is_u32() || display_data.is_i32() || display_data.is_u64() || display_data.is_i64() || display_data.is_bool() || display_data.is_float())
draw_item_text(painter, index, is_selected_row, text_rect, display_data.to_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::Right);
draw_item_text(painter, index, is_selected_row, text_rect, display_data.to_deprecated_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::Right);
if (selection_behavior() == SelectionBehavior::SelectItems && is_focused() && index == cursor_index()) {
painter.draw_rect(background_rect, palette().color(background_role()));
@ -683,7 +683,7 @@ void TreeView::auto_resize_column(int column)
} else if (cell_data.is_bitmap()) {
cell_width = cell_data.as_bitmap().width();
} else if (cell_data.is_valid()) {
cell_width = font().width(cell_data.to_string());
cell_width = font().width(cell_data.to_deprecated_string());
}
if (is_empty && cell_width > 0)
is_empty = false;
@ -726,7 +726,7 @@ void TreeView::update_column_sizes()
} else if (cell_data.is_bitmap()) {
cell_width = cell_data.as_bitmap().width();
} else if (cell_data.is_valid()) {
cell_width = font().width(cell_data.to_string());
cell_width = font().width(cell_data.to_deprecated_string());
}
column_width = max(column_width, cell_width);
return IterationDecision::Continue;
@ -743,7 +743,7 @@ void TreeView::update_column_sizes()
auto cell_data = model.index(index.row(), tree_column, index.parent()).data();
int cell_width = 0;
if (cell_data.is_valid()) {
cell_width = font().width(cell_data.to_string());
cell_width = font().width(cell_data.to_deprecated_string());
cell_width += horizontal_padding() * 2 + indent_level * indent_width_in_pixels() + icon_size() / 2 + text_padding() * 2;
}
tree_column_width = max(tree_column_width, cell_width);

View file

@ -66,11 +66,11 @@ bool Variant::operator==(Variant const& other) const
return &own_value.impl() == &other_value.impl();
// FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
else
return to_string() == other.to_string();
return to_deprecated_string() == other.to_deprecated_string();
},
[&](auto const&) {
// FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
return to_string() == other.to_string();
return to_deprecated_string() == other.to_deprecated_string();
});
});
}
@ -92,10 +92,10 @@ bool Variant::operator<(Variant const& other) const
return own_value < other_value;
// FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
else
return to_string() < other.to_string();
return to_deprecated_string() < other.to_deprecated_string();
},
[&](auto const&) -> bool {
return to_string() < other.to_string(); // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
return to_deprecated_string() < other.to_deprecated_string(); // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
});
});
}

View file

@ -199,7 +199,7 @@ public:
return default_value;
}
DeprecatedString to_string() const
DeprecatedString to_deprecated_string() const
{
return visit(
[](Empty) -> DeprecatedString { return "[null]"; },

View file

@ -1489,14 +1489,14 @@ void VimEditingEngine::put_before()
sb.append(m_yank_buffer);
sb.append_code_point(0x0A);
}
m_editor->insert_at_cursor_or_replace_selection(sb.to_string());
m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string());
m_editor->set_cursor({ m_editor->cursor().line(), m_editor->current_line().first_non_whitespace_column() });
} else {
StringBuilder sb = StringBuilder(m_yank_buffer.length() * amount);
for (auto i = 0; i < amount; i++) {
sb.append(m_yank_buffer);
}
m_editor->insert_at_cursor_or_replace_selection(sb.to_string());
m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string());
move_one_left();
}
}
@ -1512,7 +1512,7 @@ void VimEditingEngine::put_after()
sb.append_code_point(0x0A);
sb.append(m_yank_buffer);
}
m_editor->insert_at_cursor_or_replace_selection(sb.to_string());
m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string());
m_editor->set_cursor({ m_editor->cursor().line(), m_editor->current_line().first_non_whitespace_column() });
} else {
// FIXME: If attempting to put on the last column a line,
@ -1522,7 +1522,7 @@ void VimEditingEngine::put_after()
for (auto i = 0; i < amount; i++) {
sb.append(m_yank_buffer);
}
m_editor->insert_at_cursor_or_replace_selection(sb.to_string());
m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string());
move_one_left();
}
}

View file

@ -81,11 +81,11 @@ Widget::Widget()
register_property(
"font_type", [this] { return m_font->is_fixed_width() ? "FixedWidth" : "Normal"; },
[this](auto& value) {
if (value.to_string() == "FixedWidth") {
if (value.to_deprecated_string() == "FixedWidth") {
set_font_fixed_width(true);
return true;
}
if (value.to_string() == "Normal") {
if (value.to_deprecated_string() == "Normal") {
set_font_fixed_width(false);
return true;
}
@ -127,9 +127,9 @@ Widget::Widget()
});
register_property(
"foreground_color", [this]() -> JsonValue { return palette().color(foreground_role()).to_string(); },
"foreground_color", [this]() -> JsonValue { return palette().color(foreground_role()).to_deprecated_string(); },
[this](auto& value) {
auto c = Color::from_string(value.to_string());
auto c = Color::from_string(value.to_deprecated_string());
if (c.has_value()) {
auto _palette = palette();
_palette.set_color(foreground_role(), c.value());
@ -140,9 +140,9 @@ Widget::Widget()
});
register_property(
"background_color", [this]() -> JsonValue { return palette().color(background_role()).to_string(); },
"background_color", [this]() -> JsonValue { return palette().color(background_role()).to_deprecated_string(); },
[this](auto& value) {
auto c = Color::from_string(value.to_string());
auto c = Color::from_string(value.to_deprecated_string());
if (c.has_value()) {
auto _palette = palette();
_palette.set_color(background_role(), c.value());
@ -1188,12 +1188,12 @@ bool Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::O
if (auto* registration = Core::ObjectClassRegistration::find(class_name)) {
auto layout = registration->construct();
if (!layout || !registration->is_derived_from(layout_class)) {
dbgln("Invalid layout class: '{}'", class_name.to_string());
dbgln("Invalid layout class: '{}'", class_name.to_deprecated_string());
return false;
}
set_layout(static_ptr_cast<Layout>(layout).release_nonnull());
} else {
dbgln("Unknown layout class: '{}'", class_name.to_string());
dbgln("Unknown layout class: '{}'", class_name.to_deprecated_string());
return false;
}

View file

@ -80,7 +80,7 @@ Window::Window(Core::Object* parent)
"title",
[this] { return title(); },
[this](auto& value) {
set_title(value.to_string());
set_title(value.to_deprecated_string());
return true;
});

View file

@ -13,7 +13,7 @@ namespace Gemini {
ByteBuffer GeminiRequest::to_raw_request() const
{
StringBuilder builder;
builder.append(m_url.to_string());
builder.append(m_url.to_deprecated_string());
builder.append("\r\n"sv);
return builder.to_byte_buffer();
}

View file

@ -70,14 +70,14 @@ Link::Link(DeprecatedString text, Document const& document)
}
m_url = document.url().complete_url(url);
if (m_name.is_null())
m_name = m_url.to_string();
m_name = m_url.to_deprecated_string();
}
DeprecatedString Link::render_to_html() const
{
StringBuilder builder;
builder.append("<a href=\""sv);
builder.append(escape_html_entities(m_url.to_string()));
builder.append(escape_html_entities(m_url.to_deprecated_string()));
builder.append("\">"sv);
builder.append(escape_html_entities(m_name));
builder.append("</a><br>\n"sv);

View file

@ -18,12 +18,12 @@
namespace Gfx {
DeprecatedString Color::to_string() const
DeprecatedString Color::to_deprecated_string() const
{
return DeprecatedString::formatted("#{:02x}{:02x}{:02x}{:02x}", red(), green(), blue(), alpha());
}
DeprecatedString Color::to_string_without_alpha() const
DeprecatedString Color::to_deprecated_string_without_alpha() const
{
return DeprecatedString::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue());
}
@ -384,5 +384,5 @@ ErrorOr<void> IPC::decode(Decoder& decoder, Color& color)
ErrorOr<void> AK::Formatter<Gfx::Color>::format(FormatBuilder& builder, Gfx::Color const& value)
{
return Formatter<StringView>::format(builder, value.to_string());
return Formatter<StringView>::format(builder, value.to_deprecated_string());
}

View file

@ -352,8 +352,8 @@ public:
return m_value == other.m_value;
}
DeprecatedString to_string() const;
DeprecatedString to_string_without_alpha() const;
DeprecatedString to_deprecated_string() const;
DeprecatedString to_deprecated_string_without_alpha() const;
static Optional<Color> from_string(StringView);
constexpr HSV to_hsv() const

View file

@ -930,7 +930,7 @@ void DDSLoadingContext::dump_debug()
builder.append(" DDS_ALPHA_MODE_CUSTOM"sv);
builder.append("\n"sv);
dbgln("{}", builder.to_string());
dbgln("{}", builder.to_deprecated_string());
}
DDSImageDecoderPlugin::DDSImageDecoderPlugin(u8 const* data, size_t size)

View file

@ -380,7 +380,7 @@ DeprecatedString BitmapFont::variant() const
builder.append(' ');
builder.append(slope_to_name(slope()));
}
return builder.to_string();
return builder.to_deprecated_string();
}
Font const& Font::bold_variant() const

View file

@ -141,7 +141,7 @@ public:
return Line<U>(*this);
}
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
private:
Point<T> m_a;
@ -149,13 +149,13 @@ private:
};
template<>
inline DeprecatedString IntLine::to_string() const
inline DeprecatedString IntLine::to_deprecated_string() const
{
return DeprecatedString::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y());
}
template<>
inline DeprecatedString FloatLine::to_string() const
inline DeprecatedString FloatLine::to_deprecated_string() const
{
return DeprecatedString::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y());
}

View file

@ -2417,7 +2417,7 @@ DeprecatedString parse_ampersand_string(StringView raw_text, Optional<size_t>* u
}
builder.append(raw_text[i]);
}
return builder.to_string();
return builder.to_deprecated_string();
}
void Gfx::Painter::draw_ui_text(Gfx::IntRect const& rect, StringView text, Gfx::Font const& font, Gfx::TextAlignment text_alignment, Gfx::Color color)

View file

@ -177,7 +177,7 @@ void Path::close_all_subpaths()
}
}
DeprecatedString Path::to_string() const
DeprecatedString Path::to_deprecated_string() const
{
StringBuilder builder;
builder.append("Path { "sv);
@ -207,19 +207,19 @@ DeprecatedString Path::to_string() const
switch (segment.type()) {
case Segment::Type::QuadraticBezierCurveTo:
builder.append(", "sv);
builder.append(static_cast<QuadraticBezierCurveSegment const&>(segment).through().to_string());
builder.append(static_cast<QuadraticBezierCurveSegment const&>(segment).through().to_deprecated_string());
break;
case Segment::Type::CubicBezierCurveTo:
builder.append(", "sv);
builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_0().to_string());
builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_0().to_deprecated_string());
builder.append(", "sv);
builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_1().to_string());
builder.append(static_cast<CubicBezierCurveSegment const&>(segment).through_1().to_deprecated_string());
break;
case Segment::Type::EllipticalArcTo: {
auto& arc = static_cast<EllipticalArcSegment const&>(segment);
builder.appendff(", {}, {}, {}, {}, {}",
arc.radii().to_string().characters(),
arc.center().to_string().characters(),
arc.radii().to_deprecated_string().characters(),
arc.center().to_deprecated_string().characters(),
arc.x_axis_rotation(),
arc.theta_1(),
arc.theta_delta());
@ -232,7 +232,7 @@ DeprecatedString Path::to_string() const
builder.append(") "sv);
}
builder.append('}');
return builder.to_string();
return builder.to_deprecated_string();
}
void Path::segmentize_path()

View file

@ -245,7 +245,7 @@ public:
Path copy_transformed(AffineTransform const&) const;
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
private:
void invalidate_split_lines()

View file

@ -36,13 +36,13 @@ template<typename T>
}
template<>
DeprecatedString IntPoint::to_string() const
DeprecatedString IntPoint::to_deprecated_string() const
{
return DeprecatedString::formatted("[{},{}]", x(), y());
}
template<>
DeprecatedString FloatPoint::to_string() const
DeprecatedString FloatPoint::to_deprecated_string() const
{
return DeprecatedString::formatted("[{},{}]", x(), y());
}

Some files were not shown because too many files have changed in this diff Show more