[ox/fs] Add FileSystem::ls(const String&)
This commit is contained in:
parent
304a43a4b4
commit
28dc5552d4
4
deps/ox/src/ox/fs/filesystem/filesystem.cpp
vendored
4
deps/ox/src/ox/fs/filesystem/filesystem.cpp
vendored
@ -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:
|
||||||
|
2
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
2
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user