Added the Options Enum advice.

This commit is contained in:
Jan Kevin Dick
2019-11-26 13:03:43 +01:00
parent 8b4ef5f706
commit d5a25f2053
11 changed files with 45 additions and 39 deletions

View File

@@ -70,6 +70,12 @@ public:
LINK_SYMBOLIC = 1 /// symbolic link
};
enum Options
/// Options for File Copy/Movement
{
OPT_FAIL_ON_OVERWRITE = 0x01
};
File();
/// Creates the file.
@@ -183,7 +189,7 @@ public:
///
/// Does nothing on Windows.
void copyTo(const std::string& path, bool failOnOverwrite = false) const;
void copyTo(const std::string& path, int options = 0) const;
/// Copies the file (or directory) to the given path.
/// The target path can be a directory.
///
@@ -191,13 +197,13 @@ public:
/// If failOnOverwrite is set the Method throws an FileExists Exception
/// if the File already exists.
void moveTo(const std::string& path, bool failOnOverwrite = false);
void moveTo(const std::string& path, int options = 0);
/// Copies the file (or directory) to the given path and
/// removes the original file. The target path can be a directory.
/// If failOnOverwrite is set the Method throws an FileExists Exception
/// if the File already exists.
void renameTo(const std::string& path, bool failOnOverwrite = false);
void renameTo(const std::string& path, int options = 0);
/// Renames the file to the new name.
/// If failOnOverwrite is set the Method throws an FileExists Exception
/// if the File already exists.
@@ -259,7 +265,7 @@ public:
/// exception for the last file-related error.
protected:
void copyDirectory(const std::string& path, bool failOnOverwrite = false) const;
void copyDirectory(const std::string& path, int options = 0) const;
/// Copies a directory. Used internally by copyTo().
};