1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +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

@ -9,6 +9,7 @@
#include <AK/RefPtr.h>
#include <AK/ScopeGuard.h>
#include <AK/Utf8View.h>
#include <LibCore/File.h>
#include <LibCore/Stream.h>
M3UParser::M3UParser()
@ -17,7 +18,7 @@ M3UParser::M3UParser()
NonnullOwnPtr<M3UParser> M3UParser::from_file(StringView path)
{
auto file_result = Core::Stream::File::open(path, Core::Stream::OpenMode::Read).release_value_but_fixme_should_propagate_errors();
auto file_result = Core::File::open(path, Core::File::OpenMode::Read).release_value_but_fixme_should_propagate_errors();
auto contents = file_result->read_until_eof().release_value_but_fixme_should_propagate_errors();
auto use_utf8 = path.ends_with(".m3u8"sv, CaseSensitivity::CaseInsensitive);
return from_memory(DeprecatedString { contents, NoChomp }, use_utf8);