summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.h
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2021-03-04 16:51:03 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2021-03-09 14:47:26 (GMT)
commit100016e9cb31aad7b642a9733409c7294cd6652f (patch)
treeaaecf7949a2822a9e277512369db417f1069900e /Source/cmSystemTools.h
parentb5f60c54d02ba9df7f2ba67200efb97446e0417a (diff)
downloadCMake-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.h18
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,