diff --git a/source/coral/files.cpp b/source/coral/files.cpp index b41e2e0..0df5bb9 100644 --- a/source/coral/files.cpp +++ b/source/coral/files.cpp @@ -144,41 +144,22 @@ export namespace coral { * Platform-generalized file system interface. */ struct fs { - /** - * Descriptor of the various rules that the file-system enforces over access to its files. - */ - struct access_rules { - bool can_read; - - bool can_write; - }; - - enum class [[nodiscard]] walk_result { - ok, - not_implemented, - access_denied, - not_found, - io_error, - }; + using walker = closure, io_error>()>; virtual ~fs() {}; - virtual walk_result walk_files(path const & target_path, closure const & apply) { - return walk_result::not_implemented; - } - /** - * Queries the file-system for its global [access_rules], returning them. + * */ - virtual access_rules query_access() = 0; + virtual void walk_files(path const & target_path, closure const & then) {} /** - * Attempts to read the file in `file_path`, calling `then` if it was successfully opened for reading. + * Attempts to read the file in `target_path`, calling `then` if it was successfully opened for reading. */ virtual void read_file(path const & target_path, closure const & then) {} /** - * Attempts to write the file in the file system located at `file_path`, calling `then` if it was successfully + * Attempts to write the file in the file system located at `target_path`, calling `then` if it was successfully * opened for writing. */ virtual void write_file(path const & target_path, closure const & then) {}