diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-06 14:47:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-06 14:47:39 +0300 |
commit | b7ee14cadb1e5675f7e36565aec1fe39e55ccc34 (patch) | |
tree | d92328178a64cd15891802ced4a0db5a0a751e11 /src/utils | |
parent | 3cb15a8f777bd9907d8dc4ba57774c762ec1f67f (diff) | |
download | manaverse-b7ee14cadb1e5675f7e36565aec1fe39e55ccc34.tar.gz manaverse-b7ee14cadb1e5675f7e36565aec1fe39e55ccc34.tar.bz2 manaverse-b7ee14cadb1e5675f7e36565aec1fe39e55ccc34.tar.xz manaverse-b7ee14cadb1e5675f7e36565aec1fe39e55ccc34.zip |
add ability to inlude config parts from subdirs for items, monsters, npcs.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/files.cpp | 11 | ||||
-rw-r--r-- | src/utils/files.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/files.cpp b/src/utils/files.cpp index 72a4b2cb5..9abf13593 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -207,3 +207,14 @@ void Files::getFiles(const std::string &path, StringVect &list) } PhysFs::freeList(fonts); } + +void Files::getFilesWithDir(const std::string &path, StringVect &list) +{ + char **fonts = PhysFs::enumerateFiles(path.c_str()); + for (char **i = fonts; *i; i++) + { + if (!PhysFs::isDirectory((path + *i).c_str())) + list.push_back(path + *i); + } + PhysFs::freeList(fonts); +} diff --git a/src/utils/files.h b/src/utils/files.h index b7b5bbc31..9363f96da 100644 --- a/src/utils/files.h +++ b/src/utils/files.h @@ -56,6 +56,9 @@ namespace Files const std::string &restrict pTo); void getFiles(const std::string &path, StringVect &list); + + void getFilesWithDir(const std::string &restrict path, + StringVect &restrict list); } // namespace Files #endif // UTILS_FILES_H |