summaryrefslogtreecommitdiffstats
path: root/src/common/file_util.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-09-06 08:59:04 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-05-21 17:41:02 +0200
commit8ab6f26c09e5b77a051fa545570ca2986c45bf4a (patch)
treea0664d2b9bb548cbd7f78ed60b846a88c09f90f4 /src/common/file_util.h
parentAppveyor: Restore working directory after test_script (#1835) (diff)
downloadyuzu-8ab6f26c09e5b77a051fa545570ca2986c45bf4a.tar
yuzu-8ab6f26c09e5b77a051fa545570ca2986c45bf4a.tar.gz
yuzu-8ab6f26c09e5b77a051fa545570ca2986c45bf4a.tar.bz2
yuzu-8ab6f26c09e5b77a051fa545570ca2986c45bf4a.tar.lz
yuzu-8ab6f26c09e5b77a051fa545570ca2986c45bf4a.tar.xz
yuzu-8ab6f26c09e5b77a051fa545570ca2986c45bf4a.tar.zst
yuzu-8ab6f26c09e5b77a051fa545570ca2986c45bf4a.zip
Diffstat (limited to '')
-rw-r--r--src/common/file_util.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h
index c6a8694ce..32ae2dc57 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -105,11 +105,13 @@ bool CreateEmptyFile(const std::string &filename);
* @param num_entries_out to be assigned by the callable with the number of iterated directory entries, never null
* @param directory the path to the enclosing directory
* @param virtual_name the entry name, without any preceding directory info
+ * @param recursion Number of children directory to read before giving up
* @return whether handling the entry succeeded
*/
using DirectoryEntryCallable = std::function<bool(unsigned* num_entries_out,
const std::string& directory,
- const std::string& virtual_name)>;
+ const std::string& virtual_name,
+ unsigned int recursion)>;
/**
* Scans a directory, calling the callback for each file/directory contained within.
@@ -117,20 +119,22 @@ using DirectoryEntryCallable = std::function<bool(unsigned* num_entries_out,
* @param num_entries_out assigned by the function with the number of iterated directory entries, can be null
* @param directory the directory to scan
* @param callback The callback which will be called for each entry
+ * @param recursion Number of children directories to read before giving up
* @return whether scanning the directory succeeded
*/
-bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directory, DirectoryEntryCallable callback);
+bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directory, DirectoryEntryCallable callback, unsigned int recursion = 0);
/**
* Scans the directory tree, storing the results.
* @param directory the parent directory to start scanning from
* @param parent_entry FSTEntry where the filesystem tree results will be stored.
+ * @param recursion Number of children directories to read before giving up.
* @return the total number of files/directories found
*/
-unsigned ScanDirectoryTree(const std::string &directory, FSTEntry& parent_entry);
+unsigned ScanDirectoryTree(const std::string &directory, FSTEntry& parent_entry, unsigned int recursion = 0);
// deletes the given directory and anything under it. Returns true on success.
-bool DeleteDirRecursively(const std::string &directory);
+bool DeleteDirRecursively(const std::string &directory, unsigned int recursion = 256);
// Returns the current directory
std::string GetCurrentDir();