mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Load files from subfolders in texturepacks
Updated and rebased version of a PR by red-001
This commit is contained in:
parent
ae9b1aa177
commit
05d93c7fa1
7 changed files with 63 additions and 19 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue