mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:28:11 +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
|
@ -6,7 +6,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -35,10 +35,10 @@ extern "C" {
|
|||
namespace Core {
|
||||
|
||||
struct ArgvList {
|
||||
DeprecatedString m_path;
|
||||
ByteString m_path;
|
||||
Vector<char const*, 10> m_argv;
|
||||
|
||||
ArgvList(DeprecatedString path, size_t size)
|
||||
ArgvList(ByteString path, size_t size)
|
||||
: m_path { path }
|
||||
{
|
||||
m_argv.ensure_capacity(size + 2);
|
||||
|
@ -103,12 +103,12 @@ ErrorOr<Process> Process::spawn(ProcessSpawnOptions const& options)
|
|||
return Process { pid };
|
||||
}
|
||||
|
||||
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<DeprecatedString> arguments, DeprecatedString working_directory, KeepAsChild keep_as_child)
|
||||
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<ByteString> arguments, ByteString working_directory, KeepAsChild keep_as_child)
|
||||
{
|
||||
auto process = TRY(spawn({
|
||||
.path = path,
|
||||
.arguments = Vector<DeprecatedString> { arguments },
|
||||
.working_directory = working_directory.is_empty() ? Optional<DeprecatedString> {} : Optional<DeprecatedString> { working_directory },
|
||||
.arguments = Vector<ByteString> { arguments },
|
||||
.working_directory = working_directory.is_empty() ? Optional<ByteString> {} : Optional<ByteString> { working_directory },
|
||||
}));
|
||||
|
||||
if (keep_as_child == KeepAsChild::No)
|
||||
|
@ -120,9 +120,9 @@ ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<DeprecatedString> ar
|
|||
return process.pid();
|
||||
}
|
||||
|
||||
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<StringView> arguments, DeprecatedString working_directory, KeepAsChild keep_as_child)
|
||||
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<StringView> arguments, ByteString working_directory, KeepAsChild keep_as_child)
|
||||
{
|
||||
Vector<DeprecatedString> backing_strings;
|
||||
Vector<ByteString> backing_strings;
|
||||
backing_strings.ensure_capacity(arguments.size());
|
||||
for (auto const& argument : arguments)
|
||||
backing_strings.append(argument);
|
||||
|
@ -130,7 +130,7 @@ ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<StringView> argument
|
|||
auto process = TRY(spawn({
|
||||
.path = path,
|
||||
.arguments = backing_strings,
|
||||
.working_directory = working_directory.is_empty() ? Optional<DeprecatedString> {} : Optional<DeprecatedString> { working_directory },
|
||||
.working_directory = working_directory.is_empty() ? Optional<ByteString> {} : Optional<ByteString> { working_directory },
|
||||
}));
|
||||
|
||||
if (keep_as_child == KeepAsChild::No)
|
||||
|
@ -140,9 +140,9 @@ ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<StringView> argument
|
|||
return process.pid();
|
||||
}
|
||||
|
||||
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<char const*> arguments, DeprecatedString working_directory, KeepAsChild keep_as_child)
|
||||
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<char const*> arguments, ByteString working_directory, KeepAsChild keep_as_child)
|
||||
{
|
||||
Vector<DeprecatedString> backing_strings;
|
||||
Vector<ByteString> backing_strings;
|
||||
backing_strings.ensure_capacity(arguments.size());
|
||||
for (auto const& argument : arguments)
|
||||
backing_strings.append(argument);
|
||||
|
@ -150,7 +150,7 @@ ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<char const*> argumen
|
|||
auto process = TRY(spawn({
|
||||
.path = path,
|
||||
.arguments = backing_strings,
|
||||
.working_directory = working_directory.is_empty() ? Optional<DeprecatedString> {} : Optional<DeprecatedString> { working_directory },
|
||||
.working_directory = working_directory.is_empty() ? Optional<ByteString> {} : Optional<ByteString> { working_directory },
|
||||
}));
|
||||
|
||||
if (keep_as_child == KeepAsChild::No)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue