diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-03-04 16:51:03 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2021-03-09 14:47:26 (GMT) |
commit | 100016e9cb31aad7b642a9733409c7294cd6652f (patch) | |
tree | aaecf7949a2822a9e277512369db417f1069900e /Source/cmSystemTools.h | |
parent | b5f60c54d02ba9df7f2ba67200efb97446e0417a (diff) | |
download | CMake-100016e9cb31aad7b642a9733409c7294cd6652f.zip CMake-100016e9cb31aad7b642a9733409c7294cd6652f.tar.gz CMake-100016e9cb31aad7b642a9733409c7294cd6652f.tar.bz2 |
cmSystemTools: add utilities to copy a file with error handling
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 3cc032c..2ff4c5d 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -128,6 +128,24 @@ public: static bool SimpleGlob(const std::string& glob, std::vector<std::string>& files, int type = 0); + enum class CopyWhen + { + Always, + OnlyIfDifferent, + }; + enum class CopyResult + { + Success, + Failure, + }; + + /** Copy a file. */ + static bool CopySingleFile(const std::string& oldname, + const std::string& newname); + static CopyResult CopySingleFile(std::string const& oldname, + std::string const& newname, CopyWhen when, + std::string* err = nullptr); + enum class Replace { Yes, |