Convert: Extract ConvertToRelativePath from Convert()
Convert() does some kind of relative conversion, followed by a conversion to 'output format'. Make it possible to do the former without the latter.
This commit is contained in:
parent
95a659f180
commit
564d3a1dc8
|
@ -46,11 +46,9 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
|
||||||
return this->ConvertToOutputFormat(remote, format);
|
return this->ConvertToOutputFormat(remote, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmOutputConverter::Convert(const std::string& source,
|
std::string cmOutputConverter::ConvertToRelativePath(
|
||||||
RelativeRoot relative,
|
const std::string& source, RelativeRoot relative) const
|
||||||
OutputFormat output) const
|
|
||||||
{
|
{
|
||||||
// Convert the path to a relative path.
|
|
||||||
std::string result = source;
|
std::string result = source;
|
||||||
|
|
||||||
switch (relative) {
|
switch (relative) {
|
||||||
|
@ -76,6 +74,15 @@ std::string cmOutputConverter::Convert(const std::string& source,
|
||||||
result = cmSystemTools::CollapseFullPath(result);
|
result = cmSystemTools::CollapseFullPath(result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string cmOutputConverter::Convert(const std::string& source,
|
||||||
|
RelativeRoot relative,
|
||||||
|
OutputFormat output) const
|
||||||
|
{
|
||||||
|
// Convert the path to a relative path.
|
||||||
|
std::string result = this->ConvertToRelativePath(source, relative);
|
||||||
return this->ConvertToOutputFormat(result, output);
|
return this->ConvertToOutputFormat(result, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ public:
|
||||||
OutputFormat output) const;
|
OutputFormat output) const;
|
||||||
std::string Convert(const std::string& remote, RelativeRoot local,
|
std::string Convert(const std::string& remote, RelativeRoot local,
|
||||||
OutputFormat output = UNCHANGED) const;
|
OutputFormat output = UNCHANGED) const;
|
||||||
|
std::string ConvertToRelativePath(const std::string& remote,
|
||||||
|
RelativeRoot local) const;
|
||||||
std::string ConvertDirectorySeparatorsForShell(
|
std::string ConvertDirectorySeparatorsForShell(
|
||||||
const std::string& source) const;
|
const std::string& source) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue