diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-05-12 13:56:43 +0430 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-12 11:00:45 +0100 |
commit | a91a49337c5992d64b30f493eea1eb492792b667 (patch) | |
tree | b665e2c0b31a9935ca8a8f8b5b71bbadf476e32f /Userland/Libraries/LibLine | |
parent | 422ef7904e9eb6be1182421a7529ed0d5e00991f (diff) | |
download | serenity-a91a49337c5992d64b30f493eea1eb492792b667.zip |
LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
Diffstat (limited to 'Userland/Libraries/LibLine')
-rw-r--r-- | Userland/Libraries/LibLine/Editor.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibLine/InternalFunctions.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index d516a3ac98..838ac82413 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -220,7 +220,7 @@ void Editor::add_to_history(const String& line) bool Editor::load_history(const String& path) { auto history_file = Core::File::construct(path); - if (!history_file->open(Core::IODevice::ReadOnly)) + if (!history_file->open(Core::OpenMode::ReadOnly)) return false; auto data = history_file->read_all(); auto hist = StringView { data.data(), data.size() }; @@ -279,7 +279,7 @@ bool Editor::save_history(const String& path) { Vector<HistoryEntry> final_history { { "", 0 } }; { - auto file_or_error = Core::File::open(path, Core::IODevice::ReadWrite, 0600); + auto file_or_error = Core::File::open(path, Core::OpenMode::ReadWrite, 0600); if (file_or_error.is_error()) return false; auto file = file_or_error.release_value(); @@ -294,7 +294,7 @@ bool Editor::save_history(const String& path) [](const HistoryEntry& left, const HistoryEntry& right) { return left.timestamp < right.timestamp; }); } - auto file_or_error = Core::File::open(path, Core::IODevice::WriteOnly, 0600); + auto file_or_error = Core::File::open(path, Core::OpenMode::WriteOnly, 0600); if (file_or_error.is_error()) return false; auto file = file_or_error.release_value(); diff --git a/Userland/Libraries/LibLine/InternalFunctions.cpp b/Userland/Libraries/LibLine/InternalFunctions.cpp index 8c0964078d..49806f543d 100644 --- a/Userland/Libraries/LibLine/InternalFunctions.cpp +++ b/Userland/Libraries/LibLine/InternalFunctions.cpp @@ -569,7 +569,7 @@ void Editor::edit_in_external_editor() } { - auto file_or_error = Core::File::open(file_path, Core::IODevice::OpenMode::ReadOnly); + auto file_or_error = Core::File::open(file_path, Core::OpenMode::ReadOnly); if (file_or_error.is_error()) return; |