Browse Source

cmFilePathChecksum: Make methods const useable

Sebastian Holtermann 8 years ago
parent
commit
2296a2e9ee
2 changed files with 4 additions and 4 deletions
  1. 2 2
      Source/cmFilePathChecksum.cxx
  2. 2 2
      Source/cmFilePathChecksum.h

+ 2 - 2
Source/cmFilePathChecksum.cxx

@@ -45,7 +45,7 @@ void cmFilePathChecksum::setupParentDirs(const std::string& currentSrcDir,
   parentDirs[3].second = "ProjectBinary";
 }
 
-std::string cmFilePathChecksum::get(const std::string& filePath)
+std::string cmFilePathChecksum::get(const std::string& filePath) const
 {
   std::string relPath;
   std::string relSeed;
@@ -82,7 +82,7 @@ std::string cmFilePathChecksum::get(const std::string& filePath)
 }
 
 std::string cmFilePathChecksum::getPart(const std::string& filePath,
-                                        size_t length)
+                                        size_t length) const
 {
   return get(filePath).substr(0, length);
 }

+ 2 - 2
Source/cmFilePathChecksum.h

@@ -47,13 +47,13 @@ public:
   /* @brief Calculates the path checksum for the parent directory of a file
    *
    */
-  std::string get(const std::string& filePath);
+  std::string get(const std::string& filePath) const;
 
   /* @brief Same as get() but returns only the first length characters
    *
    */
   std::string getPart(const std::string& filePath,
-                      size_t length = partLengthDefault);
+                      size_t length = partLengthDefault) const;
 
 private:
   /// Size of the parent directory list