diff --git a/deps/ox/src/ox/fs/filesystem/filesystem.cpp b/deps/ox/src/ox/fs/filesystem/filesystem.cpp index 35f5c527..7772b1c5 100644 --- a/deps/ox/src/ox/fs/filesystem/filesystem.cpp +++ b/deps/ox/src/ox/fs/filesystem/filesystem.cpp @@ -13,7 +13,7 @@ namespace ox { -Result MemFS::directAccess(const FileAddress &addr) noexcept { +Result MemFS::directAccess(const FileAddress &addr) const noexcept { switch (addr.type()) { case FileAddressType::Inode: return directAccess(addr.getInode().value); diff --git a/deps/ox/src/ox/fs/filesystem/filesystem.hpp b/deps/ox/src/ox/fs/filesystem/filesystem.hpp index 18f291db..a9dbeb82 100644 --- a/deps/ox/src/ox/fs/filesystem/filesystem.hpp +++ b/deps/ox/src/ox/fs/filesystem/filesystem.hpp @@ -126,20 +126,20 @@ class FileSystem { class MemFS: public FileSystem { public: - Result directAccess(const FileAddress &addr) noexcept; + Result directAccess(const FileAddress &addr) const noexcept; - inline Result directAccess(CRStringView path) noexcept { + inline Result directAccess(CRStringView path) const noexcept { return directAccessPath(path); } - inline Result directAccess(uint64_t inode) noexcept { + inline Result directAccess(uint64_t inode) const noexcept { return directAccessInode(inode); } protected: - virtual Result directAccessPath(CRStringView path) noexcept = 0; + virtual Result directAccessPath(CRStringView path) const noexcept = 0; - virtual Result directAccessInode(uint64_t inode) noexcept = 0; + virtual Result directAccessInode(uint64_t inode) const noexcept = 0; }; /** @@ -177,13 +177,13 @@ class FileSystemTemplate: public MemFS { Error readFilePath(CRStringView path, void *buffer, std::size_t buffSize) noexcept override; - Result directAccessPath(CRStringView) noexcept override; + Result directAccessPath(CRStringView) const noexcept override; Error readFileInode(uint64_t inode, void *buffer, std::size_t size) noexcept override; Error readFileInodeRange(uint64_t inode, std::size_t readStart, std::size_t readSize, void *buffer, std::size_t *size) noexcept override; - Result directAccessInode(uint64_t) noexcept override; + Result directAccessInode(uint64_t) const noexcept override; Result> ls(CRStringView dir) const noexcept override; @@ -302,7 +302,7 @@ Error FileSystemTemplate::readFilePath(CRStringView path, } template -Result FileSystemTemplate::directAccessPath(CRStringView path) noexcept { +Result FileSystemTemplate::directAccessPath(CRStringView path) const noexcept { oxRequire(fd, fileSystemData()); Directory rootDir(m_fs, fd.rootDirInode); oxRequire(inode, rootDir.find(path)); @@ -324,7 +324,7 @@ Error FileSystemTemplate::readFileInodeRange(uint64_t inod } template -Result FileSystemTemplate::directAccessInode(uint64_t inode) noexcept { +Result FileSystemTemplate::directAccessInode(uint64_t inode) const noexcept { auto data = m_fs.read(inode); if (!data.valid()) { return OxError(1, "Data not valid");