[ox/fs] Add FileSystem::exists
This commit is contained in:
parent
49b859ecf5
commit
af634bd4e5
15
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
15
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
@ -99,6 +99,21 @@ class FileSystem {
|
||||
|
||||
Result<FileStat> stat(const FileAddress &addr) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
inline bool exists(uint64_t inode) const noexcept {
|
||||
return statInode(inode).ok();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline bool exists(ox::StringView path) const noexcept {
|
||||
return statPath(path).ok();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline bool exists(FileAddress const&addr) const noexcept {
|
||||
return stat(addr).ok();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
virtual uint64_t spaceNeeded(uint64_t size) const noexcept = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user