mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibCore: Move Stream-based file into the Core
namespace
This commit is contained in:
parent
a96339b72b
commit
606a3982f3
Notes:
sideshowbarker
2024-07-18 05:01:22 +09:00
Author: https://github.com/timschumi
Commit: 606a3982f3
Pull-request: https://github.com/SerenityOS/serenity/pull/17406
Reviewed-by: https://github.com/linusg
218 changed files with 748 additions and 643 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/Stream.h>
|
||||
#include <LibCpp/Parser.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
|
@ -14,7 +15,7 @@ constexpr char TESTS_ROOT_DIR[] = "/home/anon/Tests/cpp-tests/preprocessor";
|
|||
|
||||
static DeprecatedString read_all(DeprecatedString const& path)
|
||||
{
|
||||
auto file = MUST(Core::Stream::File::open(path, Core::Stream::OpenMode::Read));
|
||||
auto file = MUST(Core::File::open(path, Core::File::OpenMode::Read));
|
||||
auto file_size = MUST(file->size());
|
||||
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
|
||||
MUST(file->read_entire_buffer(content.bytes()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue