diff options
author | Brad King <brad.king@kitware.com> | 2021-03-03 20:51:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-03-04 13:26:21 (GMT) |
commit | 0c2dc345047135cac824ffc222bfb0c26f6c23be (patch) | |
tree | 93ea6aed747d653102dbd11b666c334f786f9331 /Source/cmSystemTools.h | |
parent | adc351db8f89c3c41190df381c65800e7514e126 (diff) | |
download | CMake-0c2dc345047135cac824ffc222bfb0c26f6c23be.zip CMake-0c2dc345047135cac824ffc222bfb0c26f6c23be.tar.gz CMake-0c2dc345047135cac824ffc222bfb0c26f6c23be.tar.bz2 |
cmSystemTools: Add RenameFile signature to capture the error message
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 5bbbb0c..bb90135 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -128,10 +128,18 @@ public: static bool SimpleGlob(const std::string& glob, std::vector<std::string>& files, int type = 0); + enum class RenameResult + { + Success, + Failure, + }; + /** Rename a file or directory within a single disk volume (atomic if possible). */ 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); //! Rename a file if contents are different, delete the source otherwise static void MoveFileIfDifferent(const std::string& source, |