summaryrefslogtreecommitdiff
path: root/src/common/file_util.h
diff options
context:
space:
mode:
authorGravatar bunnei2016-06-22 16:27:12 -0400
committerGravatar GitHub2016-06-22 16:27:12 -0400
commit4d31874c7c028f18c5336fe2f9d1edc934473c23 (patch)
treeee295fae7d41b782df99b1d15ad13f5da0c2c325 /src/common/file_util.h
parentMerge pull request #1922 from yuriks/microprofile-dpi-fix (diff)
parentFix recursive scanning of directories (diff)
downloadyuzu-4d31874c7c028f18c5336fe2f9d1edc934473c23.tar.gz
yuzu-4d31874c7c028f18c5336fe2f9d1edc934473c23.tar.xz
yuzu-4d31874c7c028f18c5336fe2f9d1edc934473c23.zip
Merge pull request #1923 from yuriks/fix-recursive
Fix recursive scanning of directories
Diffstat (limited to 'src/common/file_util.h')
-rw-r--r--src/common/file_util.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h
index 32ae2dc57..7ad7ee829 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -105,13 +105,11 @@ bool CreateEmptyFile(const std::string &filename);
105 * @param num_entries_out to be assigned by the callable with the number of iterated directory entries, never null 105 * @param num_entries_out to be assigned by the callable with the number of iterated directory entries, never null
106 * @param directory the path to the enclosing directory 106 * @param directory the path to the enclosing directory
107 * @param virtual_name the entry name, without any preceding directory info 107 * @param virtual_name the entry name, without any preceding directory info
108 * @param recursion Number of children directory to read before giving up
109 * @return whether handling the entry succeeded 108 * @return whether handling the entry succeeded
110 */ 109 */
111using DirectoryEntryCallable = std::function<bool(unsigned* num_entries_out, 110using DirectoryEntryCallable = std::function<bool(unsigned* num_entries_out,
112 const std::string& directory, 111 const std::string& directory,
113 const std::string& virtual_name, 112 const std::string& virtual_name)>;
114 unsigned int recursion)>;
115 113
116/** 114/**
117 * Scans a directory, calling the callback for each file/directory contained within. 115 * Scans a directory, calling the callback for each file/directory contained within.
@@ -119,10 +117,9 @@ using DirectoryEntryCallable = std::function<bool(unsigned* num_entries_out,
119 * @param num_entries_out assigned by the function with the number of iterated directory entries, can be null 117 * @param num_entries_out assigned by the function with the number of iterated directory entries, can be null
120 * @param directory the directory to scan 118 * @param directory the directory to scan
121 * @param callback The callback which will be called for each entry 119 * @param callback The callback which will be called for each entry
122 * @param recursion Number of children directories to read before giving up
123 * @return whether scanning the directory succeeded 120 * @return whether scanning the directory succeeded
124 */ 121 */
125bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directory, DirectoryEntryCallable callback, unsigned int recursion = 0); 122bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directory, DirectoryEntryCallable callback);
126 123
127/** 124/**
128 * Scans the directory tree, storing the results. 125 * Scans the directory tree, storing the results.