mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18: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
|
@ -54,13 +54,13 @@ ErrorOr<String> load_error_page(AK::URL const& url)
|
|||
{
|
||||
// Generate HTML error page from error template file
|
||||
// FIXME: Use an actual templating engine (our own one when it's built, preferably with a way to check these usages at compile time)
|
||||
auto template_path = AK::URL::create_with_url_or_path(error_page_url().to_deprecated_string()).serialize_path();
|
||||
auto template_path = AK::URL::create_with_url_or_path(error_page_url().to_byte_string()).serialize_path();
|
||||
auto template_file = TRY(Core::File::open(template_path, Core::File::OpenMode::Read));
|
||||
auto template_contents = TRY(template_file->read_until_eof());
|
||||
StringBuilder builder;
|
||||
SourceGenerator generator { builder };
|
||||
generator.set("resource_directory_url", resource_directory_url());
|
||||
generator.set("failed_url", url.to_deprecated_string());
|
||||
generator.set("failed_url", url.to_byte_string());
|
||||
generator.append(template_contents);
|
||||
return TRY(String::from_utf8(generator.as_string_view()));
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ ErrorOr<String> load_file_directory_page(LoadRequest const& request)
|
|||
// Generate HTML contents entries table
|
||||
auto lexical_path = LexicalPath(request.url().serialize_path());
|
||||
Core::DirIterator dt(lexical_path.string(), Core::DirIterator::Flags::SkipParentAndBaseDir);
|
||||
Vector<DeprecatedString> names;
|
||||
Vector<ByteString> names;
|
||||
while (dt.has_next())
|
||||
names.append(dt.next_path());
|
||||
quick_sort(names);
|
||||
|
@ -88,7 +88,7 @@ ErrorOr<String> load_file_directory_page(LoadRequest const& request)
|
|||
contents.appendff("<td><span class=\"{}\"></span></td>", is_directory ? "folder" : "file");
|
||||
contents.appendff("<td><a href=\"file://{}\">{}</a></td><td> </td>"sv, path, name);
|
||||
contents.appendff("<td>{:10}</td><td> </td>", is_directory ? "-" : human_readable_size(st.st_size));
|
||||
contents.appendff("<td>{}</td>"sv, Core::DateTime::from_timestamp(st.st_mtime).to_deprecated_string());
|
||||
contents.appendff("<td>{}</td>"sv, Core::DateTime::from_timestamp(st.st_mtime).to_byte_string());
|
||||
contents.append("</tr>\n"sv);
|
||||
}
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ ErrorOr<String> load_file_directory_page(LoadRequest const& request)
|
|||
|
||||
// Generate HTML directory page from directory template file
|
||||
// FIXME: Use an actual templating engine (our own one when it's built, preferably with a way to check these usages at compile time)
|
||||
auto template_path = AK::URL::create_with_url_or_path(directory_page_url().to_deprecated_string()).serialize_path();
|
||||
auto template_path = AK::URL::create_with_url_or_path(directory_page_url().to_byte_string()).serialize_path();
|
||||
auto template_file = TRY(Core::File::open(template_path, Core::File::OpenMode::Read));
|
||||
auto template_contents = TRY(template_file->read_until_eof());
|
||||
StringBuilder builder;
|
||||
|
@ -104,7 +104,7 @@ ErrorOr<String> load_file_directory_page(LoadRequest const& request)
|
|||
generator.set("resource_directory_url", resource_directory_url());
|
||||
generator.set("path", escape_html_entities(lexical_path.string()));
|
||||
generator.set("parent_path", escape_html_entities(lexical_path.parent().string()));
|
||||
generator.set("contents", contents.to_deprecated_string());
|
||||
generator.set("contents", contents.to_byte_string());
|
||||
generator.append(template_contents);
|
||||
return TRY(String::from_utf8(generator.as_string_view()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue