1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 21:48:11 +00:00

LibCore: Move Core::Stream::File::exists() to Core::File

`Core::Stream::File` shouldn't hold any utility methods that are
unrelated to constructing a `Core::Stream`, so let's just replace the
existing `Core::File::exists` with the nicer looking implementation.
This commit is contained in:
Tim Schumacher 2022-12-07 21:34:00 +01:00 committed by Sam Atkins
parent bd272e638c
commit 2fc2025f49
10 changed files with 14 additions and 18 deletions

View file

@ -12,6 +12,7 @@
#include <AK/Types.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/Directory.h>
#include <LibCore/File.h>
#include <LibCore/Stream.h>
#include <LibUnicode/Emoji.h>
@ -45,7 +46,7 @@ static void set_image_path_for_emoji(StringView emoji_resource_path, Emoji& emoj
}
auto path = DeprecatedString::formatted("{}/{}.png", emoji_resource_path, builder.build());
if (Core::Stream::File::exists(path))
if (Core::File::exists(path))
emoji.image_path = move(path);
}
@ -339,7 +340,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.parse(arguments);
auto emoji_test_file = TRY(open_file(emoji_test_path, Core::Stream::OpenMode::Read));
VERIFY(!emoji_resource_path.is_empty() && Core::Stream::File::exists(emoji_resource_path));
VERIFY(!emoji_resource_path.is_empty() && Core::File::exists(emoji_resource_path));
EmojiData emoji_data {};
TRY(parse_emoji_test_data(*emoji_test_file, emoji_data));