mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:24:58 +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
|
@ -289,7 +289,7 @@ static void dump(XML::Document& document)
|
|||
color(ColorRole::Tag);
|
||||
out("{} ", declaration.name);
|
||||
declaration.definition.visit(
|
||||
[](DeprecatedString const& value) {
|
||||
[](ByteString const& value) {
|
||||
color(ColorRole::AttributeValue);
|
||||
out("\"{}\"", value);
|
||||
},
|
||||
|
@ -320,7 +320,7 @@ static void dump(XML::Document& document)
|
|||
color(ColorRole::Tag);
|
||||
out("{} ", declaration.name);
|
||||
declaration.definition.visit(
|
||||
[](DeprecatedString const& value) {
|
||||
[](ByteString const& value) {
|
||||
color(ColorRole::AttributeValue);
|
||||
out("\"{}\"", value);
|
||||
},
|
||||
|
@ -362,8 +362,8 @@ static auto parse(StringView contents)
|
|||
contents,
|
||||
{
|
||||
.preserve_comments = true,
|
||||
.resolve_external_resource = [&](XML::SystemID const& system_id, Optional<XML::PublicID> const&) -> ErrorOr<DeprecatedString> {
|
||||
auto base = URL::create_with_file_scheme(s_path.to_deprecated_string());
|
||||
.resolve_external_resource = [&](XML::SystemID const& system_id, Optional<XML::PublicID> const&) -> ErrorOr<ByteString> {
|
||||
auto base = URL::create_with_file_scheme(s_path.to_byte_string());
|
||||
auto url = URLParser::basic_parse(system_id.system_literal, base);
|
||||
if (!url.is_valid())
|
||||
return Error::from_string_literal("Invalid URL");
|
||||
|
@ -372,7 +372,7 @@ static auto parse(StringView contents)
|
|||
return Error::from_string_literal("NYI: Nonlocal entity");
|
||||
|
||||
auto file = TRY(Core::File::open(url.serialize_path(), Core::File::OpenMode::Read));
|
||||
return DeprecatedString::copy(TRY(file->read_until_eof()));
|
||||
return ByteString::copy(TRY(file->read_until_eof()));
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -383,7 +383,7 @@ enum class TestResult {
|
|||
Failed,
|
||||
RunnerFailed,
|
||||
};
|
||||
static HashMap<DeprecatedString, TestResult> s_test_results {};
|
||||
static HashMap<ByteString, TestResult> s_test_results {};
|
||||
static void do_run_tests(XML::Document& document)
|
||||
{
|
||||
auto& root = document.root().content.get<XML::Node::Element>();
|
||||
|
@ -402,7 +402,7 @@ static void do_run_tests(XML::Document& document)
|
|||
|
||||
dump_cases(root);
|
||||
|
||||
auto base_path = LexicalPath::dirname(s_path.to_deprecated_string());
|
||||
auto base_path = LexicalPath::dirname(s_path.to_byte_string());
|
||||
|
||||
while (!suites.is_empty()) {
|
||||
auto& node = *suites.dequeue();
|
||||
|
@ -430,7 +430,7 @@ static void do_run_tests(XML::Document& document)
|
|||
path_builder.append(entry);
|
||||
path_builder.append('/');
|
||||
}
|
||||
auto test_base_path = path_builder.to_deprecated_string();
|
||||
auto test_base_path = path_builder.to_byte_string();
|
||||
|
||||
path_builder.append(suite.attributes.find("URI")->value);
|
||||
auto url = URL::create_with_file_scheme(path_builder.string_view());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue