1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

PixelPaint: Port to Core::Stream :^)

This commit is contained in:
Karol Kosek 2022-12-17 17:51:26 +01:00 committed by Sam Atkins
parent 4f699d0f58
commit 301f9de915
11 changed files with 59 additions and 74 deletions

View file

@ -10,15 +10,14 @@
#include <AK/DeprecatedString.h>
#include <AK/JsonObject.h>
#include <AK/Result.h>
#include <LibCore/File.h>
#include <LibCore/MappedFile.h>
#include <LibImageDecoderClient/Client.h>
namespace PixelPaint {
ErrorOr<void> ProjectLoader::try_load_from_file(Core::File& file)
ErrorOr<void> ProjectLoader::try_load_from_file(NonnullOwnPtr<Core::Stream::File> file)
{
auto contents = file.read_all();
auto contents = TRY(file->read_until_eof());
auto json_or_error = JsonValue::from_string(contents);
if (json_or_error.is_error()) {