[ox/fs] Improve const-correctness of FileSystem

This commit is contained in:
2022-01-26 01:27:31 -06:00
parent 9ee7cd5d53
commit f687134943
5 changed files with 39 additions and 39 deletions

View File

@ -51,10 +51,10 @@ class PassThroughFS: public FileSystem {
Result<const char*> directAccess(uint64_t) noexcept override;
Result<Vector<String>> ls(const char *dir) noexcept override;
Result<Vector<String>> ls(const char *dir) const noexcept override;
template<typename F>
Error ls(const char *dir, F cb) noexcept;
Error ls(const char *dir, F cb) const noexcept;
Error remove(const char *path, bool recursive = false) noexcept override;
@ -64,13 +64,13 @@ class PassThroughFS: public FileSystem {
Error write(uint64_t inode, const void *buffer, uint64_t size, FileType fileType = FileType::NormalFile) noexcept override;
Result<FileStat> stat(uint64_t inode) noexcept override;
Result<FileStat> stat(uint64_t inode) const noexcept override;
Result<FileStat> stat(const char *path) noexcept override;
Result<FileStat> stat(const char *path) const noexcept override;
uint64_t spaceNeeded(uint64_t size) noexcept override;
uint64_t spaceNeeded(uint64_t size) const noexcept override;
Result<uint64_t> available() noexcept override;
Result<uint64_t> available() const noexcept override;
Result<uint64_t> size() const noexcept override;
@ -90,7 +90,7 @@ class PassThroughFS: public FileSystem {
};
template<typename F>
Error PassThroughFS::ls(const char *dir, F cb) noexcept {
Error PassThroughFS::ls(const char *dir, F cb) const noexcept {
std::error_code ec;
const auto di = std::filesystem::directory_iterator(m_path / stripSlash(dir), ec);
oxReturnError(OxError(ec.value(), "PassThroughFS: ls failed"));