summaryrefslogtreecommitdiff
path: root/src/fs/virtfs.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-01 00:09:28 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-01 00:09:28 +0300
commitaf8edd3f2f53cb2ece9a7b1f6a62bd5e7ce57a9a (patch)
tree0074b8eb5fea7f48f44dd81bc5089316e81aafd0 /src/fs/virtfs.cpp
parentdb31c2f832dd4067e4670dd469fe3b696188576b (diff)
downloadplus-af8edd3f2f53cb2ece9a7b1f6a62bd5e7ce57a9a.tar.gz
plus-af8edd3f2f53cb2ece9a7b1f6a62bd5e7ce57a9a.tar.bz2
plus-af8edd3f2f53cb2ece9a7b1f6a62bd5e7ce57a9a.tar.xz
plus-af8edd3f2f53cb2ece9a7b1f6a62bd5e7ce57a9a.zip
Impliment some functions in VirtFs with physfs disabled.
Diffstat (limited to 'src/fs/virtfs.cpp')
-rw-r--r--src/fs/virtfs.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/fs/virtfs.cpp b/src/fs/virtfs.cpp
index 3ba214dc7..69f379a08 100644
--- a/src/fs/virtfs.cpp
+++ b/src/fs/virtfs.cpp
@@ -87,12 +87,23 @@ namespace VirtFs
bool exists(const std::string &restrict name)
{
+#ifdef USE_PHYSFS
return VirtFsPhys::exists(name);
+#else // USE_PHYSFS
+ return VirtFsDir::exists(name) || VirtFsZip::exists(name);
+#endif // USE_PHYSFS
}
- VirtList *enumerateFiles(const std::string &restrict dir)
+ VirtList *enumerateFiles(const std::string &restrict dirName)
{
+#ifdef USE_PHYSFS
return VirtFsPhys::enumerateFiles(dir);
+#else // USE_PHYSFS
+ VirtList *const list = new VirtList;
+ VirtFsDir::enumerateFiles(dirName, list);
+ VirtFsZip::enumerateFiles(dirName, list);
+ return list;
+#endif // USE_PHYSFS
}
bool isDirectory(const std::string &restrict name)