1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +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

@ -29,7 +29,7 @@ void ScriptEditor::new_script_with_temp_name(DeprecatedString name)
ErrorOr<void> ScriptEditor::open_script_from_file(LexicalPath const& file_path)
{
auto file = TRY(Core::Stream::File::open(file_path.string(), Core::Stream::OpenMode::Read));
auto file = TRY(Core::File::open(file_path.string(), Core::File::OpenMode::Read));
auto buffer = TRY(file->read_until_eof());
set_text({ buffer.bytes() });
@ -40,7 +40,7 @@ ErrorOr<void> ScriptEditor::open_script_from_file(LexicalPath const& file_path)
static ErrorOr<void> save_text_to_file(StringView filename, DeprecatedString text)
{
auto file = TRY(Core::Stream::File::open(filename, Core::Stream::OpenMode::Write));
auto file = TRY(Core::File::open(filename, Core::File::OpenMode::Write));
if (!text.is_empty())
TRY(file->write_entire_buffer(text.bytes()));