diff options
author | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-11-23 02:16:51 (GMT) |
---|---|---|
committer | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-12-08 11:24:06 (GMT) |
commit | 33f08eec18b440eac1f24f6f18b971c6203307bd (patch) | |
tree | efb4e1304611ce92cd8b6312f4dffa1cad6d2045 /Source/cmOutputConverter.cxx | |
parent | 87e810f223bad6fb889e7ae4ad08be98461bf6e2 (diff) | |
download | CMake-33f08eec18b440eac1f24f6f18b971c6203307bd.zip CMake-33f08eec18b440eac1f24f6f18b971c6203307bd.tar.gz CMake-33f08eec18b440eac1f24f6f18b971c6203307bd.tar.bz2 |
cmOutputConverter: Moved ContainedInDirectory to cmStateDirectory
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r-- | Source/cmOutputConverter.cxx | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 58d31b9..011c7d8 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -9,7 +9,6 @@ #include <string.h> #include <vector> -#include "cmAlgorithms.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmSystemTools.h" @@ -73,41 +72,11 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell( return result; } -static bool cmOutputConverterNotAbove(const char* a, const char* b) -{ - return (cmSystemTools::ComparePath(a, b) || - cmSystemTools::IsSubDirectory(a, b)); -} - -bool cmOutputConverter::ContainedInDirectory(std::string const& local_path, - std::string const& remote_path, - cmStateDirectory const& directory) -{ - const std::string& relativePathTopBinary = - directory.GetRelativePathTopBinary(); - const std::string& relativePathTopSource = - directory.GetRelativePathTopSource(); - - const bool bothInBinary = - cmOutputConverterNotAbove(local_path.c_str(), - relativePathTopBinary.c_str()) && - cmOutputConverterNotAbove(remote_path.c_str(), - relativePathTopBinary.c_str()); - - const bool bothInSource = - cmOutputConverterNotAbove(local_path.c_str(), - relativePathTopSource.c_str()) && - cmOutputConverterNotAbove(remote_path.c_str(), - relativePathTopSource.c_str()); - - return bothInSource || bothInBinary; -} - std::string cmOutputConverter::ConvertToRelativePath( std::string const& local_path, std::string const& remote_path) const { - if (!ContainedInDirectory(local_path, remote_path, - this->StateSnapshot.GetDirectory())) { + if (!this->StateSnapshot.GetDirectory().ContainsBoth(local_path, + remote_path)) { return remote_path; } |