summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-23 12:51:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-23 12:53:17 (GMT)
commitd1a570f18c47bb840fc19a9979d3970fbaa7e58a (patch)
tree81e86463acb8b4ec9293c2349d71b40092adb3f3 /Source/cmFileCommand.cxx
parentd7e70d01fe510b6f5760a88cc6f244cbc0ed5f32 (diff)
parent5b53cfda247f7d688a058f358628639a431313a8 (diff)
downloadCMake-d1a570f18c47bb840fc19a9979d3970fbaa7e58a.zip
CMake-d1a570f18c47bb840fc19a9979d3970fbaa7e58a.tar.gz
CMake-d1a570f18c47bb840fc19a9979d3970fbaa7e58a.tar.bz2
Merge topic 'cmFileTimes'
5b53cfda24 cmSystemTools: Remove cmSystemToolsFileTime interface 9c576a88d9 Use cmFileTimes instead of cmSystemToolsFileTime interface 4b45a5d5c7 cmFileTimes: New RAII based cmFileTimes class Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3358
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx19
1 files changed, 5 insertions, 14 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 17a6a74..c0e263a 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -25,6 +25,7 @@
#include "cmFileCopier.h"
#include "cmFileInstaller.h"
#include "cmFileLockPool.h"
+#include "cmFileTimes.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmHexFileConverter.h"
@@ -52,8 +53,6 @@
# include <windows.h>
#endif
-class cmSystemToolsFileTime;
-
#if defined(_WIN32)
// libcurl doesn't support file:// urls for unicode filenames on Windows.
// Convert string from UTF-8 to ACP if this is a file:// URL.
@@ -1114,8 +1113,7 @@ bool cmFileCommand::HandleRPathChangeCommand(
return false;
}
bool success = true;
- cmSystemToolsFileTime* ft = cmSystemTools::FileTimeNew();
- bool have_ft = cmSystemTools::FileTimeGet(file, ft);
+ cmFileTimes const ft(file);
std::string emsg;
bool changed;
if (!cmSystemTools::ChangeRPath(file, oldRPath, newRPath, &emsg, &changed)) {
@@ -1139,11 +1137,8 @@ bool cmFileCommand::HandleRPathChangeCommand(
message += "\"";
this->Makefile->DisplayStatus(message, -1);
}
- if (have_ft) {
- cmSystemTools::FileTimeSet(file, ft);
- }
+ ft.Store(file);
}
- cmSystemTools::FileTimeDelete(ft);
return success;
}
@@ -1182,8 +1177,7 @@ bool cmFileCommand::HandleRPathRemoveCommand(
return false;
}
bool success = true;
- cmSystemToolsFileTime* ft = cmSystemTools::FileTimeNew();
- bool have_ft = cmSystemTools::FileTimeGet(file, ft);
+ cmFileTimes const ft(file);
std::string emsg;
bool removed;
if (!cmSystemTools::RemoveRPath(file, &emsg, &removed)) {
@@ -1203,11 +1197,8 @@ bool cmFileCommand::HandleRPathRemoveCommand(
message += "\"";
this->Makefile->DisplayStatus(message, -1);
}
- if (have_ft) {
- cmSystemTools::FileTimeSet(file, ft);
- }
+ ft.Store(file);
}
- cmSystemTools::FileTimeDelete(ft);
return success;
}