diff options
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/GMLPlayground/main.cpp | 2 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/Editor.cpp | 2 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/Git/GitWidget.cpp | 2 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/HackStudioWidget.cpp | 4 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp | 7 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/LanguageServers/FileDB.h | 2 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/ProjectBuilder.cpp | 4 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/ProjectConfig.cpp | 3 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/ProjectFile.cpp | 3 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/Profile.cpp | 2 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/SourceModel.cpp | 4 | ||||
-rw-r--r-- | Userland/DevTools/SQLStudio/ScriptEditor.cpp | 4 | ||||
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/main.cpp | 2 |
13 files changed, 22 insertions, 19 deletions
diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index 4bb2bb2246..f1c9a7d5b0 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -157,7 +157,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) save_as_action->activate(); return; } - auto response = FileSystemAccessClient::Client::the().request_file(window, file_path, Core::Stream::OpenMode::Truncate | Core::Stream::OpenMode::Write); + auto response = FileSystemAccessClient::Client::the().request_file(window, file_path, Core::File::OpenMode::Truncate | Core::File::OpenMode::Write); if (response.is_error()) return; diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index 4fe98a0b61..83bb54c955 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -232,7 +232,7 @@ void Editor::show_documentation_tooltip_if_available(DeprecatedString const& hov } dbgln_if(EDITOR_DEBUG, "opening {}", it->value); - auto file_or_error = Core::Stream::File::open(it->value, Core::Stream::OpenMode::Read); + auto file_or_error = Core::File::open(it->value, Core::File::OpenMode::Read); if (file_or_error.is_error()) { dbgln("Failed to open {}, {}", it->value, file_or_error.error()); return; diff --git a/Userland/DevTools/HackStudio/Git/GitWidget.cpp b/Userland/DevTools/HackStudio/Git/GitWidget.cpp index e079a84dd5..2afe716263 100644 --- a/Userland/DevTools/HackStudio/Git/GitWidget.cpp +++ b/Userland/DevTools/HackStudio/Git/GitWidget.cpp @@ -155,7 +155,7 @@ void GitWidget::set_view_diff_callback(ViewDiffCallback callback) void GitWidget::show_diff(DeprecatedString const& file_path) { if (!m_git_repo->is_tracked(file_path)) { - auto file = Core::Stream::File::open(file_path, Core::Stream::OpenMode::Read).release_value_but_fixme_should_propagate_errors(); + auto file = Core::File::open(file_path, Core::File::OpenMode::Read).release_value_but_fixme_should_propagate_errors(); auto content = file->read_until_eof().release_value_but_fixme_should_propagate_errors(); m_view_diff_callback("", Diff::generate_only_additions(content)); return; diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 464baebc50..deeda7935b 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -550,7 +550,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_new_file_action(Dep filepath = DeprecatedString::formatted("{}{}", filepath, filename); - auto file_or_error = Core::Stream::File::open(filepath, Core::Stream::OpenMode::Write | Core::Stream::OpenMode::MustBeNew); + auto file_or_error = Core::File::open(filepath, Core::File::OpenMode::Write | Core::File::OpenMode::MustBeNew); if (file_or_error.is_error()) { GUI::MessageBox::show_error(window(), DeprecatedString::formatted("Failed to create '{}': {}", filepath, file_or_error.error())); return; @@ -1791,7 +1791,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_open_project_config if (maybe_error.is_error() && maybe_error.error().code() != EEXIST) return maybe_error.release_error(); - auto file = TRY(Core::Stream::File::open(absolute_config_file_path, Core::Stream::OpenMode::Write)); + auto file = TRY(Core::File::open(absolute_config_file_path, Core::File::OpenMode::Write)); TRY(file->write_entire_buffer( "{\n" " \"build_command\": \"your build command here\",\n" diff --git a/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp b/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp index 27c2091c2b..15673d56a5 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp +++ b/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp @@ -9,6 +9,7 @@ #include <AK/Debug.h> #include <AK/LexicalPath.h> #include <AK/NonnullRefPtr.h> +#include <LibCore/File.h> namespace LanguageServers { @@ -74,13 +75,13 @@ DeprecatedString FileDB::to_absolute_path(DeprecatedString const& filename) cons ErrorOr<NonnullRefPtr<GUI::TextDocument>> FileDB::create_from_filesystem(DeprecatedString const& filename) const { - auto file = TRY(Core::Stream::File::open(to_absolute_path(filename), Core::Stream::OpenMode::Read)); + auto file = TRY(Core::File::open(to_absolute_path(filename), Core::File::OpenMode::Read)); return create_from_file(move(file)); } ErrorOr<NonnullRefPtr<GUI::TextDocument>> FileDB::create_from_fd(int fd) const { - auto file = TRY(Core::Stream::File::adopt_fd(fd, Core::Stream::OpenMode::Read)); + auto file = TRY(Core::File::adopt_fd(fd, Core::File::OpenMode::Read)); return create_from_file(move(file)); } @@ -101,7 +102,7 @@ public: }; static DefaultDocumentClient s_default_document_client; -ErrorOr<NonnullRefPtr<GUI::TextDocument>> FileDB::create_from_file(NonnullOwnPtr<Core::Stream::File> file) const +ErrorOr<NonnullRefPtr<GUI::TextDocument>> FileDB::create_from_file(NonnullOwnPtr<Core::File> file) const { auto content = TRY(file->read_until_eof()); auto document = GUI::TextDocument::create(&s_default_document_client); diff --git a/Userland/DevTools/HackStudio/LanguageServers/FileDB.h b/Userland/DevTools/HackStudio/LanguageServers/FileDB.h index 86cbaf4357..8cb3302c64 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/FileDB.h +++ b/Userland/DevTools/HackStudio/LanguageServers/FileDB.h @@ -34,7 +34,7 @@ public: private: ErrorOr<NonnullRefPtr<GUI::TextDocument>> create_from_filesystem(DeprecatedString const& filename) const; ErrorOr<NonnullRefPtr<GUI::TextDocument>> create_from_fd(int fd) const; - ErrorOr<NonnullRefPtr<GUI::TextDocument>> create_from_file(NonnullOwnPtr<Core::Stream::File>) const; + ErrorOr<NonnullRefPtr<GUI::TextDocument>> create_from_file(NonnullOwnPtr<Core::File>) const; static RefPtr<GUI::TextDocument> create_with_content(DeprecatedString const&); private: diff --git a/Userland/DevTools/HackStudio/ProjectBuilder.cpp b/Userland/DevTools/HackStudio/ProjectBuilder.cpp index 8fc1c05812..5c714c9753 100644 --- a/Userland/DevTools/HackStudio/ProjectBuilder.cpp +++ b/Userland/DevTools/HackStudio/ProjectBuilder.cpp @@ -112,7 +112,7 @@ ErrorOr<void> ProjectBuilder::build_serenity_component() ErrorOr<DeprecatedString> ProjectBuilder::component_name(StringView cmake_file_path) { - auto file = TRY(Core::Stream::File::open(cmake_file_path, Core::Stream::OpenMode::Read)); + auto file = TRY(Core::File::open(cmake_file_path, Core::File::OpenMode::Read)); auto content = TRY(file->read_until_eof()); static Regex<ECMA262> const component_name(R"~~~(serenity_component\([\s]*(\w+)[\s\S]*\))~~~"); @@ -135,7 +135,7 @@ ErrorOr<void> ProjectBuilder::initialize_build_directory() if (Core::DeprecatedFile::exists(cmake_file_path)) MUST(Core::DeprecatedFile::remove(cmake_file_path, Core::DeprecatedFile::RecursionMode::Disallowed)); - auto cmake_file = TRY(Core::Stream::File::open(cmake_file_path, Core::Stream::OpenMode::Write)); + auto cmake_file = TRY(Core::File::open(cmake_file_path, Core::File::OpenMode::Write)); TRY(cmake_file->write_entire_buffer(generate_cmake_file_content().bytes())); TRY(m_terminal->run_command(DeprecatedString::formatted("cmake -S {} -DHACKSTUDIO_BUILD=ON -DHACKSTUDIO_BUILD_CMAKE_FILE={}" diff --git a/Userland/DevTools/HackStudio/ProjectConfig.cpp b/Userland/DevTools/HackStudio/ProjectConfig.cpp index 2171c03b21..5eacf415ae 100644 --- a/Userland/DevTools/HackStudio/ProjectConfig.cpp +++ b/Userland/DevTools/HackStudio/ProjectConfig.cpp @@ -6,6 +6,7 @@ #include "ProjectConfig.h" #include <AK/NonnullOwnPtr.h> +#include <LibCore/File.h> #include <LibCore/Stream.h> namespace HackStudio { @@ -17,7 +18,7 @@ ProjectConfig::ProjectConfig(JsonObject config) ErrorOr<NonnullOwnPtr<ProjectConfig>> ProjectConfig::try_load_project_config(DeprecatedString path) { - auto file = TRY(Core::Stream::File::open(path, Core::Stream::OpenMode::Read)); + auto file = TRY(Core::File::open(path, Core::File::OpenMode::Read)); auto file_contents = TRY(file->read_until_eof()); auto json = TRY(JsonValue::from_string(file_contents)); diff --git a/Userland/DevTools/HackStudio/ProjectFile.cpp b/Userland/DevTools/HackStudio/ProjectFile.cpp index a7c5129347..768085b08c 100644 --- a/Userland/DevTools/HackStudio/ProjectFile.cpp +++ b/Userland/DevTools/HackStudio/ProjectFile.cpp @@ -5,6 +5,7 @@ */ #include "ProjectFile.h" +#include <LibCore/File.h> #include <LibCore/Stream.h> namespace HackStudio { @@ -54,7 +55,7 @@ void ProjectFile::create_document_if_needed() const return; m_document = CodeDocument::create(m_name); - auto file_or_error = Core::Stream::File::open(m_name, Core::Stream::OpenMode::Read); + auto file_or_error = Core::File::open(m_name, Core::File::OpenMode::Read); if (file_or_error.is_error()) { warnln("Couldn't open '{}': {}", m_name, file_or_error.error()); // This is okay though, we'll just go with an empty document and create the file when saving. diff --git a/Userland/DevTools/Profiler/Profile.cpp b/Userland/DevTools/Profiler/Profile.cpp index 2247fbf1b7..9d512f029c 100644 --- a/Userland/DevTools/Profiler/Profile.cpp +++ b/Userland/DevTools/Profiler/Profile.cpp @@ -236,7 +236,7 @@ OwnPtr<Debug::DebugInfo> g_kernel_debug_info; ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path) { - auto file = TRY(Core::Stream::File::open(path, Core::Stream::OpenMode::Read)); + auto file = TRY(Core::File::open(path, Core::File::OpenMode::Read)); auto json = JsonValue::from_string(TRY(file->read_until_eof())); if (json.is_error() || !json.value().is_object()) diff --git a/Userland/DevTools/Profiler/SourceModel.cpp b/Userland/DevTools/Profiler/SourceModel.cpp index ca478adc24..87d60dc373 100644 --- a/Userland/DevTools/Profiler/SourceModel.cpp +++ b/Userland/DevTools/Profiler/SourceModel.cpp @@ -29,8 +29,8 @@ public: DeprecatedString source_file_name = filename.replace("../../"sv, source_root_path, ReplaceMode::FirstOnly); auto try_read_lines = [&]() -> ErrorOr<void> { - auto unbuffered_file = TRY(Core::Stream::File::open(source_file_name, Core::Stream::OpenMode::Read)); - auto file = TRY(Core::Stream::BufferedFile::create(move(unbuffered_file))); + auto unbuffered_file = TRY(Core::File::open(source_file_name, Core::File::OpenMode::Read)); + auto file = TRY(Core::BufferedFile::create(move(unbuffered_file))); Array<u8, 1024> buffer; while (!file->is_eof()) diff --git a/Userland/DevTools/SQLStudio/ScriptEditor.cpp b/Userland/DevTools/SQLStudio/ScriptEditor.cpp index 0ad9807301..3c8261b901 100644 --- a/Userland/DevTools/SQLStudio/ScriptEditor.cpp +++ b/Userland/DevTools/SQLStudio/ScriptEditor.cpp @@ -29,7 +29,7 @@ void ScriptEditor::new_script_with_temp_name(DeprecatedString name) ErrorOr<void> ScriptEditor::open_script_from_file(LexicalPath const& file_path) { - auto file = TRY(Core::Stream::File::open(file_path.string(), Core::Stream::OpenMode::Read)); + auto file = TRY(Core::File::open(file_path.string(), Core::File::OpenMode::Read)); auto buffer = TRY(file->read_until_eof()); set_text({ buffer.bytes() }); @@ -40,7 +40,7 @@ ErrorOr<void> ScriptEditor::open_script_from_file(LexicalPath const& file_path) static ErrorOr<void> save_text_to_file(StringView filename, DeprecatedString text) { - auto file = TRY(Core::Stream::File::open(filename, Core::Stream::OpenMode::Write)); + auto file = TRY(Core::File::open(filename, Core::File::OpenMode::Write)); if (!text.is_empty()) TRY(file->write_entire_buffer(text.bytes())); diff --git a/Userland/DevTools/UserspaceEmulator/main.cpp b/Userland/DevTools/UserspaceEmulator/main.cpp index eda37b6d7e..52e497f69d 100644 --- a/Userland/DevTools/UserspaceEmulator/main.cpp +++ b/Userland/DevTools/UserspaceEmulator/main.cpp @@ -61,7 +61,7 @@ int main(int argc, char** argv, char** env) OwnPtr<Vector<int>> profile_string_id_map; if (dump_profile) { - auto profile_stream_or_error = Core::Stream::File::open(profile_dump_path, Core::Stream::OpenMode::Write); + auto profile_stream_or_error = Core::File::open(profile_dump_path, Core::File::OpenMode::Write); if (profile_stream_or_error.is_error()) { warnln("Failed to open '{}' for writing: {}", profile_dump_path, profile_stream_or_error.error()); return 1; |