summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/virtfs.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-24 17:04:47 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-24 17:04:47 +0300
commitd1b635ebf238fac5911fde8982d067ee4ffffe3a (patch)
tree788b6c6733550f5a54d5b3552a909a141af1223c /src/fs/virtfs/virtfs.cpp
parent0835e09ee3a6c83ffa01454f2c05597e6195b07d (diff)
downloadmanaplus-d1b635ebf238fac5911fde8982d067ee4ffffe3a.tar.gz
manaplus-d1b635ebf238fac5911fde8982d067ee4ffffe3a.tar.bz2
manaplus-d1b635ebf238fac5911fde8982d067ee4ffffe3a.tar.xz
manaplus-d1b635ebf238fac5911fde8982d067ee4ffffe3a.zip
Improve VirtFs::getDirs.
Diffstat (limited to 'src/fs/virtfs/virtfs.cpp')
-rw-r--r--src/fs/virtfs/virtfs.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/fs/virtfs/virtfs.cpp b/src/fs/virtfs/virtfs.cpp
index e61069301..b4807afe7 100644
--- a/src/fs/virtfs/virtfs.cpp
+++ b/src/fs/virtfs/virtfs.cpp
@@ -183,6 +183,28 @@ namespace VirtFs
}
}
+ void getDirs(std::string dirName,
+ StringVect &list)
+ {
+ prepareFsPath(dirName);
+ if (checkPath(dirName) == false)
+ {
+ reportAlways("VirtFs::enumerateFiles invalid path: %s",
+ dirName.c_str());
+ return;
+ }
+
+ std::string rootDir = dirName;
+ if (findLast(rootDir, std::string(dirSeparator)) == false)
+ rootDir += dirSeparator;
+
+ FOR_EACH (std::vector<VirtFsEntry*>::const_iterator, it, mEntries)
+ {
+ VirtFsEntry *const entry = *it;
+ entry->funcs->getDirs(entry, rootDir, list);
+ }
+ }
+
bool isDirectory(std::string name)
{
prepareFsPath(name);