[ox/fs] Cleanup

This commit is contained in:
Gary Talent 2021-05-03 14:56:00 -04:00
parent d01ff63527
commit c1418cdd6c
3 changed files with 8 additions and 3 deletions

View File

@ -6,6 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <ox/std/error.hpp>
#include <ox/std/utility.hpp>
#include "filesystem.hpp"
@ -36,9 +37,9 @@ Error FileSystem::read(const FileAddress &addr, void *buffer, std::size_t size)
}
}
Result<Vector<char>> FileSystem::read(const FileAddress &addr) noexcept {
Result<Buffer> FileSystem::read(const FileAddress &addr) noexcept {
oxRequire(s, stat(addr));
ox::Vector<char> buff(s.size);
Buffer buff(s.size);
oxReturnError(read(addr, buff.data(), buff.size()));
return ox::move(buff);
}

View File

@ -8,6 +8,8 @@
#pragma once
#include <ox/std/buffer.hpp>
#include <ox/fs/filestore/filestoretemplate.hpp>
#include <ox/fs/filesystem/filelocation.hpp>
#include <ox/fs/filesystem/types.hpp>
@ -42,7 +44,7 @@ class FileSystem {
Error read(const FileAddress &addr, void *buffer, std::size_t size) noexcept;
Result<Vector<char>> read(const FileAddress &addr) noexcept;
Result<Buffer> read(const FileAddress &addr) noexcept;
Error read(const FileAddress &addr, std::size_t readStart, std::size_t readSize, void *buffer, std::size_t *size) noexcept;

View File

@ -6,6 +6,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <ox/std/error.hpp>
#include "passthroughfs.hpp"
#if defined(OX_HAS_PASSTHROUGHFS)