FileSystem: Add Error to CreateDirectory()/RenamePath()

This commit is contained in:
Stenzek
2024-03-31 15:50:13 +10:00
parent 3ecc19c43f
commit eb504143c1
2 changed files with 53 additions and 25 deletions

View File

@@ -89,7 +89,7 @@ bool DirectoryIsEmpty(const char* path);
bool DeleteFile(const char* path);
/// Rename file
bool RenamePath(const char* OldPath, const char* NewPath);
bool RenamePath(const char* OldPath, const char* NewPath, Error* error = nullptr);
/// Deleter functor for managed file pointers
struct FileDeleter
@@ -151,11 +151,11 @@ bool WriteStringToFile(const char* filename, const std::string_view& sv);
/// if the directory already exists, the return value will be true.
/// if Recursive is specified, all parent directories will be created
/// if they do not exist.
bool CreateDirectory(const char* path, bool recursive);
bool CreateDirectory(const char* path, bool recursive, Error* error = nullptr);
/// Creates a directory if it doesn't already exist.
/// Returns false if it does not exist and creation failed.
bool EnsureDirectoryExists(const char* path, bool recursive);
bool EnsureDirectoryExists(const char* path, bool recursive, Error* error = nullptr);
/// Removes a directory.
bool DeleteDirectory(const char* path);