diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-04-24 17:04:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-04-24 17:04:47 +0300 |
commit | d1b635ebf238fac5911fde8982d067ee4ffffe3a (patch) | |
tree | 788b6c6733550f5a54d5b3552a909a141af1223c /src/fs/virtfs/virtfs.cpp | |
parent | 0835e09ee3a6c83ffa01454f2c05597e6195b07d (diff) | |
download | manaverse-d1b635ebf238fac5911fde8982d067ee4ffffe3a.tar.gz manaverse-d1b635ebf238fac5911fde8982d067ee4ffffe3a.tar.bz2 manaverse-d1b635ebf238fac5911fde8982d067ee4ffffe3a.tar.xz manaverse-d1b635ebf238fac5911fde8982d067ee4ffffe3a.zip |
Improve VirtFs::getDirs.
Diffstat (limited to 'src/fs/virtfs/virtfs.cpp')
-rw-r--r-- | src/fs/virtfs/virtfs.cpp | 22 |
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); |