mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:47:44 +00:00
LibCore: Move Stream-based file into the Core
namespace
This commit is contained in:
parent
a96339b72b
commit
606a3982f3
218 changed files with 748 additions and 643 deletions
|
@ -111,13 +111,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
static ErrorOr<void> load_content_filters()
|
||||
{
|
||||
auto file_or_error = Core::Stream::File::open(DeprecatedString::formatted("{}/home/anon/.config/BrowserContentFilters.txt", s_serenity_resource_root), Core::Stream::OpenMode::Read);
|
||||
auto file_or_error = Core::File::open(DeprecatedString::formatted("{}/home/anon/.config/BrowserContentFilters.txt", s_serenity_resource_root), Core::File::OpenMode::Read);
|
||||
if (file_or_error.is_error())
|
||||
file_or_error = Core::Stream::File::open(DeprecatedString::formatted("{}/res/ladybird/BrowserContentFilters.txt", s_serenity_resource_root), Core::Stream::OpenMode::Read);
|
||||
file_or_error = Core::File::open(DeprecatedString::formatted("{}/res/ladybird/BrowserContentFilters.txt", s_serenity_resource_root), Core::File::OpenMode::Read);
|
||||
if (file_or_error.is_error())
|
||||
return file_or_error.release_error();
|
||||
auto file = file_or_error.release_value();
|
||||
auto ad_filter_list = TRY(Core::Stream::BufferedFile::create(move(file)));
|
||||
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));
|
||||
|
|
|
@ -1006,7 +1006,7 @@ Gfx::IntRect WebContentView::notify_server_did_request_fullscreen_window()
|
|||
|
||||
void WebContentView::notify_server_did_request_file(Badge<WebContentClient>, DeprecatedString const& path, i32 request_id)
|
||||
{
|
||||
auto file = Core::Stream::File::open(path, Core::Stream::OpenMode::Read);
|
||||
auto file = Core::File::open(path, Core::File::OpenMode::Read);
|
||||
if (file.is_error())
|
||||
client().async_handle_file_return(file.error().code(), {}, request_id);
|
||||
else
|
||||
|
|
|
@ -31,8 +31,8 @@ static ErrorOr<void> handle_attached_debugger()
|
|||
// incorrectly forwards the signal to us even when it's set to
|
||||
// "nopass". See https://sourceware.org/bugzilla/show_bug.cgi?id=9425
|
||||
// for details.
|
||||
auto unbuffered_status_file = TRY(Core::Stream::File::open("/proc/self/status"sv, Core::Stream::OpenMode::Read));
|
||||
auto status_file = TRY(Core::Stream::BufferedFile::create(move(unbuffered_status_file)));
|
||||
auto unbuffered_status_file = TRY(Core::File::open("/proc/self/status"sv, Core::File::OpenMode::Read));
|
||||
auto status_file = TRY(Core::BufferedFile::create(move(unbuffered_status_file)));
|
||||
auto buffer = TRY(ByteBuffer::create_uninitialized(4096));
|
||||
while (TRY(status_file->can_read_line())) {
|
||||
auto line = TRY(status_file->read_line(buffer));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue