diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-25 19:10:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-25 19:11:57 +0300 |
commit | e6198149823ee18e4167b0e6dd34cfb7f2e2f496 (patch) | |
tree | 013181d9d8e4f06433838cffaabf6159aa2f775b /src/fs/virtfileprivate.cpp | |
parent | 0bb68a88e6dc6a04685825e80b4e3dca1dc097d2 (diff) | |
download | manaverse-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.tar.gz manaverse-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.tar.bz2 manaverse-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.tar.xz manaverse-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.zip |
Implement basic VirtFsZip for virtual fs based on zip archives.
Api similar to VirtFs.
For now unused.
Diffstat (limited to 'src/fs/virtfileprivate.cpp')
-rw-r--r-- | src/fs/virtfileprivate.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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; } |