From e6198149823ee18e4167b0e6dd34cfb7f2e2f496 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 25 Feb 2017 19:10:51 +0300 Subject: Implement basic VirtFsZip for virtual fs based on zip archives. Api similar to VirtFs. For now unused. --- src/fs/virtfileprivate.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/fs/virtfileprivate.cpp') diff --git a/src/fs/virtfileprivate.cpp b/src/fs/virtfileprivate.cpp index 5ebb234cc..4be55fc1b 100644 --- a/src/fs/virtfileprivate.cpp +++ b/src/fs/virtfileprivate.cpp @@ -27,18 +27,37 @@ VirtFilePrivate::VirtFilePrivate() : mFile(nullptr), + mBuf(nullptr), + mPos(0U), + mSize(0U), mFd(-1) { } VirtFilePrivate::VirtFilePrivate(const int fd) : mFile(nullptr), + mBuf(nullptr), + mPos(0U), + mSize(0U), mFd(fd) { } VirtFilePrivate::VirtFilePrivate(PHYSFS_file *restrict const file) : mFile(file), + mBuf(nullptr), + mPos(0U), + mSize(0U), + mFd(-1) +{ +} + +VirtFilePrivate::VirtFilePrivate(uint8_t *restrict const buf, + const size_t sz) : + mFile(nullptr), + mBuf(buf), + mPos(0U), + mSize(sz), mFd(-1) { } @@ -49,4 +68,6 @@ VirtFilePrivate::~VirtFilePrivate() PHYSFS_close(mFile); if (mFd != -1) close(mFd); + if (mBuf) + delete [] mBuf; } -- cgit v1.2.3-70-g09d2