file_util: Migrate Exists() and IsDirectory() over to std::filesystem

Greatly simplifies our file-handling code for these functions.
This commit is contained in:
Lioncash 2020-12-08 18:36:49 -05:00
parent aeb100cffe
commit 0e54aa17e6
2 changed files with 13 additions and 57 deletions

View file

@ -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);