diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-13 18:10:19 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-18 14:09:11 (GMT) |
commit | 216416219ae438ec5e93a1e125298fa0b5fd64d9 (patch) | |
tree | e261b3d50b62af1c826b4d4a633bee541046c96d /Source/cmFileTimeComparison.cxx | |
parent | 31602583930b6c517c439ae8c15df26043031345 (diff) | |
download | CMake-216416219ae438ec5e93a1e125298fa0b5fd64d9.zip CMake-216416219ae438ec5e93a1e125298fa0b5fd64d9.tar.gz CMake-216416219ae438ec5e93a1e125298fa0b5fd64d9.tar.bz2 |
Rename cmFileTimeComparison to cmFileTimeCache
The name `cmFileTimeCache` reflects the functionality of the class more
appropriately.
Diffstat (limited to 'Source/cmFileTimeComparison.cxx')
-rw-r--r-- | Source/cmFileTimeComparison.cxx | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx deleted file mode 100644 index 2115029..0000000 --- a/Source/cmFileTimeComparison.cxx +++ /dev/null @@ -1,59 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmFileTimeComparison.h" - -#include <string> -#include <unordered_map> -#include <utility> - -cmFileTimeComparison::cmFileTimeComparison() = default; - -cmFileTimeComparison::~cmFileTimeComparison() = default; - -bool cmFileTimeComparison::Load(std::string const& fileName, - cmFileTime& fileTime) -{ - // Use the stored time if available. - { - auto fit = this->FileTimes.find(fileName); - if (fit != this->FileTimes.end()) { - fileTime = fit->second; - return true; - } - } - // Read file time from OS - if (!fileTime.Load(fileName)) { - return false; - } - // Store file time in cache - this->FileTimes[fileName] = fileTime; - return true; -} - -bool cmFileTimeComparison::FileTimeCompare(std::string const& f1, - std::string const& f2, int* result) -{ - // Get the modification time for each file. - cmFileTime ft1, ft2; - if (this->Load(f1, ft1) && this->Load(f2, ft2)) { - // Compare the two modification times. - *result = ft1.Compare(ft2); - return true; - } - // No comparison available. Default to the same time. - *result = 0; - return false; -} - -bool cmFileTimeComparison::FileTimesDiffer(std::string const& f1, - std::string const& f2) -{ - // Get the modification time for each file. - cmFileTime ft1, ft2; - if (this->Load(f1, ft1) && this->Load(f2, ft2)) { - // Compare the two modification times. - return ft1.DifferS(ft2); - } - // No comparison available. Default to different times. - return true; -} |