diff options
author | number Zero <silverunicorn2011@yandex.ru> | 2017-09-13 23:03:18 +0300 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-11-17 19:23:08 +0000 |
commit | 05d93c7fa1be9245dd5211b7dc1bdf0961b39eea (patch) | |
tree | cbf354caa6c100f2e1e5c524d2f959913f52ac0e /src/filesys.h | |
parent | ae9b1aa1774aedca8f452514d9462c281e36773a (diff) | |
download | minetest-05d93c7fa1be9245dd5211b7dc1bdf0961b39eea.tar.gz minetest-05d93c7fa1be9245dd5211b7dc1bdf0961b39eea.tar.bz2 minetest-05d93c7fa1be9245dd5211b7dc1bdf0961b39eea.zip |
Load files from subfolders in texturepacks
Updated and rebased version of a PR by red-001
Diffstat (limited to 'src/filesys.h')
-rw-r--r-- | src/filesys.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/filesys.h b/src/filesys.h index 5f246e387..09f129aa3 100644 --- a/src/filesys.h +++ b/src/filesys.h @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once +#include <set> #include <string> #include <vector> #include "exceptions.h" @@ -66,10 +67,23 @@ bool DeleteSingleFileOrEmptyDirectory(const std::string &path); // Returns path to temp directory, can return "" on error std::string TempPath(); +/* Returns a list of subdirectories, including the path itself, but excluding + hidden directories (whose names start with . or _) +*/ +void GetRecursiveDirs(std::vector<std::string> &dirs, const std::string &dir); +std::vector<std::string> GetRecursiveDirs(const std::string &dir); + /* Multiplatform */ -// The path itself not included -void GetRecursiveSubPaths(const std::string &path, std::vector<std::string> &dst); +/* The path itself not included, returns a list of all subpaths. + dst - vector that contains all the subpaths. + list files - include files in the list of subpaths. + ignore - paths that start with these charcters will not be listed. +*/ +void GetRecursiveSubPaths(const std::string &path, + std::vector<std::string> &dst, + bool list_files, + const std::set<char> &ignore = {}); // Tries to delete all, returns false if any failed bool DeletePaths(const std::vector<std::string> &paths); |