mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 19:37:35 +00:00
LibCore: Move Stream-based file into the Core
namespace
This commit is contained in:
parent
a96339b72b
commit
606a3982f3
218 changed files with 748 additions and 643 deletions
|
@ -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()));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue