diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-04 18:02:33 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-06 08:54:33 +0100 |
commit | 6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch) | |
tree | 372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Utilities/ps.cpp | |
parent | f74251606d74b504a1379ebb893fdb5529054ea5 (diff) | |
download | serenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip |
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 :^)
Diffstat (limited to 'Userland/Utilities/ps.cpp')
-rw-r--r-- | Userland/Utilities/ps.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Userland/Utilities/ps.cpp b/Userland/Utilities/ps.cpp index b080a72b12..bfce160cf3 100644 --- a/Userland/Utilities/ps.cpp +++ b/Userland/Utilities/ps.cpp @@ -12,7 +12,7 @@ #include <sys/sysmacros.h> #include <unistd.h> -static ErrorOr<String> determine_tty_pseudo_name() +static ErrorOr<DeprecatedString> determine_tty_pseudo_name() { struct stat tty_stat; if (fstat(STDIN_FILENO, &tty_stat) < 0) { @@ -25,11 +25,11 @@ static ErrorOr<String> determine_tty_pseudo_name() int tty_device_minor = minor(tty_stat.st_rdev); if (tty_device_major == 201) { - return String::formatted("pts:{}", tty_device_minor); + return DeprecatedString::formatted("pts:{}", tty_device_minor); } if (tty_device_major == 4) { - return String::formatted("tty:{}", tty_device_minor); + return DeprecatedString::formatted("tty:{}", tty_device_minor); } return "n/a"; } @@ -51,15 +51,15 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) }; struct Column { - String title; + DeprecatedString title; Alignment alignment { Alignment::Left }; int width { 0 }; - String buffer; + DeprecatedString buffer; }; bool every_process_flag = false; bool full_format_flag = false; - String pid_list; + DeprecatedString pid_list; Core::ArgsParser args_parser; args_parser.add_option(every_process_flag, "Show every process", nullptr, 'e'); @@ -132,10 +132,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) quick_sort(processes, [](auto& a, auto& b) { return a.pid < b.pid; }); } - Vector<Vector<String>> rows; + Vector<Vector<DeprecatedString>> rows; TRY(rows.try_ensure_capacity(1 + processes.size())); - Vector<String> header; + Vector<DeprecatedString> header; TRY(header.try_ensure_capacity(columns.size())); for (auto& column : columns) header.unchecked_append(column.title); @@ -148,7 +148,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto* state = process.threads.is_empty() ? "Zombie" : process.threads.first().state.characters(); - Vector<String> row; + Vector<DeprecatedString> row; TRY(row.try_resize(columns.size())); if (tty == "") @@ -157,13 +157,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) if (uid_column != -1) row[uid_column] = process.username; if (pid_column != -1) - row[pid_column] = String::number(process.pid); + row[pid_column] = DeprecatedString::number(process.pid); if (ppid_column != -1) - row[ppid_column] = String::number(process.ppid); + row[ppid_column] = DeprecatedString::number(process.ppid); if (pgid_column != -1) - row[pgid_column] = String::number(process.pgid); + row[pgid_column] = DeprecatedString::number(process.pgid); if (sid_column != -1) - row[sid_column] = String::number(process.sid); + row[sid_column] = DeprecatedString::number(process.sid); if (tty_column != -1) row[tty_column] = tty; if (state_column != -1) |