From 0e54aa17e64a5c5b62d60a70414742be29eccff9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 8 Dec 2020 18:36:49 -0500 Subject: file_util: Migrate Exists() and IsDirectory() over to std::filesystem Greatly simplifies our file-handling code for these functions. --- src/common/file_util.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/common/file_util.h') 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 #include +#include #include #include #include @@ -47,11 +48,11 @@ struct FSTEntry { std::vector 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); -- cgit v1.2.3