mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +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:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -85,7 +85,7 @@ static ErrorOr<String> column_to_string(ColumnId column_id, Core::ProcessStatist
|
|||
{
|
||||
switch (column_id) {
|
||||
case ColumnId::UserId:
|
||||
return String::from_deprecated_string(process.username);
|
||||
return String::from_byte_string(process.username);
|
||||
case ColumnId::ProcessId:
|
||||
return String::number(process.pid);
|
||||
case ColumnId::ParentProcessId:
|
||||
|
@ -95,11 +95,11 @@ static ErrorOr<String> column_to_string(ColumnId column_id, Core::ProcessStatist
|
|||
case ColumnId::SessionId:
|
||||
return String::number(process.sid);
|
||||
case ColumnId::TTY:
|
||||
return process.tty == "" ? "n/a"_string : String::from_deprecated_string(process.tty);
|
||||
return process.tty == "" ? "n/a"_string : String::from_byte_string(process.tty);
|
||||
case ColumnId::State:
|
||||
return process.threads.is_empty()
|
||||
? "Zombie"_string
|
||||
: String::from_deprecated_string(process.threads.first().state);
|
||||
: String::from_byte_string(process.threads.first().state);
|
||||
case ColumnId::StartTime: {
|
||||
auto now = Core::DateTime::now();
|
||||
auto today_start = Core::DateTime::now();
|
||||
|
@ -110,7 +110,7 @@ static ErrorOr<String> column_to_string(ColumnId column_id, Core::ProcessStatist
|
|||
return process_creation_time.to_string("%b%d"sv);
|
||||
}
|
||||
case ColumnId::Command:
|
||||
return String::from_deprecated_string(process.name);
|
||||
return String::from_byte_string(process.name);
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
Vector<Column> columns;
|
||||
Vector<pid_t> pid_list;
|
||||
Vector<pid_t> parent_pid_list;
|
||||
Vector<DeprecatedString> tty_list;
|
||||
Vector<ByteString> tty_list;
|
||||
Vector<uid_t> uid_list;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
|
@ -267,14 +267,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
warnln("Could not parse '{}' as a PID.", pid_string);
|
||||
return pid;
|
||||
}));
|
||||
args_parser.add_option(make_list_option(tty_list, "Show processes associated with the given terminal. (Comma- or space-separated list.) The short TTY name or the full device path may be used.", "tty", 't', "tty-list", [&](StringView tty_string) -> Optional<DeprecatedString> {
|
||||
args_parser.add_option(make_list_option(tty_list, "Show processes associated with the given terminal. (Comma- or space-separated list.) The short TTY name or the full device path may be used.", "tty", 't', "tty-list", [&](StringView tty_string) -> Optional<ByteString> {
|
||||
provided_filtering_option = true;
|
||||
auto tty_pseudo_name_or_error = parse_tty_pseudo_name(tty_string);
|
||||
if (tty_pseudo_name_or_error.is_error()) {
|
||||
warnln("Could not parse '{}' as a TTY", tty_string);
|
||||
return {};
|
||||
}
|
||||
return tty_pseudo_name_or_error.release_value().to_deprecated_string();
|
||||
return tty_pseudo_name_or_error.release_value().to_byte_string();
|
||||
}));
|
||||
args_parser.add_option(make_list_option(uid_list, "Show processes with a matching user ID or login name. (Comma- or space-separated list.)", nullptr, 'u', "user-list", [&](StringView user_string) -> Optional<uid_t> {
|
||||
provided_filtering_option = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue