diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-10-01 10:02:10 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-10-01 10:03:36 (GMT) |
commit | 23ad08dd6ce092f1ae7eff168bb2e0189a5dce9c (patch) | |
tree | a11713749c6a25e4129c21412743f8e86fc64170 /Source/cmFilePathChecksum.h | |
parent | dea0379a696e073fbb71f1e733c71a1849b950ff (diff) | |
download | CMake-23ad08dd6ce092f1ae7eff168bb2e0189a5dce9c.zip CMake-23ad08dd6ce092f1ae7eff168bb2e0189a5dce9c.tar.gz CMake-23ad08dd6ce092f1ae7eff168bb2e0189a5dce9c.tar.bz2 |
Migrate cmFilePathChecksum to C++11
Diffstat (limited to 'Source/cmFilePathChecksum.h')
-rw-r--r-- | Source/cmFilePathChecksum.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/cmFilePathChecksum.h b/Source/cmFilePathChecksum.h index 9d570eb..48b5da0 100644 --- a/Source/cmFilePathChecksum.h +++ b/Source/cmFilePathChecksum.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <array> #include <stddef.h> #include <string> #include <utility> @@ -29,37 +30,35 @@ public: cmFilePathChecksum(); /// @brief Initilizes the parent directories manually - cmFilePathChecksum(const std::string& currentSrcDir, - const std::string& currentBinDir, - const std::string& projectSrcDir, - const std::string& projectBinDir); + cmFilePathChecksum(std::string const& currentSrcDir, + std::string const& currentBinDir, + std::string const& projectSrcDir, + std::string const& projectBinDir); /// @brief Initilizes the parent directories from a makefile cmFilePathChecksum(cmMakefile* makefile); /// @brief Allows parent directories setup after construction /// - void setupParentDirs(const std::string& currentSrcDir, - const std::string& currentBinDir, - const std::string& projectSrcDir, - const std::string& projectBinDir); + void setupParentDirs(std::string const& currentSrcDir, + std::string const& currentBinDir, + std::string const& projectSrcDir, + std::string const& projectBinDir); /* @brief Calculates the path checksum for the parent directory of a file * */ - std::string get(const std::string& filePath) const; + std::string get(std::string const& filePath) const; /* @brief Same as get() but returns only the first length characters * */ - std::string getPart(const std::string& filePath, + std::string getPart(std::string const& filePath, size_t length = partLengthDefault) const; private: - /// Size of the parent directory list - static const size_t numParentDirs = 4; /// List of (directory name, seed name) pairs - std::pair<std::string, std::string> parentDirs[numParentDirs]; + std::array<std::pair<std::string, std::string>, 4> parentDirs; }; #endif |