Expose interface for querying access rules on coral::fs

This commit is contained in:
kayomn 2023-02-23 00:28:06 +00:00
parent 2f884f92a1
commit 2b1a34d5e2
1 changed files with 14 additions and 0 deletions

View File

@ -122,8 +122,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;
};
virtual ~fs() {};
/**
* Queries the file-system for its global [access_rules], returning them.
*/
virtual access_rules query_access() = 0;
/**
* Attempts to read the file in the file system located at `file_path` relative, calling
* `then` if it was successfully opened for reading.