summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/virtfile.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-29 17:16:27 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-29 17:16:27 +0300
commitd9c0d1c3b2800b0c995393426b65a031203ca2f0 (patch)
treeae5a5bab4a7a2ef5fbb9229fa5ce153f0178d011 /src/fs/virtfs/virtfile.cpp
parentd1fb04c1d91596706ebf402acfdab24dabad19f4 (diff)
downloadplus-d9c0d1c3b2800b0c995393426b65a031203ca2f0.tar.gz
plus-d9c0d1c3b2800b0c995393426b65a031203ca2f0.tar.bz2
plus-d9c0d1c3b2800b0c995393426b65a031203ca2f0.tar.xz
plus-d9c0d1c3b2800b0c995393426b65a031203ca2f0.zip
Merge virtfileprivate with virtfile.
Because now physfs is gone and nothing to hide from other code.
Diffstat (limited to 'src/fs/virtfs/virtfile.cpp')
-rw-r--r--src/fs/virtfs/virtfile.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/fs/virtfs/virtfile.cpp b/src/fs/virtfs/virtfile.cpp
index b60db8c99..957392bef 100644
--- a/src/fs/virtfs/virtfile.cpp
+++ b/src/fs/virtfs/virtfile.cpp
@@ -20,17 +20,32 @@
#include "fs/virtfs/virtfile.h"
-#include "fs/virtfs/virtfileprivate.h"
-
#include "debug.h"
-VirtFile::VirtFile(const VirtFsFuncs *restrict const funcs0) :
+VirtFile::VirtFile(const VirtFsFuncs *restrict const funcs0,
+ const uint8_t *restrict const buf,
+ const size_t sz) :
+ funcs(funcs0),
+ mBuf(buf),
+ mPos(0U),
+ mSize(sz),
+ mFd(FILEHDEFAULT)
+{
+}
+
+VirtFile::VirtFile(const VirtFsFuncs *restrict const funcs0,
+ FILEHTYPE fd) :
funcs(funcs0),
- mPrivate(nullptr)
+ mBuf(nullptr),
+ mPos(0U),
+ mSize(0U),
+ mFd(fd)
{
}
VirtFile::~VirtFile()
{
- delete mPrivate;
+ if (mFd != FILEHDEFAULT)
+ FILECLOSE(mFd);
+ delete [] mBuf;
}