diff options
author | Lioncash <mathew1800@gmail.com> | 2018-07-21 22:36:19 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-07-21 22:42:08 -0400 |
commit | 0ba7fe4ab11d5c7a934a1b45b374f3277bc9f2cf (patch) | |
tree | 3753ff286d37c247cde5c6be66740641bba587c1 /src/common/file_util.h | |
parent | 964154ce44cfa25bd59c6fa10113e948a3b43d5c (diff) |
file_util: Use a u64 to represent number of entries
This avoids a truncating cast on size. I doubt we'd ever traverse a
directory this large, however we also shouldn't truncate sizes away.
Diffstat (limited to 'src/common/file_util.h')
-rw-r--r-- | src/common/file_util.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h index ff01bf0ff7..090907c033 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -84,7 +84,7 @@ bool CreateEmptyFile(const std::string& filename); * @return whether handling the entry succeeded */ using DirectoryEntryCallable = std::function<bool( - unsigned* num_entries_out, const std::string& directory, const std::string& virtual_name)>; + u64* num_entries_out, const std::string& directory, const std::string& virtual_name)>; /** * Scans a directory, calling the callback for each file/directory contained within. @@ -95,7 +95,7 @@ using DirectoryEntryCallable = std::function<bool( * @param callback The callback which will be called for each entry * @return whether scanning the directory succeeded */ -bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directory, +bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory, DirectoryEntryCallable callback); /** @@ -105,8 +105,8 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directo * @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 int recursion = 0); +u64 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, unsigned int recursion = 256); |