summaryrefslogtreecommitdiff
path: root/src/common/file_util.h
diff options
context:
space:
mode:
authorGravatar Lioncash2020-12-08 18:36:49 -0500
committerGravatar Lioncash2020-12-08 18:36:53 -0500
commit0e54aa17e64a5c5b62d60a70414742be29eccff9 (patch)
tree13c55de6081891fa19afe4526fa83328520c9026 /src/common/file_util.h
parentMerge pull request #5171 from lat9nq/ci-unicorn-cleanup (diff)
downloadyuzu-0e54aa17e64a5c5b62d60a70414742be29eccff9.tar.gz
yuzu-0e54aa17e64a5c5b62d60a70414742be29eccff9.tar.xz
yuzu-0e54aa17e64a5c5b62d60a70414742be29eccff9.zip
file_util: Migrate Exists() and IsDirectory() over to std::filesystem
Greatly simplifies our file-handling code for these functions.
Diffstat (limited to 'src/common/file_util.h')
-rw-r--r--src/common/file_util.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h
index 840cde2a6..be0906434 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -6,6 +6,7 @@
6 6
7#include <array> 7#include <array>
8#include <cstdio> 8#include <cstdio>
9#include <filesystem>
9#include <fstream> 10#include <fstream>
10#include <functional> 11#include <functional>
11#include <limits> 12#include <limits>
@@ -47,11 +48,11 @@ struct FSTEntry {
47 std::vector<FSTEntry> children; 48 std::vector<FSTEntry> children;
48}; 49};
49 50
50// Returns true if file filename exists 51// Returns true if the exists
51[[nodiscard]] bool Exists(const std::string& filename); 52[[nodiscard]] bool Exists(const std::filesystem::path& path);
52 53
53// Returns true if filename is a directory 54// Returns true if path is a directory
54[[nodiscard]] bool IsDirectory(const std::string& filename); 55[[nodiscard]] bool IsDirectory(const std::filesystem::path& path);
55 56
56// Returns the size of filename (64bit) 57// Returns the size of filename (64bit)
57[[nodiscard]] u64 GetSize(const std::string& filename); 58[[nodiscard]] u64 GetSize(const std::string& filename);