forked from eden-emu/eden
file_util: Migrate Exists() and IsDirectory() over to std::filesystem
Greatly simplifies our file-handling code for these functions.
This commit is contained in:
parent
aeb100cffe
commit
0e54aa17e6
2 changed files with 13 additions and 57 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue