diff options
author | Lioncash <mathew1800@gmail.com> | 2020-12-08 18:36:49 -0500 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-12-08 18:36:53 -0500 |
commit | 0e54aa17e64a5c5b62d60a70414742be29eccff9 (patch) | |
tree | 13c55de6081891fa19afe4526fa83328520c9026 /src/common/file_util.h | |
parent | aeb100cffe2495d35f4d38d4212e7a101b0d600f (diff) |
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.h | 9 |
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 @@ #include <array> #include <cstdio> +#include <filesystem> #include <fstream> #include <functional> #include <limits> @@ -47,11 +48,11 @@ struct FSTEntry { std::vector<FSTEntry> children; }; -// Returns true if file filename exists -[[nodiscard]] bool Exists(const std::string& filename); +// Returns true if the exists +[[nodiscard]] bool Exists(const std::filesystem::path& path); -// Returns true if filename is a directory -[[nodiscard]] bool IsDirectory(const std::string& filename); +// Returns true if path is a directory +[[nodiscard]] bool IsDirectory(const std::filesystem::path& path); // Returns the size of filename (64bit) [[nodiscard]] u64 GetSize(const std::string& filename); |