[ox/fs] Add FileSystem::ls(const String&)

This commit is contained in:
Gary Talent 2021-04-17 17:35:21 -05:00
parent 304a43a4b4
commit 28dc5552d4
2 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,10 @@ Error FileSystem::read(FileAddress addr, std::size_t readStart, std::size_t read
} }
} }
Result<Vector<String>> FileSystem::ls(const ox::String &dir) noexcept {
return ls(dir.c_str());
}
Error FileSystem::remove(FileAddress addr, bool recursive) noexcept { Error FileSystem::remove(FileAddress addr, bool recursive) noexcept {
switch (addr.type()) { switch (addr.type()) {
case FileAddressType::Inode: case FileAddressType::Inode:

View File

@ -46,6 +46,8 @@ class FileSystem {
Result<const uint8_t*> read(FileAddress addr) noexcept; Result<const uint8_t*> read(FileAddress addr) noexcept;
Result<Vector<String>> ls(const ox::String &dir) noexcept;
virtual Result<Vector<String>> ls(const char *dir) noexcept = 0; virtual Result<Vector<String>> ls(const char *dir) noexcept = 0;
virtual Error remove(const char *path, bool recursive = false) noexcept = 0; virtual Error remove(const char *path, bool recursive = false) noexcept = 0;