mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 21:58:48 +00:00
Add warning flags to File deletion functions
Adds a flag to File::Delete and File::DeleteDir functions to control whether a console warning is emitted when the file or directory doesn't exist. The flag is optional and true by default to match current behavior.
This commit is contained in:
parent
c434eefe94
commit
4a55511e18
2 changed files with 20 additions and 6 deletions
|
@ -136,12 +136,20 @@ bool CreateDir(const std::string& filename);
|
|||
// Creates the full path of fullPath returns true on success
|
||||
bool CreateFullPath(const std::string& fullPath);
|
||||
|
||||
enum class IfAbsentBehavior
|
||||
{
|
||||
ConsoleWarning,
|
||||
NoConsoleWarning
|
||||
};
|
||||
|
||||
// Deletes a given filename, return true on success
|
||||
// Doesn't supports deleting a directory
|
||||
bool Delete(const std::string& filename);
|
||||
bool Delete(const std::string& filename,
|
||||
IfAbsentBehavior behavior = IfAbsentBehavior::ConsoleWarning);
|
||||
|
||||
// Deletes a directory filename, returns true on success
|
||||
bool DeleteDir(const std::string& filename);
|
||||
bool DeleteDir(const std::string& filename,
|
||||
IfAbsentBehavior behavior = IfAbsentBehavior::ConsoleWarning);
|
||||
|
||||
// renames file srcFilename to destFilename, returns true on success
|
||||
bool Rename(const std::string& srcFilename, const std::string& destFilename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue