summaryrefslogtreecommitdiff
path: root/src/fs/virtfs.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-27 18:16:39 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-27 18:16:39 +0300
commit6388446b85e1fa5deccc6d5c1683fba88ef53d99 (patch)
treedaaa6c764a34aece74de45dddc5b1e276d61774d /src/fs/virtfs.cpp
parent757069bdedabbd904e56d153e2e858db2a2cf2f1 (diff)
downloadplus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.tar.gz
plus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.tar.bz2
plus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.tar.xz
plus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.zip
Add functions pointers into VirtFile.
From VirtFs call if possible pointer from VirtFile.
Diffstat (limited to 'src/fs/virtfs.cpp')
-rw-r--r--src/fs/virtfs.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fs/virtfs.cpp b/src/fs/virtfs.cpp
index fa9df5ac2..833d31bd2 100644
--- a/src/fs/virtfs.cpp
+++ b/src/fs/virtfs.cpp
@@ -22,6 +22,7 @@
#include "fs/virtfsphys.h"
#include "fs/virtfile.h"
+#include "fs/virtfsfuncs.h"
#include "fs/virtlist.h"
#include "debug.h"
@@ -157,8 +158,7 @@ namespace VirtFs
{
if (file == nullptr)
return 0;
- delete file;
- return 1;
+ return file->funcs->close(file);
}
int64_t read(VirtFile *restrict const file,
@@ -166,7 +166,7 @@ namespace VirtFs
const uint32_t objSize,
const uint32_t objCount)
{
- return VirtFsPhys::read(file,
+ return file->funcs->read(file,
buffer,
objSize,
objCount);
@@ -177,7 +177,7 @@ namespace VirtFs
const uint32_t objSize,
const uint32_t objCount)
{
- return VirtFsPhys::write(file,
+ return file->funcs->write(file,
buffer,
objSize,
objCount);
@@ -185,23 +185,23 @@ namespace VirtFs
int64_t fileLength(VirtFile *restrict const file)
{
- return VirtFsPhys::fileLength(file);
+ return file->funcs->fileLength(file);
}
int64_t tell(VirtFile *restrict const file)
{
- return VirtFsPhys::tell(file);
+ return file->funcs->tell(file);
}
int seek(VirtFile *restrict const file,
const uint64_t pos)
{
- return VirtFsPhys::seek(file,
+ return file->funcs->seek(file,
pos);
}
int eof(VirtFile *restrict const file)
{
- return VirtFsPhys::eof(file);
+ return file->funcs->eof(file);
}
} // namespace VirtFs