[ox/fs] Add FileSystem::exists
This commit is contained in:
parent
f6235304a0
commit
7eaa7b36c0
@ -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…
x
Reference in New Issue
Block a user