1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:37:35 +00:00

LibCore+Everywhere: Move OpenMode out of IODevice

...and make it an enum class so people don't omit "OpenMode".
This commit is contained in:
Ali Mohammad Pur 2021-05-12 13:56:43 +04:30 committed by Linus Groh
parent 422ef7904e
commit a91a49337c
113 changed files with 180 additions and 177 deletions

View file

@ -483,7 +483,7 @@ String ChessWidget::get_fen() const
bool ChessWidget::import_pgn(const StringView& import_path)
{
auto file_or_error = Core::File::open(import_path, Core::File::OpenMode::ReadOnly);
auto file_or_error = Core::File::open(import_path, Core::OpenMode::ReadOnly);
if (file_or_error.is_error()) {
warnln("Couldn't open '{}': {}", import_path, file_or_error.error());
return false;
@ -588,7 +588,7 @@ bool ChessWidget::import_pgn(const StringView& import_path)
bool ChessWidget::export_pgn(const StringView& export_path) const
{
auto file_or_error = Core::File::open(export_path, Core::File::WriteOnly);
auto file_or_error = Core::File::open(export_path, Core::OpenMode::WriteOnly);
if (file_or_error.is_error()) {
warnln("Couldn't open '{}': {}", export_path, file_or_error.error());
return false;

View file

@ -49,11 +49,11 @@ Engine::Engine(const StringView& command)
close(rpipefds[1]);
auto infile = Core::File::construct();
infile->open(rpipefds[0], Core::IODevice::ReadOnly, Core::File::ShouldCloseFileDescriptor::Yes);
infile->open(rpipefds[0], Core::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescriptor::Yes);
set_in(infile);
auto outfile = Core::File::construct();
outfile->open(wpipefds[1], Core::IODevice::WriteOnly, Core::File::ShouldCloseFileDescriptor::Yes);
outfile->open(wpipefds[1], Core::OpenMode::WriteOnly, Core::File::ShouldCloseFileDescriptor::Yes);
set_out(outfile);
send_command(Chess::UCI::UCICommand());