1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 12:37:44 +00:00

LibCore: Move Stream-based file into the Core namespace

This commit is contained in:
Tim Schumacher 2023-02-09 03:02:46 +01:00 committed by Linus Groh
parent a96339b72b
commit 606a3982f3
218 changed files with 748 additions and 643 deletions

View file

@ -488,7 +488,7 @@ ErrorOr<void> BrowserWindow::load_search_engines(GUI::Menu& settings_menu)
m_search_engine_actions.add_action(*m_disable_search_engine_action);
m_disable_search_engine_action->set_checked(true);
auto search_engines_file = TRY(Core::Stream::File::open(Browser::search_engines_file_path(), Core::Stream::OpenMode::Read));
auto search_engines_file = TRY(Core::File::open(Browser::search_engines_file_path(), Core::File::OpenMode::Read));
auto file_size = TRY(search_engines_file->size());
auto buffer = TRY(ByteBuffer::create_uninitialized(file_size));
if (!search_engines_file->read_entire_buffer(buffer).is_error()) {
@ -775,7 +775,7 @@ ErrorOr<void> BrowserWindow::take_screenshot(ScreenshotType type)
auto encoded = TRY(Gfx::PNGWriter::encode(*bitmap.bitmap()));
auto screenshot_file = TRY(Core::Stream::File::open(path.string(), Core::Stream::OpenMode::Write));
auto screenshot_file = TRY(Core::File::open(path.string(), Core::File::OpenMode::Write));
TRY(screenshot_file->write(encoded));
return {};

View file

@ -47,7 +47,7 @@ DownloadWidget::DownloadWidget(const URL& url)
};
{
auto file_or_error = Core::Stream::File::open(m_destination_path, Core::Stream::OpenMode::Write);
auto file_or_error = Core::File::open(m_destination_path, Core::File::OpenMode::Write);
if (file_or_error.is_error()) {
GUI::MessageBox::show(window(), DeprecatedString::formatted("Cannot open {} for writing", m_destination_path), "Download failed"sv, GUI::MessageBox::Type::Error);
window()->close();

View file

@ -38,7 +38,7 @@ private:
RefPtr<GUI::Button> m_close_button;
RefPtr<GUI::CheckBox> m_close_on_finish_checkbox;
RefPtr<GUI::ImageWidget> m_browser_image;
OwnPtr<Core::Stream::File> m_output_file_stream;
OwnPtr<Core::File> m_output_file_stream;
Core::ElapsedTimer m_elapsed_timer;
};

View file

@ -45,8 +45,8 @@ DeprecatedString g_webdriver_content_ipc_path;
static ErrorOr<void> load_content_filters()
{
auto file = TRY(Core::Stream::File::open(DeprecatedString::formatted("{}/BrowserContentFilters.txt", Core::StandardPaths::config_directory()), Core::Stream::OpenMode::Read));
auto ad_filter_list = TRY(Core::Stream::BufferedFile::create(move(file)));
auto file = TRY(Core::File::open(DeprecatedString::formatted("{}/BrowserContentFilters.txt", Core::StandardPaths::config_directory()), Core::File::OpenMode::Read));
auto ad_filter_list = TRY(Core::BufferedFile::create(move(file)));
auto buffer = TRY(ByteBuffer::create_uninitialized(4096));
while (TRY(ad_filter_list->can_read_line())) {
auto line = TRY(ad_filter_list->read_line(buffer));