diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-02-09 03:02:46 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-13 00:50:07 +0000 |
commit | 606a3982f34d777f121fcc4aa964141199676c20 (patch) | |
tree | 836fef41d11f1b77f4dac7d699e5c9f720ee4ff1 /Userland/Games | |
parent | a96339b72b3b417ffaa4fbb4e7575149f749acaa (diff) | |
download | serenity-606a3982f34d777f121fcc4aa964141199676c20.zip |
LibCore: Move Stream-based file into the `Core` namespace
Diffstat (limited to 'Userland/Games')
-rw-r--r-- | Userland/Games/Chess/ChessWidget.cpp | 5 | ||||
-rw-r--r-- | Userland/Games/Chess/ChessWidget.h | 4 | ||||
-rw-r--r-- | Userland/Games/MasterWord/WordGame.cpp | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index 4c34b056b8..65e0006a60 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -10,6 +10,7 @@ #include <AK/Random.h> #include <AK/String.h> #include <LibCore/DateTime.h> +#include <LibCore/File.h> #include <LibCore/Stream.h> #include <LibGUI/MessageBox.h> #include <LibGUI/Painter.h> @@ -532,7 +533,7 @@ DeprecatedString ChessWidget::get_fen() const return m_playback ? m_board_playback.to_fen() : m_board.to_fen(); } -ErrorOr<void> ChessWidget::import_pgn(Core::Stream::File& file) +ErrorOr<void> ChessWidget::import_pgn(Core::File& file) { m_board = Chess::Board(); @@ -629,7 +630,7 @@ ErrorOr<void> ChessWidget::import_pgn(Core::Stream::File& file) return {}; } -ErrorOr<void> ChessWidget::export_pgn(Core::Stream::File& file) const +ErrorOr<void> ChessWidget::export_pgn(Core::File& file) const { // Tag Pair Section TRY(file.write("[Event \"Casual Game\"]\n"sv.bytes())); diff --git a/Userland/Games/Chess/ChessWidget.h b/Userland/Games/Chess/ChessWidget.h index ef048ec7ae..3e35f2706f 100644 --- a/Userland/Games/Chess/ChessWidget.h +++ b/Userland/Games/Chess/ChessWidget.h @@ -54,8 +54,8 @@ public: void set_show_available_moves(bool e) { m_show_available_moves = e; } DeprecatedString get_fen() const; - ErrorOr<void> import_pgn(Core::Stream::File&); - ErrorOr<void> export_pgn(Core::Stream::File&) const; + ErrorOr<void> import_pgn(Core::File&); + ErrorOr<void> export_pgn(Core::File&) const; int resign(); void flip_board(); diff --git a/Userland/Games/MasterWord/WordGame.cpp b/Userland/Games/MasterWord/WordGame.cpp index a7665458a2..9a3d1ddfed 100644 --- a/Userland/Games/MasterWord/WordGame.cpp +++ b/Userland/Games/MasterWord/WordGame.cpp @@ -177,8 +177,8 @@ void WordGame::read_words() m_words.clear(); auto try_load_words = [&]() -> ErrorOr<void> { - auto response = TRY(Core::Stream::File::open("/res/words.txt"sv, Core::Stream::OpenMode::Read)); - auto words_file = TRY(Core::Stream::BufferedFile::create(move(response))); + auto response = TRY(Core::File::open("/res/words.txt"sv, Core::File::OpenMode::Read)); + auto words_file = TRY(Core::BufferedFile::create(move(response))); Array<u8, 128> buffer; while (!words_file->is_eof()) { |