From 149af87b86362449a99301860af5aac1a3b4b20c Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 16 Jun 2016 21:37:57 +0200 Subject: cmOutputConverter: split ConvertToRelativePath Split the ConvertToRelativePath funtion into ConvertToRelativePath and ForceToRelativePath. Both functions take the local path as a string rather than a vector of path segments. Reimplement the old interface on top of the two new functions for interface compatibility. --- Source/cmOutputConverter.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Source/cmOutputConverter.h') diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index ac58ddc32d..1efe109aa4 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -145,6 +145,24 @@ public: const std::string& in_remote, bool force = false) const; + /** + * Convert the given remote path to a relative path with respect to + * the given local path. Both paths must use forward slashes and not + * already be escaped or quoted. + * The conversion is skipped if the paths are not both in the source + * or both in the binary tree. + */ + std::string ConvertToRelativePath(std::string const& local_path, + std::string const& remote_path) const; + + /** + * Convert the given remote path to a relative path with respect to + * the given local path. Both paths must use forward slashes and not + * already be escaped or quoted. + */ + static std::string ForceToRelativePath(std::string const& local_path, + std::string const& remote_path); + private: cmState* GetState() const; -- cgit v1.2.1