diff options
author | Brad King <brad.king@kitware.com> | 2021-03-04 13:23:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-03-04 13:47:31 (GMT) |
commit | 3600c6cd8c09e501faa06be5f98465e994d51569 (patch) | |
tree | 1b67331f5bc6dfa2893e94b97b1fa0ae08469dd0 /Source/cmSystemTools.h | |
parent | c61292726cd3018ec502f8d59e62352c8dce62d3 (diff) | |
download | CMake-3600c6cd8c09e501faa06be5f98465e994d51569.zip CMake-3600c6cd8c09e501faa06be5f98465e994d51569.tar.gz CMake-3600c6cd8c09e501faa06be5f98465e994d51569.tar.bz2 |
cmSystemTools: Add RenameFile option to not replace destination
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index bb90135..3cc032c 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -128,9 +128,15 @@ public: static bool SimpleGlob(const std::string& glob, std::vector<std::string>& files, int type = 0); + enum class Replace + { + Yes, + No, + }; enum class RenameResult { Success, + NoReplace, Failure, }; @@ -139,7 +145,8 @@ public: static bool RenameFile(const std::string& oldname, const std::string& newname); static RenameResult RenameFile(std::string const& oldname, - std::string const& newname, std::string* err); + std::string const& newname, Replace replace, + std::string* err = nullptr); //! Rename a file if contents are different, delete the source otherwise static void MoveFileIfDifferent(const std::string& source, |