summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/virtfs.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-24 19:27:07 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-24 19:27:07 +0300
commit6f58d1ee37041da28562d09757a9f653109f5677 (patch)
tree494b990338727f2adfdc7d7c6e46558be696aa29 /src/fs/virtfs/virtfs.cpp
parentd1b635ebf238fac5911fde8982d067ee4ffffe3a (diff)
downloadplus-6f58d1ee37041da28562d09757a9f653109f5677.tar.gz
plus-6f58d1ee37041da28562d09757a9f653109f5677.tar.bz2
plus-6f58d1ee37041da28562d09757a9f653109f5677.tar.xz
plus-6f58d1ee37041da28562d09757a9f653109f5677.zip
Improve VirtFs::getFilesWithDir.
Diffstat (limited to 'src/fs/virtfs/virtfs.cpp')
-rw-r--r--src/fs/virtfs/virtfs.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/fs/virtfs/virtfs.cpp b/src/fs/virtfs/virtfs.cpp
index b4807afe7..1f7bde683 100644
--- a/src/fs/virtfs/virtfs.cpp
+++ b/src/fs/virtfs/virtfs.cpp
@@ -183,6 +183,29 @@ namespace VirtFs
}
}
+ void getFilesWithDir(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->getFilesWithDir(entry, rootDir, list);
+ }
+ }
+
+
void getDirs(std::string dirName,
StringVect &list)
{