From 858ba9fe8d25e7ade45c5bb16752ad0cdf2fe73a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 18 Apr 2021 15:03:45 -0500 Subject: [PATCH] [ox/fs] Rename Result FileSystem::read to directAccess --- deps/ox/src/ox/fs/filesystem/filesystem.hpp | 14 +++++++------- deps/ox/src/ox/fs/filesystem/passthroughfs.cpp | 8 ++++---- deps/ox/src/ox/fs/filesystem/passthroughfs.hpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/deps/ox/src/ox/fs/filesystem/filesystem.hpp b/deps/ox/src/ox/fs/filesystem/filesystem.hpp index 8261ffea..a76100aa 100644 --- a/deps/ox/src/ox/fs/filesystem/filesystem.hpp +++ b/deps/ox/src/ox/fs/filesystem/filesystem.hpp @@ -32,13 +32,13 @@ class FileSystem { virtual Error read(const char *path, void *buffer, std::size_t buffSize) noexcept = 0; - virtual Result read(const char *path) noexcept = 0; + virtual Result directAccess(const char *path) noexcept = 0; virtual Error read(uint64_t inode, void *buffer, std::size_t size) noexcept = 0; virtual Error read(uint64_t inode, std::size_t readStart, std::size_t readSize, void *buffer, std::size_t *size) noexcept = 0; - virtual Result read(uint64_t inode) noexcept = 0; + virtual Result directAccess(uint64_t inode) noexcept = 0; Error read(FileAddress addr, void *buffer, std::size_t size) noexcept; @@ -122,13 +122,13 @@ class FileSystemTemplate: public FileSystem { Error read(const char *path, void *buffer, std::size_t buffSize) noexcept override; - Result read(const char*) noexcept override; + Result directAccess(const char*) noexcept override; Error read(uint64_t inode, void *buffer, std::size_t size) noexcept override; Error read(uint64_t inode, std::size_t readStart, std::size_t readSize, void *buffer, std::size_t *size) noexcept override; - Result read(uint64_t) noexcept override; + Result directAccess(uint64_t) noexcept override; Result> ls(const char *dir) noexcept override; @@ -247,13 +247,13 @@ Error FileSystemTemplate::read(const char *path, void *buf } template -Result FileSystemTemplate::read(const char *path) noexcept { +Result FileSystemTemplate::directAccess(const char *path) noexcept { auto fd = fileSystemData(); oxReturnError(fd.error); Directory rootDir(m_fs, fd.value.rootDirInode); auto [inode, err] = rootDir.find(path); oxReturnError(err); - return read(inode); + return directAccess(inode); } template @@ -267,7 +267,7 @@ Error FileSystemTemplate::read(uint64_t inode, std::size_t } template -Result FileSystemTemplate::read(uint64_t inode) noexcept { +Result FileSystemTemplate::directAccess(uint64_t inode) noexcept { auto data = m_fs.read(inode); if (!data.valid()) { return OxError(1); diff --git a/deps/ox/src/ox/fs/filesystem/passthroughfs.cpp b/deps/ox/src/ox/fs/filesystem/passthroughfs.cpp index f2a03758..66367323 100644 --- a/deps/ox/src/ox/fs/filesystem/passthroughfs.cpp +++ b/deps/ox/src/ox/fs/filesystem/passthroughfs.cpp @@ -74,8 +74,8 @@ Error PassThroughFS::read(const char *path, void *buffer, std::size_t buffSize) return OxError(0); } -Result PassThroughFS::read(const char*) noexcept { - return OxError(1); +Result PassThroughFS::directAccess(const char*) noexcept { + return OxError(1, "PassThroughFS::directAccess not supported"); } Error PassThroughFS::read(uint64_t, void*, std::size_t) noexcept { @@ -88,8 +88,8 @@ Error PassThroughFS::read(uint64_t, std::size_t, std::size_t, void*, std::size_t return OxError(1); } -Result PassThroughFS::read(uint64_t) noexcept { - return OxError(1); +Result PassThroughFS::directAccess(uint64_t) noexcept { + return OxError(1, "PassThroughFS::directAccess not supported"); } Result> PassThroughFS::ls(const char *dir) noexcept { diff --git a/deps/ox/src/ox/fs/filesystem/passthroughfs.hpp b/deps/ox/src/ox/fs/filesystem/passthroughfs.hpp index f62a0d04..2745aa34 100644 --- a/deps/ox/src/ox/fs/filesystem/passthroughfs.hpp +++ b/deps/ox/src/ox/fs/filesystem/passthroughfs.hpp @@ -43,13 +43,13 @@ class PassThroughFS: public FileSystem { Error read(const char *path, void *buffer, std::size_t buffSize) noexcept override; - Result read(const char*) noexcept override; + Result directAccess(const char*) noexcept override; Error read(uint64_t inode, void *buffer, std::size_t size) noexcept override; Error read(uint64_t inode, std::size_t readStart, std::size_t readSize, void *buffer, std::size_t *size) noexcept override; - Result read(uint64_t) noexcept override; + Result directAccess(uint64_t) noexcept override; Result> ls(const char *dir) noexcept override;