vfs_offset: don't record parent directory

This commit is contained in:
Liam 2024-02-26 20:49:06 -05:00
parent 1bec420695
commit be0e37dc63
2 changed files with 4 additions and 6 deletions

View File

@ -9,9 +9,8 @@
namespace FileSys {
OffsetVfsFile::OffsetVfsFile(VirtualFile file_, std::size_t size_, std::size_t offset_,
std::string name_, VirtualDir parent_)
: file(file_), offset(offset_), size(size_), name(std::move(name_)),
parent(parent_ == nullptr ? file->GetContainingDirectory() : std::move(parent_)) {}
std::string name_)
: file(file_), offset(offset_), size(size_), name(std::move(name_)) {}
OffsetVfsFile::~OffsetVfsFile() = default;
@ -37,7 +36,7 @@ bool OffsetVfsFile::Resize(std::size_t new_size) {
}
VirtualDir OffsetVfsFile::GetContainingDirectory() const {
return parent;
return nullptr;
}
bool OffsetVfsFile::IsWritable() const {

View File

@ -16,7 +16,7 @@ namespace FileSys {
class OffsetVfsFile : public VfsFile {
public:
OffsetVfsFile(VirtualFile file, std::size_t size, std::size_t offset = 0,
std::string new_name = "", VirtualDir new_parent = nullptr);
std::string new_name = "");
~OffsetVfsFile() override;
std::string GetName() const override;
@ -44,7 +44,6 @@ private:
std::size_t offset;
std::size_t size;
std::string name;
VirtualDir parent;
};
} // namespace FileSys