diff options
author | bunnei <bunneidev@gmail.com> | 2018-07-08 05:24:51 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-07-08 05:24:51 +0200 |
commit | 913896cbd99e414c325c9d47a987376ed6d9fffd (patch) | |
tree | b660920a49f538f0ee00486c50a0d153d53c423d /src/core/file_sys/vfs_offset.h | |
parent | Merge pull request #632 from FearlessTobi/add-discord-link (diff) | |
download | yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar.gz yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar.bz2 yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar.lz yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar.xz yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.tar.zst yuzu-913896cbd99e414c325c9d47a987376ed6d9fffd.zip |
Diffstat (limited to 'src/core/file_sys/vfs_offset.h')
-rw-r--r-- | src/core/file_sys/vfs_offset.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/core/file_sys/vfs_offset.h b/src/core/file_sys/vfs_offset.h deleted file mode 100644 index adc615b38..000000000 --- a/src/core/file_sys/vfs_offset.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/file_sys/vfs.h" - -namespace FileSys { - -// An implementation of VfsFile that wraps around another VfsFile at a certain offset. -// Similar to seeking to an offset. -// If the file is writable, operations that would write past the end of the offset file will expand -// the size of this wrapper. -struct OffsetVfsFile : public VfsFile { - OffsetVfsFile(std::shared_ptr<VfsFile> file, size_t size, size_t offset = 0, - const std::string& new_name = ""); - - std::string GetName() const override; - size_t GetSize() const override; - bool Resize(size_t new_size) override; - std::shared_ptr<VfsDirectory> GetContainingDirectory() const override; - bool IsWritable() const override; - bool IsReadable() const override; - size_t Read(u8* data, size_t length, size_t offset) const override; - size_t Write(const u8* data, size_t length, size_t offset) override; - boost::optional<u8> ReadByte(size_t offset) const override; - std::vector<u8> ReadBytes(size_t size, size_t offset) const override; - std::vector<u8> ReadAllBytes() const override; - bool WriteByte(u8 data, size_t offset) override; - size_t WriteBytes(std::vector<u8> data, size_t offset) override; - - bool Rename(const std::string& name) override; - - size_t GetOffset() const; - -private: - size_t TrimToFit(size_t r_size, size_t r_offset) const; - - std::shared_ptr<VfsFile> file; - size_t offset; - size_t size; - std::string name; -}; - -} // namespace FileSys |