1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibFileSystemAccessClient: Add functions returning FSAC::File

This patch reimplements the now deprecated try_open_file(),
try_request_file() and try_request_file_read_only_approved() functions,
with the difference that the new ones return a FSAC::File object
(currently a wrapper with a Core::Stream and a filename) instead of a
Core::File.

Implemented in a similar manner to 6dd716adf2.
This commit is contained in:
Karol Kosek 2022-12-17 00:52:07 +01:00 committed by Sam Atkins
parent 2cbe2dd3c0
commit 86f6586c6e
2 changed files with 73 additions and 0 deletions

View file

@ -51,6 +51,9 @@ public:
DeprecatedResult try_open_file_deprecated(GUI::Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::OpenMode requested_access = Core::OpenMode::ReadOnly);
DeprecatedResult try_save_file_deprecated(GUI::Window* parent_window, DeprecatedString const& name, DeprecatedString const ext, Core::OpenMode requested_access = Core::OpenMode::WriteOnly | Core::OpenMode::Truncate);
Result request_file_read_only_approved(GUI::Window* parent_window, DeprecatedString const& path);
Result request_file(GUI::Window* parent_window, DeprecatedString const& path, Core::Stream::OpenMode requested_access);
Result open_file(GUI::Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::Stream::OpenMode requested_access = Core::Stream::OpenMode::Read);
Result save_file(GUI::Window* parent_window, DeprecatedString const& name, DeprecatedString const ext, Core::Stream::OpenMode requested_access = Core::Stream::OpenMode::Write | Core::Stream::OpenMode::Truncate);
static Client& the();