diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-06 13:29:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-06 13:29:14 +0300 |
commit | 3cb15a8f777bd9907d8dc4ba57774c762ec1f67f (patch) | |
tree | ec991d4a6c5c9a528163dad15a284674d478e64b /src/utils/files.cpp | |
parent | 5ab85579f493e951d0042cd879cc848d4c7c871b (diff) | |
download | mv-3cb15a8f777bd9907d8dc4ba57774c762ec1f67f.tar.gz mv-3cb15a8f777bd9907d8dc4ba57774c762ec1f67f.tar.bz2 mv-3cb15a8f777bd9907d8dc4ba57774c762ec1f67f.tar.xz mv-3cb15a8f777bd9907d8dc4ba57774c762ec1f67f.zip |
simplify files enumerate function usage.
Diffstat (limited to 'src/utils/files.cpp')
-rw-r--r-- | src/utils/files.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/utils/files.cpp b/src/utils/files.cpp index 206a4d4bd..72a4b2cb5 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -22,10 +22,10 @@ #if defined(ANDROID) || defined(__native_client__) #include "resources/resourcemanager.h" -#include "utils/physfstools.h" #endif #include "utils/mkdir.h" +#include "utils/physfstools.h" #include "localconsts.h" @@ -196,3 +196,14 @@ int Files::copyFile(const std::string &restrict srcName, fclose(dstFile); return 0; } + +void Files::getFiles(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); +} |