From 2317fbe9d29f5bea76a2ba05b40841b11de1a6f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 10 Jan 2014 01:50:12 +0300 Subject: fix dirs and files enumeration in some systems. --- src/utils/files.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/utils/files.cpp') diff --git a/src/utils/files.cpp b/src/utils/files.cpp index 9abf13593..39451b129 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -208,6 +208,17 @@ void Files::getFiles(const std::string &path, StringVect &list) PhysFs::freeList(fonts); } +void Files::getDirs(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(*i); + } + PhysFs::freeList(fonts); +} + void Files::getFilesWithDir(const std::string &path, StringVect &list) { char **fonts = PhysFs::enumerateFiles(path.c_str()); -- cgit v1.2.3-70-g09d2